1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSpinButton
4 // Author: Stefan Csomor
7 // RCS-ID: $Id: spinbutt.cpp 54129 2008-06-11 19:30:52Z SC $
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
16 #include "wx/spinbutt.h"
17 #include "wx/osx/private.h"
19 @interface wxNSStepper : NSStepper
24 - (void)setImplementation: (wxWidgetImpl *) theImplementation;
25 - (wxWidgetImpl*) implementation;
27 - (void) clickedAction: (id) sender;
31 @implementation wxNSStepper
33 - (id)initWithFrame:(NSRect)frame
35 [super initWithFrame:frame];
37 [self setTarget: self];
38 [self setAction: @selector(clickedAction:)];
42 - (void) clickedAction: (id) sender
46 wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
48 wxpeer->HandleClicked(0);
52 - (void)setImplementation: (wxWidgetImpl *) theImplementation
54 impl = theImplementation;
57 - (wxWidgetImpl*) implementation
69 wxWidgetImplType* wxWidgetImpl::CreateSpinButton( wxWindowMac* wxpeer,
80 NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
81 wxNSStepper* v = [[wxNSStepper alloc] initWithFrame:r];
83 [v setMinValue: minimum];
84 [v setMaxValue: maximum];
85 [v setIntValue: value];
87 if ( style & wxSP_WRAP )
88 [v setValueWraps:YES];
90 wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
91 [v setImplementation:c];
95 #endif // wxUSE_SPINBTN