]>
git.saurik.com Git - wxWidgets.git/blob - src/osx/statbox_osx.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/statbox_osx.cpp
3 // Purpose: wxStaticBox
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
16 #include "wx/statbox.h"
17 #include "wx/osx/private.h"
19 IMPLEMENT_DYNAMIC_CLASS(wxStaticBox
, wxControl
)
21 bool wxStaticBox::Create( wxWindow
*parent
,
23 const wxString
& label
,
27 const wxString
& name
)
29 m_macIsUserPane
= false;
31 if ( !wxControl::Create( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
) )
34 m_labelOrig
= m_label
= label
;
36 m_peer
= wxWidgetImpl::CreateGroupBox( this, parent
, id
, label
, pos
, size
, style
, GetExtraStyle() );
38 MacPostControlCreate( pos
, size
);
43 void wxStaticBox::GetBordersForSizer(int *borderTop
, int *borderOther
) const
45 static int extraTop
= -1; // Uninitted
50 // The minimal border used for the top.
51 // Later on, the staticbox's font height is added to this.
54 // As indicated by the HIG, Panther needs an extra border of 11
55 // pixels (otherwise overlapping occurs at the top). The "other"
56 // border has to be 11.
61 *borderTop
= extraTop
;
62 if ( !m_label
.empty() )
63 *borderTop
+= GetCharHeight();
68 bool wxStaticBox::SetFont(const wxFont
& font
)
70 bool retval
= wxWindowBase::SetFont( font
);
72 // dont' update the native control, it has its own small font
77 #endif // wxUSE_STATBOX