// make the window modal (all other windows unresponsive)
virtual void MakeModal(bool modal = TRUE);
+ virtual void SetThemeEnabled(bool enableTheme) { m_themeEnabled = enableTheme; }
+ virtual bool GetThemeEnabled() const { return m_themeEnabled; }
+
// focus handling
// --------------
long m_windowStyle,
m_exStyle;
wxString m_windowName;
+ bool m_themeEnabled;
protected:
// common part of all ctors: it is not virtual because it is called from
#if wxUSE_CARET
m_caret = (wxCaret *)NULL;
#endif // wxUSE_CARET
+
+ // Whether we're using the current theme for this window (wxGTK only for now)
+ m_themeEnabled = FALSE;
}
// common part of window creation process
m_nFields = 0;
m_borderX = wxTHICK_LINE_BORDER;
m_borderY = wxTHICK_LINE_BORDER;
+ m_themeEnabled = TRUE;
bool success = wxWindow::Create(parent, id,
wxDefaultPosition, wxDefaultSize,
m_returnCode = 0;
m_sizeSet = FALSE;
m_modalShowing = FALSE;
+ m_themeEnabled = TRUE;
}
wxDialog::wxDialog( wxWindow *parent,
m_insertInClientArea = TRUE;
m_isIconized = FALSE;
m_fsIsShowing = FALSE;
+ m_themeEnabled = TRUE;
}
bool wxFrame::Create( wxWindow *parent,
bool wxFrame::IsMaximized() const
{
- wxFAIL_MSG( _T("not implemented") );
+ // wxFAIL_MSG( _T("not implemented") );
+ // This is an approximation
return FALSE;
}
m_imageList = (wxImageList *) NULL;
m_pages.DeleteContents( TRUE );
m_lastSelection = -1;
+ m_themeEnabled = TRUE;
}
wxNotebook::wxNotebook()
gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget),
GTK_SIGNAL_FUNC(gtk_notebook_page_change_callback), (gpointer) this );
+ if (m_themeEnabled)
+ win->SetThemeEnabled(TRUE);
+
GtkNotebook *notebook = GTK_NOTEBOOK(m_widget);
wxGtkNotebookPage *page = new wxGtkNotebookPage();
{
m_fg =
m_bg = (GdkColor *)NULL;
-
m_toolbar = (GtkToolbar *)NULL;
-
m_blockNextEvent = FALSE;
+ m_themeEnabled = TRUE;
}
wxToolBar::~wxToolBar()
*/
GtkPizza *pizza = GTK_PIZZA (widget);
-
+
+/*
if (win->IsTopLevel())
{
gtk_paint_flat_box (win->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
gtk_paint_flat_box (parent->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
GTK_SHADOW_NONE, &gdk_event->area, parent->m_widget, "base", 0, 0, -1, -1);
}
+*/
+ if (win->GetThemeEnabled())
+ {
+ wxWindow *parent = win->GetParent();
+ while (parent && !parent->IsTopLevel())
+ parent = parent->GetParent();
+ if (!parent)
+ parent = win;
+
+ gtk_paint_flat_box (parent->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
+ GTK_SHADOW_NONE, &gdk_event->area, parent->m_widget, "base", 0, 0, -1, -1);
+ }
win->GetUpdateRegion().Union( gdk_event->area.x,
gdk_event->area.y,
m_returnCode = 0;
m_sizeSet = FALSE;
m_modalShowing = FALSE;
+ m_themeEnabled = TRUE;
}
wxDialog::wxDialog( wxWindow *parent,
m_insertInClientArea = TRUE;
m_isIconized = FALSE;
m_fsIsShowing = FALSE;
+ m_themeEnabled = TRUE;
}
bool wxFrame::Create( wxWindow *parent,
bool wxFrame::IsMaximized() const
{
- wxFAIL_MSG( _T("not implemented") );
+ // wxFAIL_MSG( _T("not implemented") );
+ // This is an approximation
return FALSE;
}
m_imageList = (wxImageList *) NULL;
m_pages.DeleteContents( TRUE );
m_lastSelection = -1;
+ m_themeEnabled = TRUE;
}
wxNotebook::wxNotebook()
gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget),
GTK_SIGNAL_FUNC(gtk_notebook_page_change_callback), (gpointer) this );
+ if (m_themeEnabled)
+ win->SetThemeEnabled(TRUE);
+
GtkNotebook *notebook = GTK_NOTEBOOK(m_widget);
wxGtkNotebookPage *page = new wxGtkNotebookPage();
{
m_fg =
m_bg = (GdkColor *)NULL;
-
m_toolbar = (GtkToolbar *)NULL;
-
m_blockNextEvent = FALSE;
+ m_themeEnabled = TRUE;
}
wxToolBar::~wxToolBar()
*/
GtkPizza *pizza = GTK_PIZZA (widget);
-
+
+/*
if (win->IsTopLevel())
{
gtk_paint_flat_box (win->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
gtk_paint_flat_box (parent->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
GTK_SHADOW_NONE, &gdk_event->area, parent->m_widget, "base", 0, 0, -1, -1);
}
+*/
+ if (win->GetThemeEnabled())
+ {
+ wxWindow *parent = win->GetParent();
+ while (parent && !parent->IsTopLevel())
+ parent = parent->GetParent();
+ if (!parent)
+ parent = win;
+
+ gtk_paint_flat_box (parent->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
+ GTK_SHADOW_NONE, &gdk_event->area, parent->m_widget, "base", 0, 0, -1, -1);
+ }
win->GetUpdateRegion().Union( gdk_event->area.x,
gdk_event->area.y,