]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/slider.mm
[ 1509599 ] 'Split pickers page in widgets sample' with more icons and rebaking.
[wxWidgets.git] / src / cocoa / slider.mm
index 7e319e48446b3da55c54278e32e1579ba1770bba..9e3e790f426bf22445cffca79abbada2a6dc26a5 100644 (file)
@@ -1,24 +1,28 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        cocoa/slider.mm
+// Name:        src/cocoa/slider.mm
 // Purpose:     wxSlider
 // Author:      David Elliott
 // Modified by:
 // Created:     2003/06/19
 // RCS-ID:      $Id$
 // Copyright:   (c) 2003 David Elliott
-// Licence:    wxWindows licence
+// Licence:     wxWidgets licence
 /////////////////////////////////////////////////////////////////////////////
 
-#include "wx/setup.h"
+#include "wx/wxprec.h"
+
 #if wxUSE_SLIDER
 
-#include "wx/app.h"
 #include "wx/slider.h"
 
-#import <AppKit/NSView.h>
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+#endif //WX_PRECOMP
+
+#import <AppKit/NSSlider.h>
 
 IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl)
-BEGIN_EVENT_TABLE(wxSlider, wxSliderBase)
+    BEGIN_EVENT_TABLE(wxSlider, wxSliderBase)
 END_EVENT_TABLE()
 // WX_IMPLEMENT_COCOA_OWNER(wxSlider,NSSlider,NSControl,NSView)
 
@@ -29,10 +33,12 @@ 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;
 }