Added more original works and stubs
[wxWidgets.git] / src / cocoa / statbox.mm
1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        cocoa/statbox.mm
3 // Purpose:     wxStaticBox
4 // Author:      David Elliott
5 // Modified by:
6 // Created:     2003/02/15
7 // RCS-ID:      $Id: 
8 // Copyright:   (c) 2003 David Elliott
9 // Licence:     wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #include "wx/app.h"
13 #include "wx/statbox.h"
14
15 #import <AppKit/NSBox.h>
16 #import <Foundation/NSString.h>
17
18 IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
19 BEGIN_EVENT_TABLE(wxStaticBox, wxStaticBoxBase)
20 END_EVENT_TABLE()
21 WX_IMPLEMENT_COCOA_OWNER(wxStaticBox,NSBox,NSView,NSView)
22
23 bool wxStaticBox::Create(wxWindow *parent, wxWindowID winid,
24            const wxString& title,
25            const wxPoint& pos,
26            const wxSize& size,
27            long style, const wxValidator& validator,
28            const wxString& name)
29 {
30     if(!CreateControl(parent,winid,pos,size,style,validator,name))
31         return false;
32     m_cocoaNSView = NULL;
33     SetNSBox([[NSBox alloc] initWithFrame:NSMakeRect(0,0,30,30)]);
34     [GetNSBox() setTitle:[NSString stringWithCString:title.c_str()]];
35     if(m_parent)
36         m_parent->CocoaAddChild(this);
37     return true;
38 }
39
40 wxStaticBox::~wxStaticBox()
41 {
42     CocoaRemoveFromParent();
43     SetNSBox(NULL);
44 }
45