]> git.saurik.com Git - wxWidgets.git/blob - src/cocoa/slider.mm
Implement GetValue() and SetValue() and send an event when clicked
[wxWidgets.git] / src / cocoa / slider.mm
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: cocoa/slider.mm
3 // Purpose: wxSlider
4 // Author: David Elliott
5 // Modified by:
6 // Created: 2003/06/19
7 // RCS-ID: $Id$
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #include "wx/setup.h"
13 #if wxUSE_SLIDER
14
15 #include "wx/app.h"
16 #include "wx/slider.h"
17
18 #import <AppKit/NSView.h>
19
20 IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl)
21 BEGIN_EVENT_TABLE(wxSlider, wxSliderBase)
22 END_EVENT_TABLE()
23 // WX_IMPLEMENT_COCOA_OWNER(wxSlider,NSSlider,NSControl,NSView)
24
25 bool wxSlider::Create(wxWindow *parent, wxWindowID winid,
26 int value, int minValue, int maxValue,
27 const wxPoint& pos, const wxSize& size, long style,
28 const wxValidator& validator, const wxString& name)
29 {
30 if(!CreateControl(parent,winid,pos,size,style,validator,name))
31 return false;
32 SetNSView([[NSView alloc] initWithFrame: MakeDefaultNSRect(size)]);
33 [m_cocoaNSView release];
34 if(m_parent)
35 m_parent->CocoaAddChild(this);
36 SetInitialFrameRect(pos,size);
37
38 return true;
39 }
40
41 wxSlider::~wxSlider()
42 {
43 }
44
45 #endif // wxUSE_SLIDER