1 /////////////////////////////////////////////////////////////////////////////
2 // Name: cocoa/statbox.mm
3 // Purpose: wxStaticBox
4 // Author: David Elliott
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
13 #include "wx/statbox.h"
15 #import <AppKit/NSBox.h>
16 #import <Foundation/NSString.h>
18 IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
19 BEGIN_EVENT_TABLE(wxStaticBox, wxStaticBoxBase)
21 WX_IMPLEMENT_COCOA_OWNER(wxStaticBox,NSBox,NSView,NSView)
23 bool wxStaticBox::Create(wxWindow *parent, wxWindowID winid,
24 const wxString& title,
27 long style, const wxValidator& validator,
30 if(!CreateControl(parent,winid,pos,size,style,validator,name))
33 SetNSBox([[NSBox alloc] initWithFrame:NSMakeRect(0,0,30,30)]);
34 [GetNSBox() setTitle:[NSString stringWithCString:title.c_str()]];
36 m_parent->CocoaAddChild(this);
40 wxStaticBox::~wxStaticBox()
42 CocoaRemoveFromParent();