From c36f02449beace1fe721e14ad4d87a0700d0c49e Mon Sep 17 00:00:00 2001 From: Stefan Csomor <csomor@advancedconcepts.ch> Date: Sun, 3 Jun 2001 10:29:00 +0000 Subject: [PATCH] added GetControlBounds for accessing contrl.rect git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10417 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/uma.h | 2 +- src/mac/carbon/uma.cpp | 25 ++++++++++++++----------- src/mac/uma.cpp | 25 ++++++++++++++----------- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/include/wx/mac/uma.h b/include/wx/mac/uma.h index 937ef9d0f7..fd2017069e 100644 --- a/include/wx/mac/uma.h +++ b/include/wx/mac/uma.h @@ -243,7 +243,7 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ; #define GetQDGlobalsBlack( a ) (&((*a) = qd.black)) #define GetQDGlobalsScreenBits( a ) (*a) = qd.screenBits #define GetQDGlobalsArrow( a ) (&((*a) = qd.arrow)) -#define GetControlBounds( c , b ) ((*b) = (**c).contrlRect ) +#define GetControlBounds( c , b ) &((*b) = (**c).contrlRect ) #define GetPortBitMapForCopyBits( p ) ((BitMap*) &(((CGrafPtr)p)->portPixMap )) #endif diff --git a/src/mac/carbon/uma.cpp b/src/mac/carbon/uma.cpp index c96a8f93de..49ce364221 100644 --- a/src/mac/carbon/uma.cpp +++ b/src/mac/carbon/uma.cpp @@ -471,7 +471,8 @@ void UMAActivateControl( ControlHandle inControl ) ::ActivateControl( inControl ) ; if ( visible ) { SetControlVisibility( inControl , true , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } } } @@ -530,12 +531,14 @@ void UMAMoveControl( ControlHandle inControl , short x , short y ) bool visible = UMAIsControlVisible( inControl ) ; if ( visible ) { SetControlVisibility( inControl , false , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } ::MoveControl( inControl , x , y ) ; if ( visible ) { SetControlVisibility( inControl , true , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } } } @@ -547,12 +550,14 @@ void UMASizeControl( ControlHandle inControl , short x , short y ) bool visible = UMAIsControlVisible( inControl ) ; if ( visible ) { SetControlVisibility( inControl , false , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } ::SizeControl( inControl , x , y ) ; if ( visible ) { SetControlVisibility( inControl , true , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } } } @@ -569,7 +574,8 @@ void UMADeactivateControl( ControlHandle inControl ) ::DeactivateControl( inControl ) ; if ( visible ) { SetControlVisibility( inControl , true , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } } } @@ -684,11 +690,8 @@ void UMAShowControl (ControlHandle inControl) if ( UMAHasAppearance() ) { SetControlVisibility( inControl , true , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; - } - else - { - (**inControl).contrlVis = 255 ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } } diff --git a/src/mac/uma.cpp b/src/mac/uma.cpp index c96a8f93de..49ce364221 100644 --- a/src/mac/uma.cpp +++ b/src/mac/uma.cpp @@ -471,7 +471,8 @@ void UMAActivateControl( ControlHandle inControl ) ::ActivateControl( inControl ) ; if ( visible ) { SetControlVisibility( inControl , true , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } } } @@ -530,12 +531,14 @@ void UMAMoveControl( ControlHandle inControl , short x , short y ) bool visible = UMAIsControlVisible( inControl ) ; if ( visible ) { SetControlVisibility( inControl , false , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } ::MoveControl( inControl , x , y ) ; if ( visible ) { SetControlVisibility( inControl , true , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } } } @@ -547,12 +550,14 @@ void UMASizeControl( ControlHandle inControl , short x , short y ) bool visible = UMAIsControlVisible( inControl ) ; if ( visible ) { SetControlVisibility( inControl , false , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } ::SizeControl( inControl , x , y ) ; if ( visible ) { SetControlVisibility( inControl , true , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } } } @@ -569,7 +574,8 @@ void UMADeactivateControl( ControlHandle inControl ) ::DeactivateControl( inControl ) ; if ( visible ) { SetControlVisibility( inControl , true , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } } } @@ -684,11 +690,8 @@ void UMAShowControl (ControlHandle inControl) if ( UMAHasAppearance() ) { SetControlVisibility( inControl , true , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; - } - else - { - (**inControl).contrlVis = 255 ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } } -- 2.45.2