]> git.saurik.com Git - wxWidgets.git/commitdiff
Better listbox scrollbar behavior.
authorDavid Elliott <dfe@tgwbd.org>
Thu, 14 Feb 2008 23:34:48 +0000 (23:34 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Thu, 14 Feb 2008 23:34:48 +0000 (23:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51800 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/cocoa/listbox.mm

index e6d13e33ebe8cbfae9ac8aaae39761135468b299..0d24e92f68a8ef4f7a0572bde66807b1fc1fb9a9 100644 (file)
@@ -118,8 +118,14 @@ The listbox contents are sorted in alphabetical order.
     CocoaCreateNSScrollView();
     SetInitialFrameRect(pos,size);
 
-    // Force showing of a vertical scrollbar
     [m_wxCocoaScrollView->GetNSScrollView() setHasVerticalScroller:YES];
+    // Pre-10.3: Always show vertical scroller, never show horizontal scroller
+    // Post-10.3: Show scrollers dynamically (turn them both on, set auto-hide)
+    if([m_wxCocoaScrollView->GetNSScrollView() respondsToSelector:@selector(setAutohidesScrollers:)])
+    {
+        [m_wxCocoaScrollView->GetNSScrollView() setHasHorizontalScroller:YES];
+        [m_wxCocoaScrollView->GetNSScrollView() setAutohidesScrollers:YES];
+    }
 
     // Set up extended/multiple selection flags
     if ((style & wxLB_EXTENDED) || (style & wxLB_MULTIPLE))