]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/window.cpp
don't create non-existing groups in HasEntry()
[wxWidgets.git] / src / mac / carbon / window.cpp
index e3631536fa9879ee9001ee7a15b26f26eddd636e..7b4445cc308a214b1d2372cdfbc3532a901be7d8 100644 (file)
     #include "wx/panel.h"
     #include "wx/frame.h"
     #include "wx/dc.h"
+    #include "wx/dcclient.h"
+    #include "wx/button.h"
+    #include "wx/menu.h"
+    #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/menu.h"
-#include "wx/dcclient.h"
-#include "wx/layout.h"
-#include "wx/dialog.h"
-#include "wx/scrolbar.h"
-#include "wx/statbox.h"
-#include "wx/button.h"
-#include "wx/settings.h"
-#include "wx/msgdlg.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 <string.h>
 
-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