From a9825a9ba21e595beefe08b9ce958a3a5c768329 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 30 Mar 2004 14:43:06 +0000 Subject: [PATCH] since we are not getting the kEventDraw messages for everything we handle UserPanes via a proper draw proc and only dispatch the kEventDraw for the native OS controls git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26491 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/window.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index da1fc11f4c..1c97b5a05a 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -165,10 +165,9 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl CGContextFillRect( cgContext, bounds ); } #endif - if ( thisWindow->MacDoRedraw( updateRgn , cEvent.GetTicks() ) ) + if ( !thisWindow->MacIsUserPane() && thisWindow->MacDoRedraw( updateRgn , cEvent.GetTicks() ) ) result = noErr ; - else - result = eventNotHandledErr; + } break ; case kEventControlVisibilityChanged : @@ -554,14 +553,15 @@ bool wxWindowMac::Create(wxWindowMac *parent, wxWindowID id, { Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; - UInt32 features = kControlSupportsEmbedding | kControlSupportsLiveFeedback /*| kControlHasSpecialBackground */ | kControlSupportsCalcBestRect | kControlHandlesTracking | kControlSupportsFocus | kControlWantsActivate | kControlWantsIdle; + UInt32 features = kControlSupportsEmbedding | kControlSupportsLiveFeedback | kControlHasSpecialBackground | + kControlSupportsCalcBestRect | kControlHandlesTracking | kControlSupportsFocus | kControlWantsActivate | kControlWantsIdle; - ::CreateUserPaneControl( MAC_WXHWND(GetParent()->MacGetTopLevelWindowRef()) , &bounds, features, (ControlRef*) &m_macControl); + ::CreateUserPaneControl( MAC_WXHWND(GetParent()->MacGetTopLevelWindowRef()) , &bounds, kControlSupportsEmbedding , (ControlRef*) &m_macControl); MacPostControlCreate(pos,size) ; -#if !TARGET_API_MAC_OSX SetControlData((ControlRef) m_macControl,kControlEntireControl,kControlUserPaneDrawProcTag, sizeof(gControlUserPaneDrawUPP),(Ptr) &gControlUserPaneDrawUPP); +#if !TARGET_API_MAC_OSX SetControlData((ControlRef) m_macControl,kControlEntireControl,kControlUserPaneHitTestProcTag, sizeof(gControlUserPaneHitTestUPP),(Ptr) &gControlUserPaneHitTestUPP); SetControlData((ControlRef) m_macControl,kControlEntireControl,kControlUserPaneTrackingProcTag, @@ -1723,6 +1723,20 @@ void wxWindowMac::Refresh(bool eraseBack, const wxRect *rect) HIViewSetNeedsDisplayInRegion( (ControlRef) m_macControl , update , true ) ; } #else +/* + RgnHandle updateRgn = NewRgn() ; + if ( rect == NULL ) + { + CopyRgn( (RgnHandle) MacGetVisibleRegion().GetWXHRGN() , updateRgn ) ; + } + else + { + SetRectRgn( updateRgn , rect->x , rect->y , rect->x + rect->width , rect->y + rect->height ) ; + SectRgn( (RgnHandle) MacGetVisibleRegion().GetWXHRGN() , updateRgn , updateRgn ) ; + } + InvalWindowRgn( (WindowRef) MacGetTopLevelWindowRef() , updateRgn ) ; + DisposeRgn(updateRgn) ; +*/ if ( IsControlVisible( (ControlRef) m_macControl ) ) { SetControlVisibility( (ControlRef) m_macControl , false , false ) ; -- 2.47.2