X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e8e24dfa9322702d56a125586a7d4a37f4a5dfd7..e3f9e20cb15c62bd347a8e52d2d36529adbdb3d6:/src/gtk1/spinctrl.cpp diff --git a/src/gtk1/spinctrl.cpp b/src/gtk1/spinctrl.cpp index e071efbce9..ff4ee9faeb 100644 --- a/src/gtk1/spinctrl.cpp +++ b/src/gtk1/spinctrl.cpp @@ -228,6 +228,19 @@ void wxSpinCtrl::SetValue( int value ) GtkEnableEvents(); } +void wxSpinCtrl::SetSelection(long from, long to) +{ + // translate from wxWindows conventions to GTK+ ones: (-1, -1) means the + // entire range + if ( from == -1 && to == -1 ) + { + from = 0; + to = INT_MAX; + } + + gtk_editable_select_region( GTK_EDITABLE(m_widget), (gint)from, (gint)to ); +} + void wxSpinCtrl::SetRange(int minVal, int maxVal) { wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") );