DIRECTORY Imager USING [Font], Menus USING [ClickProc], Rope USING [ROPE], ViewerClasses USING [Viewer, ViewerRec]; Buttons: CEDAR DEFINITIONS = BEGIN OPEN ViewerClasses; Button: TYPE = Viewer; ButtonProc: TYPE = Menus.ClickProc; Create: PROC [info: ViewerRec _ [], proc: ButtonProc, clientData: REF ANY _ NIL, fork: BOOL _ TRUE, font: Imager.Font _ NIL, documentation: REF ANY _ NIL, guarded: BOOL _ FALSE, paint: BOOL _ TRUE ] RETURNS [button: Button]; Destroy: PROC [button: Button]; ReLabel: PROC [button: Button, newName: Rope.ROPE, paint: BOOL _ TRUE]; SetDisplayStyle: PROC [button: Button, style: ATOM, paint: BOOL _ TRUE]; END. 2Buttons.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Edited by McGregor on August 30, 1982 4:05 pm Last Edited by: Maxwell, December 17, 1982 10:06 am Doug Wyatt, April 14, 1985 11:05:16 pm PST A button is a viewer that posts a message and, when clicked, invokes a procedure. info.name contains the message displayed within the button. If the info.wh and info.ww are defaulted, aesthetic values will be chosen based on the height and width of the name. Defaulting the info.wx and info.wy, with parent=NIL creates a "system" button appended after the most recent system button after the message window. fork tells whether to create and detach a new process on calling. clientData is the info that will be passed to proc on invocation. Guarded buttons must be confirmed by the user before invocation. documentation may either be a REF ButtonProc or a ROPE. Documentation will be posted for guarded buttons when the guard is removed on the first click. If the documentation is a ROPE then it will be posted in the MessageWindow, otherwise the client's proc will be called. Implementation guide: the proc that calls a button proc has an ! ABORT => CONTINUE catch phrase so that the client may make use of Process.Abort to cancel execution. If fork=FALSE then proc will be called at Process.priorityForeground! Change the text of a button (but alas, not the size) recognised display styles are: $BlackOnWhite - black letters on white background (default) $WhiteOnBlack - white letters on black background $BlackOnGrey - black letters on grey background ΚΔ– "Mesa" style˜codešΟc ™ Kšœ Οmœ1™