font inheritance fixes (patch 983251)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28130 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -168,7 +168,8 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
|
|||||||
|
|
||||||
// set up fonts and colours
|
// set up fonts and colours
|
||||||
InheritAttributes();
|
InheritAttributes();
|
||||||
SetFont(GetDefaultAttributes().font);
|
if (!m_hasFont)
|
||||||
|
SetFont(GetDefaultAttributes().font);
|
||||||
|
|
||||||
// set the size now if no initial size specified
|
// set the size now if no initial size specified
|
||||||
SetInitialBestSize(size);
|
SetInitialBestSize(size);
|
||||||
|
@@ -168,7 +168,6 @@ wxGLCanvas::wxGLCanvas(wxWindow *parent, wxWindowID id,
|
|||||||
if ( ret )
|
if ( ret )
|
||||||
{
|
{
|
||||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
||||||
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
|
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
|
||||||
@@ -192,7 +191,6 @@ wxGLCanvas::wxGLCanvas( wxWindow *parent,
|
|||||||
if ( ret )
|
if ( ret )
|
||||||
{
|
{
|
||||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
||||||
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
|
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
|
||||||
@@ -217,7 +215,6 @@ wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared, wxWindowID i
|
|||||||
if ( ret )
|
if ( ret )
|
||||||
{
|
{
|
||||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
||||||
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
|
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
|
||||||
|
@@ -773,7 +773,7 @@ bool wxListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT *item)
|
|||||||
|
|
||||||
wxDC dc;
|
wxDC dc;
|
||||||
dc.SetHDC((WXHDC)hdc);
|
dc.SetHDC((WXHDC)hdc);
|
||||||
dc.SetFont(wxSystemSettings::GetFont(wxSYS_ANSI_VAR_FONT));
|
dc.SetFont(GetFont());
|
||||||
|
|
||||||
pStruct->itemHeight = dc.GetCharHeight() + 2*OWNER_DRAWN_LISTBOX_EXTRA_SPACE;
|
pStruct->itemHeight = dc.GetCharHeight() + 2*OWNER_DRAWN_LISTBOX_EXTRA_SPACE;
|
||||||
pStruct->itemWidth = dc.GetCharWidth();
|
pStruct->itemWidth = dc.GetCharWidth();
|
||||||
|
@@ -372,7 +372,8 @@ bool wxSpinCtrl::Create(wxWindow *parent,
|
|||||||
|
|
||||||
// set up fonts and colours (This is nomally done in MSWCreateControl)
|
// set up fonts and colours (This is nomally done in MSWCreateControl)
|
||||||
InheritAttributes();
|
InheritAttributes();
|
||||||
SetFont(GetDefaultAttributes().font);
|
if (!m_hasFont)
|
||||||
|
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
|
||||||
|
@@ -116,6 +116,7 @@ bool wxStatusBar95::Create(wxWindow *parent,
|
|||||||
|
|
||||||
SetFieldsCount(1);
|
SetFieldsCount(1);
|
||||||
SubclassWin(m_hWnd);
|
SubclassWin(m_hWnd);
|
||||||
|
InheritAttributes();
|
||||||
|
|
||||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR));
|
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user