+ if ( !m_hasFont )
+ {
+#if wxUSE_LISTCTRL || wxUSE_TREECTRL
+ // if we set a font for {list,tree}ctrls and the font size is changed in
+ // the display properties then the font size for these controls doesn't
+ // automatically adjust when they receive WM_SETTINGCHANGE
+ if ( wxDynamicCastThis(wxListCtrl) || wxDynamicCastThis(wxTreeCtrl) )
+ {
+ // not sure if we need to explicitly set the font here for Win95/NT4
+ // but we definitely can't do it for any newer version
+ // see wxGetCCDefaultFont() in src/msw/settings.cpp for explanation
+ // of why this test works
+
+ // TODO: test Win95/NT4 to see if this is needed or breaks the
+ // font resizing as it does on newer versions
+ wxFont font = GetDefaultAttributes().font;
+ if ( font == wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) )
+ {
+ SetFont(font);
+ }
+ }
+ else
+#endif // wxUSE_LISTCTRL || wxUSE_TREECTRL
+ {
+ SetFont(GetDefaultAttributes().font);
+ }
+ }