X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b03e4fcd11071534f942a6c3b16bb86792c71e83..a9249b2eb2a40d8c71f828669045c4ddaa8dc5ff:/src/mac/carbon/uma.cpp diff --git a/src/mac/carbon/uma.cpp b/src/mac/carbon/uma.cpp index 00e22e0ffa..25a90e1ec5 100644 --- a/src/mac/carbon/uma.cpp +++ b/src/mac/carbon/uma.cpp @@ -396,8 +396,10 @@ void UMAGetWTitleC( WindowRef inWindowRef , char *title ) void UMAActivateControl( ControlHandle inControl ) { - if ( !IsControlActive( inControl ) ) - { + // we have to add the control after again to the update rgn + // otherwise updates get lost + if ( !IsControlActive( inControl ) ) + { bool visible = IsControlVisible( inControl ) ; if ( visible ) SetControlVisibility( inControl , false , false ) ; @@ -407,7 +409,7 @@ void UMAActivateControl( ControlHandle inControl ) Rect ctrlBounds ; InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } - } + } } void UMADrawControl( ControlHandle inControl ) @@ -415,13 +417,12 @@ void UMADrawControl( ControlHandle inControl ) WindowRef theWindow = GetControlOwner(inControl) ; RgnHandle updateRgn = NewRgn() ; GetWindowUpdateRgn( theWindow , updateRgn ) ; - Point zero = { 0 , 0 } ; - LocalToGlobal( &zero ) ; - OffsetRgn( updateRgn , -zero.h , -zero.v ) ; - ::DrawControlInCurrentPort( inControl ) ; - InvalWindowRgn( theWindow, updateRgn) ; - DisposeRgn( updateRgn ) ; - + Point zero = { 0 , 0 } ; + LocalToGlobal( &zero ) ; + OffsetRgn( updateRgn , -zero.h , -zero.v ) ; + ::DrawControlInCurrentPort( inControl ) ; + InvalWindowRgn( theWindow, updateRgn) ; + DisposeRgn( updateRgn ) ; } void UMAMoveControl( ControlHandle inControl , short x , short y ) @@ -458,8 +459,8 @@ void UMASizeControl( ControlHandle inControl , short x , short y ) void UMADeactivateControl( ControlHandle inControl ) { - if ( IsControlActive( inControl ) ) - { + // we have to add the control after again to the update rgn + // otherwise updates get lost bool visible = IsControlVisible( inControl ) ; if ( visible ) SetControlVisibility( inControl , false , false ) ; @@ -469,7 +470,6 @@ void UMADeactivateControl( ControlHandle inControl ) Rect ctrlBounds ; InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } - } } // shows the control and adds the region to the update region void UMAShowControl (ControlHandle inControl) @@ -479,6 +479,13 @@ void UMAShowControl (ControlHandle inControl) InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } +// shows the control and adds the region to the update region +void UMAHideControl (ControlHandle inControl) +{ + SetControlVisibility( inControl , false , false ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; +} // keyboard focus OSErr UMASetKeyboardFocus (WindowPtr inWindow, ControlHandle inControl,