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