From 8d2e831b091a0245a5760fd9bb360daae510fbb0 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 29 Jun 2004 17:44:21 +0000 Subject: [PATCH] minsize and attribute tweaks git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28089 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/spinbutt.cpp | 5 ++--- src/msw/spinctrl.cpp | 12 +++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp index d49253743b..98d967b2ff 100644 --- a/src/msw/spinbutt.cpp +++ b/src/msw/spinbutt.cpp @@ -129,9 +129,6 @@ bool wxSpinButton::Create(wxWindow *parent, // basic initialization m_windowId = (id == -1) ? NewControlId() : id; - m_backgroundColour = parent->GetBackgroundColour() ; - m_foregroundColour = parent->GetForegroundColour() ; - SetName(name); int x = pos.x; @@ -199,6 +196,8 @@ bool wxSpinButton::Create(wxWindow *parent, SubclassWin(m_hWnd); + SetBestSize(size); + return TRUE; } diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 36396bf241..2531dd54c9 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -370,9 +370,10 @@ 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(); + 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 +384,9 @@ 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); + //DoMoveWindow(pos.x, pos.y, + // sizeText.x + sizeBtn.x + MARGIN_BETWEEN, sizeText.y); + SetBestSize(size); (void)::ShowWindow(GetBuddyHwnd(), SW_SHOW);