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:
@@ -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)
|
||||||
};
|
};
|
||||||
|
@@ -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)
|
||||||
};
|
};
|
||||||
|
@@ -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;
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user