added wxSpinCtrl::SetSelection()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
a69be60b0f
commit
07901ec945
@ -59,6 +59,9 @@ public:
|
||||
// because the base class already has one returning int!)
|
||||
void SetValue(const wxString& text);
|
||||
|
||||
// another wxTextCtrl-like method
|
||||
void SetSelection(long from, long to);
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
|
@ -352,6 +352,18 @@ int wxSpinCtrl::GetValue() const
|
||||
return n;
|
||||
}
|
||||
|
||||
void wxSpinCtrl::SetSelection(long from, long to)
|
||||
{
|
||||
// if from and to are both -1, it means (in wxWindows) that all text should
|
||||
// be selected - translate into Windows convention
|
||||
if ( (from == -1) && (to == -1) )
|
||||
{
|
||||
from = 0;
|
||||
}
|
||||
|
||||
::SendMessage((HWND)m_hwndBuddy, EM_SETSEL, (WPARAM)from, (LPARAM)to);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// forward some methods to subcontrols
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user