DIRECTORY Menus USING [Entry], Rope USING [ROPE], VFonts USING [defaultFont, FONT], ViewerOps USING [DestroyViewer], ViewerClasses USING [NotifyProc, Viewer, ViewerRec]; Buttons: CEDAR DEFINITIONS IMPORTS VFonts, ViewerOps = BEGIN OPEN ViewerClasses; Button: TYPE = Viewer; Create: PROC [info: ViewerRec _ [], proc: ViewerClasses.NotifyProc, entry: Menus.Entry, font: VFonts.FONT _ VFonts.defaultFont, clientData: REF ANY _ NIL, paint: BOOL _ TRUE] RETURNS [button: Button]; 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, clientData: REF ANY] = INLINE {button.class.set[button, clientData, FALSE, $ClientData]} ; GetClientData: PROC [button: Button] RETURNS[clientData: REF ANY] = INLINE {RETURN[button.class.get[button, $ClientData]]} ; SetDisplayStyle: PROC [button: Button, style: ATOM, paint: BOOL _ TRUE] = INLINE {button.class.set[button, style, paint, $DisplayStyle]} ; END. ดButtons.mesa; Written by S. McGregor Edited by McGregor on July 29, 1983 2:17 pm Last Edited by: Maxwell, December 17, 1982 10:06 am Last Edited by: Pausch, August 26, 1983 12:08 pm Last Edited by: Wyatt, October 7, 1983 2:18 pm A button is a viewer that posts a message and, when clicked, invokes a procedure. entry contains all vital information for the input actions, just as if it were an entry in a real menu. Information for the button viewer is taken from info. 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 info.parent=NIL, creates a "system" button at the top of the screen. 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 ส๐– "cedar" style˜Jšฯc$™$Jš+™+Jšœ3™3Jš0™0Jš.™.J™šฯk ˜ Jšœžœ ˜Jšœžœžœ˜Jšœžœžœ˜!Jšœ žœ˜ Jšœžœ!˜4J˜—Jšœ ž˜Jšžœ˜Jšœžœžœ˜J˜šœžœ ˜JšœQ™Q—J˜šฯnœžœYžœ#žœžœžœ žœžœ˜ฎJšžœ˜Jšหž5™ƒ—J˜JšŸœžœžœ#˜JJ˜š Ÿœžœ žœ žœžœž˜OJ˜+Jš4™4J˜—š Ÿ œžœžœžœž˜BJšœ&žœ˜