]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/window.cpp
removed useless PM_USE_SESSION_APIS define (it must be defined in MacHeaders
[wxWidgets.git] / src / mac / window.cpp
index d443d4bfa85ad586a66ec013e74426bee66ef967..edc7d866a8004aeafd795eb68bb2dced560eb4c8 100644 (file)
@@ -296,6 +296,11 @@ void wxWindow::CaptureMouse()
     wxTheApp->s_captureWindow = this ;
 }
 
+wxWindow* wxWindowBase::GetCapture()
+{
+    return wxTheApp->s_captureWindow ;
+}
+
 void wxWindow::ReleaseMouse()
 {
     wxTheApp->s_captureWindow = NULL ;
@@ -689,16 +694,18 @@ void wxWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags)
                MacRepositionScrollBars() ;
                if ( doMove )
                {
-               wxMoveEvent event(wxPoint(m_x, m_y), m_windowId);
+               wxPoint point(m_x, m_y);
+               wxMoveEvent event(point, m_windowId);
                event.SetEventObject(this);
                GetEventHandler()->ProcessEvent(event) ;
        }
        if ( doResize )
        {
-                       MacRepositionScrollBars() ;
-               wxSizeEvent event(wxSize(m_width, m_height), m_windowId);
-               event.SetEventObject(this);
-               GetEventHandler()->ProcessEvent(event);
+           MacRepositionScrollBars() ;
+           wxSize size(m_width, m_height);
+           wxSizeEvent event(size, m_windowId);
+           event.SetEventObject(this);
+           GetEventHandler()->ProcessEvent(event);
        }
        }
 }
@@ -757,7 +764,8 @@ bool wxWindow::Show(bool show)
                UMASelectWindow( m_macWindowData->m_macWindow ) ;
                // no need to generate events here, they will get them triggered by macos
                // actually they should be , but apparently they are not
-           wxSizeEvent event(wxSize(m_width, m_height), m_windowId);
+           wxSize size(m_width, m_height);
+           wxSizeEvent event(size, m_windowId);
            event.SetEventObject(this);
            GetEventHandler()->ProcessEvent(event);
          }
@@ -767,7 +775,17 @@ bool wxWindow::Show(bool show)
          }
        }
        MacSuperShown( show ) ;
-       Refresh() ;
+       if ( !show )
+       {
+           WindowRef window = GetMacRootWindow() ;
+           wxWindow* win = wxFindWinFromMacWindow( window ) ;
+           if ( !win->m_isBeingDeleted )
+               Refresh() ;     
+       }
+       else
+       {
+       Refresh() ;     
+       }
 
     return TRUE;
 }