implemented SetSelection
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25308 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -51,6 +51,7 @@ public:
|
|||||||
const wxString& name = _T("wxSpinCtrl"));
|
const wxString& name = _T("wxSpinCtrl"));
|
||||||
|
|
||||||
void SetValue(const wxString& text);
|
void SetValue(const wxString& text);
|
||||||
|
void SetSelection(long from, long to);
|
||||||
|
|
||||||
virtual int GetValue() const;
|
virtual int GetValue() const;
|
||||||
virtual void SetValue( int value );
|
virtual void SetValue( int value );
|
||||||
|
@@ -51,6 +51,7 @@ public:
|
|||||||
const wxString& name = _T("wxSpinCtrl"));
|
const wxString& name = _T("wxSpinCtrl"));
|
||||||
|
|
||||||
void SetValue(const wxString& text);
|
void SetValue(const wxString& text);
|
||||||
|
void SetSelection(long from, long to);
|
||||||
|
|
||||||
virtual int GetValue() const;
|
virtual int GetValue() const;
|
||||||
virtual void SetValue( int value );
|
virtual void SetValue( int value );
|
||||||
|
@@ -228,6 +228,19 @@ void wxSpinCtrl::SetValue( int value )
|
|||||||
GtkEnableEvents();
|
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)
|
void wxSpinCtrl::SetRange(int minVal, int maxVal)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") );
|
wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") );
|
||||||
|
@@ -228,6 +228,19 @@ void wxSpinCtrl::SetValue( int value )
|
|||||||
GtkEnableEvents();
|
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)
|
void wxSpinCtrl::SetRange(int minVal, int maxVal)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") );
|
wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") );
|
||||||
|
Reference in New Issue
Block a user