Make wx{List,Tree}Ctrl resize their standard font if the user changes the system font.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37707 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jamie Gadd
2006-02-24 14:19:12 +00:00
parent 605c2c4ac6
commit 3c96418b71
6 changed files with 78 additions and 38 deletions

View File

@@ -2849,6 +2849,10 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
processed = HandleCaptureChanged((WXHWND) (HWND) lParam);
break;
case WM_SETTINGCHANGE:
processed = HandleSettingChange(wParam, lParam);
break;
case WM_QUERYNEWPALETTE:
processed = HandleQueryNewPalette();
break;
@@ -3933,6 +3937,41 @@ bool wxWindowMSW::HandleCaptureChanged(WXHWND hWndGainedCapture)
return GetEventHandler()->ProcessEvent(event);
}
bool wxWindowMSW::HandleSettingChange(WXWPARAM wParam, WXLPARAM lParam)
{
// despite MSDN saying "(This message cannot be sent directly to a window.)"
// we need to send this to child windows (it is only sent to top-level
// windows) so {list,tree}ctrls can adjust their font size if necessary
// this is exactly how explorer does it to enable the font size changes
wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
while ( node )
{
// top-level windows already get this message from the system
wxWindow *win = node->GetData();
if ( !win->IsTopLevel() )
{
::SendMessage(GetHwndOf(win), WM_SETTINGCHANGE, wParam, lParam);
}
node = node->GetNext();
}
#if defined(__SMARTPHONE__) || defined(__POCKETPC__)
if ( IsTopLevel() )
{
SHACTIVATEINFO *info = (SHACTIVATEINFO*) m_activateInfo;
if ( info )
{
return SHHandleWMSettingChange(GetHwnd(), wParam, lParam, info) == TRUE;
}
}
#endif // defined(__SMARTPHONE__) || defined(__POCKETPC__)
// let the system handle it
return false;
}
bool wxWindowMSW::HandleQueryNewPalette()
{