]> 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 46f90f87320d5e65c62d4f06650e5bdaf33e7c9f..7b4445cc308a214b1d2372cdfbc3532a901be7d8 100644 (file)
 
 #include "wx/wxprec.h"
 
-#include "wx/menu.h"
 #include "wx/window.h"
-#include "wx/dc.h"
-#include "wx/dcclient.h"
-#include "wx/utils.h"
-#include "wx/app.h"
-#include "wx/panel.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/frame.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/log.h"
+    #include "wx/app.h"
+    #include "wx/utils.h"
+    #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/tooltip.h"
-#include "wx/statusbr.h"
-#include "wx/menuitem.h"
 #include "wx/spinctrl.h"
-#include "wx/log.h"
 #include "wx/geometry.h"
-#include "wx/textctrl.h"
-
-#include "wx/toolbar.h"
-#include "wx/dc.h"
 
 #if wxUSE_CARET
     #include "wx/caret.h"
@@ -65,8 +67,6 @@
 
 #include <string.h>
 
-extern wxList wxPendingDelete;
-
 #ifdef __WXUNIVERSAL__
     IMPLEMENT_ABSTRACT_CLASS(wxWindowMac, wxWindowBase)
 #else
@@ -514,7 +514,7 @@ pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler , Even
 
         uniChars = new wchar_t[ numChars ] ;
         GetEventParameter( event, kEventParamTextInputSendText, typeUnicodeText, NULL, dataSize , NULL , charBuf ) ;
-               charBuf[ numChars - 1 ] = 0;
+        charBuf[ numChars - 1 ] = 0;
 #if SIZEOF_WCHAR_T == 2
         uniChars = (wchar_t*) charBuf ;
         memcpy( uniChars , charBuf , numChars * 2 ) ;
@@ -1761,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;
@@ -2545,6 +2545,7 @@ void wxWindowMac::SetScrollbar(int orient, int pos, int thumbVisible,
     int range, bool refresh)
 {
     bool showScroller;
+    bool triggerSizeEvent = false;
 
     if ( orient == wxHORIZONTAL )
     {
@@ -2552,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 ) ;
         }
@@ -2563,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