X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b6f5f27a330a5f3f05ee4824270e7dc692441d42..bed5584e2a93de909120d3eed5710f48d590a2a8:/src/mac/control.cpp diff --git a/src/mac/control.cpp b/src/mac/control.cpp index 0ef4cd0a87..92e8cd3cc8 100644 --- a/src/mac/control.cpp +++ b/src/mac/control.cpp @@ -400,6 +400,10 @@ void wxControl::MacPostControlCreate() { wxMacControlActionUPP = NewControlDefUPP( wxMacControlDefintion ) ; } + // The following block of code is responsible for crashes when switching + // back to windows, which can be seen in the dialogs sample. + // It is disabled until a proper solution can be found. +#if 0 #if TARGET_CARBON /* only working under classic carbon @@ -417,6 +421,7 @@ void wxControl::MacPostControlCreate() (**cdef).function = (void(*)()) wxMacControlActionUPP; (**(ControlHandle)m_macControl).contrlDefProc = (Handle) cdef ; } +#endif #endif SetControlColorProc( (ControlHandle) m_macControl , wxMacSetupControlBackgroundUPP ) ; @@ -437,6 +442,9 @@ void wxControl::MacPostControlCreate() SetSize(pos.x, pos.y, new_size.x, new_size.y); UMAShowControl( (ControlHandle) m_macControl ) ; + + SetCursor( *wxSTANDARD_CURSOR ) ; + Refresh() ; } @@ -755,7 +763,7 @@ void wxControl::Refresh(bool eraseBack, const wxRect *rect) void wxControl::MacRedrawControl() { - if ( (ControlHandle) m_macControl && MacGetRootWindow() ) + if ( (ControlHandle) m_macControl && MacGetRootWindow() && m_macControlIsShown ) { wxClientDC dc(this) ; wxMacPortSetter helper(&dc) ; @@ -767,11 +775,6 @@ void wxControl::MacRedrawControl() void wxControl::OnPaint(wxPaintEvent& event) { - if ( IsKindOf( CLASSINFO( wxBitmapButton ) ) ) - { - int i ; - i = 0 ; - } if ( (ControlHandle) m_macControl ) { wxPaintDC dc(this) ; @@ -824,7 +827,6 @@ void wxControl::OnMouseEvent( wxMouseEvent &event ) ControlHandle control ; Point localwhere ; SInt16 controlpart ; - WindowRef window = (WindowRef) MacGetRootWindow() ; localwhere.h = x ; localwhere.v = y ; @@ -845,20 +847,7 @@ void wxControl::OnMouseEvent( wxMouseEvent &event ) if ( event.m_metaDown ) modifiers |= cmdKey ; -/* -#if TARGET_CARBON - control = FindControlUnderMouse( localwhere , window , &controlpart ) ; -#else - controlpart = FindControl( localwhere , window , &control ) ; -#endif -*/ { - /* - if ( AcceptsFocus() && FindFocus() != this ) - { - SetFocus() ; - } - */ control = (ControlHandle) m_macControl ; if ( control && ::IsControlActive( control ) ) {