fix lack of spin control update event when control lost focus (replaces patch 1630906, corrects bug introduced in rev 1.66)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44194 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-01-11 01:45:31 +00:00
parent be809e82f2
commit e816f5c736
2 changed files with 22 additions and 15 deletions

View File

@@ -88,6 +88,13 @@ Major new features in 2.8 release
wxSearchCtrl, wxAboutBox, wxTreebook, tar streams. wxSearchCtrl, wxAboutBox, wxTreebook, tar streams.
2.8.2
-----
wxMSW
- Fix lack of spin control update event when control lost focus
2.8.1 2.8.1
----- -----

View File

@@ -111,7 +111,6 @@ wxCONSTRUCTOR_6( wxSpinCtrl , wxWindow* , Parent , wxWindowID , Id , wxString ,
IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
#endif #endif
//pmg EVT_KILL_FOCUS
BEGIN_EVENT_TABLE(wxSpinCtrl, wxSpinButton) BEGIN_EVENT_TABLE(wxSpinCtrl, wxSpinButton)
EVT_CHAR(wxSpinCtrl::OnChar) EVT_CHAR(wxSpinCtrl::OnChar)
@@ -269,16 +268,17 @@ void wxSpinCtrl::OnSetFocus(wxFocusEvent& event)
void wxSpinCtrl::NormalizeValue() void wxSpinCtrl::NormalizeValue()
{ {
int value = GetValue(); const int value = GetValue();
SetValue( value ); if ( value == m_oldValue )
if (value != m_oldValue) return;
{
wxCommandEvent event( wxEVT_COMMAND_SPINCTRL_UPDATED, GetId() ); SetValue(value);
event.SetEventObject( this );
event.SetInt( value ); wxCommandEvent event(wxEVT_COMMAND_SPINCTRL_UPDATED, GetId());
GetEventHandler()->ProcessEvent( event ); event.SetEventObject(this);
event.SetInt(value);
GetEventHandler()->ProcessEvent(event);
m_oldValue = value; m_oldValue = value;
}
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------