X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/63f06c22b993b8ead320680ffa586d7c0b12ff2e..41286fd1def19641be3ae5bb9666c84a1c0b5525:/src/univ/themes/gtk.cpp diff --git a/src/univ/themes/gtk.cpp b/src/univ/themes/gtk.cpp index ce8692df8d..73ff1f5322 100644 --- a/src/univ/themes/gtk.cpp +++ b/src/univ/themes/gtk.cpp @@ -54,7 +54,7 @@ // constants (to be removed, for testing only) // ---------------------------------------------------------------------------- -static const wxCoord BORDER_THICKNESS = 1; +static const size_t BORDER_THICKNESS = 1; // ---------------------------------------------------------------------------- // wxGTKRenderer: draw the GUI elements in GTK style @@ -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 )