// 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
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
wxGTKTheme::wxGTKTheme()
{
- m_scheme = new wxGTKColourScheme;
- m_renderer = new wxGTKRenderer(m_scheme);
+ m_scheme = NULL;
+ m_renderer = NULL;
m_handlerDefault = NULL;
}
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 )
wxCoord *extraSpaceBeyond)
{
wxRect rectText = rect;
- rectText.Inflate(-2*BORDER_THICKNESS);
+ rectText.Deflate(2*BORDER_THICKNESS);
if ( text->WrapLines() )
{
size->y += 4;
}
} else
-#endif wxUSE_BUTTON
+#endif //wxUSE_BUTTON
if ( wxDynamicCast(window, wxScrollBar) )
{
// we only set the width of vert scrollbars and height of the