]> git.saurik.com Git - wxWidgets.git/commitdiff
make sure NSScrollers are always having the desired orientation, fixes #10803
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 27 May 2009 08:17:47 +0000 (08:17 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 27 May 2009 08:17:47 +0000 (08:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/scrolbar.mm

index 0c154086e9abafdc32c65863a050ce8bf9e2b6d9..eec8756cfc3930f52a7b3d9c31a7c23e7fea7bc8 100644 (file)
@@ -140,11 +140,15 @@ wxWidgetImplType* wxWidgetImpl::CreateScrollBar( wxWindowMac* wxpeer,
                                     wxWindowID WXUNUSED(id), 
                                     const wxPoint& pos, 
                                     const wxSize& size,
-                                    long WXUNUSED(style)
+                                    long style
                                     long WXUNUSED(extraStyle))
 {
     NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
-    wxNSScroller* v = [[wxNSScroller alloc] initWithFrame:r];
+    // the creation rect defines the orientation 
+    NSRect createRect = ( style & wxSB_HORIZONTAL ) ? NSMakeRect(r.origin.x, r.origin.y , 17, 16) :
+        NSMakeRect(r.origin.x, r.origin.y , 16, 17);
+    wxNSScroller* v = [[wxNSScroller alloc] initWithFrame:createRect];
+    [v setFrame:r];
 
     wxWidgetCocoaImpl* c = new wxOSXScrollBarCocoaImpl( wxpeer, v );
     [v setEnabled:YES];