]> git.saurik.com Git - wxWidgets.git/commitdiff
minsize and attribute tweaks
authorRobin Dunn <robin@alldunn.com>
Tue, 29 Jun 2004 17:44:21 +0000 (17:44 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 29 Jun 2004 17:44:21 +0000 (17:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28089 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/spinbutt.cpp
src/msw/spinctrl.cpp

index d49253743b649e4e25ba19913c6a3920b10e4740..98d967b2ffbd36614470ec7e9ac49e21c7a1fb8a 100644 (file)
@@ -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;
 }
 
index 36396bf241f62fd0d3c096c2a3f06e71450d5946..2531dd54c90825bb6db49e71ced811cde63c3575 100644 (file)
@@ -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);