DIRECTORY AtomButtonsTypes, Basics, Buttons, Imager, Menus, PopUpButtons, Rope, TiogaButtons, ViewerClasses; AtomButtons: CEDAR DEFINITIONS = BEGIN ConfirmProc: TYPE = AtomButtonsTypes.ConfirmProc; Event: TYPE = AtomButtonsTypes.Event; HandleButtonProc: TYPE = AtomButtonsTypes.HandleButtonProc; InitButtonProc: TYPE = AtomButtonsTypes.InitButtonProc; InitTwoStateProc: TYPE = AtomButtonsTypes.InitTwoStateProc; SortedButtonClient: TYPE = AtomButtonsTypes.SortedButtonClient; SortedButtonHandle: TYPE = AtomButtonsTypes.SortedButtonHandle; TwoState: TYPE = AtomButtonsTypes.TwoState; UpdateProc: TYPE = AtomButtonsTypes.InitButtonProc; Viewer: TYPE = ViewerClasses.Viewer; ButtonType: TYPE = {button, label, text, popUpButton, twoState}; 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, events: LIST OF Event, 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, help: PopUpButtons.Help, disableDecoding: BOOL ¬ FALSE, headMenu: BOOL ¬ TRUE, 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], twoState => [name: Rope.ROPE, event: LIST OF REF ANY, on: BOOL ¬ FALSE, initProc: InitTwoStateProc ¬ NIL, ww: NAT ¬ 0, wxRelative: INTEGER ¬ -1, border: BOOL ¬ TRUE, font: Imager.Font ¬ NIL] ENDCASE ]; 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]; SetBinaryState: PROC [twoState: TwoState, on: BOOL]; GetBinaryState: PROC [twoState: TwoState] RETURNS [on: BOOL]; SwitchBinaryState: PROC [handle: TwoState]; CreateSortedButtonViewer: PROC [container: Viewer, x, y: NAT, lineHeight: INTEGER ¬ 15] RETURNS [SortedButtonHandle]; SortedButtonEntry: TYPE = RECORD [name: Rope.ROPE, value: REF ANY, events: LIST OF Event, on: BOOL]; CompareProc: TYPE = PROC [aName: Rope.ROPE, aValue: REF ANY, bName: Rope.ROPE, bValue: REF ANY] RETURNS [compare: Basics.Comparison]; FindProc: TYPE = PROC [state: BOOL, name: Rope.ROPE, value: REF ANY, clientData: REF ANY] RETURNS [found: BOOL, done: BOOL ¬ FALSE]; ReadSortedProc: TYPE = PROC [state: BOOL, name: Rope.ROPE, value: REF ANY, clientData: REF ANY] RETURNS [done: BOOL ¬ FALSE]; WriteSortedProc: TYPE = PROC [state: BOOL, name: Rope.ROPE, value: REF ANY, clientData: REF ANY] RETURNS [newState: BOOL, newName: Rope.ROPE ¬ NIL, newValue: REF ANY, done: BOOL ¬ FALSE]; BuildSortedButtons: PROC [handle: SortedButtonHandle, clientData: REF ANY, handleProc: HandleButtonProc, header: Rope.ROPE, sortedButtonList: LIST OF SortedButtonEntry]; ReadSortedButtons: PROC [handle: SortedButtonHandle, readProc: ReadSortedProc, clientData: REF ANY ¬ NIL]; WriteSortedButtons: PROC [handle: SortedButtonHandle, writeProc: WriteSortedProc, clientData: REF ANY ¬ NIL]; AddSortedButton: PROC [clientData: REF ANY, handle: SortedButtonHandle, entry: SortedButtonEntry, compareProc: CompareProc] RETURNS [oldFoundButton: SortedButtonClient ¬ NIL]; DeleteSortedButtons: PROC [clientData: REF ANY, handle: SortedButtonHandle, findProc: FindProc]; ScalarButton: TYPE = RECORD [name: Rope.ROPE, value: REAL, events: LIST OF Event, on: BOOL]; BuildScalarButtons: PROC [handle: SortedButtonHandle, clientData: REF ANY, handleProc: HandleButtonProc, header: Rope.ROPE, scalarButtonList: LIST OF ScalarButton]; Order: TYPE = {incr, decr}; SetAllScalarStates: PROC [clientData: REF ANY, handle: SortedButtonHandle, on: BOOL]; SetScalarState: PROC [clientData: REF ANY, handle: SortedButtonHandle, scalar: REAL, on: BOOL, epsilon: REAL ¬ 0.001]; GetScalarState: PROC [clientData: REF ANY, handle: SortedButtonHandle, scalar: REAL, epsilon: REAL ¬ 0.001] RETURNS [on: BOOL]; ToggleScalarState: PROC [clientData: REF ANY, handle: SortedButtonHandle, scalar: REAL, epsilon: REAL ¬ 0.001] RETURNS [newState: BOOL]; AddScalarSorted: PROC [clientData: REF ANY, handle: SortedButtonHandle, button: ScalarButton, order: Order ¬ incr] RETURNS [oldFoundButton: SortedButtonClient ¬ NIL]; RebuildScalarButtons: PROC [viewer: Viewer, headerButton: TiogaButtons.TiogaButton, clientData: REF ANY, handleProc: HandleButtonProc, scalarButtonList: LIST OF ScalarButton] RETURNS [buttons: SortedButtonClient]; EnumTypeRef: TYPE = AtomButtonsTypes.EnumTypeRef; ButtonList: TYPE = AtomButtonsTypes.ButtonList; 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]; HandlePopUpProc: TYPE = PROC [button: REF ANY, clientData: REF ANY, event: LIST OF REF ANY]; BuildPopUp: PROC [clientData: REF, handleProc: HandlePopUpProc, paint: PopUpButtons.PaintProc, inButton: PopUpButtons.InTestProc, entry: ButtonLineEntry, clientPackageName: Rope.ROPE] RETURNS [instance: REF]; 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]; BuildUnQueuedButtonLine: PROC [container: Viewer, x, y: NAT, clientData: REF ANY, entries: LIST OF UnQueuedButtonLineEntry, horizontalSpace: INTEGER ¬ 2, lineHeight: INTEGER ¬ 15] RETURNS [nextX: INTEGER]; END. œAtomButtons.mesa Copyright Ó 1989, 1992 by Xerox Corporation. All rights reserved. Last edited by Bier on June 25, 1987 1:02:17 pm PDT. Contents: Some Useful Button Classes. Pier, July 1, 1986 2:12:59 pm PDT Aaron Goodisman, June 13, 1989 10:50:40 am PDT Michael Plass, March 25, 1992 10:58 am PST 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 five 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. Binary (on/off) Buttons. 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]; 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. Extensible Sorted Button List Make a list of buttons each of which displays some kind of value. There is some ordering on the buttons that the client describes with a Compare proc. We manage the process of splicing in new buttons and splicing out old buttons while keeping the buttons sorted. Each button has an on/off state which we indicate by video-reversing. The client determines which state each button is in using the state changing routines provided. 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 SortedButtonClient records. The first TiogaButton is a dummy and has no corresponding SortedButtonClient, as shown above. sortedButtonList is assumed to be already in the proper order. Extensible Scalar (REAL valued) Button List [Artwork node; type 'ArtworkInterpress on' to command tool] Builds a list of TiogaButtons and a parallel list of SortedButtonClient records. The first TiogaButton is a dummy and has no corresponding SortedButtonClient, as shown above. Adds a new scalar button to the list, sort in increasing order or decreasing order as requested. Enumerated Type (Cycling) Button PopUp Button Build a pop-up menu with no associated button. The button will be provided (as the "view" argument) when PopUpButtons.RawPop is called. Old-fashioned callback proc buttons. Use is discouraged. 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. Êþ•NewlineDelimiter –(cedarcode) style˜code™Kšœ Ïeœ6™BK™4K™&K™!Kšœ+Ïk™.K™*K™—šž ˜ Kšœb˜b—K˜KšÏn œžœž œž˜&˜Kšœ žœ ˜1Kšœžœ˜%Kšœžœžœž˜;Kšœžœ#˜7Kšœžœ%˜;Idefaultšœžœ'˜?Kšœžœ'˜?Kšœ žœ˜+Kšœ žœžœž˜3Kšœžœ˜$—Ihead1šÏb/™/K™Kšœ žœ0˜@K˜K˜Kšœžœžœžœ ˜)šœ žœžœ žœžœžœžœžœ žœžœ˜vK™¾—K˜šœžœžœ˜ šžœž˜Kšœžœ žœžœžœžœžœžœžœžœžœ˜ÉKšœžœ%žœžœžœžœ,žœžœ žœžœžœžœžœ˜Kšœžœžœžœžœžœžœžœ˜‘Kšœžœžœžœžœžœžœžœ˜’Kšœžœ žœžœžœžœžœžœžœžœžœžœžœžœ˜¾Kšž˜Kšœ˜—Kšœ œ9 œZ  œ œ= œB  œ  œG œh™¿—K˜šŸœžœžœžœžœ)žœžœ#žœžœžœ žœ˜ÛKšœ¥™¥—Mš ™šŸœžœžœžœžœ+žœ žœžœ!žœžœžœžœžœžœžœ™‹Kšœ™K™—šŸ Ÿœžœžœ˜4K™<—Kš Ÿ Ÿœžœžœžœ˜=KšŸ Ÿœžœ˜+Mš  œ™L™°L™š Ÿœžœžœžœžœ˜uKšœY™Y—L˜Lšœžœžœ žœ žœžœ žœžœ žœ˜dLšœ žœžœžœ žœžœžœ žœžœžœ˜…Lšœ žœžœ žœ žœ žœžœžœžœžœ žœžœžœ˜„Lšœžœžœ žœ žœ žœžœžœžœžœžœžœ˜}Lš!œžœžœ žœ žœ žœžœžœžœžœ žœžœžœ žœžœžœžœ˜»L˜šŸœžœ*žœžœ-žœžœžœ˜©Kšœï™ïK™—K˜Kš ŸœžœDžœžœžœ˜jKš ŸœžœFžœžœžœ˜mK˜Kš ŸœžœžœžœRžœ'žœ˜¯KšŸœžœžœžœ2˜`Mš +™+Kšœžœžœ žœ žœ žœžœ žœ˜\I artworkFigure–G59.26667 mm topLeading 59.26667 mm topIndent 1.411111 mm bottomLeading •Bounds:0.0 mm xmin 0.0 mm ymin 164.7472 mm xmax 56.44444 mm ymax •Artwork Interpress• Interpress™Interpress/Xerox/3.0  f j k j¡¥“ÄWB ¤ ¨  s@¡£˜§ ¢ ¨ r j  º ¢ ¨¡¡¨ÄWB ¤ ¨ r j¡¥“ÄWB ¤ ¨¡¡¨ r j¢·“¢°“¡¡¨¢¯“%š%º¡¹¡¡¨¢¯“%ºdº¡¹¡¡¨¢¯“dºdš¡¹¡¡¨¢¯“dš%š¡¹ k é r j¢·“¢°“¡¡¨¢¯“€Û€û¡¹¡¡¨¢¯“€û¿û¡¹¡¡¨¢¯“¿û¿Û¡¹¡¡¨¢¯“¿Û€Û¡¹ k é r j¢·“¢°“¡¡¨¢¯“ÛÛÛû¡¹¡¡¨¢¯“Ûûû¡¹¡¡¨¢¯“ûÛ¡¹¡¡¨¢¯“ÛÛÛ¡¹ k é r j¢·“¢°“¡¡¨¢¯“6Û6û¡¹¡¡¨¢¯“6ûuû¡¹¡¡¨¢¯“uûuÛ¡¹¡¡¨¢¯“uÛ6Û¡¹ k é r j¢·“¢°“¡¡¨¢¯“€š€º¡¹¡¡¨¢¯“€º¿º¡¹¡¡¨¢¯“¿º¿š¡¹¡¡¨¢¯“¿š€š¡¹ k é r j¢·“¢°“¡¡¨¢¯“ÛšÛº¡¹¡¡¨¢¯“Ûºº¡¹¡¡¨¢¯“ºš¡¹¡¡¨¢¯“šÛš¡¹ k é r j¢·“¢°“¡¡¨¢¯“6š6º¡¹¡¡¨¢¯“6ºuº¡¹¡¡¨¢¯“uºuš¡¹¡¡¨¢¯“uš6š¡¹ k é r jÄ1PÄè!¤ ¢ ¨ÅXeroxÅ TiogaFontsÅ Helvetica10£¡ “ •  —¡¡¨  ŠÁScalarButtonClients–¡¡¨ k é r jÄ ¨Ä• ¢ ¨ÅXeroxÅ TiogaFontsÅ Helvetica10£¡ “ •  —¡¡¨  ŠÁ TiogaButtons–¡¡¨ k é r j¢·“¢°“¡¡¨¢¯“À×À¡¹¡¡¨¢¯“À¡¹¡¡¨¢¯“ס¹¡¡¨¢¯“×Àס¹ k é r j¢·“¢°“¡¡¨¢¯“À×ÀÄ©¡¹¡¡¨¢¯“ÀÄ©Ä©¡¹¡¡¨¢¯“Ä©ס¹¡¡¨¢¯“×Àס¹ k é r j¢·“¢°“¡¡¨¢¯“ÀÄ©À¡¹¡¡¨¢¯“À¡¹¡¡¨¢¯“Ä©¡¹¡¡¨¢¯“Ä©ÀÄ©¡¹ k é¢¯“¡¡¨¢·“¢°“íÄ™ÄIº—˜¢¯“¡¡¨¢·“¢°“íÄ™€ë—˜ r jÄ aļ‘¤ ¢ ¨ÅXeroxÅ TiogaFontsÅ Helvetica10£¡ “ •  —¡¡¨  ŠÁScalarButtonHandle–¡¡¨ k é¢¯“¡¡¨¢·“¢°“ÄÿÛ™º˜¢¯“¡¡¨¢·“¢°“Äd=gĉ]™Äÿº—Äi\gÄ>Ç—˜¢¯“¡¡¨¢·“¢°“ĵۙº˜¢¯“¡¡¨¢·“¢°“ĈÚ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˜—Kšœžœ˜K˜Kš Ÿœžœžœžœ"žœ˜UKšŸœžœžœžœ&žœžœ žœ ˜vKšŸœžœžœžœ&žœ žœ žœžœ˜KšŸœžœžœžœ&žœ žœ žœ žœ˜ˆK˜š ŸœžœžœžœIžœ'žœ˜¦Kšœ`™`—K˜KšŸœžœFžœžœ2žœžœžœ˜ÕM™ Kšœ žœ ˜1Kšœ žœ˜/K˜Kšœ žœ ˜1Kšœžœ!˜3KšŸœžœ&žœ žœžœžœ,žœžœžœ#žœ!žœžœžœžœ˜àK˜Kš Ÿœžœ žœžœžœžœ˜.M™ Kšœžœžœ žœžœžœžœ žœžœžœžœ˜\K˜š Ÿ œžœžœ‘žœžœ žœ˜ÐKšœˆ™ˆ—Mš 9™9Kšœžœžœ žœIžœžœžœžœžœžœžœ˜ûK˜šŸœžœžœžœžœ žœžœ+žœžœžœ žœ˜ÍKšœ¥™¥—K˜Kšžœ˜K˜K˜—…—¤8>