]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/osx/statbox_osx.cpp
Applied #15375 to stop event-sending in generic wxSpinCtrl ctor (eco)
[wxWidgets.git] / src / osx / statbox_osx.cpp
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/osx/statbox_osx.cpp
3// Purpose: wxStaticBox
4// Author: Stefan Csomor
5// Modified by:
6// Created: 1998-01-01
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
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 )
25{
26 DontCreatePeer();
27
28 if ( !wxControl::Create( parent, id, pos, size, style, wxDefaultValidator, name ) )
29 return false;
30
31 m_labelOrig = m_label = label;
32
33 SetPeer(wxWidgetImpl::CreateGroupBox( this, parent, id, label, pos, size, style, GetExtraStyle() ));
34
35 MacPostControlCreate( pos, size );
36
37 return true;
38}
39
40void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const
41{
42 static int extraTop = 11;
43 static int other = 11;
44
45 *borderTop = extraTop;
46 if ( !m_label.empty() )
47 {
48#if wxOSX_USE_COCOA
49 *borderTop += 11;
50#else
51 *borderTop += GetCharHeight();
52#endif
53 }
54
55 *borderOther = other;
56}
57
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
67#endif // wxUSE_STATBOX
68