]>
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
7 // RCS-ID: $Id: statbox.cpp 54129 2008-06-11 19:30:52Z SC $
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 #endif // wxUSE_STATBOX