X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af498247c5ea024a781d0ef8d30cbbfb44749641..79630806b65160fe7a433f243a6aa9b55e690aec:/src/msw/spinctrl.cpp diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 91b80a80e6..a2a61fc04a 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -296,7 +296,11 @@ bool wxSpinCtrl::Create(wxWindow *parent, style |= wxSP_VERTICAL; if ( (style & wxBORDER_MASK) == wxBORDER_DEFAULT ) +#ifdef __WXWINCE__ + style |= wxBORDER_SIMPLE; +#else style |= wxBORDER_SUNKEN; +#endif SetWindowStyle(style); @@ -366,21 +370,22 @@ bool wxSpinCtrl::Create(wxWindow *parent, m_wndProcBuddy = (WXFARPROC)wxSetWindowProc(GetBuddyHwnd(), wxBuddyTextWndProc); - // should have the same font as the other controls - SetFont(GetParent()->GetFont()); + // set up fonts and colours (This is nomally done in MSWCreateControl) + InheritAttributes(); + if (!m_hasFont) + SetFont(GetDefaultAttributes().font); // set the size of the text window - can do it only now, because we // couldn't call DoGetBestSize() before as font wasn't set if ( sizeText.y <= 0 ) { int cx, cy; - wxGetCharSize(GetHWND(), &cx, &cy, &GetFont()); + wxGetCharSize(GetHWND(), &cx, &cy, GetFont()); sizeText.y = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy); } - DoMoveWindow(pos.x, pos.y, - sizeText.x + sizeBtn.x + MARGIN_BETWEEN, sizeText.y); + SetBestSize(size); (void)::ShowWindow(GetBuddyHwnd(), SW_SHOW); @@ -437,7 +442,7 @@ int wxSpinCtrl::GetValue() const void wxSpinCtrl::SetSelection(long from, long to) { - // if from and to are both -1, it means (in wxWindows) that all text should + // if from and to are both -1, it means (in wxWidgets) that all text should // be selected - translate into Windows convention if ( (from == -1) && (to == -1) ) { @@ -522,7 +527,7 @@ wxSize wxSpinCtrl::DoGetBestSize() const sizeBtn.x += DEFAULT_ITEM_WIDTH + MARGIN_BETWEEN; int y; - wxGetCharSize(GetHWND(), NULL, &y, &GetFont()); + wxGetCharSize(GetHWND(), NULL, &y, GetFont()); y = EDIT_HEIGHT_FROM_CHAR_HEIGHT(y); // JACS: we should always use the height calculated