corrected control update code

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10123 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2001-05-11 08:16:52 +00:00
parent a8cd4a3a03
commit be57fda609
2 changed files with 100 additions and 16 deletions

View File

@@ -461,11 +461,14 @@ void UMAActivateControl( ControlHandle inControl )
{ {
WindowRef theWindow = GetControlOwner(inControl) ; WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( theWindow , updateRgn ) ; GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -486,17 +489,24 @@ void UMAActivateControl( ControlHandle inControl )
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
DisposeRgn( updateRgn ) ;
} }
void UMADrawControl( ControlHandle inControl ) void UMADrawControl( ControlHandle inControl )
{ {
WindowRef theWindow = GetControlOwner(inControl) ; WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( theWindow , updateRgn ) ; GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -517,17 +527,22 @@ void UMADrawControl( ControlHandle inControl )
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
} }
void UMAMoveControl( ControlHandle inControl , short x , short y ) void UMAMoveControl( ControlHandle inControl , short x , short y )
{ {
WindowRef theWindow = GetControlOwner(inControl) ; WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( theWindow , updateRgn ) ; GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -548,17 +563,22 @@ void UMAMoveControl( ControlHandle inControl , short x , short y )
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
} }
void UMASizeControl( ControlHandle inControl , short x , short y ) void UMASizeControl( ControlHandle inControl , short x , short y )
{ {
WindowRef theWindow = GetControlOwner(inControl) ; WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( theWindow , updateRgn ) ; GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -579,6 +599,8 @@ void UMASizeControl( ControlHandle inControl , short x , short y )
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
} }
@@ -586,11 +608,14 @@ void UMADeactivateControl( ControlHandle inControl )
{ {
WindowRef theWindow = GetControlOwner(inControl) ; WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( theWindow , updateRgn ) ; GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -611,6 +636,8 @@ void UMADeactivateControl( ControlHandle inControl )
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
} }
void UMASetThemeWindowBackground (WindowRef inWindow, void UMASetThemeWindowBackground (WindowRef inWindow,
@@ -708,11 +735,14 @@ void UMAHiliteControl (ControlHandle inControl,
{ {
WindowRef theWindow = GetControlOwner(inControl) ; WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( theWindow , updateRgn ) ; GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
::HiliteControl( inControl , hiliteState ) ; ::HiliteControl( inControl , hiliteState ) ;
@@ -726,17 +756,22 @@ void UMAHiliteControl (ControlHandle inControl,
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
} }
void UMAShowControl (ControlHandle inControl) void UMAShowControl (ControlHandle inControl)
{ {
WindowRef theWindow = GetControlOwner(inControl) ; WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( theWindow , updateRgn ) ; GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
::ShowControl( inControl ) ; ::ShowControl( inControl ) ;
@@ -750,6 +785,8 @@ void UMAShowControl (ControlHandle inControl)
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
} }
@@ -1003,11 +1040,14 @@ void UMAIdleControls (WindowPtr inWindow)
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
{ {
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( inWindow , updateRgn ) ; GetWindowUpdateRgn( inWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -1028,6 +1068,8 @@ void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
} }
OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl )

View File

@@ -461,11 +461,14 @@ void UMAActivateControl( ControlHandle inControl )
{ {
WindowRef theWindow = GetControlOwner(inControl) ; WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( theWindow , updateRgn ) ; GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -486,17 +489,24 @@ void UMAActivateControl( ControlHandle inControl )
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
DisposeRgn( updateRgn ) ;
} }
void UMADrawControl( ControlHandle inControl ) void UMADrawControl( ControlHandle inControl )
{ {
WindowRef theWindow = GetControlOwner(inControl) ; WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( theWindow , updateRgn ) ; GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -517,17 +527,22 @@ void UMADrawControl( ControlHandle inControl )
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
} }
void UMAMoveControl( ControlHandle inControl , short x , short y ) void UMAMoveControl( ControlHandle inControl , short x , short y )
{ {
WindowRef theWindow = GetControlOwner(inControl) ; WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( theWindow , updateRgn ) ; GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -548,17 +563,22 @@ void UMAMoveControl( ControlHandle inControl , short x , short y )
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
} }
void UMASizeControl( ControlHandle inControl , short x , short y ) void UMASizeControl( ControlHandle inControl , short x , short y )
{ {
WindowRef theWindow = GetControlOwner(inControl) ; WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( theWindow , updateRgn ) ; GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -579,6 +599,8 @@ void UMASizeControl( ControlHandle inControl , short x , short y )
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
} }
@@ -586,11 +608,14 @@ void UMADeactivateControl( ControlHandle inControl )
{ {
WindowRef theWindow = GetControlOwner(inControl) ; WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( theWindow , updateRgn ) ; GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -611,6 +636,8 @@ void UMADeactivateControl( ControlHandle inControl )
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
} }
void UMASetThemeWindowBackground (WindowRef inWindow, void UMASetThemeWindowBackground (WindowRef inWindow,
@@ -708,11 +735,14 @@ void UMAHiliteControl (ControlHandle inControl,
{ {
WindowRef theWindow = GetControlOwner(inControl) ; WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( theWindow , updateRgn ) ; GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
::HiliteControl( inControl , hiliteState ) ; ::HiliteControl( inControl , hiliteState ) ;
@@ -726,17 +756,22 @@ void UMAHiliteControl (ControlHandle inControl,
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
} }
void UMAShowControl (ControlHandle inControl) void UMAShowControl (ControlHandle inControl)
{ {
WindowRef theWindow = GetControlOwner(inControl) ; WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( theWindow , updateRgn ) ; GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
::ShowControl( inControl ) ; ::ShowControl( inControl ) ;
@@ -750,6 +785,8 @@ void UMAShowControl (ControlHandle inControl)
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
} }
@@ -1003,11 +1040,14 @@ void UMAIdleControls (WindowPtr inWindow)
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
{ {
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332) #if TARGET_CARBON
GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn ) ; GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn ) ;
#else #else
GetWindowUpdateRgn( inWindow , updateRgn ) ; GetWindowUpdateRgn( inWindow , updateRgn ) ;
#endif #endif
Point zero = { 0 , 0 } ;
LocalToGlobal( &zero ) ;
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -1028,6 +1068,8 @@ void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
#else #else
InvalRgn( updateRgn ) ; InvalRgn( updateRgn ) ;
#endif #endif
DisposeRgn( updateRgn ) ;
} }
OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl )