DIRECTORY Buttons USING [ButtonProc], Menus USING [ClickProc, MenuEntry], MBQueue USING [Action], Rope USING [ROPE], VFonts USING [Font], ViewerClasses USING [Viewer, ViewerRec]; NutButtons: CEDAR DEFINITIONS = BEGIN OPEN ViewerClasses; NutButton: TYPE = Viewer; -- A button is a viewer that posts a message and when clicked, invokes a procedure. ButtonFontInfo: TYPE = REF ButtonFontInfoRec; ButtonFontInfoRec: TYPE = RECORD [ twoFont: BOOL _ FALSE, singleFont: VFonts.Font _ NIL, attrFont: VFonts.Font _ NIL, valFont: VFonts.Font _ NIL]; Create: PROC [info: ViewerRec _ [], proc: Buttons.ButtonProc, clientData: REF ANY _ NIL, fork: BOOL _ FALSE, documentation: REF ANY _ NIL, font: ButtonFontInfo _ NIL, guarded: BOOL _ FALSE, paint: BOOL _ TRUE] RETURNS [button: NutButton] ; Queue: TYPE = REF QueueObj; QueueObj: TYPE; Action: TYPE = MBQueue.Action; QueueButton: PROC [ q: Queue, info: ViewerClasses.ViewerRec _ [], proc: Buttons.ButtonProc, clientData: REF ANY _ NIL, fork: BOOL _ TRUE, font: ButtonFontInfo _ NIL, documentation: REF ANY _ NIL, guarded: BOOL _ FALSE, paint: BOOL _ TRUE] RETURNS [NutButton]; CreateQueue: PROC [pushModel: BOOL] RETURNS [Queue]; CreateQMenuEntry: PROC [ q: Queue, name: Rope.ROPE, proc: Menus.ClickProc, clientData: REF ANY _ NIL, documentation: REF ANY _ NIL, fork: BOOL _ TRUE, guarded: BOOL _ FALSE] RETURNS [Menus.MenuEntry]; QueueClientAction: PROC [ q: Queue, proc: PROC [REF ANY], data: REF ANY]; DequeueAction: PROC [q: Queue] RETURNS [Action]; Flush: PROC [q: Queue]; END. jNutButtons.mesa; Last Edited by: Butler, July 15, 1984 4:09:20 pm PDT 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.ROPE. Documentation will be posted for guarded buttons when the guard is removed on the first click. If the documentation is a Rope.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! Κ}– "Mesa" style˜JšΟc™J™4J™J™šΟk ˜ Jšœ˜Jšœžœ˜#Jšœžœ ˜Jšœžœžœ˜J˜Jšœžœ˜(J˜—Jšœ žœ˜J˜Jšœ˜J˜Jšžœžœ˜J˜Jšœ žœ S˜nJ˜Jšœ-˜-šœžœ˜#J˜J˜J˜J˜—J˜š Οnœžœ>žœžœžœ˜XJš œžœžœžœžœžœ˜NJš œ žœžœ žœžœ˜+Jšžœ˜J˜—Jš™J˜Jšš™šJ˜Jšν™νJ™Jšœžœžœ ˜Jšœ žœ˜J˜Jšœžœ˜J˜JšŸ œžœ[žœžœžœžœžœ/žœžœžœ žœžœ žœžœ˜τJšœžœ ˜J˜JšŸ œžœ žœžœ ˜4J˜JšŸœžœžœ%žœžœžœžœžœžœžœžœ žœžœžœ˜ΞJ˜JšŸœžœžœžœžœ žœžœ˜KJ˜JšŸ œžœ žœ ˜0J˜JšŸœžœ ˜J˜Jšžœ˜J˜J˜—…—