X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7a5e53abb3f9ea13eba2880972306446e4e21e83..fcf90ee1b10d41b4ddfbfa537481a9c64e30348f:/src/msw/spinctrl.cpp?ds=sidebyside diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 36396bf241..a2a61fc04a 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -370,9 +370,11 @@ 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 ) @@ -383,8 +385,7 @@ bool wxSpinCtrl::Create(wxWindow *parent, 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);