<> <> <> <<>> DIRECTORY Menus USING [ClickProc], Rope USING [ROPE], VFonts USING [defaultFont, Font], ViewerOps USING [DestroyViewer], ViewerClasses USING [Viewer, ViewerRec]; Buttons: CEDAR DEFINITIONS IMPORTS VFonts, ViewerOps = BEGIN OPEN ViewerClasses; Button: TYPE = Viewer; -- A button is a viewer that posts a message and when clicked, invokes a procedure. Create: PROC [info: ViewerRec _ [], proc: ButtonProc, clientData: REF ANY _ NIL, fork: BOOL _ TRUE, font: VFonts.Font _ VFonts.defaultFont, documentation: REF ANY _ NIL, guarded: BOOL _ FALSE, paint: BOOL _ TRUE] RETURNS [button: Button] ; <> <> < 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!>> Destroy: PROC [button: Button] = INLINE {ViewerOps.DestroyViewer[button]}; ReLabel: PROC [button: Button, newName: Rope.ROPE, paint: BOOL _ TRUE] = INLINE {button.class.set[button, newName, paint]}; <> SetClientData: PROC [button: Button, newData: REF ANY] = INLINE {button.class.set[button, newData, FALSE, $ClientData]} ; SetDisplayStyle: PROC [button: Button, style: ATOM, paint: BOOL _ TRUE] = INLINE {button.class.set[button, style, paint, $DisplayStyle]} ; <> <<$BlackOnWhite - black letters on white background (default)>> <<$WhiteOnBlack - white letters on black background>> <<$BlackOnGrey - black letters on grey background>> ButtonProc: TYPE = Menus.ClickProc; END.