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

Function OnSettingChange

Libraries/PropertyGrid/PropertyTree.h:541–571  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539 }
540
541 LRESULT OnSettingChange(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
542 {
543 // Standard colors
544 m_di.clrText = ::GetSysColor(COLOR_WINDOWTEXT);
545 m_di.clrBack = ::GetSysColor(COLOR_WINDOW);
546 m_di.clrSelText = ::GetSysColor(COLOR_HIGHLIGHTTEXT);
547 m_di.clrSelBack = ::GetSysColor(COLOR_HIGHLIGHT);
548 m_di.clrDisabled = ::GetSysColor(COLOR_GRAYTEXT);
549 // Border
550 m_di.clrBorder = ::GetSysColor(COLOR_BTNFACE);
551 if( !m_BorderPen.IsNull() ) m_BorderPen.DeleteObject();
552 m_di.Border = m_BorderPen.CreatePen(PS_SOLID, 1, m_di.clrBorder);
553 // Fonts
554 if( !m_TextFont.IsNull() ) m_TextFont.DeleteObject();
555 if( !m_CategoryFont.IsNull() ) m_CategoryFont.DeleteObject();
556 LOGFONT lf = { 0 };
557 HFONT hFont = (HFONT)::SendMessage(GetParent(), WM_GETFONT, 0, 0);
558 if( hFont == NULL ) hFont = AtlGetDefaultGuiFont();
559 ::GetObject(hFont, sizeof(lf), &lf);
560 m_di.TextFont = m_TextFont.CreateFontIndirect(&lf);
561 SetFont(m_di.TextFont);
562 m_di.CategoryFont = m_CategoryFont.CreateFontIndirect(&lf);
563 // Text metrics
564 CClientDC dc(m_hWnd);
565 HFONT hOldFont = dc.SelectFont(m_di.TextFont);
566 dc.GetTextMetrics(&m_di.tmText);
567 dc.SelectFont(hOldFont);
568 // Repaint
569 Invalidate();
570 return 0;
571 }
572
573 LRESULT OnSetFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
574 {

Callers

nothing calls this directly

Calls 2

CreateFontIndirectMethod · 0.80
IsNullMethod · 0.45

Tested by

no test coverage detected