]> git.saurik.com Git - wxWidgets.git/commitdiff
changing scrollbars (hiding/showing) triggers a size event.
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 31 May 2006 05:38:46 +0000 (05:38 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 31 May 2006 05:38:46 +0000 (05:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39480 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/window.cpp

index 6c8a60d542a5b05adc9db89c7039f7069f0633ca..0623dc4a13e2ae00d611f34418b7dc95aad56eea 100644 (file)
@@ -2546,6 +2546,7 @@ void wxWindowMac::SetScrollbar(int orient, int pos, int thumbVisible,
     int range, bool refresh)
 {
     bool showScroller;
+    bool triggerSizeEvent = false;
 
     if ( orient == wxHORIZONTAL )
     {
@@ -2553,7 +2554,10 @@ void wxWindowMac::SetScrollbar(int orient, int pos, int thumbVisible,
         {
             showScroller = ((range != 0) && (range > thumbVisible));
             if ( m_hScrollBar->IsShown() != showScroller )
-                m_hScrollBar->Show( showScroller ) ;
+            {
+                m_hScrollBar->Show( showScroller );
+                triggerSizeEvent = true;
+            }
 
             m_hScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ;
         }
@@ -2564,13 +2568,22 @@ void wxWindowMac::SetScrollbar(int orient, int pos, int thumbVisible,
         {
             showScroller = ((range != 0) && (range > thumbVisible));
             if ( m_vScrollBar->IsShown() != showScroller )
+            {
                 m_vScrollBar->Show( showScroller ) ;
+                triggerSizeEvent = true;
+            }
 
             m_vScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ;
         }
     }
 
     MacRepositionScrollBars() ;
+    if ( triggerSizeEvent )
+    {
+        wxSizeEvent event(GetSize(), m_windowId);
+        event.SetEventObject(this);
+        GetEventHandler()->ProcessEvent(event);
+    }
 }
 
 // Does a physical scroll