]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/statbox.cpp
f4bd92905d414b4dd953973566bba31656dede0d
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxStaticBox
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13 #pragma implementation "statbox.h"
16 #include "wx/wxprec.h"
20 #include "wx/statbox.h"
21 #include "wx/mac/uma.h"
23 IMPLEMENT_DYNAMIC_CLASS(wxStaticBox
, wxControl
)
29 bool wxStaticBox::Create(wxWindow
*parent
, wxWindowID id
,
30 const wxString
& label
,
36 m_macIsUserPane
= FALSE
;
38 if ( !wxControl::Create(parent
, id
, pos
, size
,
39 style
, wxDefaultValidator
, name
) )
44 Rect bounds
= wxMacGetBoundsForControl( this , pos
, size
) ;
46 m_peer
= new wxMacControl(this) ;
47 verify_noerr(CreateGroupBoxControl(MAC_WXHWND(parent
->MacGetTopLevelWindowRef()),&bounds
, CFSTR("") ,
48 true /*primary*/ , m_peer
->GetControlRefAddr() ) ) ;
50 MacPostControlCreate(pos
,size
) ;
55 void wxStaticBox::GetBordersForSizer(int *borderTop
, int *borderOther
) const
57 static int extraTop
= -1; // Uninitted
62 // The minimal border used for the top. Later on the staticbox'
63 // font height is added to this.
66 if ( UMAGetSystemVersion() >= 0x1030 /*Panther*/ )
68 // As indicated by the HIG, Panther needs an extra border of 11
69 // pixels (otherwise overlapping occurs at the top). The "other"
70 // border has to be 11.
77 *borderTop
= extraTop
+ GetCharHeight();
81 #endif // wxUSE_STATBOX