]> 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 693dbce205f07d3c81194bc29f78c59ff081ec52..7fe754a52e2f6a68a1ac1de0925ea6e787a1f43e 100644 (file)
@@ -55,10 +55,9 @@ bool wxGauge::Create( wxWindow *parent,
 
     m_parent->DoAddChild( this );
 
-    PostCreation();
-
-    Show( TRUE );
-
+    PostCreation(size);
+    SetBestSize(size);
+    
     return TRUE;
 }
 
@@ -71,6 +70,14 @@ void wxGauge::DoSetGauge()
                              m_rangeMax ? ((float)m_gaugePos)/m_rangeMax : 0.);
 }
 
+wxSize wxGauge::DoGetBestSize() const
+{
+    if (HasFlag(wxGA_VERTICAL))
+        return wxSize(28, 100);
+    else
+        return wxSize(100, 28);
+}
+
 void wxGauge::SetRange( int range )
 {
     m_rangeMax = range;
@@ -105,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