apply patch 1630906 after all as with my simpler fix in the last commit the control may remain empty when it is supposed to show 0 value
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44195 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -269,16 +269,21 @@ void wxSpinCtrl::OnSetFocus(wxFocusEvent& event)
|
|||||||
void wxSpinCtrl::NormalizeValue()
|
void wxSpinCtrl::NormalizeValue()
|
||||||
{
|
{
|
||||||
const int value = GetValue();
|
const int value = GetValue();
|
||||||
if ( value == m_oldValue )
|
const bool changed = value == m_oldValue;
|
||||||
return;
|
|
||||||
|
|
||||||
|
// notice that we have to call SetValue() even if the value didn't change
|
||||||
|
// because otherwise we could be left with empty buddy control when value
|
||||||
|
// is 0, see comment in SetValue()
|
||||||
SetValue(value);
|
SetValue(value);
|
||||||
|
|
||||||
wxCommandEvent event(wxEVT_COMMAND_SPINCTRL_UPDATED, GetId());
|
if ( changed )
|
||||||
event.SetEventObject(this);
|
{
|
||||||
event.SetInt(value);
|
wxCommandEvent event(wxEVT_COMMAND_SPINCTRL_UPDATED, GetId());
|
||||||
GetEventHandler()->ProcessEvent(event);
|
event.SetEventObject(this);
|
||||||
m_oldValue = value;
|
event.SetInt(value);
|
||||||
|
GetEventHandler()->ProcessEvent(event);
|
||||||
|
m_oldValue = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user