Fix setting initial wxSpinCtrl value outside 0..100 range in wxMSW.
Set the range before setting the initial value when creating wxSpinCtrl, as otherwise the value was wrongly limited to the default 0..100 range instead of the one really specified. Closes #14894. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -399,12 +399,11 @@ bool wxSpinCtrl::Create(wxWindow *parent,
|
||||
if ( value.ToLong(&initialFromText) )
|
||||
initial = initialFromText;
|
||||
|
||||
SetValue(initial);
|
||||
|
||||
m_oldValue = initial;
|
||||
|
||||
// Set the range in the native control
|
||||
// Set the range in the native control: notice that we must do it before
|
||||
// calling SetValue() to use the correct validity checks for the initial
|
||||
// value.
|
||||
SetRange(min, max);
|
||||
SetValue(initial);
|
||||
|
||||
// Also set the text part of the control if it was specified independently
|
||||
// but don't generate an event for this, it would be unexpected.
|
||||
|
Reference in New Issue
Block a user