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
21 WXCOCOAIMPL_COMMON_MEMBERS
24 WXCOCOAIMPL_COMMON_INTERFACE
26 - (void) clickedAction: (id) sender;
30 @implementation wxNSStepper
32 - (id)initWithFrame:(NSRect)frame
34 [super initWithFrame:frame];
36 [self setTarget: self];
37 [self setAction: @selector(clickedAction:)];
41 - (void) clickedAction: (id) sender
45 wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
47 wxpeer->HandleClicked(0);
51 WXCOCOAIMPL_COMMON_IMPLEMENTATION
55 wxWidgetImplType* wxWidgetImpl::CreateSpinButton( wxWindowMac* wxpeer,
66 NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
67 wxNSStepper* v = [[wxNSStepper alloc] initWithFrame:r];
69 [v setMinValue: minimum];
70 [v setMaxValue: maximum];
71 [v setIntValue: value];
73 if ( style & wxSP_WRAP )
74 [v setValueWraps:YES];
76 wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
77 [v setImplementation:c];
81 #endif // wxUSE_SPINBTN