X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/93c4157c6cf8603eaba7ebbbc3b1e7bd303d8241..d8c65cf48881468f97798ac521fb93f9b8b5a293:/src/msw/spinctrl.cpp diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index dbf5cdceef..8cbf378f11 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -162,7 +162,7 @@ bool wxSpinCtrl::ProcessTextCommand(WXWORD cmd, WXWORD WXUNUSED(id)) void wxSpinCtrl::OnChar(wxKeyEvent& event) { - switch ( event.KeyCode() ) + switch ( event.GetKeyCode() ) { case WXK_RETURN: { @@ -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 // ----------------------------------------------------------------------------