]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/window.cpp
changed argument types (replaced long with wxCoord)
[wxWidgets.git] / src / mac / window.cpp
index 3dd198b36997c90f3570183a59f78acebbab0f21..e602f93fabec8748d20fbfa1304b25047cafbe0c 100644 (file)
@@ -1246,6 +1246,20 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect)
        InvalWindowRgn( GetMacRootWindow() ,  updateRgn ) ;
        DisposeRgn( updateRgn ) ;
        }
+       
+       for (wxNode *node = GetChildren().First(); node; node = node->Next())
+       {
+               wxWindow *child = (wxWindow*)node->Data();
+               if (child == m_vScrollBar) continue;
+               if (child == m_hScrollBar) continue;
+               if (child->IsTopLevel()) continue;
+               int x,y;
+               child->GetPosition( &x, &y );
+               int w,h;
+               child->GetSize( &w, &h );
+               child->SetSize( x+dx, y+dy, w, h );
+       }
+       
 }
 
 void wxWindow::MacOnScroll(wxScrollEvent &event )
@@ -1257,36 +1271,26 @@ void wxWindow::MacOnScroll(wxScrollEvent &event )
            wevent.SetOrientation(event.GetOrientation());
            wevent.m_eventObject = this;
        
-           switch ( event.m_eventType )
-           {
-           case wxEVT_SCROLL_TOP:
+       if (event.m_eventType == wxEVT_SCROLL_TOP) {
                wevent.m_eventType = wxEVT_SCROLLWIN_TOP;
-               break;
-       
-           case wxEVT_SCROLL_BOTTOM:
+           } else
+       if (event.m_eventType == wxEVT_SCROLL_BOTTOM) {
                wevent.m_eventType = wxEVT_SCROLLWIN_BOTTOM;
-               break;
-       
-           case wxEVT_SCROLL_LINEUP:
+           } else
+       if (event.m_eventType == wxEVT_SCROLL_LINEUP) {
                wevent.m_eventType = wxEVT_SCROLLWIN_LINEUP;
-               break;
-       
-           case wxEVT_SCROLL_LINEDOWN:
+           } else
+       if (event.m_eventType == wxEVT_SCROLL_LINEDOWN) {
                wevent.m_eventType = wxEVT_SCROLLWIN_LINEDOWN;
-               break;
-       
-           case wxEVT_SCROLL_PAGEUP:
+           } else
+       if (event.m_eventType == wxEVT_SCROLL_PAGEUP) {
                wevent.m_eventType = wxEVT_SCROLLWIN_PAGEUP;
-               break;
-       
-           case wxEVT_SCROLL_PAGEDOWN:
+           } else
+       if (event.m_eventType == wxEVT_SCROLL_PAGEDOWN) {
                wevent.m_eventType = wxEVT_SCROLLWIN_PAGEDOWN;
-               break;
-       
-           case wxEVT_SCROLL_THUMBTRACK:
+           } else
+       if (event.m_eventType == wxEVT_SCROLL_THUMBTRACK) {
                wevent.m_eventType = wxEVT_SCROLLWIN_THUMBTRACK;
-               break;
-       
            }
                
            GetEventHandler()->ProcessEvent(wevent);
@@ -1741,6 +1745,7 @@ void wxWindow::MacRedraw( RgnHandle updatergn , long time)
                        RgnHandle newupdate = NewRgn() ;
                        wxSize point = GetClientSize() ;
                        wxPoint origin = GetClientAreaOrigin() ;
+
                        SetRectRgn( newupdate , origin.x , origin.y , origin.x + point.x , origin.y+point.y ) ;
                        SectRgn( newupdate , m_macUpdateRgn , newupdate ) ;
                        OffsetRgn( newupdate , -origin.x , -origin.y ) ;
@@ -1754,13 +1759,10 @@ void wxWindow::MacRedraw( RgnHandle updatergn , long time)
                event.SetEventObject(this);
                GetEventHandler()->ProcessEvent(event);
        }
-       {
-       }
-
        
        
        RgnHandle childupdate = NewRgn() ;
-
+                       
        for (wxNode *node = GetChildren().First(); node; node = node->Next())
        {
                wxWindow *child = (wxWindow*)node->Data();
@@ -2344,3 +2346,21 @@ wxMacDrawingClientHelper::~wxMacDrawingClientHelper()
        if ( m_formerPort != m_currentPort )
                SetPort( m_formerPort ) ;
 }
+
+// Find the wxWindow at the current mouse position, returning the mouse
+// position.
+wxWindow* wxFindWindowAtPointer(wxPoint& pt)
+{
+    pt = wxGetMousePosition();
+    wxWindow* found = wxFindWindowAtPoint(pt);
+    return found;
+}
+
+// Get the current mouse position.
+wxPoint wxGetMousePosition()
+{
+    int x, y;
+    wxGetMousePosition(& x, & y);
+    return wxPoint(x, y);
+}
+