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