]> git.saurik.com Git - wxWidgets.git/commitdiff
corrected redraw problems in controls (the erroneusly revalidated their draw area...
authorStefan Csomor <csomor@advancedconcepts.ch>
Thu, 10 May 2001 06:28:28 +0000 (06:28 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Thu, 10 May 2001 06:28:28 +0000 (06:28 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10098 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/choice.cpp
src/mac/carbon/uma.cpp
src/mac/choice.cpp
src/mac/uma.cpp

index 9c4e7d94a9861a9dc33492cecc1dfd56040f7e57..9363a6cdda1275826287db0c8a7e0a9f1e8b1984 100644 (file)
@@ -27,7 +27,7 @@ short nextMenuId = 100 ; // wxMenu takes the lower ids
 wxChoice::~wxChoice()
 {
        // DeleteMenu( m_macPopUpMenuId ) ;
-       DisposeMenu( m_macPopUpMenuHandle ) ;
+       // DisposeMenu( m_macPopUpMenuHandle ) ;
 }
 
 bool wxChoice::Create(wxWindow *parent, wxWindowID id,
index 19a50536458b87a925c47b4ab50a6c7f15f320f8..3be88ef8ec9c288a3a44f0d037d83e1f1bdb668a 100644 (file)
 
 // init
 
+#if !TARGET_CARBON
+#define        GetControlOwner( control ) (**control).contrlOwner
+#endif
+
 static bool    sUMAHasAppearance = false ;
 static long sUMAAppearanceVersion = 0 ;
 extern int gAGABackgroundColor ;
@@ -453,6 +457,8 @@ void                        UMACloseWindow(WindowRef inWindowRef)
 
 void UMAActivateControl( ControlHandle inControl ) 
 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
 #if UMA_USE_APPEARANCE
        if ( UMAHasAppearance() )
        {
@@ -468,10 +474,13 @@ void UMAActivateControl( ControlHandle inControl )
        {
        }
 #endif
+                       InvalRgn( updateRgn ) ;
 }
 
 void UMADrawControl( ControlHandle inControl ) 
 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
 #if UMA_USE_APPEARANCE
        if ( UMAHasAppearance() )
        {
@@ -487,10 +496,13 @@ void UMADrawControl( ControlHandle inControl )
        {
        }
 #endif
+                       InvalRgn( updateRgn ) ;
 }
 
 void UMAMoveControl( ControlHandle inControl , short x , short y ) 
 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
 #if UMA_USE_APPEARANCE
        if ( UMAHasAppearance() )
        {
@@ -506,10 +518,13 @@ void UMAMoveControl( ControlHandle inControl , short x , short y )
        {
        }
 #endif
+                       InvalRgn( updateRgn ) ;
 }
 
 void UMASizeControl( ControlHandle inControl , short x , short y ) 
 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
 #if UMA_USE_APPEARANCE
        if ( UMAHasAppearance() )
        {
@@ -525,10 +540,13 @@ void UMASizeControl( ControlHandle inControl , short x , short y )
        {
        }
 #endif
+                       InvalRgn( updateRgn ) ;
 }
 
 void UMADeactivateControl( ControlHandle inControl ) 
 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
 #if UMA_USE_APPEARANCE
        if ( UMAHasAppearance() )
        {
@@ -544,6 +562,7 @@ void UMADeactivateControl( ControlHandle inControl )
        {
        }
 #endif
+                       InvalRgn( updateRgn ) ;
 }
 
 void                   UMASetThemeWindowBackground             (WindowRef                              inWindow,
@@ -640,6 +659,8 @@ void UMADisposeControl (ControlHandle                       theControl)
 void UMAHiliteControl  (ControlHandle                  theControl,
                                                                 ControlPartCode                hiliteState)
                                                                 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( GetControlOwner(theControl) , updateRgn ) ;
        if ( UMAHasAppearance() )
        {
        ::HiliteControl( theControl , hiliteState ) ;
@@ -648,11 +669,14 @@ void UMAHiliteControl     (ControlHandle                  theControl,
    {
        ::HiliteControl( theControl , hiliteState ) ;
        }
+                       InvalRgn( updateRgn ) ;
 }
 
 
 void UMAShowControl                                            (ControlHandle                  theControl)
 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( GetControlOwner(theControl) , updateRgn ) ;
        if ( UMAHasAppearance() )
        {
        ::ShowControl( theControl ) ;
@@ -661,6 +685,7 @@ void UMAShowControl                                         (ControlHandle                  theControl)
    {
        ::ShowControl( theControl ) ;
    }
+                       InvalRgn( updateRgn ) ;
 }
 
 
@@ -913,6 +938,8 @@ void UMAIdleControls                                        (WindowPtr                              inWindow)
 
 void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) 
 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( inWindow , updateRgn ) ;
 #if UMA_USE_APPEARANCE
        if ( UMAHasAppearance() )
        {
@@ -928,6 +955,7 @@ void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
        {
        }
 #endif
+                       InvalRgn( updateRgn ) ;
 }
 
 OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) 
index 9c4e7d94a9861a9dc33492cecc1dfd56040f7e57..9363a6cdda1275826287db0c8a7e0a9f1e8b1984 100644 (file)
@@ -27,7 +27,7 @@ short nextMenuId = 100 ; // wxMenu takes the lower ids
 wxChoice::~wxChoice()
 {
        // DeleteMenu( m_macPopUpMenuId ) ;
-       DisposeMenu( m_macPopUpMenuHandle ) ;
+       // DisposeMenu( m_macPopUpMenuHandle ) ;
 }
 
 bool wxChoice::Create(wxWindow *parent, wxWindowID id,
index 19a50536458b87a925c47b4ab50a6c7f15f320f8..3be88ef8ec9c288a3a44f0d037d83e1f1bdb668a 100644 (file)
 
 // init
 
+#if !TARGET_CARBON
+#define        GetControlOwner( control ) (**control).contrlOwner
+#endif
+
 static bool    sUMAHasAppearance = false ;
 static long sUMAAppearanceVersion = 0 ;
 extern int gAGABackgroundColor ;
@@ -453,6 +457,8 @@ void                        UMACloseWindow(WindowRef inWindowRef)
 
 void UMAActivateControl( ControlHandle inControl ) 
 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
 #if UMA_USE_APPEARANCE
        if ( UMAHasAppearance() )
        {
@@ -468,10 +474,13 @@ void UMAActivateControl( ControlHandle inControl )
        {
        }
 #endif
+                       InvalRgn( updateRgn ) ;
 }
 
 void UMADrawControl( ControlHandle inControl ) 
 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
 #if UMA_USE_APPEARANCE
        if ( UMAHasAppearance() )
        {
@@ -487,10 +496,13 @@ void UMADrawControl( ControlHandle inControl )
        {
        }
 #endif
+                       InvalRgn( updateRgn ) ;
 }
 
 void UMAMoveControl( ControlHandle inControl , short x , short y ) 
 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
 #if UMA_USE_APPEARANCE
        if ( UMAHasAppearance() )
        {
@@ -506,10 +518,13 @@ void UMAMoveControl( ControlHandle inControl , short x , short y )
        {
        }
 #endif
+                       InvalRgn( updateRgn ) ;
 }
 
 void UMASizeControl( ControlHandle inControl , short x , short y ) 
 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
 #if UMA_USE_APPEARANCE
        if ( UMAHasAppearance() )
        {
@@ -525,10 +540,13 @@ void UMASizeControl( ControlHandle inControl , short x , short y )
        {
        }
 #endif
+                       InvalRgn( updateRgn ) ;
 }
 
 void UMADeactivateControl( ControlHandle inControl ) 
 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
 #if UMA_USE_APPEARANCE
        if ( UMAHasAppearance() )
        {
@@ -544,6 +562,7 @@ void UMADeactivateControl( ControlHandle inControl )
        {
        }
 #endif
+                       InvalRgn( updateRgn ) ;
 }
 
 void                   UMASetThemeWindowBackground             (WindowRef                              inWindow,
@@ -640,6 +659,8 @@ void UMADisposeControl (ControlHandle                       theControl)
 void UMAHiliteControl  (ControlHandle                  theControl,
                                                                 ControlPartCode                hiliteState)
                                                                 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( GetControlOwner(theControl) , updateRgn ) ;
        if ( UMAHasAppearance() )
        {
        ::HiliteControl( theControl , hiliteState ) ;
@@ -648,11 +669,14 @@ void UMAHiliteControl     (ControlHandle                  theControl,
    {
        ::HiliteControl( theControl , hiliteState ) ;
        }
+                       InvalRgn( updateRgn ) ;
 }
 
 
 void UMAShowControl                                            (ControlHandle                  theControl)
 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( GetControlOwner(theControl) , updateRgn ) ;
        if ( UMAHasAppearance() )
        {
        ::ShowControl( theControl ) ;
@@ -661,6 +685,7 @@ void UMAShowControl                                         (ControlHandle                  theControl)
    {
        ::ShowControl( theControl ) ;
    }
+                       InvalRgn( updateRgn ) ;
 }
 
 
@@ -913,6 +938,8 @@ void UMAIdleControls                                        (WindowPtr                              inWindow)
 
 void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) 
 {
+                       RgnHandle updateRgn = NewRgn() ;
+                       GetWindowUpdateRgn( inWindow , updateRgn ) ;
 #if UMA_USE_APPEARANCE
        if ( UMAHasAppearance() )
        {
@@ -928,6 +955,7 @@ void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
        {
        }
 #endif
+                       InvalRgn( updateRgn ) ;
 }
 
 OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl )