wxStatusBarGeneric::DoGetBestSize
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26658 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -119,6 +119,8 @@ protected:
|
|||||||
wxPen m_mediumShadowPen;
|
wxPen m_mediumShadowPen;
|
||||||
wxPen m_hilightPen;
|
wxPen m_hilightPen;
|
||||||
|
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric)
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric)
|
||||||
|
@@ -109,6 +109,24 @@ bool wxStatusBarGeneric::Create(wxWindow *parent,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wxSize wxStatusBarGeneric::DoGetBestSize() const
|
||||||
|
{
|
||||||
|
int width, height;
|
||||||
|
|
||||||
|
// best width is the width of the parent
|
||||||
|
GetParent()->GetClientSize(&width, NULL);
|
||||||
|
|
||||||
|
// best height is as calculated above in Create
|
||||||
|
wxClientDC dc((wxWindow*)this);
|
||||||
|
dc.SetFont(GetFont());
|
||||||
|
wxCoord y;
|
||||||
|
dc.GetTextExtent(_T("X"), NULL, &y );
|
||||||
|
height = (int)( (11*y)/10 + 2*GetBorderY());
|
||||||
|
|
||||||
|
return wxSize(width, height);
|
||||||
|
}
|
||||||
|
|
||||||
void wxStatusBarGeneric::SetFieldsCount(int number, const int *widths)
|
void wxStatusBarGeneric::SetFieldsCount(int number, const int *widths)
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( number >= 0, _T("negative number of fields in wxStatusBar?") );
|
wxASSERT_MSG( number >= 0, _T("negative number of fields in wxStatusBar?") );
|
||||||
|
Reference in New Issue
Block a user