DIRECTORY AtomButtons, Feedback, FeedbackOps, FeedbackTypes, FS, GGBasicTypes, GGControlPanelTypes, GGCoreOps, GGInterfaceTypes, GGMenu, GGModelTypes, GGRefreshTypes, GGSceneType, GGSegmentTypes, GGUserInput, Imager, ImagerFont, Menus, Rope, ViewerClasses; GGMenuImplC: CEDAR PROGRAM IMPORTS AtomButtons, Feedback, FeedbackOps, FS, GGCoreOps, GGUserInput, ImagerFont EXPORTS GGMenu, GGModelTypes, GGInterfaceTypes = BEGIN Controls: TYPE = REF ControlsObj; ControlsObj: PUBLIC TYPE = GGControlPanelTypes.ControlsObj; MsgRouter: TYPE = FeedbackTypes.MsgRouter; GGData: TYPE = GGInterfaceTypes.GGData; RefreshDataObj: PUBLIC TYPE = GGRefreshTypes.RefreshDataObj; SceneObj: PUBLIC TYPE = GGSceneType.SceneObj; -- export of opaque type SceneRef: TYPE = REF SceneObj; entryHeight: CARDINAL = 15; -- height of a line of items entryHSpace: CARDINAL = 2; -- horizontal space between items on a line entryVSpace: CARDINAL = 2; -- vertical leading between lines fullColumn: CARDINAL = 600; -- the width of the standard large left column. smallNumberSize: CARDINAL = 60; <> FileExists: PROC [fileName: Rope.ROPE] RETURNS [answer: BOOL _ TRUE] = { [] _ FS.FileInfo[fileName ! FS.Error => IF error.code=$unknownFile THEN { answer _ FALSE; CONTINUE }; ]; }; END. g(GGMenuImplC.mesa Copyright Σ 1985, 1987, 1988, 1989 by Xerox Corporation. All rights reserved. Created by Pier, June 23, 1987, when GGMenuImpl overflowed Pier, October 17, 1990 3:30 pm PDT Bier, June 12, 1991 11:23 am PDT Doug Wyatt, December 19, 1989 11:15:30 am PST Last tweaked by Mike Spreitzer on May 3, 1990 3:50:48 pm PDT PUChoiceList: PUBLIC PROC [r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23: AtomButtons.PopUpChoice _ [] ] RETURNS [list: AtomButtons.PopUpChoices] = { OPEN AtomButtons; InnerCons: PROC[r: PopUpChoice] = {rList _ CONS[r, rList]; }; rList: PopUpChoices; IF r0.action#NIL THEN InnerCons[r0]; IF r1.action#NIL THEN InnerCons[r1]; IF r2.action#NIL THEN InnerCons[r2]; IF r3.action#NIL THEN InnerCons[r3]; IF r4.action#NIL THEN InnerCons[r4]; IF r5.action#NIL THEN InnerCons[r5]; IF r6.action#NIL THEN InnerCons[r6]; IF r7.action#NIL THEN InnerCons[r7]; IF r8.action#NIL THEN InnerCons[r8]; IF r9.action#NIL THEN InnerCons[r9]; IF r10.action#NIL THEN InnerCons[r10]; IF r11.action#NIL THEN InnerCons[r11]; IF r12.action#NIL THEN InnerCons[r12]; IF r13.action#NIL THEN InnerCons[r13]; IF r14.action#NIL THEN InnerCons[r14]; IF r15.action#NIL THEN InnerCons[r15]; IF r16.action#NIL THEN InnerCons[r16]; IF r17.action#NIL THEN InnerCons[r17]; IF r18.action#NIL THEN InnerCons[r18]; IF r19.action#NIL THEN InnerCons[r19]; IF r20.action#NIL THEN InnerCons[r20]; IF r21.action#NIL THEN InnerCons[r21]; IF r22.action#NIL THEN InnerCons[r22]; IF r23.action#NIL THEN InnerCons[r23]; FOR dummy: PopUpChoices _ rList, dummy.rest UNTIL dummy=NIL DO list _ CONS[dummy.first, list]; ENDLOOP; }; List: PROC [ref1, ref2, ref3: REF ANY _ NIL] RETURNS [LIST OF REF ANY] = GGCoreOps.List; mergeMenuDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["Merge Menu"]]; mergeMenu: AtomButtons.ButtonLineEntry _ [popUpButton["Merge", PUChoiceList [ Choice[List [$MergeAll], "MergeAll", "Merges in geometry, options and defaults from a Gargoyle file"], Choice[List [$MergeShapes], "MergeShapes", "Merges in geometry from a Gargoyle file"], Choice[List [$MergeOptions], "MergeOptions", "Merges in options and defaults from a Gargoyle file"], Choice[List [$MergeAlignments], "MergeAlignments", "Merges in alignment menu state from a Gargoyle file"] ], -1, FALSE, popUpFont, mergeMenuDoc, disableDecoding]]; stuffMenuDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["Stuff Menu"]]; stuffMenu: AtomButtons.ButtonLineEntry _ [popUpButton["Stuff", PUChoiceList [ Choice[List [$StuffToTioga], "ToTioga [GT]", "Stuff selected objects into Tioga node"], Choice[List [$StuffToFile], "ToFile [GT]", "Store selected objects to the Gargoyle file named in the Tioga selection"], Choice[List [$MergeFromTioga], "MergeFromTioga [T]", "Merge Gargoyle objects from Tioga node"], Choice[List [$StuffToTiogaBordered], "ToTiogaBordered [GT]", "Stuff selected objects into Tioga node with border"], Choice[List [$StuffToFileAlt], "ToFileAlt [GT]", "Store selected objects to the Gargoyle file named in the Tioga selection using alternate fonts"], Choice[List [$GrabFromTioga], "GrabFromTioga [T]", "Merge Gargoyle objects from Tioga node and translate to caret"], Choice[List [$StuffToTiogaFit], "ToTiogaFit [GT]", "Stuff selected objects into Tioga node and fit to margins"], noOpChoice, Choice[List [$GetFromTioga], "GetFromTioga [T]", "Get Gargoyle objects from Tioga node, clearing first"], Choice[List [$StuffToTiogaBorderedAndFit], "ToTiogaBorderedAndFit [GT]", "Stuff selected objects into Tioga node with border and fit to margins"], noOpChoice, Choice[List [$MergeFromGargoyle], "MergeFromGargoyle [G]", "Merge selected Gargoyle objects from another Gargoyle viewer into this Gargoyle viewer"], Choice[List [$StuffToTiogaAlt], "StuffToTiogaAlt [GT]", "Stuff selected objects into Tioga node using alternate fonts"] ], -1, FALSE, popUpFont, stuffMenuDoc, disableDecoding]]; interpressMenuDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["Interpress Menu"]]; interpressMenu: AtomButtons.ButtonLineEntry _ [popUpButton["IP", PUChoiceList [ Choice[List [$ToIP], "ToFile [T]", "Store all objects to the IP file named in the Tioga selection"], Choice[List [$IPToTioga], "StuffToTioga [GT]", "Stuff selected objects into Tioga node"], Choice[List [$MergeIPEditable], "MergeIPEditable [T]", "Merge objects from the IP file named in the Tioga selection into the scene"], Choice[List [$ToIPScreen], "ToFileAlt [T]", "Store all objects to the IP file named in the Tioga selection using alternate fonts"], Choice[List [$IPToTiogaBordered], "StuffToTiogaBordered [GT]", "Stuff selected objects into Tioga node with border"], Choice[List [$MergeIPSlice], "MergeIPSlice [T]", "Merge a single slice containing the IP file named in the Tioga selection into the scene, with optional page boundaries"], Choice[List [$ToIPSelected], "ToFileSelected [GT]", "Store all selected objects to the IP file named in the Tioga selection"], Choice[List [$IPToTiogaFit], "StuffToTiogaFit [GT]", "Stuff selected objects into Tioga node and fit to margins"], Choice[List [$IPMergeFromTioga], "MergeFromTioga [T]", "Merge the IP Artwork node in the Tioga selection into the scene"], noOpChoice, Choice[List [$IPToTiogaBorderedAndFit], "StuffToTiogaBorderedAndFit [GT]", "Stuff selected objects into Tioga node with border and fit to margins"], Choice[List [$IPToTiogaAlt], "StuffToTiogaAlt [GT]", "Stuff selected objects into Tioga node using alternate fonts"], Choice[List [$IncludeIPByReference], "IncludeByReference", "File out IP objects by file name reference only"], Choice[List [$ShowIPIncludeMode], "ShowIncludeMode", "Print IP include mode"], Choice[List [$IncludeIPByValue], "IncludeByValue", "File out IP objects directly"] ], -1, FALSE, popUpFont, interpressMenuDoc, disableDecoding]]; scriptMenuDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["Script Menu"]]; scriptMenu: AtomButtons.ButtonLineEntry _ [popUpButton["Script", PUChoiceList [ Choice[List [$ScriptAction, $Playback], "PlaybackScript [T]", "Replay actions from the file named in the Tioga selection"], Choice[List [$ShowScripts], "ShowScripts", "List, in order, the names of the scripts that would recreate the current picture"], noOpChoice, Choice[List [$ScriptAction, $FastPlay], "FastPlayScript [T]", "Do a PlaybackScript, with screen update suppressed"], noOpChoice, noOpChoice, Choice[List [$ScriptAction, $Open], "OpenScript [T]", "Create a file as named in the Tioga Selection and store future actions in it"], Choice[List [$ScriptAction, $Append], "AppendToScript [T]", "Append future actions to the file named in the Tioga Selection"], Choice[List [$ScriptAction, $Close], "CloseScript", "Stop sending actions to the currently open file (files most be closed before they can be played back)"] ], -1, FALSE, popUpFont, scriptMenuDoc, disableDecoding]]; helpMenuDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["Help Menu"]]; helpMenu: AtomButtons.ButtonLineEntry _ [popUpButton["Help", PUChoiceList [ Choice[List [$Help, $MouseActions], "MouseActions", "Opens a file with a summary of Gargoyle mouse and keyboard actions"], Choice[List [$Help, $Fonts], "Fonts", "Opens a file with a summary of Gargoyle font naming conventions and some examples"], Choice[List [$Help, $Colors], "Colors", "Opens a file with a list of available color palettes"] ], -1, FALSE, popUpFont, helpMenuDoc, disableDecoding]]; nextX _ AtomButtons.BuildButtonLine [ggData.controls.panel, 0, ggData.height, ggData, GGUserInput.EventNotify, LIST[ [button["Clear", LIST[LIST[$Clear]], -1, FALSE, NIL, ConfirmClear]], [button["Restore", LIST[LIST[$Reset]], -1, FALSE, NIL, ConfirmReset]], [button["Get", LIST[LIST[$Get]], -1, FALSE, NIL, ConfirmGet]], -- guarded in spite of Tioga viewers menus [button["Store", LIST[LIST[$Store]], -1, FALSE, NIL, ConfirmStore]], [button["Save", LIST[LIST[$Save]] ]], mergeMenu, stuffMenu, interpressMenu ]]; nextX _ AtomButtons.BuildButtonLine [ggData.controls.panel, nextX+entryHSpace, ggData.height, ggData, GGUserInput.UnQueuedEventNotify, LIST[ scriptMenu, helpMenu ]]; nextX _ AtomButtons.BuildUnQueuedButtonLine [ggData.controls.panel, nextX+entryHSpace, ggData.height, ggData, LIST[ ["Revive!", button, ReviveButton] -- must be unqueued ]]; nextX _ AtomButtons.BuildButtonLine [ggData.controls.panel, nextX+entryHSpace, ggData.height, ggData, GGUserInput.EventNotify, LIST[ [button["Typescript", LIST[LIST[$Typescript]] ]] ]]; BuildStyleMenuLine: PUBLIC PROC [ggData: GGData] = { noOpChoice: AtomButtons.PopUpChoice _ [LIST [$NoOp], "", "no-op" ]; doc: Rope.ROPE _ Rope.Concat[GGUIUtility.GGHomeDirectory[], "GargoyleDoc.tioga"]; disableDecoding: BOOL _ NOT GGState.GetQuickClickMode[]; strokeMenuDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["Stroke Menu"]]; strokeMenu: AtomButtons.ButtonLineEntry _ [popUpButton["Stroke", PUChoiceList [ Choice[List [$LineWidth], "WidthFromSelection [GT]", "Assign the stroke width in the Tioga selection to selected curve segments"], Choice[List [$PrintStrokeValues], "ShowValues [G]", "Show stroke values of selected curve segment"], Choice[List [$LineWidth, NEW[REAL _ 1.0]], "1 pt (LOOK 1) [G]", "Assign unit stroke width to selected curve segments"], Choice[List [$LineEnd], "EndFromSelection [GT]", "Assign the stroke end in the Tioga selection to selected curve segments (i.e. round, butt, square)"], Choice[List [$SelectMatchingWidth], "MatchSelectedWidth [T]", "Select all curve segments having stroke width specified in the Tioga selection"], Choice[List [$LineWidth, NEW[REAL _ 0.0]], "0 pt (LOOK 0) [G]", "Assign zero stroke width to selected curve segments"], Choice[List [$DashesFromSelection], "DashesFromSelection [GT]", "Assign the dash pattern in the Tioga selection to selected curve segments: [, ] " ], Choice[List [$SelectMatchingDashes], "MatchSelectedDashes [T]", "Select all curve segments having dash pattern specified in the Tioga selection: [, ] "], Choice[List [$DashesOff], "DashesOff [G]", "Remove dashes from selected curve segments"], Choice[List [$TrajJoints], "JointFromSelection [GT]", "Assign the stroke joint in the Tioga selection to selected curve segments (i.e. round, miter, bevel)"], Choice[List [$ShowDefaultStrokeValues], "ShowDefaults", "Print default stroke values for width, end, joint, and dashes"], Choice[List [$SetDefaultStrokeValues], "MakeDefaults [G]", "Set stroke default values from the currently selected curve segment"], Choice[List [$CopyStrokeValues], "Copy [G]", "Copy stroke values from the last selected slice to all other selected slices"], noOpChoice, noOpChoice ], -1, FALSE, popUpFont, strokeMenuDoc, disableDecoding]]; popUpButtonDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["Color Menu"]]; colorMenu: AtomButtons.ButtonLineEntry _ [popUpButton["Color", PUChoiceList [ Choice[List [$LineColorFromColorTool], "FromColorTool [G]", "Make selected strokes have the color in the ColorTool"], Choice[List [$PrintLineColor], "ShowStrokeColor [G]", "Print stroke color of selected stroke"], Choice[List [$LineColorToColorTool], "ToColorTool [G]", "Send the stroke color of the selected strokes to the ColorTool"], Choice[List [$LineColorNone], "none [G]", "Make selected strokes have no color (invisible)"], Choice[List [$LineColorFollowColorTool], "FollowColorTool [G]", "Selected stroke colors will track the ColorTool. Any mouse click terminates FollowColorTool"], Choice[List [$LineColorWhite], "white [G]", "Make selected strokes have color white"], Choice[List [$LineColorFromSelectedName], "FromSelectedName [GT]", "Make selected strokes have the color named in the Tioga selection (e.g. vivid green)"], Choice[List [$SelectMatchingLineCNS], "MatchSelectedName [T]", "Select strokes whose color matches the name in the Tioga selection (e.g. vivid green)"], Choice[List [$LineColorBlack], "black [G]", "Make selected strokes have color black"], Choice[List [$LineColorFromSelectedRGB], "FromSelectedRGB [GT]", "Make selected strokes have the RGB specified in the Tioga selection (e.g. 0.5 0.9 0.67)"], Choice[List [$SelectMatchingLineRGB], "MatchSelectedRGB [T]", "Select strokes whose color matches the RGB in the Tioga selection (e.g. 0.5 0.9 0.67)"], Choice[List [$LineColorGray], "gray [G]", "Make selected strokes have color gray"], Choice[List [$CopyStrokeColor], "Copy [G]", "Copy the stroke color from the last selected stroke to all other selected strokes"], Choice[List [$ShowDefaultLineColor], "ShowDefault", "Print default stroke color"], Choice[List [$SetDefaultLineColor], "MakeDefault [G]", "Set the default stroke color from the currently selected stroke"], Choice[List [$StrokeColorFromSelectedCMYK], "FromSelectedCMYK", "Make selected strokes have the CMYK specified in the Tioga selection (e.g., 0.5 0.9 0.67 0.3)"], Choice[List [$StrokeColorFromSelectedIntensity], "FromSelectedIntensity", "Make selected strokes gray (intensity specified in the Tioga selection (e.g., 0.3))"], Choice[List [$StrokeHueFromColorTool], "HueFromColorTool", "Make selected strokes have the same hue (HSV) as the ColorTool color"] ], -1, FALSE, popUpFont, popUpButtonDoc, disableDecoding]]; fillMenuDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["Fill Menu"]]; fillMenu: AtomButtons.ButtonLineEntry _ [popUpButton["Fill", PUChoiceList [ Choice[List [$AreaColorFromColorTool], "FromColorTool [G]", "Make selected objects have the fill color in the ColorTool"], Choice[List [$PrintAreaColor], "ShowFillColor [G]", "Print fill color of selected objects"], Choice[List [$AreaColorToColorTool], "ToColorTool [G]", "Send the fill color of the selected objects to the ColorTool"], Choice[List [$AreaColorNone], "none [G]", "Make selected objects have no fill color"], Choice[List [$AreaColorFollowColorTool], "FollowColorTool [G]", "Selected fill colors will track the ColorTool. Any mouse click terminates FollowColorTool"], Choice[List [$AreaColorWhite], "white [G]", "Make selected objects have fill color white"], Choice[List [$AreaColorFromSelectedName], "FromSelectedName [GT]", "Make selected objects have the fill color named in the Tioga selection (e.g. vivid green)"], Choice[List [$SelectMatchingAreaCNS], "MatchSelectedName [T]", "Select objects whose fill color matches the name in the Tioga selection (e.g. vivid green)"], Choice[List [$AreaColorBlack], "black [G]", "Make selected objects have fill color black"], Choice[List [$AreaColorFromSelectedRGB], "FromSelectedRGB [GT]", "Make selected objects have the fill RGB specified in the Tioga selection (e.g. 0.5 0.9 0.67)"], Choice[List [$SelectMatchingAreaRGB], "MatchSelectedRGB [T]", "Select objects whose fill color matches the RGB in the Tioga selection (e.g. 0.5 0.9 0.67)"], Choice[List [$AreaColorGray], "gray [G]", "Make selected objects have fill color gray"], Choice[List [$CopyFillColor], "Copy [G]", "Copy the fill color from the last selected object to all other selected objects"], Choice[List [$ShowDefaultFillColor], "ShowDefault", "Print default fill color"], Choice[List [$SetDefaultFillColor], "MakeDefault [G]", "Set the default fill color from the currently selected object"], Choice[List [$SetWash, $White], "WashToWhite", "Create a color wash from the selected fill color to white"], Choice[List [$SetWash, $ColorTool], "WashToColorTool", "Create a color wash from the selected fill color to the ColorTool color"], Choice[List [$SetWash, $Black], "WashToBlack", "Create a color wash from the selected fill color to black"], Choice[List [$FillColorFromSelectedCMYK], "FromSelectedCMYK", "Make selected objects have the fill CMYK specified in the Tioga selection (e.g., 0.5 0.9 0.67 0.3)"], Choice[List [$FillColorFromSelectedIntensity], "FromSelectedIntensity", "Make selected objects have a gray fill (intensity specified in the Tioga selection (e.g., 0.3))"], Choice[List [$FillHueFromColorTool], "HueFromColorTool", "Make selected objects have the same hue (HSV) as the ColorTool color"] ], -1, FALSE, popUpFont, fillMenuDoc, disableDecoding]]; editMenuDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["Edit Menu"]]; editMenu: AtomButtons.ButtonLineEntry _ [popUpButton["Edit", PUChoiceList [ Choice[List [$AddControlPoint], "Add CP (^p)", "Add a control point to a curve at the caret"], Choice[List [$DescribeCurve, $Selected], "DescribeSelected [G]", "Print a description of the selected object"], Choice[List [$DeleteControlPoint], "Delete CP (^P) [G]", "Delete the selected control point"], Choice[List [$AddHoles], "MakeHoles (^h) [G]", "Use the last selected closed trajectory as a fence and convert the remaining closed trajectories to holes in that fence"], Choice[List [$Weld], "Weld (^w) [G]", "Weld one or two selected open trajectories together"], Choice[List [$DeleteHoles], "UnMakeHoles (^H) [G]", "Replace fully selected composite outlines with simple outlines, one simple outline per element"], Choice[List [$SetOddWrap], "SetOddWrap [G]", "Set all selected outlines to display themselves with odd fill rule"], Choice[List [$ShowWrapRule], "ShowWrapRule", "Print value of wrap rule for selected object"], Choice[List [$SetNonZeroWrap], "SetNonZeroWrap [G]", "Set all selected outlines to display themselves with non-zero fill rule"], Choice[List [$OrientCW], "OrientCW [G]", "Orient all selected object clockwise"], Choice[List [$ShowOrientation], "ShowOrientation [G]", "Print value of orientation for selected object"], Choice[List [$OrientCCW], "OrientCCW [G]", "Orient all selected object counterclockwise"], Choice[List [$AddJoint], "AddJoint (^j)", "Add a joint to a curve at the caret"], Choice[List [$Reorient], "Reorient [G]", "Reverse orientation of all selected objects"], Choice[List [$SetCombine, $ORs, $NoOp], "Combine [G]", "Create an object which is the union of selected objects (straight line segments only for now)"], Choice[List [$ApplyAllDefaults], "ApplyAllDefaults [G]", "Apply current default looks to all selected objects"], Choice[List [$ShowAllDefaults], "ShowAllDefaults", "Print values of current defaults (hint: look in typescript)"], Choice[List [$StandardDefaults], "StandardDefaults", "Reset defaults to original values"], Choice[List [$Delete], "Delete (DEL) [G]", "Delete selected objects"], Choice[List [$HistoryTool], "HistoryTool", "Open or build a new history tool"], noOpChoice ], -1, FALSE, popUpFont, editMenuDoc, disableDecoding]]; selectMenuDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["Select Menu"]]; selectMenu: AtomButtons.ButtonLineEntry _ [popUpButton["Select", PUChoiceList [ Choice[List [$CycleSelection, $Forward], "CycleSelection (^n)", "Select a different object near where the caret was when the last selection was made (cycling forward through the list)"], Choice[List [$SelectAll], "Select All (^d)", "Select every object in the scene"], Choice[List [$CycleSelection, $Backward], "UnCycleSelection (^N)", "Select a different object near where the caret was when the last selection was made (cycling backward through the list)"], Choice[List [$MoveSelection, $Forward], "SelectForward (^u)", "Select the object immediately in front of the currently selected object"], Choice[List [$DeselectAll], "Deselect All (^D)", "Deselect every object in the scene"], Choice[List [$MoveSelection, $Backward], "SelectBackward (^o)", "Select the object immediately behind the currently selected object"], Choice[List [$MoveSelection, $ShrinkForward], "ShrinkForward (^U)", "Select the front child of the currently selected parent"], Choice[List [$MoveSelection, $Grow], "Grow (^i)", "Select the parent of the currently selected child"], Choice[List [$MoveSelection, $ShrinkBackward], "ShrinkBackward (^O)", "Select the back child of the currently selected parent"], Choice[List [$SelectCoincident], "Coincident", "Select every segment with coincident end points"], Choice[List [$SelectUnseeableSegs], "UnSeeableSegs", "Select every segment that can never be seen"], Choice[List [$SelectUnseeableObjs], "UnSeeableObj", "Select most complete objects that can never be seen"] ], -1, FALSE, popUpFont, selectMenuDoc, disableDecoding]]; hotSpotsMenuDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["HotSpots Menu"]]; hotSpotsMenu: AtomButtons.ButtonLineEntry _ [popUpButton["HotSpots", PUChoiceList [ Choice[List [$MakeHot], "MakeHot (^s) [G]", "Make all selected objects hot"], noOpChoice, Choice[List [$MakeCold], "MakeCold (^S) [G]", "Make all selected objects cold"], Choice[List [$DropAnchor], "DropAnchor (^a)", "Drop anchor at caret"], noOpChoice, Choice[List [$LiftAnchor], "LiftAnchor (^A)", "Remove anchor"], Choice[List [$MakeAllHot], "MakeAllHot (^ss)", "Make all objects hot"], noOpChoice, Choice[List [$MakeAllCold], "MakeAllCold (^SS)", "Make all objects cold"], Choice[List [$StandardAlignments], "StandardAlignments", "Restore standard alignments"] ], -1, FALSE, popUpFont, hotSpotsMenuDoc, disableDecoding]]; pointsPerIn: REAL = 72.0; pointsPerCm: REAL = 72.0/2.54; unitsMenuDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["Units Menu"]]; unitsMenu: AtomButtons.ButtonLineEntry _ [popUpButton["Units", PUChoiceList [ [LIST[$SetScaleUnit, NEW[REAL _ pointsPerIn], $Noisy], "Inches", "Set unit value to 1 inch"], [LIST[$PrintScaleUnit], "ShowValue", "Print current unit value"], [LIST[$SetScaleUnit, NEW[REAL _ 1.0], $Noisy], "Points", "Set unit value to 1 point"], [LIST[$RadiusUnitFromSegment], "FromSegment [G]", "Set unit value to length of selected segment"], [LIST[$RadiusUnitFromValue], "FromRadiusValue", "Set unit value from number in RadiusValue"], [LIST[$RadiusUnitFromSelection], "FromSelection [T]", "Set unit value from number in the Tioga selection"], [LIST[$SetScaleUnit, NEW[REAL _ pointsPerCm], $Noisy], "Centimeters", "Set unit value to 1 centimeter"] ], -1, FALSE, popUpFont, unitsMenuDoc, disableDecoding]]; nextX: INTEGER _ AtomButtons.BuildButtonLine[ggData.controls.panel, 0, ggData.height, ggData, GGUserInput.EventNotify, LIST[ strokeMenu, colorMenu, fillMenu, editMenu, selectMenu, hotSpotsMenu, unitsMenu ]]; ggData.controls.screenStyle _ AtomButtons.BuildEnumTypeSelection[viewer: ggData.controls.panel, x: nextX + entryHSpace, y: ggData.height, maxWidth: 144, clientData: ggData, handleProc: GGUserInput.EventNotify, title: "ScreenStyle:", default: "SpecifiedFonts", borderOnButtons: TRUE, style: flipThru, allInOneRow: TRUE, buttonNames: LIST["SpecifiedFonts", "AlternateFonts", "WYSIWYG"], atom: $ScreenChoiceChange]; nextX _ AtomButtons.BuildButtonLine[ggData.controls.panel, ggData.controls.screenStyle.nextx + entryHSpace, ggData.height, ggData, GGUserInput.EventNotify, LIST[ [twoState["Buffer", LIST[$ToggleBuffer], TRUE, BufferInGGData]] ]]; ggData.height _ ggData.height + entryHeight + entryVSpace; }; ShowColorsInGGData: AtomButtonsTypes.InitTwoStateProc = { ggData: GGData _ NARROW[clientData]; ggData.refresh.showColors _ twoState; }; BufferInGGData: AtomButtons.InitTwoStateProc = { PROC [name: Rope.ROPE, clientData: REF ANY, twoState: TwoState]; ggData: GGData _ NARROW[clientData]; ggData.controls.bufferButton _ twoState; }; ConfirmClear: PROC [clientData: REF ANY] = { ggData: GGData _ NARROW[clientData]; Feedback.Append[ggData.router, oneLiner, $Confirm, "Confirm deletion of all objects"]; }; ConfirmReset: PROC [clientData: REF ANY] = { ggData: GGData _ NARROW[clientData]; filename: Rope.ROPE _ GGState.GetFullName[ggData]; IF Rope.Equal[filename, NIL] THEN Feedback.Append[ggData.router, oneLiner, $Complaint, "Restore failed: no file loaded. Do not confirm."] ELSE Feedback.Append[ggData.router, oneLiner, $Confirm, "Confirm restore to original file"]; }; ConfirmGet: PROC [clientData: REF ANY] = { -- This proc is a mess but can't be easily sanitized fullName: Rope.ROPE; success: BOOL _ FALSE; ggData: GGData _ NARROW[clientData]; filename: Rope.ROPE _ ViewerTools.GetSelectionContents[]; IF Rope.Equal[filename, NIL] THEN Feedback.Append[ggData.router, oneLiner, $Complaint, "Get failed: no filename specified. Do not confirm."] ELSE { [fullName, success, ----] _ GGFileOps.GetGargoyleFileName["Get", filename, ggData.currentWDir, ggData.router, FALSE]; IF NOT success THEN Feedback.Append[ggData.router, oneLiner, $Complaint, "Get failed: bad filename specified. Do not confirm."] ELSE Feedback.PutF[ggData.router, oneLiner, $Confirm, "Confirm Get of %g as a new scene", [rope[fullName]] ]; }; }; ConfirmStore: PROC [clientData: REF ANY] = { -- This proc is a mess but can't be easily sanitized fullName: Rope.ROPE; success: BOOL _ FALSE; ggData: GGData _ NARROW[clientData]; filename: Rope.ROPE _ ViewerTools.GetSelectionContents[]; IF Rope.Equal[filename, NIL] THEN Feedback.Append[ggData.router, oneLiner, $Complaint, "Store failed: no filename specified. Do not confirm."] ELSE { [fullName, success, ----] _ GGFileOps.GetGargoyleFileName["Store", filename, ggData.currentWDir, ggData.router, FALSE]; IF NOT success THEN Feedback.Append[ggData.router, oneLiner, $Complaint, "Store failed: bad filename specified. Do not confirm."] ELSE Feedback.PutF[ggData.router, oneLiner, $Confirm, "Confirm Store to %g [%g File]", [rope[fullName]], [rope[IF FileExists[fullName] THEN "Old" ELSE "New"]] ]; }; }; DKW: if some other error.code, reject is probably better than unnamed ERROR ReviveButton: Menus.ClickProc = { ggData: GGData _ NARROW[clientData]; scene: SceneRef _ NARROW[ggData.scene]; GGMouseEvent.ResetMouseMachinery[ggData]; CodeTimer.ResetTable[CodeTimer.GetTable[$Gargoyle]]; SlackProcess.Restart[ggData.slackHandle]; ggData.camera.quality _ fast; ggData.refresh.suppressRefresh _ FALSE; ggData.refresh.suppressScreen _ FALSE; ggData.refresh.areaFollowColorTool _ ggData.refresh.lineFollowColorTool _ FALSE; scene.ptrValid _ scene.prioritiesValid _ FALSE; ggData.aborted _ ALL[FALSE]; GGHistory.KillAdvanceCapture[ggData]; IF mouseButton#blue THEN GGWindow.RestoreScreenAndInvariants[paintAction: $PaintEntireScene, ggData: ggData, remake: triggerBag, edited: FALSE, okToSkipCapture: TRUE] }; Choice: PROC [action: LIST OF REF ANY, actionImage: Rope.ROPE, doc: Rope.ROPE, font: Imager.Font _ NIL] RETURNS [AtomButtons.PopUpChoice] = { RETURN[[action, actionImage, doc, font]]; }; popUpFont: ImagerFont.Font; -- initialized in Init below; Init: PROC = { popUpFont _ ImagerFont.Find["xerox/tiogafonts/helvetica10I"]; }; Init[]; Κ:˜codešœ™KšœN™NKšœ:™:Kšœ"™"Kšœ ™ K™-K™<—K˜šΟk ˜ Jšœφ˜φK˜—šΟn œœ˜Jšœ%œ$˜RKšœ*˜6—˜Kšœ œœ ˜!Kšœ œœ#˜;Kšœ œ˜*Kšœœ˜'Kšœœœ!˜Kšœœ™Kšœ™—K™K™—Kšžœœœœœœœœœœ™XK˜šžœœœ˜5Kšœ'œ˜CKšœ œC˜QKšœœœ˜8K˜Kšœ@œ™Tšœ)™)šœ$™$Kšœf™fKšœV™VKšœd™dKšœi™iK™—Kšœœ-™6K™—Kšœ@œ™Tšœ)™)šœ$™$KšœW™WKšœw™wKšœ_™_Kšœs™sKšœ“™“Kšœt™tKšœp™pKšœ ™ Kšœi™iKšœ’™’Kšœ ™ Kšœ•™•Kšœw™wK™—Kšœœ-™6K™—KšœEœ™^šœ.™.šœ!™!Kšœd™dKšœY™YKšœ…™…Kšœƒ™ƒKšœu™uKšœ«™«Kšœ~™~Kšœr™rKšœz™zKšœ ™ Kšœ”™”Kšœu™uKšœn™nKšœN™NKšœR™RK™—Kšœœ2™;K™—I helpfromdocšœAœ™Všœ*™*šœ%™%Kšœ{™{Kšœ™Kšœ ™ Kšœt™tKšœ ™ Kšœ ™ Kšœ†™†Kšœ~™~Kšœœ™œK™—Kšœœ.™7K™—Kšœ?œ™Ršœ(™(šœ#™#Kšœz™zKšœ{™{Kšœ_™_K™—Kšœœ,™5K˜—Kšœœ˜šœoœ™tKš œœœœœ™DKš œœœœœ™FKš œœœ œœŸ*™iKš œœœœœ™DKšœœœ ™%Kšœ ™ Kšœ ™ Kšœ™K™K™—šœ‡œ™ŒK™ K™K™K™—šœnœ™sKšœ"Ÿ™5K™K™—šœœ™„Kšœœœ™0K™—K˜Kšœ,˜,K˜Kšž˜K˜—šžœœœ™4Kšœ'œ™CKšœ œC™QKšœœœ™8KšœAœ™Všœ*™*šœ%™%Kšœ6 Iœ™‚Kšœ5 ,œ™dKšœœœ  3œ™wKšœ2 bœ™—Kšœ? Nœ™Kšœœœ  3œ™wKšœA jœ™―KšœA oœ™³Kšœ, *œ™YKšœ7 dœ™žKšœ9 =œ™yKšœ3 œ Cœ™‚Kšœ. Lœ™}Kšœ ™ Kšœ ™ K™—Kšœœ.™7K™—KšœBœ œ ™Všœ)™)šœ$™$Kšœ= ,œ ™uKšœ7 %œ™_Kšœ9 5œ ™zKšœ+ /œ™]KšœA Lœ™ŸKšœ- !œ™VKšœD Tœ™›Kšœ@ Uœ™˜Kšœ- !œ™VKšœB Wœ™œKšœ? Uœ™—Kšœ+ %œ™SKšœ- Qœ™Kšœ5 œ™RKšœ8 ?œ™zKšœA œ :œ™‘KšœK œ  .œ™‘Kšœ< œ+™‚K™—Kšœœ/™8K™—Kšœ?œ œ ™Ršœ(™(šœ#™#Kšœ= 1œ ™zKšœ5 $œ™\Kšœ9 3œ ™xKšœ+ (œ™VKšœA Jœ™Kšœ- &œ™[KšœD Yœ™ Kšœ@ Zœ™Kšœ- &œ™[KšœB \œ™‘Kšœ? Zœ™œKšœ+ *œ™XKšœ+ Oœ™}Kšœ5 œ™PKšœ8 =œ™xKšœl™lKšœ‚™‚Kšœl™lKšœ? $œ :œ™€KšœI 'œ  .œ™«Kšœ: œ+™€K™—Kšœœ,™5K™—Kšœ?œ œ ™Ršœ(™(šœ#™#Iunitšœ0 +œ™^KšœB *œ™oKšœ: !œ™^Nšœ0 wœ™ͺKšœ' 3œ™]Kšœ5 ^œ™–Nšœs™sKšœ. ,œ™]Kšœ€™€Nšœ* $œ™QKšœ8 .œ™iKšœ, +œ™ZNšœ+ #œ™QKšœ* +œ™XKšœ8 ]œ™˜Nšœ: 3œ™pKšœ4 ;œ™rKšœ6 !œ™ZNšœ, œ™FKšœ,  œ™OKšœ ™ N™—Kšœœ,™5K™—KšœAœ œ ™Všœ*™*šœ%™%KšœΊ™ΊKšœ.  œ™QKšœΎ™ΎK™Kšœ‰™‰Kšœ: œ™WKšœ†™†K™Kšœ™Kšœg™gKšœ€™€Kšœ0 /œ™bKšœ6 +œ™dKšœ5 3œ™jK™—Kšœœ.™7K™—KšœCœ™Zšœ,™,šœ'™'Kšœ- œ™MKšœ ™ Kšœ/ œ™PKšœ/ œ™FKšœ ™ Kšœ/  œ™?Kšœ0 œ™GKšœ ™ Kšœ2 œ™JKšœ: œ™WK™—Kšœœ0™9K™—Kšœ œ™Kšœ œ ™Kšœ@œ œ ™Tšœ)™)šœ$™$Kš œœœœ% œ™]Kšœœ  œ œ™AKš œœœœ œ™VKšœœ. ,œ™bKšœœ, )œ™]Kšœœ2 1œ™kKš œœœœ* œ™gK™—Kšœœ-™6K™—šœœiœ™|KšœN™NK™K™—Kšœ•œ œœL™œK™šœœœ™‘Kšœœœ™?K™K™—K™Kšœ:™:K™K™—K˜šžœ'™9Kšœœ ™$Kšœ%™%K™K™—K˜šžœ"™0Kšœ œœœ™@Kšœœ ™$Kšœ(™(K™K™—šΠbn œœœœ™,Kšœœ ™$KšœV™VKšœ™K™—š‘ œœœœ™,Kšœœ ™$Kšœœ™2Kšœœœh™ŠKšœX™\Kšœ™K™—šž œœœœ™*K™4Kšœœ™Kšœ  œ™Kšœœ ™$Kšœœ&™9Kšœœœk™Œšœ™KšœŸœVœ™uKšœœ œl™Kšœi™mKšœ™—Kšœ™K™—šž œœœœ™,K™4Kšœœ™Kšœ  œ™Kšœœ ™$Kšœœ&™9Kšœœœm™Žšœ™KšœŸœXœ™wKšœœ œn™Kšœkœœœ ™‘Kšœ™—Kšœ™K™—š ž œœœœ œœ˜Hšœœ˜š œ œœ œœ˜IKšœC™K—Kšœ˜—Kšœ˜—K™š‘ œ™!Kšœœ ™$Kšœœ™'Kšœ)™)Kšœ4™4Kšœ)™)Kšœ™Kšœ!œ™'Kšœ œ™&KšœJœ™PKšœ)œ™/Kšœœœ™Kšœ%™%KšœœqœΠbkœ™¦K™—K™šžœœ œœœœœ œœœ™Kšœ#™)K™K™—KšœŸ™9K˜šžœœ™K•StartOfExpansionO[name: ROPE, substitution: ImagerFont.Substitution _ substituteWithWarning]šœ=™=K™—K˜Kšœ™K˜Kšœ˜J˜J˜—…—<ž