X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..c655557fa685eb0201d5d45078a1f46370240592:/src/mac/classic/window.cpp diff --git a/src/mac/classic/window.cpp b/src/mac/classic/window.cpp index f5b98d14eb..1015c2ff60 100644 --- a/src/mac/classic/window.cpp +++ b/src/mac/classic/window.cpp @@ -1,42 +1,43 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: windows.cpp +// Name: src/mac/classic/window.cpp // Purpose: wxWindowMac // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "window.h" -#endif +#include "wx/wxprec.h" -#include "wx/setup.h" -#include "wx/menu.h" #include "wx/window.h" -#include "wx/dc.h" -#include "wx/dcclient.h" -#include "wx/utils.h" -#include "wx/app.h" -#include "wx/panel.h" -#include "wx/layout.h" -#include "wx/dialog.h" -#include "wx/listbox.h" -#include "wx/scrolbar.h" -#include "wx/statbox.h" -#include "wx/button.h" -#include "wx/settings.h" -#include "wx/msgdlg.h" -#include "wx/frame.h" + +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/app.h" + #include "wx/utils.h" + #include "wx/panel.h" + #include "wx/frame.h" + #include "wx/dc.h" + #include "wx/dcclient.h" + #include "wx/button.h" + #include "wx/menu.h" + #include "wx/dialog.h" + #include "wx/settings.h" + #include "wx/msgdlg.h" + #include "wx/scrolbar.h" + #include "wx/statbox.h" + #include "wx/listbox.h" + #include "wx/layout.h" + #include "wx/statusbr.h" + #include "wx/menuitem.h" +#endif + #include "wx/notebook.h" #include "wx/tabctrl.h" #include "wx/tooltip.h" -#include "wx/statusbr.h" -#include "wx/menuitem.h" #include "wx/spinctrl.h" -#include "wx/log.h" #include "wx/geometry.h" #if wxUSE_CARET @@ -59,7 +60,6 @@ #include -extern wxList wxPendingDelete; wxWindowMac* gFocusWindow = NULL ; #ifdef __WXUNIVERSAL__ @@ -68,19 +68,13 @@ wxWindowMac* gFocusWindow = NULL ; IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase) #endif // __WXUNIVERSAL__/__WXMAC__ -#if !USE_SHARED_LIBRARY - 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() -#endif - #define wxMAC_DEBUG_REDRAW 0 #ifndef wxMAC_DEBUG_REDRAW #define wxMAC_DEBUG_REDRAW 0 @@ -100,10 +94,10 @@ END_EVENT_TABLE() void wxWindowMac::Init() { - m_backgroundTransparent = FALSE; + m_backgroundTransparent = false; // as all windows are created with WS_VISIBLE style... - m_isShown = TRUE; + m_isShown = true; m_x = 0; m_y = 0 ; @@ -133,7 +127,7 @@ wxWindowMac::~wxWindowMac() } } - m_isBeingDeleted = TRUE; + m_isBeingDeleted = true; #ifndef __WXUNIVERSAL__ // VS: make sure there's no wxFrame with last focus set to us: @@ -187,7 +181,7 @@ bool wxWindowMac::Create(wxWindowMac *parent, wxWindowID id, long style, const wxString& name) { - wxCHECK_MSG( parent, FALSE, wxT("can't create wxWindowMac without parent") ); + wxCHECK_MSG( parent, false, wxT("can't create wxWindowMac without parent") ); #if wxUSE_STATBOX // wxGTK doesn't allow to create controls with static box as the parent so @@ -201,7 +195,7 @@ bool wxWindowMac::Create(wxWindowMac *parent, wxWindowID id, #endif // wxUSE_STATBOX if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) ) - return FALSE; + return false; parent->AddChild(this); @@ -222,7 +216,7 @@ bool wxWindowMac::Create(wxWindowMac *parent, wxWindowID id, wxWindowCreateEvent event(this); GetEventHandler()->AddPendingEvent(event); - return TRUE; + return true; } void wxWindowMac::SetFocus() @@ -274,13 +268,13 @@ void wxWindowMac::SetFocus() wxChildFocusEvent eventFocus(this); GetEventHandler()->ProcessEvent(eventFocus); - #ifndef __WXUNIVERSAL__ +#ifndef __WXUNIVERSAL__ wxControl* control = wxDynamicCast( gFocusWindow , wxControl ) ; if ( control && control->GetMacControl() ) { UMASetKeyboardFocus( (WindowRef) gFocusWindow->MacGetRootWindow() , (ControlHandle) control->GetMacControl() , kControlFocusNextPart ) ; } - #endif +#endif wxFocusEvent event(wxEVT_SET_FOCUS, m_windowId); event.SetEventObject(this); GetEventHandler()->ProcessEvent(event) ; @@ -291,11 +285,11 @@ void wxWindowMac::SetFocus() bool wxWindowMac::Enable(bool enable) { if ( !wxWindowBase::Enable(enable) ) - return FALSE; + return false; MacSuperEnabled( enable ) ; - return TRUE; + return true; } void wxWindowMac::DoCaptureMouse() @@ -364,7 +358,16 @@ bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y) { menu->SetInvokingWindow(this); menu->UpdateUI(); - ClientToScreen( &x , &y ) ; + + if ( x == -1 && y == -1 ) + { + wxPoint mouse = wxGetMousePosition(); + x = mouse.x; y = mouse.y; + } + else + { + ClientToScreen( &x , &y ) ; + } menu->MacBeforeDisplay( true ) ; long menuResult = ::PopUpMenuSelect((MenuHandle) menu->GetHMenu() ,y,x, 0) ; @@ -385,7 +388,7 @@ bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y) menu->SetInvokingWindow(NULL); - return TRUE; + return true; } #endif @@ -479,17 +482,17 @@ void wxWindowMac::MacRootWindowToWindow( int *x , int *y ) const bool wxWindowMac::SetCursor(const wxCursor& cursor) { if (m_cursor == cursor) - return FALSE; + return false; if (wxNullCursor == cursor) { if ( ! wxWindowBase::SetCursor( *wxSTANDARD_CURSOR ) ) - return FALSE ; + return false ; } else { if ( ! wxWindowBase::SetCursor( cursor ) ) - return FALSE ; + return false ; } wxASSERT_MSG( m_cursor.Ok(), @@ -509,7 +512,7 @@ bool wxWindowMac::SetCursor(const wxCursor& cursor) } } - return TRUE ; + return true ; } @@ -638,40 +641,40 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height) oldRgn = NewRgn() ; newRgn = NewRgn() ; diffRgn = NewRgn() ; - + // invalidate the differences between the old and the new area - + SetRectRgn(oldRgn , oldPos.x , oldPos.y , oldPos.x + m_width , oldPos.y + m_height ) ; SetRectRgn(newRgn , newPos.x , newPos.y , newPos.x + actualWidth , newPos.y + actualHeight ) ; DiffRgn( newRgn , oldRgn , diffRgn ) ; InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ; DiffRgn( oldRgn , newRgn , diffRgn ) ; InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ; - + // we also must invalidate the border areas, someone might optimize this one day to invalidate only the really // changing pixels... - - if ( MacGetLeftBorderSize() != 0 || MacGetRightBorderSize() != 0 || - MacGetTopBorderSize() != 0 || MacGetBottomBorderSize() != 0 ) + + if ( MacGetLeftBorderSize() != 0 || MacGetRightBorderSize() != 0 || + MacGetTopBorderSize() != 0 || MacGetBottomBorderSize() != 0 ) { - RgnHandle innerOldRgn, innerNewRgn ; - innerOldRgn = NewRgn() ; - innerNewRgn = NewRgn() ; - - SetRectRgn(innerOldRgn , oldPos.x + MacGetLeftBorderSize() , oldPos.y + MacGetTopBorderSize() , - oldPos.x + m_width - MacGetRightBorderSize() , oldPos.y + m_height - MacGetBottomBorderSize() ) ; - DiffRgn( oldRgn , innerOldRgn , diffRgn ) ; - InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ; - - SetRectRgn(innerNewRgn , newPos.x + MacGetLeftBorderSize() , newPos.y + MacGetTopBorderSize() , - newPos.x + actualWidth - MacGetRightBorderSize() , newPos.y + actualHeight - MacGetBottomBorderSize() ) ; - DiffRgn( newRgn , innerNewRgn , diffRgn ) ; - InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ; - - DisposeRgn( innerOldRgn ) ; - DisposeRgn( innerNewRgn ) ; + RgnHandle innerOldRgn, innerNewRgn ; + innerOldRgn = NewRgn() ; + innerNewRgn = NewRgn() ; + + SetRectRgn(innerOldRgn , oldPos.x + MacGetLeftBorderSize() , oldPos.y + MacGetTopBorderSize() , + oldPos.x + m_width - MacGetRightBorderSize() , oldPos.y + m_height - MacGetBottomBorderSize() ) ; + DiffRgn( oldRgn , innerOldRgn , diffRgn ) ; + InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ; + + SetRectRgn(innerNewRgn , newPos.x + MacGetLeftBorderSize() , newPos.y + MacGetTopBorderSize() , + newPos.x + actualWidth - MacGetRightBorderSize() , newPos.y + actualHeight - MacGetBottomBorderSize() ) ; + DiffRgn( newRgn , innerNewRgn , diffRgn ) ; + InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ; + + DisposeRgn( innerOldRgn ) ; + DisposeRgn( innerNewRgn ) ; } - + DisposeRgn(oldRgn) ; DisposeRgn(newRgn) ; DisposeRgn(diffRgn) ; @@ -793,12 +796,12 @@ wxPoint wxWindowMac::GetClientAreaOrigin() const return wxPoint(MacGetLeftBorderSize( ) , MacGetTopBorderSize( ) ); } -void wxWindowMac::SetTitle(const wxString& title) +void wxWindowMac::SetLabel(const wxString& label) { - m_label = title ; + m_label = label ; } -wxString wxWindowMac::GetTitle() const +wxString wxWindowMac::GetLabel() const { return m_label ; } @@ -806,12 +809,12 @@ wxString wxWindowMac::GetTitle() const bool wxWindowMac::Show(bool show) { if ( !wxWindowBase::Show(show) ) - return FALSE; + return false; MacSuperShown( show ) ; Refresh() ; - return TRUE; + return true; } void wxWindowMac::MacSuperShown( bool show ) @@ -905,8 +908,8 @@ void wxWindowMac::Refresh(bool eraseBack, const wxRect *rect) return ; if ( !MacIsReallyShown() ) - return ; - + return ; + wxPoint client = GetClientAreaOrigin(); int x1 = -client.x; int y1 = -client.y; @@ -970,7 +973,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 ; @@ -1095,26 +1098,26 @@ void wxWindowMac::MacPaintBorders( int left , int top ) { if( IsTopLevel() ) return ; - + int major,minor; wxGetOsVersion( &major, &minor ); RGBColor white = { 0xFFFF, 0xFFFF , 0xFFFF } ; RGBColor face = { 0xDDDD, 0xDDDD , 0xDDDD } ; - + RGBColor darkShadow = { 0x0000, 0x0000 , 0x0000 } ; RGBColor lightShadow = { 0x4444, 0x4444 , 0x4444 } ; // OS X has lighter border edges than classic: - if (major >= 10) - { - darkShadow.red = 0x8E8E; - darkShadow.green = 0x8E8E; - darkShadow.blue = 0x8E8E; - lightShadow.red = 0xBDBD; - lightShadow.green = 0xBDBD; - lightShadow.blue = 0xBDBD; - } - + if (major >= 10) + { + darkShadow.red = 0x8E8E; + darkShadow.green = 0x8E8E; + darkShadow.blue = 0x8E8E; + lightShadow.red = 0xBDBD; + lightShadow.green = 0xBDBD; + lightShadow.blue = 0xBDBD; + } + PenNormal() ; if (HasFlag(wxRAISED_BORDER) || HasFlag( wxSUNKEN_BORDER) || HasFlag(wxDOUBLE_BORDER) ) @@ -1225,7 +1228,7 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect) { if( dx == 0 && dy ==0 ) return ; - + { wxClientDC dc(this) ; @@ -1244,7 +1247,7 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect) SectRect( &scrollrect , &r , &scrollrect ) ; } ScrollRect( &scrollrect , dx , dy , updateRgn ) ; - // we also have to scroll the update rgn in this rectangle + // we also have to scroll the update rgn in this rectangle // in order not to loose updates WindowRef rootWindow = (WindowRef) MacGetRootWindow() ; RgnHandle formerUpdateRgn = NewRgn() ; @@ -1286,46 +1289,46 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect) } else { - child->SetSize( x+dx, y+dy, w, h ); - } + child->SetSize( x+dx, y+dy, w, h ); + } } - + Update() ; } 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 ; } @@ -1397,13 +1400,13 @@ bool wxWindowMac::MacGetWindowFromPointSub( const wxPoint &point , wxWindowMac** { if ((point.x < 0) || (point.y < 0) || (point.x > (m_width)) || (point.y > (m_height))) - return FALSE; + return false; } else { if ((point.x < m_x) || (point.y < m_y) || (point.x > (m_x + m_width)) || (point.y > (m_y + m_height))) - return FALSE; + return false; } WindowRef window = (WindowRef) MacGetRootWindow() ; @@ -1420,15 +1423,15 @@ 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; + return true; } } *outWin = this ; - return TRUE; + return true; } bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMac** outWin ) @@ -1439,7 +1442,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. @@ -1456,7 +1459,7 @@ bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMa return win->MacGetWindowFromPointSub( point , outWin ) ; } } - return FALSE ; + return false ; } static wxWindow *gs_lastWhich = NULL; @@ -1504,14 +1507,14 @@ bool wxWindowMac::MacSetupCursor( const wxPoint& pt) } bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event) -{ +{ if ((event.m_x < m_x) || (event.m_y < m_y) || (event.m_x > (m_x + m_width)) || (event.m_y > (m_y + m_height))) - return FALSE; + return false; if ( IsKindOf( CLASSINFO ( wxStaticBox ) ) /* || IsKindOf( CLASSINFO( wxSpinCtrl ) ) */) - return FALSE ; + return false ; WindowRef window = (WindowRef) MacGetRootWindow() ; @@ -1524,10 +1527,10 @@ 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; + return true; } } @@ -1570,14 +1573,14 @@ bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event) // Same for mouse up events if (event.GetEventType() == wxEVT_LEFT_UP) - return TRUE; + return true; if (event.GetEventType() == wxEVT_RIGHT_UP) - return TRUE; + return true; } GetEventHandler()->ProcessEvent( event ) ; - return TRUE; + return true; } wxString wxWindowMac::MacGetToolTipString( wxPoint &pt ) @@ -1595,7 +1598,7 @@ void wxWindowMac::Update() int top = 0 , left = 0 ; MacWindowToRootWindow( &left , &top ) ; WindowRef rootWindow = (WindowRef) MacGetRootWindow() ; - RgnHandle updateRgn = NewRgn() ; + RgnHandle updateRgn = NewRgn() ; // getting the update region in macos local coordinates GetWindowUpdateRgn( rootWindow , updateRgn ) ; GrafPtr port ; @@ -1627,7 +1630,7 @@ wxTopLevelWindowMac* wxWindowMac::MacGetTopLevelWindow() const WindowRef window = (WindowRef) MacGetRootWindow() ; if ( window ) { - win = wxFindWinFromMacWindow( window ) ; + win = wxFindWinFromMacWindow( (WXWindow) window ) ; } return win ; } @@ -1693,7 +1696,7 @@ const wxRegion& wxWindowMac::MacGetVisibleRegion( bool respectChildrenAndSibling int borderOther = 4 ; if ( UMAGetSystemVersion() >= 0x1030 ) borderTop += 2 ; - + SetRectRgn( tempStaticBoxRgn , child->m_x + borderOther , child->m_y + borderTop , child->m_x + child->m_width - borderOther , child->m_y + child->m_height - borderOther ) ; DiffRgn( tempRgn , tempStaticBoxRgn , tempRgn ) ; } @@ -1790,18 +1793,18 @@ 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 ) ; } } - + wxPaintEvent event; - event.m_timeStamp = time ; + event.SetTimestamp(time); event.SetEventObject(this); GetEventHandler()->ProcessEvent(event); - + for (wxWindowListNode *node = hiddenWindows.GetFirst(); node; node = node->GetNext()) { wxControl *child = wxDynamicCast( ( wxWindow*)node->GetData() , wxControl ) ; @@ -1825,7 +1828,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 ) ; @@ -1836,7 +1839,7 @@ void wxWindowMac::MacRedraw( WXHRGN updatergnr , long time, bool erase) } -WXHWND wxWindowMac::MacGetRootWindow() const +WXWindow wxWindowMac::MacGetRootWindow() const { wxWindowMac *iter = (wxWindowMac*)this ; @@ -2073,9 +2076,9 @@ wxPoint wxGetMousePosition() void wxWindowMac::OnMouseEvent( wxMouseEvent &event ) { - if ( event.GetEventType() == wxEVT_RIGHT_DOWN ) - { - // copied from wxGTK : CS + if ( event.GetEventType() == wxEVT_RIGHT_DOWN ) + { + // copied from wxGTK : CS // generate a "context menu" event: this is similar to wxEVT_RIGHT_DOWN // except that: // @@ -2087,10 +2090,9 @@ void wxWindowMac::OnMouseEvent( wxMouseEvent &event ) this->ClientToScreen(event.GetPosition())); if ( ! GetEventHandler()->ProcessEvent(evtCtx) ) event.Skip() ; - } - else - { - event.Skip() ; - } + } + else + { + event.Skip() ; + } } -