added wxSpinCtrl::SetSelection method

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16923 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Gilles Depeyrot
2002-09-01 21:29:40 +00:00
parent 2ae8a35352
commit a811affe70
3 changed files with 25 additions and 0 deletions

View File

@@ -60,6 +60,9 @@ public:
int min = 0, int max = 100, int initial = 0,
const wxString& name = _T("wxSpinCtrl"));
// wxTextCtrl-like method
void SetSelection(long from, long to);
virtual ~wxSpinCtrl();
// operations

View File

@@ -319,4 +319,15 @@ void wxSpinCtrl::SetRange(int min, int max)
m_btn->SetRange(min, max);
}
void wxSpinCtrl::SetSelection(long from, long to)
{
// if from and to are both -1, it means (in wxWindows) that all text should
// be selected
if ( (from == -1) && (to == -1) )
{
from = 0;
}
m_text->SetSelection(from, to);
}
#endif // wxUSE_SPINCTRL

View File

@@ -319,4 +319,15 @@ void wxSpinCtrl::SetRange(int min, int max)
m_btn->SetRange(min, max);
}
void wxSpinCtrl::SetSelection(long from, long to)
{
// if from and to are both -1, it means (in wxWindows) that all text should
// be selected
if ( (from == -1) && (to == -1) )
{
from = 0;
}
m_text->SetSelection(from, to);
}
#endif // wxUSE_SPINCTRL