parent
f1f27bc37c
commit
5325ccfda6
@ -351,6 +351,10 @@ protected:
|
||||
virtual wxSize DoGetBestSize() const wxOVERRIDE;
|
||||
|
||||
private:
|
||||
bool m_hasExplicitFont;
|
||||
|
||||
void OnSysColourChanged(wxSysColourChangedEvent&);
|
||||
|
||||
// Reset the state of the last find (i.e. keyboard incremental search)
|
||||
// operation.
|
||||
void ResetFindState();
|
||||
|
@ -917,6 +917,7 @@ wxBEGIN_EVENT_TABLE(wxGenericTreeCtrl, wxTreeCtrlBase)
|
||||
EVT_SET_FOCUS (wxGenericTreeCtrl::OnSetFocus)
|
||||
EVT_KILL_FOCUS (wxGenericTreeCtrl::OnKillFocus)
|
||||
EVT_TREE_ITEM_GETTOOLTIP(wxID_ANY, wxGenericTreeCtrl::OnGetToolTip)
|
||||
EVT_SYS_COLOUR_CHANGED(wxGenericTreeCtrl::OnSysColourChanged)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@ -936,24 +937,8 @@ void wxGenericTreeCtrl::Init()
|
||||
m_indent = 15;
|
||||
m_spacing = 18;
|
||||
|
||||
m_hilightBrush = new wxBrush
|
||||
(
|
||||
wxSystemSettings::GetColour
|
||||
(
|
||||
wxSYS_COLOUR_HIGHLIGHT
|
||||
),
|
||||
wxBRUSHSTYLE_SOLID
|
||||
);
|
||||
|
||||
m_hilightUnfocusedBrush = new wxBrush
|
||||
(
|
||||
wxSystemSettings::GetColour
|
||||
(
|
||||
wxSYS_COLOUR_BTNSHADOW
|
||||
),
|
||||
wxBRUSHSTYLE_SOLID
|
||||
);
|
||||
|
||||
m_hilightBrush = NULL;
|
||||
m_hilightUnfocusedBrush = NULL;
|
||||
m_imageListButtons = NULL;
|
||||
m_ownsImageListButtons = false;
|
||||
|
||||
@ -974,13 +959,6 @@ void wxGenericTreeCtrl::Init()
|
||||
m_dndEffectItem = NULL;
|
||||
|
||||
m_lastOnSame = false;
|
||||
|
||||
#if defined( __WXMAC__ )
|
||||
m_normalFont = wxFont(wxOSX_SYSTEM_FONT_VIEWS);
|
||||
#else
|
||||
m_normalFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
|
||||
#endif
|
||||
m_boldFont = m_normalFont.Bold();
|
||||
}
|
||||
|
||||
bool wxGenericTreeCtrl::Create(wxWindow *parent,
|
||||
@ -1006,14 +984,9 @@ bool wxGenericTreeCtrl::Create(wxWindow *parent,
|
||||
m_spacing = 10;
|
||||
}
|
||||
|
||||
wxVisualAttributes attr = GetDefaultAttributes();
|
||||
SetOwnForegroundColour( attr.colFg );
|
||||
SetOwnBackgroundColour( attr.colBg );
|
||||
if (!m_hasFont)
|
||||
SetOwnFont(attr.font);
|
||||
|
||||
m_dottedPen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT),
|
||||
1, wxPENSTYLE_DOT);
|
||||
m_hasExplicitFont = m_hasFont;
|
||||
wxSysColourChangedEvent evt;
|
||||
OnSysColourChanged(evt);
|
||||
|
||||
SetInitialSize(size);
|
||||
|
||||
@ -1039,6 +1012,29 @@ void wxGenericTreeCtrl::EnableBellOnNoMatch( bool on )
|
||||
m_findBell = on;
|
||||
}
|
||||
|
||||
void wxGenericTreeCtrl::OnSysColourChanged(wxSysColourChangedEvent&)
|
||||
{
|
||||
const wxVisualAttributes attr(GetDefaultAttributes());
|
||||
SetOwnForegroundColour(attr.colFg);
|
||||
SetOwnBackgroundColour(attr.colBg);
|
||||
if (!m_hasExplicitFont)
|
||||
SetOwnFont(attr.font);
|
||||
|
||||
delete m_hilightBrush;
|
||||
m_hilightBrush = new wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT));
|
||||
delete m_hilightUnfocusedBrush;
|
||||
m_hilightUnfocusedBrush = new wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW));
|
||||
|
||||
m_dottedPen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT), 1, wxPENSTYLE_DOT);
|
||||
|
||||
#if defined(__WXOSX__)
|
||||
m_normalFont = wxFont(wxOSX_SYSTEM_FONT_VIEWS);
|
||||
#else
|
||||
m_normalFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
|
||||
#endif
|
||||
m_boldFont = m_normalFont.Bold();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// accessors
|
||||
// -----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user