X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ef3e4a2c810ab1f156a3b007165b46e4332c67f3..de5dd006449a97887afb2aad39c8f20549818d98:/src/cocoa/slider.mm diff --git a/src/cocoa/slider.mm b/src/cocoa/slider.mm index ab53b6c04b..2183b7b5cc 100644 --- a/src/cocoa/slider.mm +++ b/src/cocoa/slider.mm @@ -6,15 +6,18 @@ // Created: 2003/06/19 // RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWindows licence +// Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// +#include "wx/wxprec.h" #if wxUSE_SLIDER -#include "wx/app.h" -#include "wx/slider.h" +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/slider.h" +#endif //WX_PRECOMP -#import +#import IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl) BEGIN_EVENT_TABLE(wxSlider, wxSliderBase) @@ -28,17 +31,17 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID winid, { if(!CreateControl(parent,winid,pos,size,style,validator,name)) return false; - SetNSView([[NSView alloc] initWithFrame: NSMakeRect(10,10,20,20)]); + SetNSView([[NSSlider alloc] initWithFrame: MakeDefaultNSRect(size)]); [m_cocoaNSView release]; if(m_parent) m_parent->CocoaAddChild(this); + SetInitialFrameRect(pos,size); + return true; } wxSlider::~wxSlider() { - CocoaRemoveFromParent(); - SetNSView(NULL); } #endif // wxUSE_SLIDER