]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/gauge.cpp
fixed background rendering if GetThemeEnabled()=true with GTK2
[wxWidgets.git] / src / gtk / gauge.cpp
index accbf868897740be66a9be6542979a246ae99045..7fe754a52e2f6a68a1ac1de0925ea6e787a1f43e 100644 (file)
@@ -55,11 +55,9 @@ bool wxGauge::Create( wxWindow *parent,
 
     m_parent->DoAddChild( this );
 
-    PostCreation();
+    PostCreation(size);
     SetBestSize(size);
     
-    Show( TRUE );
-
     return TRUE;
 }
 
@@ -74,10 +72,10 @@ void wxGauge::DoSetGauge()
 
 wxSize wxGauge::DoGetBestSize() const
 {
-    if (HasFlag(wxGA_HORIZONTAL))
-        return wxSize(100, 28);
-    else
+    if (HasFlag(wxGA_VERTICAL))
         return wxSize(28, 100);
+    else
+        return wxSize(100, 28);
 }
 
 void wxGauge::SetRange( int range )
@@ -114,5 +112,22 @@ void wxGauge::ApplyWidgetStyle()
     gtk_widget_set_style( m_widget, m_widgetStyle );
 }
 
+wxVisualAttributes wxGauge::GetDefaultAttributes() const
+{
+    // Visible gauge colours use a different colour state
+    return GetDefaultAttributesFromGTKWidget(m_widget,
+                                             UseGTKStyleBase(),
+                                             GTK_STATE_ACTIVE);
+
+}
+
+// static
+wxVisualAttributes
+wxGauge::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
+{
+    return GetDefaultAttributesFromGTKWidget(gtk_progress_bar_new,
+                                             false, GTK_STATE_ACTIVE);
+}
+
 #endif // wxUSE_GAUGE