CtMisc.mesa
Copyright Ó 1985, 1992 by Xerox Corporation. All rights reserved.
Bloomenthal, July 3, 1992 1:28 pm PDT
DIRECTORY Imager, Rope, SF, ViewerClasses;
CtMisc: CEDAR DEFINITIONS
~ BEGIN
Types
Color:    TYPE ~ Imager.Color;
Context:   TYPE ~ Imager.Context;
Rectangle:  TYPE ~ Imager.Rectangle;
VEC:    TYPE ~ Imager.VEC;
ROPE:    TYPE ~ Rope.ROPE;
Box:    TYPE ~ SF.Box;
Viewer:   TYPE ~ ViewerClasses.Viewer;
Buttons
ButtonToggle: PROC [button: Viewer];
Assumes the button.name contains either "off" or "on" (case insensitive) and toggles its state.
ButtonOn: PROC [button: Viewer] RETURNS [BOOL];
Return true iff "on" (case insensitive) is contained in button.name.
Printing
PrintTiogaSelection: PROC [
p: VEC, color:
Color ¬ NIL,
context: Context ¬ NIL,
screenStyle: BOOL ¬ FALSE]
RETURNS [error: ROPE];
Print the current tioga selection at the given location with the given Imager color.
p is with respect to the upper left of the color display.
If color is NIL, use the context's current color unless context is NIL, then use $Black.
Providing a context only saves the need to reacquire the color display.
If screenStyle FALSE, use printStyle.
PrintRope: PROC [
rope: ROPE,
p: VEC,
color: Color ¬ NIL,
font: ROPE ¬ NIL,
size: REAL ¬ 14.0,
context: Context ¬ NIL];
As PrintTiogaSelection but with a specified rope, and with a given font and size.
The (spline contour) fonts used are from the directory ///7.0/fonts/xerox/pressfonts;
they are antialiased if the context is in "smooth" mode.
If font is NIL, it is defaulted to "helvetica-mrr".
END.