]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/statbox.cpp
1 /////////////////////////////////////////////////////////////////////////////
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/mac/uma.h"
19 IMPLEMENT_DYNAMIC_CLASS(wxStaticBox
, wxControl
)
22 bool wxStaticBox::Create( wxWindow
*parent
,
24 const wxString
& label
,
28 const wxString
& name
)
30 m_macIsUserPane
= false;
32 if ( !wxControl::Create( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
) )
37 Rect bounds
= wxMacGetBoundsForControl( this, pos
, size
);
39 m_peer
= new wxMacControl( this );
40 OSStatus err
= CreateGroupBoxControl(
41 MAC_WXHWND(parent
->MacGetTopLevelWindowRef()), &bounds
, CFSTR(""),
42 true /*primary*/, m_peer
->GetControlRefAddr() );
45 MacPostControlCreate( pos
, size
);
50 void wxStaticBox::GetBordersForSizer(int *borderTop
, int *borderOther
) const
52 static int extraTop
= -1; // Uninitted
57 // The minimal border used for the top.
58 // Later on, the staticbox's font height is added to this.
61 if ( UMAGetSystemVersion() >= 0x1030 ) // Panther
63 // As indicated by the HIG, Panther needs an extra border of 11
64 // pixels (otherwise overlapping occurs at the top). The "other"
65 // border has to be 11.
71 *borderTop
= extraTop
+ GetCharHeight();
75 #endif // wxUSE_STATBOX