]> git.saurik.com Git - wxWidgets.git/commitdiff
Give wxGauge a best size
authorRobin Dunn <robin@alldunn.com>
Wed, 10 Mar 2004 01:15:30 +0000 (01:15 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 10 Mar 2004 01:15:30 +0000 (01:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26154 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index ced1476387a70e877163e236a5268eb97d82bf8a..5ca47abcf643511403dfdb8e688878edcf52670f 100644 (file)
@@ -98,6 +98,8 @@ protected:
     // set the gauge value to the value of m_gaugePos
     void DoSetGauge();
 
+    virtual wxSize DoGetBestSize() const;
+
 private:
     DECLARE_DYNAMIC_CLASS(wxGauge)
 };
index ced1476387a70e877163e236a5268eb97d82bf8a..5ca47abcf643511403dfdb8e688878edcf52670f 100644 (file)
@@ -98,6 +98,8 @@ protected:
     // set the gauge value to the value of m_gaugePos
     void DoSetGauge();
 
+    virtual wxSize DoGetBestSize() const;
+
 private:
     DECLARE_DYNAMIC_CLASS(wxGauge)
 };
index 693dbce205f07d3c81194bc29f78c59ff081ec52..45f1d7b86990d3c4d18d6c86546a371fd1909a3a 100644 (file)
@@ -56,7 +56,8 @@ bool wxGauge::Create( wxWindow *parent,
     m_parent->DoAddChild( this );
 
     PostCreation();
-
+    SetBestSize(size);
+    
     Show( TRUE );
 
     return TRUE;
@@ -71,6 +72,11 @@ void wxGauge::DoSetGauge()
                              m_rangeMax ? ((float)m_gaugePos)/m_rangeMax : 0.);
 }
 
+wxSize wxGauge::DoGetBestSize() const
+{
+    return wxSize(100, 28);
+}
+
 void wxGauge::SetRange( int range )
 {
     m_rangeMax = range;
index 693dbce205f07d3c81194bc29f78c59ff081ec52..45f1d7b86990d3c4d18d6c86546a371fd1909a3a 100644 (file)
@@ -56,7 +56,8 @@ bool wxGauge::Create( wxWindow *parent,
     m_parent->DoAddChild( this );
 
     PostCreation();
-
+    SetBestSize(size);
+    
     Show( TRUE );
 
     return TRUE;
@@ -71,6 +72,11 @@ void wxGauge::DoSetGauge()
                              m_rangeMax ? ((float)m_gaugePos)/m_rangeMax : 0.);
 }
 
+wxSize wxGauge::DoGetBestSize() const
+{
+    return wxSize(100, 28);
+}
+
 void wxGauge::SetRange( int range )
 {
     m_rangeMax = range;