]>
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 bool wxStaticBox::Create( wxWindow
*parent
,
21 const wxString
& label
,
25 const wxString
& name
)
27 m_macIsUserPane
= false;
29 if ( !wxControl::Create( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
) )
32 m_labelOrig
= m_label
= label
;
34 m_peer
= wxWidgetImpl::CreateGroupBox( this, parent
, id
, label
, pos
, size
, style
, GetExtraStyle() );
36 MacPostControlCreate( pos
, size
);
41 void wxStaticBox::GetBordersForSizer(int *borderTop
, int *borderOther
) const
45 m_peer
->GetContentArea(l
, t
, w
, h
);
47 *borderOther
= l
+ 10;
49 static int extraTop
= -1; // Uninitted
54 // The minimal border used for the top.
55 // Later on, the staticbox's font height is added to this.
58 // As indicated by the HIG, Panther needs an extra border of 11
59 // pixels (otherwise overlapping occurs at the top). The "other"
60 // border has to be 11.
65 *borderTop
= extraTop
;
66 if ( !m_label
.empty() )
67 *borderTop
+= GetCharHeight();
73 bool wxStaticBox::SetFont(const wxFont
& font
)
75 bool retval
= wxWindowBase::SetFont( font
);
77 // dont' update the native control, it has its own small font
82 #endif // wxUSE_STATBOX