Factor out wxGenericTreeCtrl::InitVisualAttributes()
No real changes, just avoid calling an event handler directly.
This commit is contained in:
@@ -354,7 +354,14 @@ protected:
|
|||||||
private:
|
private:
|
||||||
bool m_hasExplicitFont;
|
bool m_hasExplicitFont;
|
||||||
|
|
||||||
void OnSysColourChanged(wxSysColourChangedEvent&);
|
void OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
|
||||||
|
{
|
||||||
|
InitVisualAttributes();
|
||||||
|
}
|
||||||
|
|
||||||
|
// (Re)initialize colours, fonts, pens, brushes used by the control using
|
||||||
|
// the current system colours and font.
|
||||||
|
void InitVisualAttributes();
|
||||||
|
|
||||||
// Reset the state of the last find (i.e. keyboard incremental search)
|
// Reset the state of the last find (i.e. keyboard incremental search)
|
||||||
// operation.
|
// operation.
|
||||||
|
|||||||
@@ -983,8 +983,7 @@ bool wxGenericTreeCtrl::Create(wxWindow *parent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_hasExplicitFont = m_hasFont;
|
m_hasExplicitFont = m_hasFont;
|
||||||
wxSysColourChangedEvent evt;
|
InitVisualAttributes();
|
||||||
OnSysColourChanged(evt);
|
|
||||||
|
|
||||||
SetInitialSize(size);
|
SetInitialSize(size);
|
||||||
|
|
||||||
@@ -1007,7 +1006,7 @@ void wxGenericTreeCtrl::EnableBellOnNoMatch( bool on )
|
|||||||
m_findBell = on;
|
m_findBell = on;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericTreeCtrl::OnSysColourChanged(wxSysColourChangedEvent&)
|
void wxGenericTreeCtrl::InitVisualAttributes()
|
||||||
{
|
{
|
||||||
const wxVisualAttributes attr(GetDefaultAttributes());
|
const wxVisualAttributes attr(GetDefaultAttributes());
|
||||||
SetOwnForegroundColour(attr.colFg);
|
SetOwnForegroundColour(attr.colFg);
|
||||||
|
|||||||
Reference in New Issue
Block a user