X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/971562cb51391676afccb9822e491d677f052c0d..2fe417e4c40f5686a37d04b0e0f57a6fa6c2ceec:/src/mac/classic/window.cpp diff --git a/src/mac/classic/window.cpp b/src/mac/classic/window.cpp index 4af9bf6ce2..351f692cda 100644 --- a/src/mac/classic/window.cpp +++ b/src/mac/classic/window.cpp @@ -73,8 +73,6 @@ wxWindowMac* gFocusWindow = NULL ; BEGIN_EVENT_TABLE(wxWindowMac, wxWindowBase) EVT_NC_PAINT(wxWindowMac::OnNcPaint) EVT_ERASE_BACKGROUND(wxWindowMac::OnEraseBackground) - EVT_SYS_COLOUR_CHANGED(wxWindowMac::OnSysColourChanged) - EVT_INIT_DIALOG(wxWindowMac::OnInitDialog) EVT_SET_FOCUS(wxWindowMac::OnSetFocus) EVT_MOUSE_EVENTS(wxWindowMac::OnMouseEvent) END_EVENT_TABLE() @@ -979,7 +977,7 @@ const wxBrush& wxWindowMac::MacGetBackgroundBrush() wxWindowMac* parent = GetParent() ; while( parent ) { - if ( parent->MacGetRootWindow() != window ) + if ( parent->MacGetRootWindow() != (WXWindow) window ) { // we are in a different window on the mac system parent = NULL ; @@ -1305,36 +1303,36 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect) void wxWindowMac::MacOnScroll(wxScrollEvent &event ) { - if ( event.m_eventObject == m_vScrollBar || event.m_eventObject == m_hScrollBar ) + if ( event.GetEventObject() == m_vScrollBar || event.GetEventObject() == m_hScrollBar ) { wxScrollWinEvent wevent; wevent.SetPosition(event.GetPosition()); wevent.SetOrientation(event.GetOrientation()); - wevent.m_eventObject = this; - - if (event.m_eventType == wxEVT_SCROLL_TOP) - wevent.m_eventType = wxEVT_SCROLLWIN_TOP; - else if (event.m_eventType == wxEVT_SCROLL_BOTTOM) - wevent.m_eventType = wxEVT_SCROLLWIN_BOTTOM; - else if (event.m_eventType == wxEVT_SCROLL_LINEUP) - wevent.m_eventType = wxEVT_SCROLLWIN_LINEUP; - else if (event.m_eventType == wxEVT_SCROLL_LINEDOWN) - wevent.m_eventType = wxEVT_SCROLLWIN_LINEDOWN; - else if (event.m_eventType == wxEVT_SCROLL_PAGEUP) - wevent.m_eventType = wxEVT_SCROLLWIN_PAGEUP; - else if (event.m_eventType == wxEVT_SCROLL_PAGEDOWN) - wevent.m_eventType = wxEVT_SCROLLWIN_PAGEDOWN; - else if (event.m_eventType == wxEVT_SCROLL_THUMBTRACK) - wevent.m_eventType = wxEVT_SCROLLWIN_THUMBTRACK; - else if (event.m_eventType == wxEVT_SCROLL_THUMBRELEASE) - wevent.m_eventType = wxEVT_SCROLLWIN_THUMBRELEASE; + wevent.SetEventObject(this); + + if (event.GetEventType() == wxEVT_SCROLL_TOP) + wevent.SetEventType( wxEVT_SCROLLWIN_TOP ); + else if (event.GetEventType() == wxEVT_SCROLL_BOTTOM) + wevent.SetEventType( wxEVT_SCROLLWIN_BOTTOM ); + else if (event.GetEventType() == wxEVT_SCROLL_LINEUP) + wevent.SetEventType( wxEVT_SCROLLWIN_LINEUP ); + else if (event.GetEventType() == wxEVT_SCROLL_LINEDOWN) + wevent.SetEventType( wxEVT_SCROLLWIN_LINEDOWN ); + else if (event.GetEventType() == wxEVT_SCROLL_PAGEUP) + wevent.SetEventType( wxEVT_SCROLLWIN_PAGEUP ); + else if (event.GetEventType() == wxEVT_SCROLL_PAGEDOWN) + wevent.SetEventType( wxEVT_SCROLLWIN_PAGEDOWN ); + else if (event.GetEventType() == wxEVT_SCROLL_THUMBTRACK) + wevent.SetEventType( wxEVT_SCROLLWIN_THUMBTRACK ); + else if (event.GetEventType() == wxEVT_SCROLL_THUMBRELEASE) + wevent.SetEventType( wxEVT_SCROLLWIN_THUMBRELEASE ); GetEventHandler()->ProcessEvent(wevent); } } // Get the window with the focus -wxWindowMac *wxWindowBase::FindFocus() +wxWindowMac *wxWindowBase::DoFindFocus() { return gFocusWindow ; } @@ -1429,7 +1427,7 @@ bool wxWindowMac::MacGetWindowFromPointSub( const wxPoint &point , wxWindowMac** { wxWindowMac *child = node->GetData(); // added the m_isShown test --dmazzoni - if ( child->MacGetRootWindow() == window && child->m_isShown ) + if ( child->MacGetRootWindow() == (WXWindow) window && child->m_isShown ) { if (child->MacGetWindowFromPointSub(newPoint , outWin )) return TRUE; @@ -1448,7 +1446,7 @@ bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMa if ( ::FindWindow( pt , &window ) == 3 ) { - wxWindowMac* win = wxFindWinFromMacWindow( window ) ; + wxWindowMac* win = wxFindWinFromMacWindow( (WXWindow) window ) ; if ( win ) { // No, this yields the CLIENT are, we need the whole frame. RR. @@ -1533,7 +1531,7 @@ bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event) for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) { wxWindowMac *child = node->GetData(); - if ( child->MacGetRootWindow() == window && child->IsShown() && child->IsEnabled() ) + if ( child->MacGetRootWindow() == (WXWindow) window && child->IsShown() && child->IsEnabled() ) { if (child->MacDispatchMouseEvent(event)) return TRUE; @@ -1636,7 +1634,7 @@ wxTopLevelWindowMac* wxWindowMac::MacGetTopLevelWindow() const WindowRef window = (WindowRef) MacGetRootWindow() ; if ( window ) { - win = wxFindWinFromMacWindow( window ) ; + win = wxFindWinFromMacWindow( (WXWindow) window ) ; } return win ; } @@ -1799,7 +1797,7 @@ void wxWindowMac::MacRedraw( WXHRGN updatergnr , long time, bool erase) { wxControl *child = wxDynamicCast( ( wxWindow*)node->GetData() , wxControl ) ; - if ( child && child->MacGetRootWindow() == window && child->IsShown() && child->GetMacControl() ) + if ( child && child->MacGetRootWindow() == (WXWindow) window && child->IsShown() && child->GetMacControl() ) { SetControlVisibility( (ControlHandle) child->GetMacControl() , false , false ) ; hiddenWindows.Append( child ) ; @@ -1807,7 +1805,7 @@ void wxWindowMac::MacRedraw( WXHRGN updatergnr , long time, bool erase) } wxPaintEvent event; - event.m_timeStamp = time ; + event.SetTimestamp(time); event.SetEventObject(this); GetEventHandler()->ProcessEvent(event); @@ -1834,7 +1832,7 @@ void wxWindowMac::MacRedraw( WXHRGN updatergnr , long time, bool erase) SetRectRgn( childupdate , child->m_x , child->m_y , child->m_x + child->m_width , child->m_y + child->m_height ) ; SectRgn( childupdate , updatergn , childupdate ) ; OffsetRgn( childupdate , -child->m_x , -child->m_y ) ; - if ( child->MacGetRootWindow() == window && child->IsShown() && !EmptyRgn( childupdate ) ) + if ( child->MacGetRootWindow() == (WXWindow) window && child->IsShown() && !EmptyRgn( childupdate ) ) { // because dialogs may also be children child->MacRedraw( childupdate , time , erase ) ; @@ -1845,7 +1843,7 @@ void wxWindowMac::MacRedraw( WXHRGN updatergnr , long time, bool erase) } -WXHWND wxWindowMac::MacGetRootWindow() const +WXWindow wxWindowMac::MacGetRootWindow() const { wxWindowMac *iter = (wxWindowMac*)this ;