DIRECTORY AtomButtons, EmbeddedButtons, Feedback, FeedbackTypes, GGBasicTypes, GGCircleCache, GGContainer, GGControlPanelTypes, GGCoreOps, GGEvent, GGInterfaceTypes, GGMenu, GGModelTypes, GGScene, GGSceneType, GGSegmentTypes, GGShapes, GGUserInput, GGUserProfile, GraphicsButton, Imager, ImagerFont, List, Menus, PFS, PutGet, Rope, Rules, TextNode, TiogaActive, TiogaOps, UserProfile, ViewerClasses, ViewerTools; GGMenuImplA: CEDAR PROGRAM IMPORTS AtomButtons, EmbeddedButtons, Feedback, GGCircleCache, GGContainer, GGCoreOps, GGEvent, GGMenu, GGShapes, GGUserInput, GGUserProfile, GraphicsButton, Imager, ImagerFont, List, PFS, PutGet, Rules, TiogaActive, TiogaOps, UserProfile, ViewerTools EXPORTS GGInterfaceTypes, GGModelTypes, GGMenu = BEGIN ControlsObj: PUBLIC TYPE = GGControlPanelTypes.ControlsObj; MsgRouter: TYPE = FeedbackTypes.MsgRouter; GGData: TYPE = GGInterfaceTypes.GGData; GravityExtentData: TYPE = REF GravityExtentDataObj; GravityExtentDataObj: TYPE = GGInterfaceTypes.GravityExtentDataObj; Point: TYPE = GGBasicTypes.Point; SceneObj: PUBLIC TYPE = GGSceneType.SceneObj; -- export of opaque type SceneRef: TYPE = REF SceneObj; Viewer: TYPE = ViewerClasses.Viewer; ROPE: TYPE = Rope.ROPE; popUpFont: Imager.Font; -- initialized in Init below; 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; PUChoiceList: PROC [r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19: AtomButtons.PopUpChoice _ [] ] RETURNS [list: AtomButtons.PopUpChoices] = GGCoreOps.PUChoiceList; RList: PROC [ref1, ref2, ref3: REF ANY _ NIL] RETURNS [LIST OF REF ANY] = GGCoreOps.List; AddARule: PROC [ggData: GGData] = { rule: Rules.Rule _ Rules.Create[[ parent: ggData.controls.panel, wy: ggData.height, ww: ggData.controls.panel.cw, wh: 2 ]]; GGContainer.ChildXBound[ggData.controls.panel, rule]; ggData.height _ ggData.height + rule.wh + entryVSpace; }; BuildControlPanel: PUBLIC PROC [ggData: GGData] = { BuildActiveDocument[ggData]; BuildGravityLine[ggData]; BuildSlopeLine[ggData]; BuildAngleLine[ggData]; BuildRadiusLine[ggData]; BuildDistanceLine[ggData]; BuildMeasureLine[ggData]; BuildFeedbackLine[ggData]; AddARule[ggData]; }; BuildFeedbackLine: PROC [ggData: GGData] = { nextX: NAT _ AtomButtons.BuildButtonLine[ggData.controls.panel, 0, ggData.height, ggData, GGUserInput.EventNotify, LIST[ [label["Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Line", FeedbackLineInGGData, fullColumn]] ]]; ggData.height _ ggData.height + entryHeight; }; FeedbackLineInGGData: AtomButtons.UpdateProc = { ggData: GGData _ NARROW[clientData]; router: MsgRouter _ Feedback.CreateRouter[]; FeedbackOps.SetMultiLabel[router, button, TRUE, LIST[$Error, $Complaint]]; -- blink FeedbackOps.SetMultiLabel[router, button, FALSE, LIST[$DuringMouse, $Feedback, $Warning, $Confirm, $Show, $Statistics]]; FeedbackOps.SetMultiTypescript[router, $Gargoyle, LIST[$Error, $Warning, $Show, $Typescript, $Complaint, $Statistics]]; ggData.router _ router; ggData.controls.feedbackLine _ button; }; <, ]"], Choice[RList [$ShowCaretValues], "ShowCaretValues", "Show the current position (in current units) and angle (in degrees) of the caret"], Choice[RList [$GrabInputFocus], "GrabInputFocus", "Move the input focus to the Gargoyle viewer without disturbing the caret"], Choice[RList [$CaretAngleFromSelection], "AngleFromSelection [T]", "Set the caret angle (in degrees) from the Tioga selection"], Choice[RList [$ShowAnchorValues], "ShowAnchorValues", "Show the current position (in current units) and angle (in degrees) of the anchor"] ], -1, FALSE, popUpFont, caretMenuDoc, disableDecoding]]; transformMenuDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["Transform Menu"]]; transformMenu: AtomButtons.ButtonLineEntry _ [popUpButton["Transform", PUChoiceList [ Choice[RList [$Scale], "Scale [GT]", "Scale selected objects by the number in the Tioga selection"], Choice[RList [$ScaleXY], "ScaleXY [GT]", "Scale selected objects in X and Y by the two numbers in the Tioga selection"], Choice[RList [$UnScale], "UnScale [GT]", "Scale selected objects by the reciprocal of the number in the Tioga selection"], Choice[RList [$Rotate], "Rotate [GT]", "Rotate selected objects CCW about the Anchor by the number of degrees in the Tioga selection"], Choice[RList [$Rotate, "90.0"], "Rotate 90 [G]", "Rotate selected objects CCW about the Anchor by 90 degrees"], Choice[RList [$UnRotate], "UnRotate [GT]", "Rotate selected objects CW about the Anchor by the number of degrees in the Tioga selection"], Choice[RList [$TranslateX], "TranslateX [GT]", "Translate selected objects in X direction by the number in the Tioga selection"], Choice[RList [$TranslateXY], "TranslateXY [GT]", "Translate selected objects in X and Y directions by the two numbers in the Tioga selection"], Choice[RList [$TranslateY], "TranslateY [GT]", "Translate selected objects in Y direction by the number in the Tioga selection"], Choice[RList [$ScaleX, "-1.0"], "MirrorX [G]", "Scale selected objects by -1.0 in X direction"], Choice[RList [$Rotate, "180.0"], "MirrorXY [G]", "Rotate selected objects by 180 degrees"], Choice[RList [$ScaleY, "-1.0"], "MirrorY [G]", "Scale selected objects by -1.0 in Y direction"], Choice[RList [$ScaleX], "ScaleX [GT]", "Scale selected objects in X direction by the number in the Tioga selection"], Choice[RList [$SixPointTransform], "SixPoint [G]", "See GargoyleDoc for explanation"], Choice[RList [$ScaleY], "ScaleY [GT]", "Scale selected objects in Y direction by the number in the Tioga selection"], Choice[RList [$UnScaleX], "UnScaleX [GT]", "Scale selected objects in X direction by the reciprocal of the number in the Tioga selection"], Choice[RList [$FourPointTransform], "FourPoint [G]", "See GargoyleDoc for explanation"], Choice[RList [$UnScaleY], "UnScaleY [GT]", "Scale selected objects in Y direction by the reciprocal of the number in the Tioga selection"] ], -1, FALSE, popUpFont, transformMenuDoc, disableDecoding]]; overlapMenuDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["Overlap Menu"]]; overlapMenu: AtomButtons.ButtonLineEntry _ [popUpButton["Overlap", PUChoiceList [ Choice[RList [$Top], "Front [G]", "Move selected objects to the front"], Choice[RList [$ShowPriorityValue], "ShowValue [G]", "Show the priority number for the selected object"], Choice[RList [$Bottom], "Back [G]", "Move selected objects to the back"], Choice[RList [$UpOne], "ForwardOne [G]", "Move selected objects one layer toward the front"], Choice[RList [$FindPriorityFromSelection], "MatchFromSelection [T]", "Select the object at the priority number in the Tioga selection"], Choice[RList [$DownOne], "BackOne [G]", "Move selected objects one layer toward the back"], Choice[RList [$PutInFront], "PutInFront [G]", "Move the first selected objects in front of the last selected object"], Choice[RList [$Exchange], "Exchange [G]", "Swap priority of the two selected objects"], Choice[RList [$PutBehind], "PutBehind [G]", "Move the first selected objects behind the last selected object"], Choice[RList [$UpFromSelection], "ForwardFromSelection [GT]", "Move selected objects toward the front by the number in the Tioga selection"], Choice[RList [$PutAtSelection], "PutAtSelection [GT]", "Put the selected objects at the priority number in the Tioga selection"], Choice[RList [$DownFromSelection], "BackFromSelection [GT]", "Move selected objects toward the back by the number in the Tioga selection"] ], -1, FALSE, popUpFont, overlapMenuDoc, disableDecoding]]; curvesMenuDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["Curves Menu"]]; curvesMenu: AtomButtons.ButtonLineEntry _ [popUpButton["Curves", PUChoiceList [ Choice[RList [$SetStraight], "Line (LOOK l) [G]", "Convert selected trajectories to straight lines"], Choice[RList [$SetArc], "Arc (LOOK a) [G]", "Convert selected trajectories to arcs"], Choice[RList [$SetConic], "Conic [GT]", "Convert selected trajectories to parabolas, using the pointiness [0.0 .. 1.0] in the Tioga selection"], Choice[RList [$SetBezier], "Bezier (LOOK z) [G]", "Convert selected trajectories to Bezier splines"], Choice[RList [$SetBSpline], "B-Spline (LOOK b) [G]", "Convert selected trajectories to B-Splines"], Choice[RList [$SetNaturalSpline], "Natural Spline (LOOK n) [G]", "Convert selected trajectories to natural splines"], noOpChoice, Choice[RList [$SelectMatchingCurve], "MatchSelectedType [T]", "Select curve types matching type in the Tioga selection (Line, Straight Arc, Parabolic Conic, Bezier, BSpline, Cyclic Natural, Natural"], noOpChoice, Choice[RList [$SetConstraintType], "SetEditConstraint [T]", "Set EditConstraint to be none, tangent, or length"], Choice[RList [$ShowConstraintType], "ShowEditConstraint", "Print current edit constrain type"], Choice[RList [$SetMakeConstrained], "MakeConstrained [G]", "Enforce the current constraint at the selected trajectory joint or CP."] ], -1, FALSE, popUpFont, curvesMenuDoc, disableDecoding]]; shapesMenuDoc: PopUpButtons.Help _ PopUpButtons.HelpFromDoc[doc, LIST["Shapes Menu"]]; shapesMenu: AtomButtons.ButtonLineEntry _ [popUpButton["Shapes", PUChoiceList [ noOpChoice, Choice[RList [$SelectedBBox], "SelectedBBox", "Add the bounding box of all selected items to the scene"], Choice[RList [$NewBox, NEW[REAL _ 1.0]], "Box", "Create a unit box about the Caret"], Choice[RList [$NewCircle, NEW[REAL _ 1.0]], "Circle", "Create unit circle about the Caret"], Choice[RList [$KnotchedLine, NEW[REAL _ 4.0], NEW[INT _ 8]], "KnotchedLine", "Create a sample knotched line at the caret"], Choice[RList [$PolygonInCircle], "Polygon [T]", "Create a polygon about the Caret of the number of sides specified in the Tioga selection"], Choice[RList [$Frame, NEW[REAL _ 8.5*72.0], NEW[REAL _ 11.0*72.0]], "8.5x11", "Create an 8.5x11 inch box at the origin"], Choice[LIST [$Frame, NEW[REAL _ 8.1*72.0], NEW[REAL _ 8.9*72.0], NEW[REAL _ 0.0], NEW[REAL _ 1.3*72.0] ], "C2700", "Create an 8.1x8.9 inch box in the C2700 imaging area"], Choice[RList [$Frame, NEW[REAL _ 640.0], NEW[REAL _ 480.0]], "640x480", "Create a 640x480 point box at the origin"], Choice[RList [$MergeShapes, "[CedarChest7.0]GGBinderGridQuarterInch.gargoyle"], "8.5x11 grid", "Create a two grid axes with 1/4 inch spacings (make hot to use)"], Choice[RList [$Frame, NEW[REAL _ 1024.0], NEW[REAL _ 768.0]], "1024x768", "Create a 1024x768 point box at the origin"], Choice[RList [$Frame, NEW[REAL _ 38.0*72.0], NEW[REAL _ 50.666667*72.0]], "38x50.66 (Versatec)", "Create a 38x50.66 inch box at the origin"], Choice[RList [$NewBox, NEW[REAL _ 1.0]], "Box", "Create a unit box about the Caret"], Choice[RList [$NewArrow, NEW[REAL _ 0.5], NEW[REAL _ 0.125]], "Arrow", "Create a sample arrow at the caret"], Choice[RList [$PolygonInCircle, NEW[INT _ 3]], "Triangle", "Create triangle about the Caret"], Choice[RList [$PolygonInCircle, NEW[INT _ 4]], "Square", "Create square about the Caret"], Choice[RList [$PolygonInCircle, NEW[INT _ 5]], "Pentagon", "Create pentagon about the Caret"], Choice[RList [$PolygonInCircle, NEW[INT _ 6]], "Hexagon", "Create hexagon about the Caret"], Choice[RList [$PolygonInCircle, NEW[INT _ 8]], "Octagon", "Create octagon about the Caret"] ], -1, FALSE, popUpFont, shapesMenuDoc, disableDecoding]]; nextX _ AtomButtons.BuildButtonLine[ggData.controls.panel, 0, ggData.height, ggData, GGUserInput.EventNotify, LIST[ caretMenu, transformMenu, overlapMenu, curvesMenu, shapesMenu ]]; }; >> FindControlPanel: PROC [] RETURNS [filename: ROPE _ NIL] = { value: LIST OF ROPE; fullName: PFS.PATH _ NIL; path: PFS.PATH; value _ UserProfile.ListOfTokens["Gargoyle.ControlPanelFile", NIL]; IF value # NIL THEN { FOR list: LIST OF ROPE _ value, list.rest UNTIL list = NIL DO path _ PFS.PathFromRope[list.first]; fullName _ PFS.FileInfo[name: path ! PFS.Error=>CONTINUE].fullFName; IF fullName # NIL THEN RETURN[PFS.RopeFromPath[fullName]]; ENDLOOP; }; path _ PFS.PathFromRope["[PCedar]GargoyleControlPanel.tioga"]; fullName _ PFS.FileInfo[name: path ! PFS.Error=>CONTINUE].fullFName; IF fullName # NIL THEN RETURN[PFS.RopeFromPath[fullName]]; path _ PFS.PathFromRope["[CedarCommon]GargoyleControlPanel.tioga"]; fullName _ PFS.FileInfo[name: path ! PFS.Error=>CONTINUE].fullFName; IF fullName # NIL THEN RETURN[PFS.RopeFromPath[fullName]]; path _ PFS.PathFromRope["[PCedar]GargoyleControlPanel.tioga"]; fullName _ PFS.FileInfo[name: path ! PFS.Error=>CONTINUE].fullFName; IF fullName # NIL THEN RETURN[PFS.RopeFromPath[fullName]]; }; BuildActiveDocument: PROC [ggData: GGData] = { nextX: NAT _ 0; v: Viewer; lines: NAT _ 3; doc: TextNode.Ref _ NIL; filename: ROPE _ FindControlPanel[]; IF filename = NIL THEN Feedback.AppendByName[$System, oneLiner, $Error, "No file found for Gargoyle control panel in [PCedar], [CedarCommon], [PCedar] nor in Gargoyle.ControlPanelFile user profile entry."] ELSE { Feedback.PutFByName[$System, oneLiner, $Feedback, "Loading %g as Gargoyle's control panel", [rope[filename]]]; doc _ PutGet.FromFile[filename]; }; v _ ViewerTools.MakeNewTextViewer[[ wx: 0, wy: ggData.height, wh: lines*entryHeight, parent: ggData.controls.panel, data: doc, scrollable: TRUE, border: TRUE]]; ggData.controls.controlPanel _ TiogaActive.LookupDoc[v]; GGContainer.ChildXBound[ggData.controls.panel, v]; ggData.controls.controlPanelViewer _ v; EmbeddedButtons.LinkDocToApplication[doc: ggData.controls.controlPanel, target: $Gargoyle, targetViewer: ggData.controls.actionArea, applicationData: ggData, notifyProc: ControlPanelNotify]; EmbeddedButtons.LinkDocToApplication[doc: ggData.controls.controlPanel, target: $UnQueuedGargoyle, targetViewer: ggData.controls.actionArea, applicationData: ggData, notifyProc: UnQueuedControlPanelNotify]; TiogaOps.Interpret[ggData.controls.controlPanelViewer, LIST[$ActivityOn]]; ggData.height _ ggData.height + lines*entryHeight; }; ControlPanelNotify: EmbeddedButtons.NotifyProc = { newEvent: LIST OF REF ANY _ List.Append[events]; -- make a copy of the eventList, because EmbeddedButtons resuses the original GGUserInput.EventNotify[applicationData, newEvent]; }; UnQueuedControlPanelNotify: EmbeddedButtons.NotifyProc = { newEvent: LIST OF REF ANY _ List.Append[events]; -- make a copy of the eventList, because EmbeddedButtons resuses the original GGUserInput.UnQueuedEventNotify[applicationData, newEvent]; }; BuildGravityLine: PROC [ggData: GGData] = { nextX: NAT _ 0; ggData.controls.gravityTypeMenu _ AtomButtons.BuildEnumTypeSelection[viewer: ggData.controls.panel, x: 4, y: ggData.height, maxWidth: 140, clientData: ggData, handleProc: GGUserInput.EventNotify, title: "GravType:", default: "PreferPoints", borderOnButtons: TRUE, style: flipThru, allInOneRow: TRUE, buttonNames: LIST["PreferLines", "PreferPoints"], atom: $GravityChoiceChange]; ggData.hitTest.gravityType _ pointsPreferred; nextX _ ggData.controls.gravityTypeMenu.nextx; nextX _ AtomButtons.BuildButtonLine[ ggData.controls.panel, nextX + entryHSpace, ggData.height, ggData, GGUserInput.EventNotify, LIST[ [button["GravExtent:", LIST[LIST[$ShowGravExtent]]]] ]]; nextX _ GraphicsButton.BuildGraphicsButton[ container: ggData.controls.panel, x: nextX + entryHSpace, y: ggData.height, w: 60, -- changed from 72 to make more room in line h: entryHeight, clientData: ggData, choices: LIST[ [LIST[$GravityExtentChange, $ValueDown]], [LIST[$GravityExtentChange, $InitialValue]], [LIST[$GravityExtentChange, $ValueUp]]], handleProc: GGUserInput.EventNotify, repaintProc: GravityExtentRepaint, buttonData: NEW[GravityExtentDataObj _ [extent: GGUserProfile.GetDefaultGravityExtent[]]], updateProc: GravityExtentInGGData ]; nextX _ AtomButtons.BuildButtonLine[ ggData.controls.panel, nextX + entryHSpace, ggData.height, ggData, GGUserInput.EventNotify, LIST[ [twoState["Gravity", LIST[$ToggleGravity], TRUE, GravityInGGData]], [twoState["Midpts", LIST[$ToggleMidpoints], FALSE, MidpointsInGGData]], [twoState["Auto", LIST[$ToggleHeuristics], GGUserProfile.GetDefaultHeuristics[], HeuristicsInGGData]], [twoState["Alignments", LIST[$ToggleShowAlignments], TRUE, AlignmentsInGGData]] ], entryHSpace]; ggData.height _ ggData.height + entryHeight; }; BuildSlopeLine: PROC [ggData: GGData] = { buttonHandle: AtomButtons.SortedButtonHandle; nextX: NAT _ AtomButtons.BuildButtonLine[ggData.controls.panel, 0, ggData.height, ggData, GGUserInput.EventNotify,LIST[ [button["Slope:", LIST[LIST[$SlopePrompt]] ]], [button["Get!", LIST[LIST[$GetSlope]] ]], [button["Add!", LIST[LIST[$AddSlope]] ]], [button["Delete!", LIST[LIST[$DeleteSlope]] ]] ]]; buttonHandle _ AtomButtons.CreateSortedButtonViewer[ggData.controls.panel, nextX, ggData.height]; ggData.controls.slopeHandle _ buttonHandle; GGEvent.StandardSlopes[ggData, LIST[$InitStandardSlopes]]; ggData.height _ ggData.height + entryHeight; }; BuildAngleLine: PROC [ggData: GGData] = { buttonHandle: AtomButtons.SortedButtonHandle; nextX: NAT _ AtomButtons.BuildButtonLine[ggData.controls.panel, 0, ggData.height, ggData, GGUserInput.EventNotify,LIST[ [button["Angle:", LIST[LIST[$AnglePrompt]] ]], [button["Get!", LIST[LIST[$GetAngle]] ]], [button["Add!", LIST[LIST[$AddAngle]] ]], [button["Delete!", LIST[LIST[$DeleteAngle]] ]] ]]; buttonHandle _ AtomButtons.CreateSortedButtonViewer[ggData.controls.panel, nextX, ggData.height]; ggData.controls.angleHandle _ buttonHandle; GGEvent.StandardAngles[ggData, LIST[$InitStandardAngles]]; ggData.height _ ggData.height + entryHeight; }; BuildRadiusLine: PROC [ggData: GGData] = { buttonHandle: AtomButtons.SortedButtonHandle; nextX: NAT _ AtomButtons.BuildButtonLine[ggData.controls.panel, 0, ggData.height, ggData, GGUserInput.EventNotify, LIST[ [button["Radius:", LIST[LIST[$RadiusPrompt]] ]], [button["Get!", LIST[LIST[$GetRadius]] ]], [button["Add!", LIST[LIST[$AddRadius]] ]], [button["Delete!", LIST[LIST[$DeleteRadius]] ]] ]]; buttonHandle _ AtomButtons.CreateSortedButtonViewer[ggData.controls.panel, nextX, ggData.height]; ggData.controls.radiusHandle _ buttonHandle; GGEvent.StandardRadii[ggData, LIST[$InitStandardRadii]]; ggData.controls.radiusCircleCache _ GGCircleCache.Create[]; ggData.height _ ggData.height + entryHeight; }; BuildDistanceLine: PROC [ggData: GGData] = { buttonHandle: AtomButtons.SortedButtonHandle; nextX: NAT _ AtomButtons.BuildButtonLine[ggData.controls.panel, 0, ggData.height, ggData, GGUserInput.EventNotify, LIST[ [button["LineDist:", LIST[LIST[$DistancePrompt]] ]], [button["Get!", LIST[LIST[$GetDistance]] ]], [button["Add!", LIST[LIST[$AddDistance]] ]], [button["Delete!", LIST[LIST[$DeleteDistance]] ]] ]]; buttonHandle _ AtomButtons.CreateSortedButtonViewer[ggData.controls.panel, nextX, ggData.height]; ggData.controls.distanceHandle _ buttonHandle; GGEvent.StandardDistances[ggData, LIST[$InitStandardDistances]]; ggData.height _ ggData.height + entryHeight; }; BuildMeasureLine: PROC [ggData: GGData] = { nextX: NAT _ AtomButtons.BuildButtonLine[ggData.controls.panel, 0, ggData.height, ggData, GGUserInput.EventNotify, LIST[ [button["_", LIST[LIST[$MeasureSlopeFromSelection]], -1, TRUE ]], [button["Slope:", LIST[LIST[$MeasureSlopeHit]], -1, TRUE ]], [text["0.0", SlopeViewInGGData, smallNumberSize]], [button["_", LIST[LIST[$MeasureAngleFromSelection]], -1, TRUE ]], [button["Angle:", LIST[LIST[$MeasureAngleHit]], -1, TRUE ]], [text["0.0", AngleViewInGGData, smallNumberSize]], [button["_", LIST[LIST[$MeasureRadiusFromSelection]], -1, TRUE ]], [button["Radius:", LIST[LIST[$MeasureRadiusHit]], -1, TRUE ]], [text["0.0", DistanceViewInGGData, smallNumberSize]], [button["_", LIST[LIST[$MeasureLineDistFromSelection]], -1, TRUE ]], [button["LineDist:", LIST[LIST[$MeasureLineDistHit]], -1, TRUE ]], [text["0.0", LineDistViewInGGData, smallNumberSize]] ]]; ggData.height _ ggData.height + entryHeight; }; GravityInGGData: AtomButtons.InitTwoStateProc = { ggData: GGData _ NARROW[clientData]; ggData.controls.gravButton _ twoState; }; AlignmentsInGGData: AtomButtons.InitTwoStateProc = { ggData: GGData _ NARROW[clientData]; ggData.controls.alignments _ twoState; }; MidpointsInGGData: AtomButtons.InitTwoStateProc = { ggData: GGData _ NARROW[clientData]; ggData.controls.midpointButton _ twoState; }; HeuristicsInGGData: AtomButtons.InitTwoStateProc = { ggData: GGData _ NARROW[clientData]; ggData.controls.heuristicsButton _ twoState; }; GravityExtentInGGData: GraphicsButton.UpdateGraphicsButtonProc = { ggData: GGData _ NARROW[clientData]; ggData.controls.gravityExtentButton _ stateInfo; }; GravityExtentRepaint: PROC [dc: Imager.Context, clientData: REF ANY, buttonData: REF ANY, button: Viewer] = { caretPoint: Point; ged: GravityExtentData _ NARROW[buttonData]; extent: REAL _ ged.extent; Imager.TranslateT[dc, [0, button.wh/2.0]]; caretPoint _ [extent, 0.0]; GGShapes.DrawCaret[dc, caretPoint, [0,-1], 1.0]; }; SlopeViewInGGData: AtomButtons.UpdateProc = { ggData: GGData _ NARROW[clientData]; ggData.controls.slopeView _ button; }; AngleViewInGGData: AtomButtons.UpdateProc = { ggData: GGData _ NARROW[clientData]; ggData.controls.angleView _ button; }; DistanceViewInGGData: AtomButtons.UpdateProc = { ggData: GGData _ NARROW[clientData]; ggData.controls.radiusView _ button; }; LineDistViewInGGData: AtomButtons.UpdateProc = { ggData: GGData _ NARROW[clientData]; ggData.controls.lineDistView _ button; }; 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]]; }; gRouter: MsgRouter; -- the router used by routines that are too deep in Gargoyle to know what viewer they are working on behalf of. Sends output to the Gargoyle typescript and the Cedar Message Window. Init: PROC = { popUpFont _ ImagerFont.Find["xerox/tiogafonts/helvetica10I", substituteQuietly]; gRouter _ Feedback.CreateRouter[]; [] _ Feedback.RegisterRouter[gRouter, $Gargoyle]; FeedbackOps.SetMultiMessageWindow[gRouter, TRUE, LIST[$Error, $Complaint]]; -- blink FeedbackOps.SetMultiMessageWindow[gRouter, FALSE, LIST[$DuringMouse, $Feedback, $Warning, $Confirm, $Show, $Statistics]]; FeedbackOps.SetMultiTypescript[gRouter, $Gargoyle, LIST[$Error, $Warning, $Show, $Typescript, $Complaint, $Statistics]]; }; Init[]; END. ξGGMenuImplA.mesa Contents: Routines to build the Gargoyle control panel. Copyright Σ 1985, 1987, 1988, 1989 by Xerox Corporation. All rights reserved. Created by Pier on June 23, 1987 when GGMenuImpl overflowed Last edited by Pier on October 17, 1990 4:10 pm PDT Bier, June 12, 1991 11:21 am PDT Eisenman, July 14, 1987 6:34:23 pm PDT Doug Wyatt, December 18, 1989 2:04:01 pm PST nextX: INTEGER; GGMenu.BuildFileMenuLine[ggData]; nextX _ BuildMasterMenuLineA[ggData]; GGMenu.BuildMasterMenuLineB[ggData, nextX]; GGMenu.BuildStyleMenuLine[ggData]; If you update this routine, also update Init below. Currently, we know of these message classes used in Gargoyle: (BT) Complaint: Gargoyle informs the user of a user-initiated problem (BT) Error: internal error. One of Gargoyle's invariants has been broken (L) Confirm: Gargoyle asks the user to confirm a guarded operation (L) DuringMouse: feedback generated each time the mouse is moved. (L) Feedback: an acknowledgement that Gargoyle has done what you asked (LT) Show: info that was explicitly requested (e.g. what color is this?) (LT) Statistics: Gargoyle prints user requested statistics (LT) Warning: Problems during a batch operation, like MergeInterpress (T) Typescript: Output that only seems appropriate for the typescript, period. (L) = send to label. (B) = send to label and blink. (T) = send to typescript There are several places to look in for the Gargoyle control panel: (1) The file specified in Gargoyle.ControlPanelFile: in the user profile. (2) The file "[PCedar]GargoyleControlPanel.tioga" (useful during development) (3) The file "[CedarCommon]GargoyleControlPanel.tioga" (4) The file "[PCedar]GargoyleControlPanel.tioga" Use whichever is found first. Return NIL if none are found. If that failed, try this: If that failed, try this: If that failed, try this: PROC [buttonInfo: ButtonInfo, events: LIST OF REF ANY, targetViewer: Viewer, applicationData: REF] RETURNS [result: REF _ NIL]; PROC [buttonInfo: ButtonInfo, events: LIST OF REF ANY, targetViewer: Viewer, applicationData: REF] RETURNS [result: REF _ NIL]; [label["Measure- "]], Style Line: Gravity Line: Distance Line: If you update the router, remember to also correct it in FeedbackLineInGGData above. Κθ˜Icodešœ™™7KšœN™NKšœ;™;Kšœ3™3Kšœ ™ Kšœ#Οk™&K™,—K˜š ˜ Jšœ’˜’K˜—šΟn œœ˜Jšœτ˜ϋKšœ*˜6—˜Kšœ œœ#˜;Kšœ œ˜*Kšœœ˜'Kšœœœ˜3Kšœœ)˜CKšœœ˜!Kšœ œœΟc˜FKšœ œœ ˜Kšœœ˜$K˜Kšœœœ˜KšœŸ˜5Kšœ œŸ˜8Kšœ œŸ+˜FKšœ œŸ!˜˜>K˜—K˜Kšž˜K˜—šžœœœ  œ˜™>K™œ˜Cšœ œœ˜š œœœœœœ˜=Kšœœ˜$Kšœ œœœ ˜DJš œ œœœœ˜:Jšœ˜—K˜—K™Kšœœ>˜HKšœ œœœ ˜DJš œ œœœœ˜:K™KšœœF˜PKšœ œœœ ˜DJš œ œœœœ˜:K™KšœœA˜KKšœ œœœ ˜DJš œ œœœœ˜:K˜K˜—šžœœ˜.Kšœœ˜J˜ Jšœœ˜Jšœœ˜Jšœ œ˜$Jšœ œœΫ˜ρšœ˜Jšœn˜nJšœ ˜ J˜—šœ#˜#Kšœ0˜0Kšœ˜Kšœ ˜ Kšœ œ œ˜!—Kšœ8˜8Jšœ2˜2Kšœ'˜'KšœQ œe˜ΎKšœQ œm˜ΞJšœ7œ˜JKšœ2˜2K˜K˜—šžœ ˜2Kšœ"œœœœ)œœ  œ™Kš œ œœœœŸM˜~Kšœ3˜3K˜K˜—šžœ ˜:Kšœ"œœœœ)œœ  œ™Kš œ œœœœŸM˜~Kšœ;˜;K˜K˜—šžœœ˜+Kšœœ˜Kšœ"˜"šœh˜hKšœ˜Kšœ$˜$Kšœ,˜,Kšœœ œ˜:Kšœ œ ˜1Kšœ˜—Kšœ-˜-K˜Kšœ.˜.šœ$˜$Kšœ[˜[šœ˜Kšœ   œœœ˜4—Kšœ˜K˜—šœ+˜+Kšœ!˜!Kšœ˜Kšœ˜KšœŸ,˜3Kšœ˜Kšœ˜šœ œ˜Kšœœ$˜)Kšœœ'˜,Kšœœ#˜(—Kšœ$˜$Kšœ"˜"Kšœ œK˜ZKšœ!˜!Kšœ˜K˜—šœ$˜$Kšœ[˜[šœ˜Kšœœœ˜CKšœœœ˜GKšœœP˜fKšœœœ˜OKšœ˜—Kšœ ˜ K˜K˜—Kšœ,˜,K˜K˜—šžœœ˜)Kšœ-˜-šœœhœ˜wKšœœœ˜.Kšœœœ˜)Kšœœœ˜)Kšœœœ˜.K˜—Kšœa˜aKšœ+˜+Kšœœ˜:Kšœ,˜,˜K˜——šžœœ˜)Kšœ-˜-šœœhœ˜wKšœœœ˜.Kšœœœ˜)Kšœœœ˜)Kšœœœ˜.K˜—Kšœa˜aKšœ+˜+Kšœœ˜:Kšœ,˜,K˜K˜—šžœœ˜*Kšœ-˜-šœœiœ˜xKšœœœ˜0Kšœœœ˜*Kšœœœ˜*Kšœœœ˜/K˜—Kšœa˜aKšœ,˜,Kšœœ˜8Kšœ;˜;Kšœ,˜,K˜K˜—šžœœ˜,Kšœ-˜-šœœiœ˜xKšœœœ˜4Kšœœœ˜,Kšœœœ˜,Kšœœœ˜1K˜—Kšœa˜aKšœ.˜.Kšœ"œ˜@Kšœ,˜,K˜K˜—šžœœ˜+šœœiœ˜xKšœ™Kšœ œœ#œ˜AKšœœœœ˜Kšœ5˜5Kšœ œœ&œ˜DKšœœœœ˜BKšœ4˜4K˜—Kšœ,˜,K˜—K˜K™ K™™ K™—šžœ"˜1Kšœœ ˜$Kšœ&˜&K˜—šžœ"˜4Kšœœ ˜$Kšœ&˜&K˜—šžœ"˜3Kšœœ ˜$Kšœ*˜*K˜—šΠbn žœ"˜4Kšœœ ˜$Kšœ,˜,K˜—šžœ-˜BKšœœ ˜$Kšœ0˜0K˜K˜—š žœœ"œœœœ˜mK˜Kšœœ ˜,Kšœœ˜Kšœ*˜*Kšœ˜Kšœ0˜0K˜—K™™K™—šžœ˜-Kšœœ ˜$Kšœ#˜#K˜K˜—šžœ˜-Kšœœ ˜$Kšœ#˜#K˜K˜—šžœ˜0Kšœœ ˜$Kšœ$˜$K˜K˜—šžœ˜0Kšœœ ˜$Kšœ&˜&K˜—K˜šžœœ œœœœœ œœœ˜ŒKšœ#˜)K˜—K˜KšœŸΆ˜Κšžœœ˜K•StartOfExpansionO[name: ROPE, substitution: ImagerFont.Substitution _ substituteWithWarning]šœP˜PK™TKšœ"˜"Kšœ1˜1Kšœ+œœŸ˜TKšœ+œœC˜yKšœ3œA˜xK˜—K˜Kšœ˜K˜Kšœ˜J˜—…—ZrvH