Move wxEVT_TEXT generation to wxSpinCtrlGTKBase::GTKTextChanged()
This is more consistent with GTKValueChanged() and allows making the change in the upcoming commit. No real changes yet, this is just a refactoring.
This commit is contained in:
@@ -72,6 +72,7 @@ public:
|
||||
virtual bool GTKOutput(wxString* text) const = 0;
|
||||
|
||||
virtual void GTKValueChanged() = 0;
|
||||
void GTKTextChanged();
|
||||
|
||||
protected:
|
||||
wxSpinCtrlGTKBase();
|
||||
|
@@ -54,11 +54,7 @@ extern "C" {
|
||||
static void
|
||||
gtk_changed(GtkSpinButton*, wxSpinCtrl* win)
|
||||
{
|
||||
wxCommandEvent event( wxEVT_TEXT, win->GetId() );
|
||||
event.SetEventObject( win );
|
||||
event.SetString(win->GetTextValue());
|
||||
event.SetInt(win->GetValue());
|
||||
win->HandleWindowEvent( event );
|
||||
win->GTKTextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,6 +522,15 @@ bool wxSpinCtrlGTKBase::GTKOutput(wxString* text) const
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxSpinCtrlGTKBase::GTKTextChanged()
|
||||
{
|
||||
wxCommandEvent event( wxEVT_TEXT, GetId() );
|
||||
event.SetEventObject( this );
|
||||
event.SetString(GetTextValue());
|
||||
event.SetInt(static_cast<int>(DoGetValue()));
|
||||
HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxSpinCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user