]> git.saurik.com Git - wxWidgets.git/commitdiff
since we are not getting the kEventDraw messages for everything we handle UserPanes...
authorStefan Csomor <csomor@advancedconcepts.ch>
Tue, 30 Mar 2004 14:43:06 +0000 (14:43 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Tue, 30 Mar 2004 14:43:06 +0000 (14:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26491 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/window.cpp

index da1fc11f4c1beae52254a5eae823e4b6a3150f39..1c97b5a05ac541b843d19ea83f5d62ce48a2b679 100644 (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 ) ;