]> git.saurik.com Git - wxWidgets.git/commitdiff
a better way of applying style changes to label_widget
authorVáclav Slavík <vslavik@fastmail.fm>
Sat, 3 Jul 2004 16:58:10 +0000 (16:58 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sat, 3 Jul 2004 16:58:10 +0000 (16:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28159 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/statbox.h
include/wx/gtk1/statbox.h
src/gtk/statbox.cpp
src/gtk1/statbox.cpp

index b63c97324eeb8369d527e06af488a867cbb426ee..87b7372b86c5ba07e0ab44d70e898022bf9d4c03 100644 (file)
@@ -40,8 +40,6 @@ public:
 
     virtual void SetLabel( const wxString &label );
 
-    bool SetFont( const wxFont &font );
-    
     static wxVisualAttributes
     GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
 
@@ -49,6 +47,9 @@ public:
 
     virtual bool IsTransparentForMouse() const { return TRUE; }
 
+protected:
+    void DoApplyWidgetStyle(GtkRcStyle *style);
+    
 private:
     DECLARE_DYNAMIC_CLASS(wxStaticBox)
 };
index b63c97324eeb8369d527e06af488a867cbb426ee..87b7372b86c5ba07e0ab44d70e898022bf9d4c03 100644 (file)
@@ -40,8 +40,6 @@ public:
 
     virtual void SetLabel( const wxString &label );
 
-    bool SetFont( const wxFont &font );
-    
     static wxVisualAttributes
     GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
 
@@ -49,6 +47,9 @@ public:
 
     virtual bool IsTransparentForMouse() const { return TRUE; }
 
+protected:
+    void DoApplyWidgetStyle(GtkRcStyle *style);
+    
 private:
     DECLARE_DYNAMIC_CLASS(wxStaticBox)
 };
index a15681c0619017a1649d623c47a3340641d12c92..d6c4bc496d49c5f515f889f047aa18ace131316d 100644 (file)
@@ -91,19 +91,10 @@ void wxStaticBox::SetLabel( const wxString &label )
                          m_label.empty() ? (char *)NULL : (const char*) wxGTK_CONV( m_label ) );
 }
 
-bool wxStaticBox::SetFont( const wxFont &font )
+void wxStaticBox::DoApplyWidgetStyle(GtkRcStyle *style)
 {
-    wxControl::SetFont( font );
-
-    if (GTK_FRAME(m_widget)->label_widget)
-    {
-        GtkRcStyle *style = CreateWidgetStyle(true);
-        if ( style )
-        {
-            gtk_widget_modify_style( GTK_FRAME(m_widget)->label_widget, style);
-            gtk_rc_style_unref(style);
-        }
-    }
+    gtk_widget_modify_style(m_widget, style);
+    gtk_widget_modify_style(GTK_FRAME(m_widget)->label_widget, style);
 }
 
 // static
index a15681c0619017a1649d623c47a3340641d12c92..d6c4bc496d49c5f515f889f047aa18ace131316d 100644 (file)
@@ -91,19 +91,10 @@ void wxStaticBox::SetLabel( const wxString &label )
                          m_label.empty() ? (char *)NULL : (const char*) wxGTK_CONV( m_label ) );
 }
 
-bool wxStaticBox::SetFont( const wxFont &font )
+void wxStaticBox::DoApplyWidgetStyle(GtkRcStyle *style)
 {
-    wxControl::SetFont( font );
-
-    if (GTK_FRAME(m_widget)->label_widget)
-    {
-        GtkRcStyle *style = CreateWidgetStyle(true);
-        if ( style )
-        {
-            gtk_widget_modify_style( GTK_FRAME(m_widget)->label_widget, style);
-            gtk_rc_style_unref(style);
-        }
-    }
+    gtk_widget_modify_style(m_widget, style);
+    gtk_widget_modify_style(GTK_FRAME(m_widget)->label_widget, style);
 }
 
 // static