X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/851dee09b5ab50a69519a39b0f3f6b95b1a63373..2cf3a6d7bef6f20bea35062dd3d4dbf0aec9efb5:/src/mac/carbon/window.cpp diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 6c8a60d542..7b4445cc30 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -27,18 +27,17 @@ #include "wx/settings.h" #include "wx/msgdlg.h" #include "wx/scrolbar.h" + #include "wx/statbox.h" + #include "wx/textctrl.h" + #include "wx/toolbar.h" + #include "wx/layout.h" + #include "wx/statusbr.h" + #include "wx/menuitem.h" #endif -#include "wx/layout.h" -#include "wx/statbox.h" #include "wx/tooltip.h" -#include "wx/statusbr.h" -#include "wx/menuitem.h" #include "wx/spinctrl.h" #include "wx/geometry.h" -#include "wx/textctrl.h" - -#include "wx/toolbar.h" #if wxUSE_CARET #include "wx/caret.h" @@ -2546,6 +2545,7 @@ void wxWindowMac::SetScrollbar(int orient, int pos, int thumbVisible, int range, bool refresh) { bool showScroller; + bool triggerSizeEvent = false; if ( orient == wxHORIZONTAL ) { @@ -2553,7 +2553,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 +2567,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