Support precompiled headers
[wxWidgets.git] / src / cocoa / spinbutt.mm
1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        cocoa/spinbutt.mm
3 // Purpose:     wxSpinButton
4 // Author:      David Elliott
5 // Modified by:
6 // Created:     2003/07/14
7 // RCS-ID:      $Id$
8 // Copyright:   (c) 2003 David Elliott
9 // Licence:     wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #include "wx/wxprec.h"
13 #if wxUSE_SPINBTN
14
15 #ifndef WX_PRECOMP
16     #include "wx/app.h"
17 #endif //WX_PRECOMP
18 #include "wx/spinbutt.h"
19
20 #import <AppKit/NSStepper.h>
21
22 IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent)
23
24 IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl)
25 BEGIN_EVENT_TABLE(wxSpinButton, wxSpinButtonBase)
26 END_EVENT_TABLE()
27 // WX_IMPLEMENT_COCOA_OWNER(wxSpinButton,NSStepper,NSControl,NSView)
28
29 bool wxSpinButton::Create(wxWindow *parent, wxWindowID winid,
30             const wxPoint& pos, const wxSize& size, long style,
31             const wxString& name)
32 {
33     if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name))
34         return false;
35     SetNSControl([[NSStepper alloc] initWithFrame: MakeDefaultNSRect(size)]);
36     [m_cocoaNSView release];
37     if(m_parent)
38         m_parent->CocoaAddChild(this);
39     SetInitialFrameRect(pos,size);
40
41     return true;
42 }
43
44 wxSpinButton::~wxSpinButton()
45 {
46 }
47
48 #endif // wxUSE_SPINBTN