ControlsPrivate.mesa
Copyright Ó 1985, 1992 by Xerox Corporation. All rights reserved.
Bloomenthal, July 2, 1992 6:10 pm PDT
Ken Shoemake, September 3, 1989 1:32:58 am PDT
DIRECTORY Controls, Imager, Rope, Vector2, ViewerClasses;
ControlsPrivate: CEDAR DEFINITIONS
~ BEGIN
Types
ROPE: TYPE ~ Rope.ROPE;
Control: TYPE ~ Controls.Control;
Mouse: TYPE ~ Controls.Mouse;
Context: TYPE ~ Imager.Context;
Viewer: TYPE ~ ViewerClasses.Viewer;
Event: TYPE ~ RECORD [mouse: Mouse, value, valuePrev: REAL];
RopeFromValueProc: TYPE ~ PROC [control: Control] RETURNS [valueRope: ROPE ¬ NIL, repaint: BOOL ¬ TRUE];
SetValueFromRopeProc: TYPE ~ PROC [control: Control, valueRope: ROPE];
Miscellaneous
ActivateViewer: PROC [viewer: Viewer];
Call any proc associated with a refAny, if any, on the viewer's property list
whenever the leaving the viewer's input focus.
MaybeForkControlProc: PROC [control: Control];
If control has a non-busy proc, for it.
ForkControlProc: PROC [control: Control];
If control has a proc, fork it.
ControlProcBusy: PROC [control: Control] RETURNS [BOOL];
Test if control has a busy proc.
Sliders/Dials
EnableMouseTrapping: PROC [yes: BOOL];
If yes, then, upon a mouse-down, trap the mouse in a slider or dial. Free the mouse on up.
NewSliderDial: PROC [control: Control];
Slider or dial initialization.
NotifySliderDial: PROC [control: Control, mouse: Mouse];
Called by Controls notify proc if control is a slider or dial.
PaintSliderDial: ViewerClasses.PaintProc;
Paint proc if control is a slider or dial.
UnTick: PROC [context: Context, control: Control];
Clear the bar from the control.
Tick: PROC [context: Context, control: Control, t: REAL, detent: BOOL ¬ FALSE, width: NAT ¬ 1];
Place the bar of the control at position t.
GetQueue: PROC [control: Control] RETURNS [LIST OF Event];
Return the queued events, if any.
RegisterRopeFromValueProc: PROC [control: Control, proc: RopeFromValueProc];
Register procedure with status viewer to convert value to rope.
RegisterValueFromRopeProc: PROC [control: Control, proc: SetValueFromRopeProc];
Register procedure with status viewer to set value from typein.
Functions
NewFunction: PROC [control: Control];
Function initialization.
NotifyFunction: PROC [control: Control, mouse: Mouse];
Called by Controls notify proc if control is a function.
PaintFunction: ViewerClasses.PaintProc;
Paint proc if control is a function.
ResetFunction: PROC [control: Control, repaint: BOOL ¬ TRUE];
Set the function values to the function minimum and optionally repaint.
Contours
NewContour: PROC [control: Control];
Contour initialization.
NotifyContour: PROC [control: Control, mouse: Mouse];
Called by Controls notify proc if control is a contour.
PaintContour: ViewerClasses.PaintProc;
Paint proc if control is a contour.
ClearContour: PROC [control: Control, repaint: BOOL ¬ TRUE];
Clear the contour and optionally repaint.
Sketches
NewSketch: PROC [control: Control];
Contour initialization.
NotifySketch: PROC [control: Control, mouse: Mouse];
Called by Controls notify proc if control is a sketch.
PaintSketch: ViewerClasses.PaintProc;
Paint proc if control is a sketch.
ClearSketch: PROC [control: Control, repaint: BOOL ¬ TRUE];
Clear the sketcher and optionally repaint.
DeleteLastSketchStroke: PROC [control: Control, repaint: BOOL ¬ TRUE];
Delete the last user inputted stroke.
END.