moved DoApplyWidgetStyle to wxWindowGTK

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27899 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2004-06-19 17:49:26 +00:00
parent 5f280eaa57
commit 7074ce3577
8 changed files with 30 additions and 52 deletions

View File

@@ -56,11 +56,6 @@ public:
virtual wxVisualAttributes GetDefaultAttributes() const;
protected:
virtual void ApplyWidgetStyle(bool forceStyle = false);
// helper function to ease native widgets wrapping, called by
// ApplyWidgetStyle -- override this, not ApplyWidgetStyle
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
virtual wxSize DoGetBestSize() const;
void PostCreation(const wxSize& size);
void PostSetLabel();

View File

@@ -265,6 +265,10 @@ protected:
// Overridden in many GTK widgets who have to handle subwidgets
virtual void ApplyWidgetStyle(bool forceStyle = false);
// helper function to ease native widgets wrapping, called by
// ApplyWidgetStyle -- override this, not ApplyWidgetStyle
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
private:
DECLARE_DYNAMIC_CLASS(wxWindowGTK)
DECLARE_NO_COPY_CLASS(wxWindowGTK)

View File

@@ -56,11 +56,6 @@ public:
virtual wxVisualAttributes GetDefaultAttributes() const;
protected:
virtual void ApplyWidgetStyle(bool forceStyle = false);
// helper function to ease native widgets wrapping, called by
// ApplyWidgetStyle -- override this, not ApplyWidgetStyle
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
virtual wxSize DoGetBestSize() const;
void PostCreation(const wxSize& size);
void PostSetLabel();

View File

@@ -265,6 +265,10 @@ protected:
// Overridden in many GTK widgets who have to handle subwidgets
virtual void ApplyWidgetStyle(bool forceStyle = false);
// helper function to ease native widgets wrapping, called by
// ApplyWidgetStyle -- override this, not ApplyWidgetStyle
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
private:
DECLARE_DYNAMIC_CLASS(wxWindowGTK)
DECLARE_NO_COPY_CLASS(wxWindowGTK)

View File

@@ -278,21 +278,5 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(GtkAdjustm
return attr;
}
void wxControl::ApplyWidgetStyle(bool forceStyle)
{
GtkRcStyle *style = CreateWidgetStyle(forceStyle);
if ( style )
{
DoApplyWidgetStyle(style);
gtk_rc_style_unref(style);
}
}
void wxControl::DoApplyWidgetStyle(GtkRcStyle *style)
{
gtk_widget_modify_style(m_widget, style);
}
#endif // wxUSE_CONTROLS

View File

@@ -4090,15 +4090,21 @@ void wxWindowGTK::ApplyWidgetStyle(bool forceStyle)
GtkRcStyle *style = CreateWidgetStyle(forceStyle);
if ( style )
{
DoApplyWidgetStyle(style);
gtk_rc_style_unref(style);
}
}
void wxWindowGTK::DoApplyWidgetStyle(GtkRcStyle *style)
{
if (m_wxwindow)
// should we also do m_widget in this case?
gtk_widget_modify_style(m_wxwindow, style);
else
gtk_widget_modify_style(m_widget, style);
gtk_rc_style_unref(style);
}
}
//-----------------------------------------------------------------------------
// Pop-up menu stuff
//-----------------------------------------------------------------------------

View File

@@ -278,21 +278,5 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(GtkAdjustm
return attr;
}
void wxControl::ApplyWidgetStyle(bool forceStyle)
{
GtkRcStyle *style = CreateWidgetStyle(forceStyle);
if ( style )
{
DoApplyWidgetStyle(style);
gtk_rc_style_unref(style);
}
}
void wxControl::DoApplyWidgetStyle(GtkRcStyle *style)
{
gtk_widget_modify_style(m_widget, style);
}
#endif // wxUSE_CONTROLS

View File

@@ -4090,15 +4090,21 @@ void wxWindowGTK::ApplyWidgetStyle(bool forceStyle)
GtkRcStyle *style = CreateWidgetStyle(forceStyle);
if ( style )
{
DoApplyWidgetStyle(style);
gtk_rc_style_unref(style);
}
}
void wxWindowGTK::DoApplyWidgetStyle(GtkRcStyle *style)
{
if (m_wxwindow)
// should we also do m_widget in this case?
gtk_widget_modify_style(m_wxwindow, style);
else
gtk_widget_modify_style(m_widget, style);
gtk_rc_style_unref(style);
}
}
//-----------------------------------------------------------------------------
// Pop-up menu stuff
//-----------------------------------------------------------------------------