implemented late(r) initialization of wxUniv themes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12319 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2001-11-04 23:32:16 +00:00
parent f78024a1f9
commit 240889a18c
2 changed files with 40 additions and 7 deletions

View File

@ -549,9 +549,9 @@ public:
wxGTKTheme();
virtual ~wxGTKTheme();
virtual wxRenderer *GetRenderer() { return m_renderer; }
virtual wxRenderer *GetRenderer();
virtual wxInputHandler *GetInputHandler(const wxString& control);
virtual wxColourScheme *GetColourScheme() { return m_scheme; }
virtual wxColourScheme *GetColourScheme();
private:
// get the default input handler
@ -583,8 +583,8 @@ WX_IMPLEMENT_THEME(wxGTKTheme, gtk, wxTRANSLATE("GTK+ theme"));
wxGTKTheme::wxGTKTheme()
{
m_scheme = new wxGTKColourScheme;
m_renderer = new wxGTKRenderer(m_scheme);
m_scheme = NULL;
m_renderer = NULL;
m_handlerDefault = NULL;
}
@ -602,6 +602,25 @@ wxGTKTheme::~wxGTKTheme()
delete m_scheme;
}
wxRenderer *wxGTKTheme::GetRenderer()
{
if ( !m_renderer )
{
m_renderer = new wxGTKRenderer(GetColourScheme());
}
return m_renderer;
}
wxColourScheme *wxGTKTheme::GetColourScheme()
{
if ( !m_scheme )
{
m_scheme = new wxGTKColourScheme;
}
return m_scheme;
}
wxInputHandler *wxGTKTheme::GetDefaultInputHandler()
{
if ( !m_handlerDefault )

View File

@ -600,7 +600,7 @@ public:
wxWin32Theme();
virtual ~wxWin32Theme();
virtual wxRenderer *GetRenderer() { return m_renderer; }
virtual wxRenderer *GetRenderer();
virtual wxInputHandler *GetInputHandler(const wxString& control);
virtual wxColourScheme *GetColourScheme();
@ -1111,8 +1111,8 @@ WX_IMPLEMENT_THEME(wxWin32Theme, win32, wxTRANSLATE("Win32 theme"));
wxWin32Theme::wxWin32Theme()
{
m_scheme = new wxWin32ColourScheme;
m_renderer = new wxWin32Renderer(m_scheme);
m_scheme = NULL;
m_renderer = NULL;
m_handlerDefault = NULL;
}
@ -1131,6 +1131,16 @@ wxWin32Theme::~wxWin32Theme()
delete m_scheme;
}
wxRenderer *wxWin32Theme::GetRenderer()
{
if ( !m_renderer )
{
m_renderer = new wxWin32Renderer(GetColourScheme());
}
return m_renderer;
}
wxInputHandler *wxWin32Theme::GetDefaultInputHandler()
{
if ( !m_handlerDefault )
@ -1209,6 +1219,10 @@ wxInputHandler *wxWin32Theme::GetInputHandler(const wxString& control)
wxColourScheme *wxWin32Theme::GetColourScheme()
{
if ( !m_scheme )
{
m_scheme = new wxWin32ColourScheme;
}
return m_scheme;
}