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:
@@ -60,6 +60,9 @@ public:
|
|||||||
int min = 0, int max = 100, int initial = 0,
|
int min = 0, int max = 100, int initial = 0,
|
||||||
const wxString& name = _T("wxSpinCtrl"));
|
const wxString& name = _T("wxSpinCtrl"));
|
||||||
|
|
||||||
|
// wxTextCtrl-like method
|
||||||
|
void SetSelection(long from, long to);
|
||||||
|
|
||||||
virtual ~wxSpinCtrl();
|
virtual ~wxSpinCtrl();
|
||||||
|
|
||||||
// operations
|
// operations
|
||||||
|
@@ -319,4 +319,15 @@ void wxSpinCtrl::SetRange(int min, int max)
|
|||||||
m_btn->SetRange(min, 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
|
#endif // wxUSE_SPINCTRL
|
||||||
|
@@ -319,4 +319,15 @@ void wxSpinCtrl::SetRange(int min, int max)
|
|||||||
m_btn->SetRange(min, 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
|
#endif // wxUSE_SPINCTRL
|
||||||
|
Reference in New Issue
Block a user