X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/93c4157c6cf8603eaba7ebbbc3b1e7bd303d8241..7bb8798ce7fa001b4511cdd4656d45590fd905b7:/src/msw/spinctrl.cpp diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index dbf5cdceef..6057edf837 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -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 // ----------------------------------------------------------------------------