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 bool GTKOutput(wxString* text) const = 0;
|
||||||
|
|
||||||
virtual void GTKValueChanged() = 0;
|
virtual void GTKValueChanged() = 0;
|
||||||
|
void GTKTextChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxSpinCtrlGTKBase();
|
wxSpinCtrlGTKBase();
|
||||||
|
@@ -54,11 +54,7 @@ extern "C" {
|
|||||||
static void
|
static void
|
||||||
gtk_changed(GtkSpinButton*, wxSpinCtrl* win)
|
gtk_changed(GtkSpinButton*, wxSpinCtrl* win)
|
||||||
{
|
{
|
||||||
wxCommandEvent event( wxEVT_TEXT, win->GetId() );
|
win->GTKTextChanged();
|
||||||
event.SetEventObject( win );
|
|
||||||
event.SetString(win->GetTextValue());
|
|
||||||
event.SetInt(win->GetValue());
|
|
||||||
win->HandleWindowEvent( event );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,6 +522,15 @@ bool wxSpinCtrlGTKBase::GTKOutput(wxString* text) const
|
|||||||
return false;
|
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
|
// wxSpinCtrl
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user