Touching


I notice that the fax progress indicator does not let you switch locations or do anything while faxing. I want my progress bar to inherit similar behavior. How can I do this?


What you need to do is make the current tool the constrained touch tool. The constrained touch tool is just like the normal touch tool, but it only allows touches on its target, and the target's subviews. What you should do is set the target of iConstrainedTouchTool to be your progress window to allow touches on the stop button or title bar, then call SetTool(iConstrainedTouchTool) to make the constrained touch tool the current tool.


How can I make a viewable "transparent" to touches? I have a situation where a viewable is a subview of another viewable, but when a touch occurs on the subview, I want the touch passed up the the containing viewable.


The existing Viewable flags don't let you specify that a Viewable object should ignore touches, letting its superview handle them. To get this effect you'll need to override Touch to pass it to its superview. Touch is responsible for calling Tap, Touching, Touched, and Press, so you don't have to worry about overriding those. What you could do is define a mixin to do this, which can be inherited from by all your Viewable subclasses that want to be "transparent" to touches:

Define Class CantTouchThis;
   mixes in with Viewable;
        
   overrides Touch;
End Class;

Method void CantTouchThis_Touch(ObjectID self, ObjectID touchInput)
{
   Touch(Superview(self), touchInput);
}

How do I make the hat spin in the center of the screen instead of over the last touch point?


Spinning the hat directly over the last touch input is typically the desired behavior, because that is usually right where the user happens to be looking. The system code in ShowFingerprint ensures that the hat gets located there.

If, on the other hand, you have a good reason to center the spinning hat, you can do it by passing iEmptyTouchInput to ShowFingerprint. By typically passing TouchInput_ as the parameter to ShowFingerprint, you tell it to use the latest touch input, which is stored in the indexical iCurrentTouchInput. If you instead pass iEmptyTouchInput, ShowFingerprint will simply place the hat in the middle of the screen.