Give wxGauge a best size

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26154 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-03-10 01:15:30 +00:00
parent b6db2e9107
commit 3a12cb0a94
4 changed files with 18 additions and 2 deletions

View File

@@ -98,6 +98,8 @@ protected:
// set the gauge value to the value of m_gaugePos // set the gauge value to the value of m_gaugePos
void DoSetGauge(); void DoSetGauge();
virtual wxSize DoGetBestSize() const;
private: private:
DECLARE_DYNAMIC_CLASS(wxGauge) DECLARE_DYNAMIC_CLASS(wxGauge)
}; };

View File

@@ -98,6 +98,8 @@ protected:
// set the gauge value to the value of m_gaugePos // set the gauge value to the value of m_gaugePos
void DoSetGauge(); void DoSetGauge();
virtual wxSize DoGetBestSize() const;
private: private:
DECLARE_DYNAMIC_CLASS(wxGauge) DECLARE_DYNAMIC_CLASS(wxGauge)
}; };

View File

@@ -56,7 +56,8 @@ bool wxGauge::Create( wxWindow *parent,
m_parent->DoAddChild( this ); m_parent->DoAddChild( this );
PostCreation(); PostCreation();
SetBestSize(size);
Show( TRUE ); Show( TRUE );
return TRUE; return TRUE;
@@ -71,6 +72,11 @@ void wxGauge::DoSetGauge()
m_rangeMax ? ((float)m_gaugePos)/m_rangeMax : 0.); m_rangeMax ? ((float)m_gaugePos)/m_rangeMax : 0.);
} }
wxSize wxGauge::DoGetBestSize() const
{
return wxSize(100, 28);
}
void wxGauge::SetRange( int range ) void wxGauge::SetRange( int range )
{ {
m_rangeMax = range; m_rangeMax = range;

View File

@@ -56,7 +56,8 @@ bool wxGauge::Create( wxWindow *parent,
m_parent->DoAddChild( this ); m_parent->DoAddChild( this );
PostCreation(); PostCreation();
SetBestSize(size);
Show( TRUE ); Show( TRUE );
return TRUE; return TRUE;
@@ -71,6 +72,11 @@ void wxGauge::DoSetGauge()
m_rangeMax ? ((float)m_gaugePos)/m_rangeMax : 0.); m_rangeMax ? ((float)m_gaugePos)/m_rangeMax : 0.);
} }
wxSize wxGauge::DoGetBestSize() const
{
return wxSize(100, 28);
}
void wxGauge::SetRange( int range ) void wxGauge::SetRange( int range )
{ {
m_rangeMax = range; m_rangeMax = range;