1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/cocoa/statbox.mm
3 // Purpose: wxStaticBox
4 // Author: Stefan Csomor
7 // Copyright: (c) Stefan Csomor
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #include "wx/wxprec.h"
15 #include "wx/statbox.h"
16 #include "wx/osx/private.h"
18 @implementation wxNSBox
22 static BOOL initialized = NO;
26 wxOSXCocoaClassAddWXMethods( self );
34 class wxStaticBoxCocoaImpl : public wxWidgetCocoaImpl
37 wxStaticBoxCocoaImpl(wxWindowMac *wxpeer, wxNSBox *v)
38 : wxWidgetCocoaImpl(wxpeer, v)
42 virtual void SetLabel( const wxString& title, wxFontEncoding encoding )
45 [GetNSBox() setTitlePosition:NSNoTitle];
47 [GetNSBox() setTitlePosition:NSAtTop];
49 wxWidgetCocoaImpl::SetLabel(title, encoding);
53 NSBox *GetNSBox() const
55 wxASSERT( [m_osxView isKindOfClass:[NSBox class]] );
57 return static_cast<NSBox*>(m_osxView);
60 } // anonymous namespace
63 wxWidgetImplType* wxWidgetImpl::CreateGroupBox( wxWindowMac* wxpeer,
64 wxWindowMac* WXUNUSED(parent),
65 wxWindowID WXUNUSED(id),
66 const wxString& WXUNUSED(label),
70 long WXUNUSED(extraStyle))
72 NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
73 wxNSBox* v = [[wxNSBox alloc] initWithFrame:r];
74 wxStaticBoxCocoaImpl* c = new wxStaticBoxCocoaImpl( wxpeer, v );
75 #if !wxOSX_USE_NATIVE_FLIPPED
81 #endif // wxUSE_STATBOX