X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d8207702d1cf580a7200114abd52f186b4b9a4f3..c37dd6dad7f53b8f5f4c4a8d6434c2851cd2b9e4:/src/osx/cocoa/scrolbar.mm diff --git a/src/osx/cocoa/scrolbar.mm b/src/osx/cocoa/scrolbar.mm index 0c154086e9..eec8756cfc 100644 --- a/src/osx/cocoa/scrolbar.mm +++ b/src/osx/cocoa/scrolbar.mm @@ -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];