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
This commit is contained in:
Stefan Csomor
2004-03-30 14:43:06 +00:00
parent aa10ccc2e2
commit a9825a9ba2

View File

@@ -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 ) ;