MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / OnSettingChange

Function OnSettingChange

Libraries/PropertyGrid/PropertyGrid.h:875–907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

873 }
874
875 LRESULT OnSettingChange(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
876 {
877 // Standard colors
878 m_di.clrText = ::GetSysColor(COLOR_WINDOWTEXT);
879 m_di.clrBack = ::GetSysColor(COLOR_WINDOW);
880 m_di.clrSelText = ::GetSysColor(COLOR_HIGHLIGHTTEXT);
881 m_di.clrSelBack = ::GetSysColor(COLOR_HIGHLIGHT);
882 m_di.clrDisabled = ::GetSysColor(COLOR_GRAYTEXT);
883 m_di.clrDisabledBack = ::GetSysColor(COLOR_BTNFACE);
884 // Border
885 m_di.clrBorder = ::GetSysColor(COLOR_BTNFACE);
886 if( !m_BorderPen.IsNull() ) m_BorderPen.DeleteObject();
887 m_di.Border = m_BorderPen.CreatePen(PS_SOLID, 1, m_di.clrBorder);
888 // Fonts
889 if( !m_TextFont.IsNull() ) m_TextFont.DeleteObject();
890 if( !m_CategoryFont.IsNull() ) m_CategoryFont.DeleteObject();
891 LOGFONT lf = { 0 };
892 HFONT hFont = (HFONT) ::SendMessage(GetParent(), WM_GETFONT, 0, 0);
893 if( hFont == NULL ) hFont = AtlGetDefaultGuiFont();
894 ::GetObject(hFont, sizeof(lf), &lf);
895 m_di.TextFont = m_TextFont.CreateFontIndirect(&lf);
896 SetFont(m_di.TextFont);
897 lf.lfWeight += FW_BOLD;
898 m_di.CategoryFont = m_CategoryFont.CreateFontIndirect(&lf);
899 // Text metrics
900 CClientDC dc(m_hWnd);
901 HFONT hOldFont = dc.SelectFont(m_di.TextFont);
902 dc.GetTextMetrics(&m_di.tmText);
903 dc.SelectFont(hOldFont);
904 // Repaint
905 Invalidate();
906 return 0;
907 }
908
909 LRESULT OnSelChanged(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)
910 {

Callers

nothing calls this directly

Calls 2

CreateFontIndirectMethod · 0.80
IsNullMethod · 0.45

Tested by

no test coverage detected