]> git.saurik.com Git - wxWidgets.git/blame - src/osx/statbox_osx.cpp
Extract wxFDIOEventLoopSourceHandler in its own header.
[wxWidgets.git] / src / osx / statbox_osx.cpp
CommitLineData
e53b3d16
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/osx/statbox_osx.cpp
3// Purpose: wxStaticBox
4// Author: Stefan Csomor
5// Modified by:
6// Created: 1998-01-01
b5b208a1 7// RCS-ID: $Id$
e53b3d16
SC
8// Copyright: (c) Stefan Csomor
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#include "wx/wxprec.h"
13
14#if wxUSE_STATBOX
15
16#include "wx/statbox.h"
17#include "wx/osx/private.h"
18
e53b3d16
SC
19bool wxStaticBox::Create( wxWindow *parent,
20 wxWindowID id,
21 const wxString& label,
22 const wxPoint& pos,
23 const wxSize& size,
24 long style,
25 const wxString& name )
d15694e8
SC
26{
27 DontCreatePeer();
28
e53b3d16
SC
29 if ( !wxControl::Create( parent, id, pos, size, style, wxDefaultValidator, name ) )
30 return false;
31
32 m_labelOrig = m_label = label;
03647350 33
22756322 34 SetPeer(wxWidgetImpl::CreateGroupBox( this, parent, id, label, pos, size, style, GetExtraStyle() ));
e53b3d16
SC
35
36 MacPostControlCreate( pos, size );
37
38 return true;
39}
40
41void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const
42{
2128f218
SC
43 static int extraTop = 11;
44 static int other = 11;
e53b3d16 45
2128f218
SC
46 *borderTop = extraTop;
47 if ( !m_label.empty() )
e53b3d16 48 {
8383e673 49#if wxOSX_USE_COCOA
2128f218 50 *borderTop += 11;
8383e673 51#else
2128f218 52 *borderTop += GetCharHeight();
8383e673 53#endif
e53b3d16
SC
54 }
55
e53b3d16
SC
56 *borderOther = other;
57}
58
bbd8f8af
SC
59bool wxStaticBox::SetFont(const wxFont& font)
60{
61 bool retval = wxWindowBase::SetFont( font );
62
63 // dont' update the native control, it has its own small font
64
65 return retval;
66}
67
e53b3d16
SC
68#endif // wxUSE_STATBOX
69