X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bfddb9239fcc64dec73eeac9ddc1805ca3904b62..09e6e5ec02fdcf888062ac8a52fada2017608950:/src/cocoa/slider.mm diff --git a/src/cocoa/slider.mm b/src/cocoa/slider.mm index f239be1003..a55468122f 100644 --- a/src/cocoa/slider.mm +++ b/src/cocoa/slider.mm @@ -9,10 +9,15 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#include "wx/app.h" -#include "wx/slider.h" +#include "wx/wxprec.h" +#if wxUSE_SLIDER -#import +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/slider.h" +#endif //WX_PRECOMP + +#import IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl) BEGIN_EVENT_TABLE(wxSlider, wxSliderBase) @@ -26,16 +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