]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/slider.mm
Initial move from C to C++. The functionality of the code should not have
[wxWidgets.git] / src / cocoa / slider.mm
index f239be10036bf5aadbd7005d7d05eb6e7a0ef64b..a55468122ffc346c719b8e12e3641a41a7b1cbe2 100644 (file)
@@ -9,10 +9,15 @@
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#include "wx/app.h"
-#include "wx/slider.h"
+#include "wx/wxprec.h"
+#if wxUSE_SLIDER
 
-#import <AppKit/NSView.h>
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+    #include "wx/slider.h"
+#endif //WX_PRECOMP
+
+#import <AppKit/NSSlider.h>
 
 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