minsize and attribute tweaks

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28089 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2004-06-29 17:44:21 +00:00
parent 020707bba9
commit 8d2e831b09
2 changed files with 9 additions and 8 deletions

View File

@ -129,9 +129,6 @@ bool wxSpinButton::Create(wxWindow *parent,
// basic initialization // basic initialization
m_windowId = (id == -1) ? NewControlId() : id; m_windowId = (id == -1) ? NewControlId() : id;
m_backgroundColour = parent->GetBackgroundColour() ;
m_foregroundColour = parent->GetForegroundColour() ;
SetName(name); SetName(name);
int x = pos.x; int x = pos.x;
@ -199,6 +196,8 @@ bool wxSpinButton::Create(wxWindow *parent,
SubclassWin(m_hWnd); SubclassWin(m_hWnd);
SetBestSize(size);
return TRUE; return TRUE;
} }

View File

@ -370,9 +370,10 @@ bool wxSpinCtrl::Create(wxWindow *parent,
m_wndProcBuddy = (WXFARPROC)wxSetWindowProc(GetBuddyHwnd(), m_wndProcBuddy = (WXFARPROC)wxSetWindowProc(GetBuddyHwnd(),
wxBuddyTextWndProc); wxBuddyTextWndProc);
// should have the same font as the other controls // set up fonts and colours (This is nomally done in MSWCreateControl)
SetFont(GetParent()->GetFont()); InheritAttributes();
SetFont(GetDefaultAttributes().font);
// set the size of the text window - can do it only now, because we // set the size of the text window - can do it only now, because we
// couldn't call DoGetBestSize() before as font wasn't set // couldn't call DoGetBestSize() before as font wasn't set
if ( sizeText.y <= 0 ) if ( sizeText.y <= 0 )
@ -383,8 +384,9 @@ bool wxSpinCtrl::Create(wxWindow *parent,
sizeText.y = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy); sizeText.y = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy);
} }
DoMoveWindow(pos.x, pos.y, //DoMoveWindow(pos.x, pos.y,
sizeText.x + sizeBtn.x + MARGIN_BETWEEN, sizeText.y); // sizeText.x + sizeBtn.x + MARGIN_BETWEEN, sizeText.y);
SetBestSize(size);
(void)::ShowWindow(GetBuddyHwnd(), SW_SHOW); (void)::ShowWindow(GetBuddyHwnd(), SW_SHOW);