]> 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 3a5cfcd895c14d3c66ffcdce024049d65c746f87..edc7d866a8004aeafd795eb68bb2dced560eb4c8 100644 (file)
@@ -296,6 +296,11 @@ void wxWindow::CaptureMouse()
     wxTheApp->s_captureWindow = this ;
 }
 
     wxTheApp->s_captureWindow = this ;
 }
 
+wxWindow* wxWindowBase::GetCapture()
+{
+    return wxTheApp->s_captureWindow ;
+}
+
 void wxWindow::ReleaseMouse()
 {
     wxTheApp->s_captureWindow = NULL ;
 void wxWindow::ReleaseMouse()
 {
     wxTheApp->s_captureWindow = NULL ;
@@ -643,7 +648,7 @@ void wxWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags)
                        if ( focus.Ok() )
                        {
                                Rect clientrect = { 0 , 0 , m_height , m_width } ;
                        if ( focus.Ok() )
                        {
                                Rect clientrect = { 0 , 0 , m_height , m_width } ;
-                               ClipRect( &clientrect ) ;
+                               // ClipRect( &clientrect ) ;
                        InvalWindowRect( GetMacRootWindow() , &clientrect ) ;
                        }
                }
                        InvalWindowRect( GetMacRootWindow() , &clientrect ) ;
                        }
                }
@@ -678,7 +683,7 @@ void wxWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags)
                                if ( focus.Ok() )
                                {
                                        Rect clientrect = { 0 , 0 , m_height , m_width } ;
                                if ( focus.Ok() )
                                {
                                        Rect clientrect = { 0 , 0 , m_height , m_width } ;
-                                       ClipRect( &clientrect ) ;
+                                       // ClipRect( &clientrect ) ;
                                InvalWindowRect( GetMacRootWindow() , &clientrect ) ;
                                }
                        }
                                InvalWindowRect( GetMacRootWindow() , &clientrect ) ;
                                }
                        }
@@ -689,16 +694,18 @@ void wxWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags)
                MacRepositionScrollBars() ;
                if ( doMove )
                {
                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 )
        {
                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
                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);
          }
            event.SetEventObject(this);
            GetEventHandler()->ProcessEvent(event);
          }
@@ -767,7 +775,17 @@ bool wxWindow::Show(bool show)
          }
        }
        MacSuperShown( show ) ;
          }
        }
        MacSuperShown( show ) ;
-       Refresh() ;
+       if ( !show )
+       {
+           WindowRef window = GetMacRootWindow() ;
+           wxWindow* win = wxFindWinFromMacWindow( window ) ;
+           if ( !win->m_isBeingDeleted )
+               Refresh() ;     
+       }
+       else
+       {
+       Refresh() ;     
+       }
 
     return TRUE;
 }
 
     return TRUE;
 }
@@ -916,7 +934,7 @@ void wxWindow::Refresh(bool eraseBack, const wxRect *rect)
        if ( focus.Ok() )
        {
                Rect clientrect = { 0 , 0 , m_height , m_width } ;
        if ( focus.Ok() )
        {
                Rect clientrect = { 0 , 0 , m_height , m_width } ;
-               ClipRect( &clientrect ) ;
+               // ClipRect( &clientrect ) ;
 
        if ( rect )
        {
 
        if ( rect )
        {
@@ -1515,13 +1533,19 @@ void wxWindow::OnIdle(wxIdleEvent& event)
 // Raise the window to the top of the Z order
 void wxWindow::Raise()
 {
 // Raise the window to the top of the Z order
 void wxWindow::Raise()
 {
-    // TODO
+    if ( m_macWindowData )
+    {
+        UMABringToFront( m_macWindowData->m_macWindow ) ;
+    }
 }
 
 // Lower the window to the bottom of the Z order
 void wxWindow::Lower()
 {
 }
 
 // Lower the window to the bottom of the Z order
 void wxWindow::Lower()
 {
-    // TODO
+    if ( m_macWindowData )
+    {
+        UMASendBehind( m_macWindowData->m_macWindow , NULL ) ;
+    }
 }
 
 void wxWindow::DoSetClientSize(int width, int height)
 }
 
 void wxWindow::DoSetClientSize(int width, int height)
@@ -1795,7 +1819,7 @@ void wxWindow::MacActivate( EventRecord *ev , bool inIsActivating )
        
        GetEventHandler()->ProcessEvent(event);
        
        
        GetEventHandler()->ProcessEvent(event);
        
-    Refresh() ;
+    Refresh(false) ;
        UMAHighlightAndActivateWindow( m_macWindowData->m_macWindow , inIsActivating ) ;
 //     MacUpdateImmediately() ;
 }
        UMAHighlightAndActivateWindow( m_macWindowData->m_macWindow , inIsActivating ) ;
 //     MacUpdateImmediately() ;
 }
@@ -1872,7 +1896,7 @@ void wxWindow::MacRedraw( RgnHandle updatergn , long time)
                                RGBBackColor( &m_backgroundColour.GetPixel()) ;
                        }
             // subtract all non transparent children from updatergn
                                RGBBackColor( &m_backgroundColour.GetPixel()) ;
                        }
             // subtract all non transparent children from updatergn
-
+            
            RgnHandle childarea = NewRgn() ;
                for (wxNode *node = GetChildren().First(); node; node = node->Next())
                {
            RgnHandle childarea = NewRgn() ;
                for (wxNode *node = GetChildren().First(); node; node = node->Next())
                {
@@ -1880,7 +1904,7 @@ void wxWindow::MacRedraw( RgnHandle updatergn , long time)
                        // eventually test for transparent windows
                        if ( child->GetMacRootWindow() == window && child->IsShown() )
                        {
                        // eventually test for transparent windows
                        if ( child->GetMacRootWindow() == window && child->IsShown() )
                        {
-                           if ( !child->IsKindOf( CLASSINFO( wxControl ) ) && ((wxControl*)child)->GetMacControl() )
+                           if ( child->GetBackgroundColour() != m_backgroundColour && !child->IsKindOf( CLASSINFO( wxControl ) ) && ((wxControl*)child)->GetMacControl() )
                            {
                                SetRectRgn( childarea , child->m_x , child->m_y , child->m_x + child->m_width ,  child->m_y + child->m_height ) ;
                                DiffRgn( ownUpdateRgn , childarea , ownUpdateRgn ) ;
                            {
                                SetRectRgn( childarea , child->m_x , child->m_y , child->m_x + child->m_width ,  child->m_y + child->m_height ) ;
                                DiffRgn( ownUpdateRgn , childarea , ownUpdateRgn ) ;