]>
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
)
25 bool wxStaticBox::Create(wxWindow
*parent
, wxWindowID id
,
26 const wxString
& label
,
32 m_macIsUserPane
= FALSE
;
34 if ( !wxControl::Create(parent
, id
, pos
, size
,
35 style
, wxDefaultValidator
, name
) )
40 Rect bounds
= wxMacGetBoundsForControl( this , pos
, size
) ;
42 m_peer
= new wxMacControl(this) ;
43 verify_noerr(CreateGroupBoxControl(MAC_WXHWND(parent
->MacGetTopLevelWindowRef()),&bounds
, CFSTR("") ,
44 true /*primary*/ , m_peer
->GetControlRefAddr() ) ) ;
46 MacPostControlCreate(pos
,size
) ;
51 void wxStaticBox::GetBordersForSizer(int *borderTop
, int *borderOther
) const
53 static int extraTop
= -1; // Uninitted
58 // The minimal border used for the top. Later on the staticbox'
59 // font height is added to this.
62 if ( UMAGetSystemVersion() >= 0x1030 /*Panther*/ )
64 // As indicated by the HIG, Panther needs an extra border of 11
65 // pixels (otherwise overlapping occurs at the top). The "other"
66 // border has to be 11.
73 *borderTop
= extraTop
+ GetCharHeight();
77 #endif // wxUSE_STATBOX