X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/93c4157c6cf8603eaba7ebbbc3b1e7bd303d8241..75633395579c4154980ed7cf3042ba0f35936120:/src/msw/spinctrl.cpp diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index dbf5cdceef..d5253b263f 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -214,6 +214,10 @@ bool wxSpinCtrl::Create(wxWindow *parent, // know whether this is a horizontal or vertical control (we're always // vertical) style |= wxSP_VERTICAL; + + if ( (style & wxBORDER_MASK) == wxBORDER_DEFAULT ) + style |= wxBORDER_SUNKEN; + SetWindowStyle(style); // calculate the sizes: the size given is the toal size for both controls @@ -352,6 +356,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 // ----------------------------------------------------------------------------