1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/cocoa/statbox.mm
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 @implementation wxNSBox
23 static BOOL initialized = NO;
27 wxOSXCocoaClassAddWXMethods( self );
35 class wxStaticBoxCocoaImpl : public wxWidgetCocoaImpl
38 wxStaticBoxCocoaImpl(wxWindowMac *wxpeer, wxNSBox *v)
39 : wxWidgetCocoaImpl(wxpeer, v)
43 virtual void SetLabel( const wxString& title, wxFontEncoding encoding )
46 [GetNSBox() setTitlePosition:NSNoTitle];
48 [GetNSBox() setTitlePosition:NSAtTop];
50 wxWidgetCocoaImpl::SetLabel(title, encoding);
54 NSBox *GetNSBox() const
56 wxASSERT( [m_osxView isKindOfClass:[NSBox class]] );
58 return static_cast<NSBox*>(m_osxView);
61 } // anonymous namespace
64 wxWidgetImplType* wxWidgetImpl::CreateGroupBox( wxWindowMac* wxpeer,
65 wxWindowMac* WXUNUSED(parent),
66 wxWindowID WXUNUSED(id),
67 const wxString& WXUNUSED(label),
71 long WXUNUSED(extraStyle))
73 NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
74 wxNSBox* v = [[wxNSBox alloc] initWithFrame:r];
75 wxStaticBoxCocoaImpl* c = new wxStaticBoxCocoaImpl( wxpeer, v );
80 #endif // wxUSE_STATBOX