-}
-
-void UMAActivateControl( ControlRef inControl )
-{
-#if TARGET_API_MAC_OSX
- ::ActivateControl( inControl ) ;
-
-#else
- // 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 ) ;
-
- ::ActivateControl( inControl ) ;
-
- if ( visible )
- {
- SetControlVisibility( inControl , true , false ) ;
-
- Rect ctrlBounds ;
- InvalWindowRect( GetControlOwner(inControl), UMAGetControlBoundsInWindowCoords(inControl, &ctrlBounds) ) ;
- }
- }
-#endif
-}
-
-void UMAMoveControl( ControlRef inControl , short x , short y )
-{
-#if TARGET_API_MAC_OSX
- ::MoveControl( inControl , x , y ) ;
-
-#else
- bool visible = IsControlVisible( inControl ) ;
- if ( visible )
- {
- SetControlVisibility( inControl , false , false ) ;
- Rect ctrlBounds ;
- InvalWindowRect( GetControlOwner(inControl), GetControlBounds(inControl, &ctrlBounds) ) ;
- }
-
- ::MoveControl( inControl , x , y ) ;
-
- if ( visible )
- {
- SetControlVisibility( inControl , true , false ) ;
- Rect ctrlBounds ;
- InvalWindowRect( GetControlOwner(inControl), GetControlBounds(inControl, &ctrlBounds) ) ;
- }
-#endif
-}
-
-void UMASizeControl( ControlRef inControl , short x , short y )
-{
-#if TARGET_API_MAC_OSX
- ::SizeControl( inControl , x , y ) ;
-
-#else
- bool visible = IsControlVisible( inControl ) ;
- if ( visible )
- {
- SetControlVisibility( inControl , false , false ) ;
- Rect ctrlBounds ;
- InvalWindowRect( GetControlOwner(inControl), GetControlBounds(inControl, &ctrlBounds) ) ;
- }
-
- ::SizeControl( inControl , x , y ) ;
-
- if ( visible )
- {
- SetControlVisibility( inControl , true , false ) ;
- Rect ctrlBounds ;
- InvalWindowRect( GetControlOwner(inControl), GetControlBounds(inControl, &ctrlBounds) ) ;
- }
-#endif
-}
-
-void UMADeactivateControl( ControlRef inControl )
-{
-#if TARGET_API_MAC_OSX
- ::DeactivateControl( inControl ) ;
-
-#else
- // 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 ) ;
-
- ::DeactivateControl( inControl ) ;
-
- if ( visible )
- {
- SetControlVisibility( inControl , true , false ) ;
- Rect ctrlBounds ;
- InvalWindowRect( GetControlOwner(inControl), UMAGetControlBoundsInWindowCoords(inControl, &ctrlBounds) ) ;
- }
-#endif
-}
-
-// shows the control and adds the region to the update region
-void UMAShowControl( ControlRef inControl )
-{
- SetControlVisibility( inControl , true , false ) ;
- Rect ctrlBounds ;
- InvalWindowRect( GetControlOwner(inControl), UMAGetControlBoundsInWindowCoords(inControl, &ctrlBounds) ) ;
-}
-
-// hides the control and adds the region to the update region
-void UMAHideControl( ControlRef inControl )
-{
- SetControlVisibility( inControl , false , false ) ;
- Rect ctrlBounds ;
- InvalWindowRect( GetControlOwner(inControl), UMAGetControlBoundsInWindowCoords(inControl, &ctrlBounds) ) ;
-}
-
-// keyboard focus
-OSErr UMASetKeyboardFocus( WindowPtr inWindow,
- ControlRef inControl,
- ControlFocusPart inPart )
-{
- OSErr err = noErr;
- GrafPtr port ;
-
- GetPort( &port ) ;
- SetPortWindowPort( inWindow ) ;
-
- err = SetKeyboardFocus( inWindow , inControl , inPart ) ;
- SetPort( port ) ;