X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/246c5004eb5a1d6bd592cbc0981cf6c3e10895de..17d4f7aca810eb9286374228512569fb16a4ab03:/src/mac/carbon/window.cpp?ds=sidebyside diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 409bdd8d96..7b4445cc30 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -26,19 +26,18 @@ #include "wx/dialog.h" #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/scrolbar.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" @@ -68,8 +67,6 @@ #include -extern wxList wxPendingDelete; - #ifdef __WXUNIVERSAL__ IMPLEMENT_ABSTRACT_CLASS(wxWindowMac, wxWindowBase) #else @@ -1764,7 +1761,7 @@ bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y) menu->SetInvokingWindow(this); menu->UpdateUI(); - if ( x == -1 && y == -1 ) + if ( x == wxDefaultCoord && y == wxDefaultCoord ) { wxPoint mouse = wxGetMousePosition(); x = mouse.x; @@ -2548,6 +2545,7 @@ void wxWindowMac::SetScrollbar(int orient, int pos, int thumbVisible, int range, bool refresh) { bool showScroller; + bool triggerSizeEvent = false; if ( orient == wxHORIZONTAL ) { @@ -2555,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 ) ; } @@ -2566,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