DIRECTORY AtomButtonsTypes, Buttons, Imager, Menus, Rope, TiogaButtons, ViewerClasses; AtomButtons: CEDAR DEFINITIONS = BEGIN HandleButtonProc: TYPE = AtomButtonsTypes.HandleButtonProc; UpdateProc: TYPE = AtomButtonsTypes.InitButtonProc; Viewer: TYPE = ViewerClasses.Viewer; ConfirmProc: TYPE = AtomButtonsTypes.ConfirmProc; InitButtonProc: TYPE = AtomButtonsTypes.InitButtonProc; Action: TYPE = LIST OF REF ANY; ButtonType: TYPE = {button, label, text, popUpButton}; PopUpChoices: TYPE = LIST OF PopUpChoice; PopUpChoice: TYPE = RECORD [action: LIST OF REF ANY, actionImage: Rope.ROPE, doc: Rope.ROPE, font: Imager.Font _ NIL]; ButtonLineEntry: TYPE = RECORD [ SELECT type: ButtonType FROM button => [name: Rope.ROPE, actions: LIST OF Action, wxRelative: INTEGER _ -1, border: BOOL _ FALSE, font: Imager.Font _ NIL, confirmProc: ConfirmProc _ NIL, initProc: InitButtonProc _ NIL, ww: NAT _ 0], popUpButton => [name: Rope.ROPE, choices: PopUpChoices, wxRelative: INTEGER _ -1, border: BOOL _ FALSE, font: Imager.Font _ NIL, confirmProc: ConfirmProc _ NIL, initProc: InitButtonProc _ NIL, ww: NAT _ 0], label => [name: Rope.ROPE, initProc: InitButtonProc _ NIL, ww: NAT _ 0, wxRelative: INTEGER _ -1, border: BOOL _ FALSE, font: Imager.Font _ NIL], text => [name: Rope.ROPE, initProc: InitButtonProc _ NIL, ww: NAT _ 0, wxRelative: INTEGER _ -1, border: BOOL _ FALSE, font: Imager.Font _ NIL], ENDCASE ]; UnQueuedButtonLineEntry: TYPE = RECORD [name: Rope.ROPE, type: ButtonType, clickProc: Menus.ClickProc, updateProc: UpdateProc _ NIL, ww: NAT _ 0, wxRelative: INTEGER _ -1, border: BOOL _ FALSE, confirmProc: ConfirmProc _ NIL, font: Imager.Font _ NIL]; BuildButtonLine: PROC [container: Viewer, x, y: NAT, clientData: REF ANY, handleProc: HandleButtonProc, entries: LIST OF ButtonLineEntry, horizontalSpace: INTEGER _ 2, lineHeight: INTEGER _ 15] RETURNS [nextX: INTEGER]; BuildUnQueuedButtonLine: PROC [container: Viewer, x, y: NAT, clientData: REF ANY, entries: LIST OF UnQueuedButtonLineEntry, horizontalSpace: INTEGER _ 2, lineHeight: INTEGER _ 15] RETURNS [nextX: INTEGER]; StateType: TYPE = AtomButtonsTypes.StateType; TwoState: TYPE = REF TwoStateObj; TwoStateObj: TYPE = AtomButtonsTypes.TwoStateObj; BuildTwoStateButton: PROC [viewer: Viewer, x, y: NAT _ 0, clientData: REF ANY, handleProc: HandleButtonProc, name: Rope.ROPE, border: BOOL _ TRUE, init: StateType _ off, action: LIST OF REF ANY, lineHeight: INTEGER _ 15] RETURNS [stateInfo: TwoState, nextX: INTEGER]; SetButtonState: PROC [twoState: TwoState, state: StateType]; GetButtonState: PROC [twoState: TwoState] RETURNS [state: StateType]; SwitchState: PROC [handle: TwoState]; ScalarButton: TYPE = RECORD [name: Rope.ROPE, value: REAL, action: LIST OF REF ANY, init: StateType]; ScalarButtonHandle: TYPE = REF ScalarButtonHandleObj; ScalarButtonHandleObj: TYPE = AtomButtonsTypes.ScalarButtonHandleObj; ScalarButtonClient: TYPE = REF ScalarButtonClientObj; ScalarButtonClientObj: TYPE = AtomButtonsTypes.ScalarButtonClientObj; BuildScalarButtons: PROC [handle: ScalarButtonHandle, clientData: REF ANY, handleProc: HandleButtonProc, header: Rope.ROPE, scalarButtonList: LIST OF ScalarButton]; CreateScalarButtonViewer: PROC [container: Viewer, x, y: NAT, lineHeight: INTEGER _ 15] RETURNS [ScalarButtonHandle]; Order: TYPE = {incr, decr}; AddValueSorted: PROC [clientData: REF ANY, scalarButtonHandle: ScalarButtonHandle, value: ScalarButton, order: Order _ incr] RETURNS [oldFoundButton: ScalarButtonClient _ NIL]; RebuildScalarButtons: PROC [viewer: Viewer, headerButton: TiogaButtons.TiogaButton, clientData: REF ANY, handleProc: HandleButtonProc, scalarButtonList: LIST OF ScalarButton] RETURNS [buttons: ScalarButtonClient]; ButtonList: TYPE = AtomButtonsTypes.ButtonList; EnumTypeRef: TYPE = REF EnumTypeRec; EnumTypeRec: TYPE = AtomButtonsTypes.EnumTypeRec; StyleChoice: TYPE = AtomButtonsTypes.StyleChoice; DisplayStyle: TYPE = AtomButtonsTypes.DisplayStyle; BuildEnumTypeSelection: PROC [viewer: ViewerClasses.Viewer, x, y: NAT, maxWidth: NAT, clientData: REF ANY, handleProc: HandleButtonProc, title: Rope.ROPE, default: Rope.ROPE, borderOnButtons: BOOL, style: StyleChoice, allInOneRow: BOOL, buttonNames: ButtonList, atom: ATOM, horizontalSpace: INTEGER _ 2, lineHeight: INTEGER _ 15] RETURNS [EnumTypeRef]; TimeToFlipThru: PROC [event: LIST OF REF ANY]; END. ‚AtomButtons.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Last edited by Bier on April 30, 1987 2:07:41 pm PDT. Contents: Some Useful Button Classes. Pier, July 1, 1986 2:12:59 pm PDT Buttons, PopUpButtons, Labels, and Text Viewers. Choices should be specified in the order left, middle, right, shift-left, shift-middle, shift-right, ctrl-left, ctrl-middle, ctrl-right, ctrl-shift-left, ctrl-shift-middle, ctrl-shift-right. In all four variants, name is the string that will be displayed on the button, the actions will be passed to the handleProc when the button is pressed (see BuildButtonLine below), wxRelative positions the button relative to the leftmost button on this line (rather than spacing it from its neighboring button) allowing tidy columns, border says whether a rectangle should be drawn around the button, font changes the font that the button itself will be displayed in. If confirmProc is not NIL, then the button is guarded and the confirmProc will be called after the first button press. The initProc allows the client to store a pointer to the button in its data structures and to initialize its values. Builds a line of assorted buttons (type can be button, label, or text). When the button is pressed (if type = button), clientData and action are sent to handleProc. Builds a line of assorted buttons (type can be button, label, or text). When the button is pressed (if type = button), clientData and action are sent to handleProc. Two State (on/off) Buttons. Makes a button at position x, y. The button will always be black when stateInfo.state = on and white when stateInfo.state = off. Sets the state of the variable and updates the button looks. [Artwork node; type 'ArtworkInterpress on' to command tool] Fills a scalar button viewer with buttons. Creates a viewer that spans the container from x to the right hand edge of the container. Builds a list of TiogaButtons and a parallel list of ScalarButtonClient records. The first TiogaButton is a dummy and has no corresponding ScalarButtonClient, as shown above. Adds a new scalar button to the list, sort in increasing order or decreasing order as requested. Ê"˜code™Kšœ Ïmœ1™Ç—˜¢¯“¡¡¨¢·“¢°“ĵۙº˜¢¯“¡¡¨¢·“¢°“ĈÚgĉ]™Äµº—ÄùgÄ>Ç—˜¢¯“¡¡¨¢·“¢°“ÄkÛ™º˜¢¯“¡¡¨¢·“¢°“Ä­wgĉ]™Äkº—IJ–gÄ>Ç—˜¢¯“¡¡¨¢·“¢°“¿ë™ÛŽ˜¢¯“¡¡¨¢·“¢°“ÄU0Ätò™Äh–UÄmæU—ÄЭÄÛ`­—˜¢¯“¡¡¨¢·“¢°“ë™6Ž˜¢¯“¡¡¨¢·“¢°“ĹÉÄtò™Ä…7TÄmæU—Ä­ÄÛ`­—˜¢¯“¡¡¨¢·“¢°“¿ª™ÛŽ˜¢¯“¡¡¨¢·“¢°“ÄU0Ä-™Äh–UÄXQU—ÄЭįs­—˜¢¯“¡¡¨¢·“¢°“ª™6Ž˜¢¯“¡¡¨¢·“¢°“ĹÉÄ-™Ä…7TÄXQU—ĭįs­—˜¢¯“¡¡¨¢·“¢°“dª™€Ž˜¢¯“¡¡¨¢·“¢°“Äð—Ä-™ÄJ_UÄXQU—ę޵įs­—˜ r jÄ µ¨ ¢ ¨ÅXeroxÅ TiogaFontsÅ Helvetica10£¡ “ •  —¡¡¨  ŠÁDummy–¡¡¨ k é k é k é k gš =™=š œžœ*žœžœ-žœžœžœ˜¤K™*—K˜š  œžœžœžœžœ˜uKšœY™Y—˜Kšœ¯™¯K˜—Kšœžœ˜K˜š  œžœžœžœTžœ'žœ˜°Kšœ`™`—K˜š œžœFžœžœ2žœžœžœ˜ÕK˜—Kšœ žœ˜/Kšœ žœžœ ˜$Kšœ žœ ˜1K˜Kšœ žœ ˜1Kšœžœ!˜3Kš œžœ&žœ žœžœžœ,žœžœžœ#žœ!žœžœžœžœ˜àK˜Kš  œžœ žœžœžœžœ˜.K˜Kšžœ˜K˜K˜—…—(¶