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