]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/app.cpp
removed redundant code
[wxWidgets.git] / src / mac / carbon / app.cpp
index 89b58a9c3e9aea3c74d3a77b147df7ae62f67d07..0257b8c6070640fad78cb421e475d6dd3ba6272f 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "wx/window.h"
 #include "wx/frame.h"
+#include "wx/button.h"
 #include "wx/app.h"
 #include "wx/utils.h"
 #include "wx/gdicmn.h"
@@ -975,19 +976,24 @@ bool wxApp::Yield(bool onlyIfNeeded)
 
 void wxApp::MacSuspend( bool convertClipboard )
 {
-    // we have to deactive the window manually
+    // we have to deactive the top level windows manually
 
-    wxWindow* window = GetTopWindow() ;
-    if ( window )
-        window->MacActivate( MacGetCurrentEvent() , false ) ;
+    wxNode* node = wxTopLevelWindows.First();
+    while (node)
+    {
+        wxTopLevelWindow* win = (wxTopLevelWindow*) node->Data();
+        win->MacActivate( MacGetCurrentEvent() , false ) ;
 
-        s_lastMouseDown = 0 ;
-        if( convertClipboard )
-        {
-            MacConvertPrivateToPublicScrap() ;
-        }
+        node = node->Next();
+    }
+
+     s_lastMouseDown = 0 ;
+     if( convertClipboard )
+     {
+         MacConvertPrivateToPublicScrap() ;
+     }
 
-        ::HideFloatingWindows() ;
+     ::HideFloatingWindows() ;
 }
 
 void wxApp::MacResume( bool convertClipboard )
@@ -1110,7 +1116,7 @@ void wxApp::MacHandleMouseDownEvent( EventRecord *ev )
         ::GetWindowAttributes( frontWindow , &frontWindowAttributes ) ;
 
     short windowPart = ::FindWindow(ev->where, &window);
-    wxWindow* win = wxFindWinFromMacWindow( window ) ;
+    wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ;
     if ( wxPendingDelete.Member(win) )
         return ;
 
@@ -1273,7 +1279,7 @@ void wxApp::MacHandleMouseUpEvent( EventRecord *ev )
             break ;
         default:
             {
-                wxWindow* win = wxFindWinFromMacWindow( window ) ;
+                wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ;
                 if ( win )
                     win->MacMouseUp( ev , windowPart ) ;
             }
@@ -1555,7 +1561,7 @@ void wxApp::MacHandleActivateEvent( EventRecord *ev )
             // if it is a floater we activate/deactivate the front non-floating window instead
             window = ::FrontNonFloatingWindow() ;
         }
-        wxWindow* win = wxFindWinFromMacWindow( window ) ;
+        wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ;
         if ( win )
             win->MacActivate( ev , activate ) ;
     }
@@ -1564,11 +1570,11 @@ void wxApp::MacHandleActivateEvent( EventRecord *ev )
 void wxApp::MacHandleUpdateEvent( EventRecord *ev )
 {
     WindowRef window = (WindowRef) ev->message ;
-    wxWindow * win = wxFindWinFromMacWindow( window ) ;
+    wxTopLevelWindowMac * win = wxFindWinFromMacWindow( window ) ;
     if ( win )
     {
         if ( !wxPendingDelete.Member(win) )
-            win->MacUpdate( ev ) ;
+            win->MacUpdate( ev->when ) ;
     }
     else
     {
@@ -1625,13 +1631,13 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
 
                     if ( oldFrontWindow )
                     {
-                        wxWindow* win = wxFindWinFromMacWindow( oldFrontWindow ) ;
+                        wxTopLevelWindowMac* win = wxFindWinFromMacWindow( oldFrontWindow ) ;
                         if ( win )
                             win->MacActivate( ev , false ) ;
                     }
                     if ( newFrontWindow )
                     {
-                        wxWindow* win = wxFindWinFromMacWindow( newFrontWindow ) ;
+                        wxTopLevelWindowMac* win = wxFindWinFromMacWindow( newFrontWindow ) ;
                         if ( win )
                             win->MacActivate( ev , true ) ;
                     }
@@ -1725,7 +1731,7 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
                             ::GetNextEvent(0, &tmp);
                             ev->modifiers = tmp.modifiers;
                             
-                            wxWindow* win = wxFindWinFromMacWindow( window ) ;
+                            wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ;
                             if ( win )
                                 win->MacMouseMoved( ev , windowPart ) ;
                             else