]> git.saurik.com Git - wxWidgets.git/blob - src/cocoa/slider.mm
Wrappers for *ToText
[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: wxWidgets licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #include "wx/wxprec.h"
13 #if wxUSE_SLIDER
14
15 #ifndef WX_PRECOMP
16 #include "wx/app.h"
17 #include "wx/slider.h"
18 #endif //WX_PRECOMP
19
20 #import <AppKit/NSSlider.h>
21
22 IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl)
23 BEGIN_EVENT_TABLE(wxSlider, wxSliderBase)
24 END_EVENT_TABLE()
25 // WX_IMPLEMENT_COCOA_OWNER(wxSlider,NSSlider,NSControl,NSView)
26
27 bool wxSlider::Create(wxWindow *parent, wxWindowID winid,
28 int value, int minValue, int maxValue,
29 const wxPoint& pos, const wxSize& size, long style,
30 const wxValidator& validator, const wxString& name)
31 {
32 if(!CreateControl(parent,winid,pos,size,style,validator,name))
33 return false;
34 SetNSView([[NSSlider alloc] initWithFrame: MakeDefaultNSRect(size)]);
35 [m_cocoaNSView release];
36 if(m_parent)
37 m_parent->CocoaAddChild(this);
38 SetInitialFrameRect(pos,size);
39
40 return true;
41 }
42
43 wxSlider::~wxSlider()
44 {
45 }
46
47 #endif // wxUSE_SLIDER