GGMenuImplB.mesa
Copyright Ó 1985, 1987, 1989 by Xerox Corporation. All rights reserved.
Last edited by Pier on June 23, 1987
Created by Pier, June 23, 1987, when GGMenuImpl overflowed
Pier, February 26, 1991 10:45 am PST
Bier, June 4, 1991 4:41 pm PDT
Doug Wyatt, December 18, 1989 2:09:01 pm PST
DIRECTORY
FeedbackTypes, GGBasicTypes, GGControlPanelTypes, GGInterfaceTypes, GGMenu, GGModelTypes, GGScene, GGSceneType, GGSegmentTypes, Imager, Menus, ViewerClasses;
GGMenuImplB: CEDAR PROGRAM
IMPORTS
EXPORTS GGMenu, GGInterfaceTypes, GGModelTypes = BEGIN
ControlsObj: PUBLIC TYPE = GGControlPanelTypes.ControlsObj; -- export to GGInterfaceTypes
MsgRouter: TYPE = FeedbackTypes.MsgRouter;
GGData: TYPE = GGInterfaceTypes.GGData;
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;
<<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;>>
<<List: PROC [ref1, ref2, ref3: REF ANYNIL] RETURNS [LIST OF REF ANY] = GGCoreOps.List;>>
BuildMasterMenuLineB: PUBLIC PROC [ggData: GGData, nextX: INTEGER] = {};
<<BuildMasterMenuLineB: PUBLIC PROC [ggData: GGData, nextX: INTEGER] = {
noOpChoice: AtomButtons.PopUpChoice ← [List [$NoOp], "", "no-op" ];
doc: Rope.ROPE ← Rope.Concat[GGUIUtility.GGHomeDirectory[], "GargoyleDoc.tioga"];
disableDecoding: BOOLNOT GGState.GetQuickClickMode[];
textMenuDoc: PopUpButtons.Help ← PopUpButtons.HelpFromDoc[doc, LIST["Text Menu"]];
textMenu: AtomButtons.ButtonLineEntry ←
[popUpButton["Text", PUChoiceList [
Choice[List [$AddText], "AddText [T]", "Add the current Tioga selection to the scene at the Caret"],
Choice[List [$EditTiogaFill], "EditTiogaFill [G]", "Create a Tioga viewer containing a copy of the formatted nodes in the selected boxes"],
Choice[List [$TiogaFillFromSelection], "FillBoxesFromSelection [GT]", "Fill the selected Gargoyle box objects with a copy of the formatted nodes in the Tioga selection"],
Choice[List [$ScreenStyleKind], "StyleKindScreen [G]", "Set all selected boxes to screen style kind"],
Choice[List [$ShowStyleKind], "ShowStyleKind [G]", "Show the style kind of the currently selected box"],
Choice[List [$PrintStyleKind], "StyleKindPrint [G]", "Set all selected boxes to print style kind"],
Choice[List [$SetDropShadow, NEW[REAL ← -1.0], NEW[REAL ← -1.0]], "DropShadowOn 0.10 [G]", "Add a drop shadow to each selected text object down and left by 0.10 of the text size"],
Choice[List [$PrintDropShadow], "ShowDropShadow [G]", "Print drop shadow for the selected text object"],
Choice[List [$DropShadowOff], "DropShadowOff [G]", "Remove drop shadows from the selected text objects"],
Choice[List [$DropShadowFromSelection], "DropShadowFromSelection [GT]", "Add a drop shadow down and left to the selected text objects by the fraction of the text size in the Tioga selection"],
Choice[List [$ShowDefaultTextLooks], "ShowDefaultLooks", "Print default text color and drop shadow"],
Choice[List [$SetDefaultTextLooks], "MakeDefaultLooks [G]", "Set default text color and drop shadow from selected text"],
Choice[List [$AmplifySpaceFromSelection], "AmplifySpaceFromSelection [GT]", "Set space amplification of the selected text objects from the number in the Tioga selection"],
Choice[List [$PrintAmplifySpace], "ShowAmplifySpace [G]", "Print space amplification value for the selected text object"],
Choice[List [$SetAmplifySpace, NEW[REAL ← 1.0]], "ResetAmplifySpace [G]", "Set the space amplification value to 1.0 for the selected text objects"],
Choice[List [$SetNewlineFactor], "SetNewlineFactor [GT]", "Set all selected text string's line spacing to the factor in the Tioga selection (e.g. 1.2 for 20% line spacing)"],
Choice[List [$ShowNewlineFactor], "ShowNewlineFactor [G]", "Show the line spacing factor of the currently selected text (e.g. 1.2 => 20% line spacing)"],
Choice[List [$ConvertTextToSplines], "ConvertTextToSplines [G]", "From each selected text character, create an Outline object of the same shape"]
],
-1, FALSE, popUpFont, textMenuDoc, disableDecoding]];
fontsMenuDoc: PopUpButtons.Help ← PopUpButtons.HelpFromDoc[doc, LIST["Fonts Menu"]];
fontsMenu: AtomButtons.ButtonLineEntry ←
[popUpButton["Fonts", PUChoiceList [
Choice[List [$SetPressFont], "SetPressFont [GT]", "Set selected text objects to the Press font described in the Tioga selection (e.g. Helvetica-BI 22)"],
Choice[List [$ShowFontValues], "ShowFont [G]", "Print the font data for the selected text object"],
Choice[List [$SetPrintFont], "SetXCFont [GT]", "Set selected text objects to the XC font described in the Tioga selection (e.g. Cream-BI 22)"],
Choice[List [$SetFontDetailed], "SetDetailedFont [GT]", "Set selected text objects to the detailed font description in the Tioga selection (e.g. xerox/xc1-1-2/helvetica [r1: 50.0 s: [15.0 15.0] r2: 20.0])"],
Choice[List [$ShowDefaultFontValues], "ShowDefaultFont", "Print the current default font data"],
Choice[List [$SetDefaultFontValues], "MakeDefaultFont [G]", "Set the current default font to the font of the selected text object"],
Choice[List [$SetFontLiteral], "SetLiteralFont [GT]", "Set selected text objects to the literal font description in the Tioga selection (e.g. xerox/tiogafonts/tioga10 [r1: 0.0 s: [10.0 10.0] r2: 0.0] 10.0 1.0)"],
Choice[List [$ShowFontValuesLiteral], "ShowLiteralFont [G]", "Print the literal font data for the selected text object"],
Choice[List [$SetScreenFont], "SetScreenFont [GT]", "Set selected text objects to the screen font described in the Tioga selection (e.g. Tioga10-BI 10)"],
Choice[List [$CopyAll], "CopyFontAndTransform [G]", "Copy the font family, face, and transform from the last selected text object to all other selected text objects"],
noOpChoice,
Choice[List [$CopyFont], "CopyFamilyAndFace [G]", "Copy the font family and face from the last selected text object to all other selected text objects"],
Choice[List [$MatchAll], "MatchLiteral [G]", "Select all text objects with fonts exactly matching the currently selected text object"],
Choice[List [$MatchSelectedName], "MatchName [T]", "Select all text objects whose user font name contains the name in the current Tioga selection"],
Choice[List [$MatchSelectedNameLiteral], "MatchNameLiteral [T]", "Select all text objects whose literal font name contains the name in the current Tioga selection"]
],
-1, FALSE, popUpFont, fontsMenuDoc, disableDecoding]];
groupsMenuDoc: PopUpButtons.Help ← PopUpButtons.HelpFromDoc[doc, LIST["Groups Menu"]];
groupsMenu: AtomButtons.ButtonLineEntry ←
[popUpButton["Groups", PUChoiceList [
Choice[List [$Cluster], "Cluster (^c) [G]", "Turn the selected objects into a single object, for purposes of selection"],
Choice[List [$ClusterAndFreeze], "ClusterAndFreeze [G]", "Turn the selected objects into a single object and prevent the parts from being moved individually"],
Choice[List [$UnCluster], "UnCluster (^C) [G]", "Separate the selected cluster into its component objects"],
Choice[List [$FreezeCluster], "FreezeCluster [G]", "Prevent the parts of the selected cluster(s) from being moved individually"],
Choice[List [$ShowFrozen], "ShowFrozen [G]", "Prints whether the selected cluster is frozen or thawed"],
Choice[List [$ThawCluster], "ThawCluster [G]", "Allows the parts of the selected cluster(s) to be moved individually"],
Choice[List [$AddToGroup], "AddToGroup [GT]", "Add selected objects to the group named in the Tioga selection"],
Choice[List [$PrintGroupsOfSelected], "ShowGroupsOfSelected [G]", "Print all the group names to which any selected object belongs"],
Choice[List [$RemoveFromGroup], "RemoveFromGroup [GT]", "Remove selected objects from the group named in the Tioga selection"],
Choice[List [$SelectGroup], "MatchGroup [T]", "Select all members of the group named in the Tioga selection"],
Choice[List [$PrintAllGroups], "ShowAllGroups", "Print all the group names in the entire scene"],
noOpChoice
],
-1, FALSE, popUpFont, groupsMenuDoc, disableDecoding]];
debugMenuDoc: PopUpButtons.Help ← PopUpButtons.HelpFromDoc[doc, LIST["Debug Menu"]];
debugMenu: AtomButtons.ButtonLineEntry ←
[popUpButton["Debug", PUChoiceList [
Choice[List [$ResetStatistics], "ResetStatistics", "Reset statistics for all timed operations"],
Choice[List [$Statistics], "ShowStatistics", "Print on the typescript execution times for all timed operations that have been active since the last reset"],
Choice[List [$PrintSelectedStatistic], "ShowSelectedStatistic", "Print on the typescript execution times for the timed operation named in the Tioga selection"],
Choice[List [$TestGravity], "TestGravity", "Draw a gravity scatter-plot, where number of test points is the Tioga selection"],
Choice[List [$CauseAnError], "CauseASignal", "Pop up a SIGNAL window to examine state"],
Choice[List [$ToIPTestGravity], "ToIPTestGravity", "Draw a scatter-plot of the current gravity function onto the interpress master named in the Tioga selection"],
Choice[List [$DrawBackgroundBox], "DrawBackgroundBox", "Draw a single box around all of the parts of selected objects that would be on the background plane during a drag"],
Choice[List [$DrawOverlayBox], "DrawOverlayBox", "Draw a single box around all of the parts of selected objects that would be stationary on the overlay plane during a drag"],
Choice[List [$DrawRubberBox], "DrawRubberBox", "Draw a single box around all of the parts of selected objects that would rubberband during a drag"],
Choice[List [$DrawDragBox], "DrawDragBox", "Draw a single box around all of the parts of selected objects that would move rigidly during a drag"],
Choice[List [$DrawOutlineBoxes], "DrawOutlineBoxes", "Draw loose-fitting bounding boxes around all selected Outlines"],
Choice[List [$SlackLog], "SlackLog", "Currently broken"],
Choice[List [$DescribeCaretObject], "DescribeCaretObject", "Describe the object that the caret is currently attracted to"]
Choice[List [$UserTraceOn], "UserTraceOn", "Start printing the procedure names Gargoyle is using to execute commands"],
Choice[List [$UserTraceOff], "UserTraceOff", "Stop printing module names"],
noOpChoice,
Choice[List [$PrintAllInput], "InputTraceOn", "Start printing the input tokens Gargoyle is receiving"], << KAP >>
Choice[List [$ResetAllInput], "InputTraceOff", "Stop printing the input tokens Gargoyle is receiving"],
Choice[List [$SceneState], "SceneState", "Show scene state"],
Choice[List [$SceneBagState], "SceneBagState", "Show SceneBag state"],
Choice[List [$DrawPolylines], "DrawPolylines", "Draw Polyline approximations to all closed trajectories"],
Choice[List [$DrawTightBoxes], "DrawTightBoxes", "Draw tight-fitting bounding boxes around all selected slices"],
Choice[List [$DrawBoundBoxes], "DrawBoundingBoxes", "Draw loose-fitting bounding boxes around all slices in scene"],
Choice[List [$DrawSelectionBox], "DrawSelectionBox", "Draw a single box around all of the selected objects"],
Choice[List [$FSMInfo], "FSMInfo", "Describe the current state of the mouse action finite state machine (as a hierarchical name)"],
],
-1, FALSE, popUpFont, debugMenuDoc, disableDecoding]];
debugMenu2: AtomButtons.ButtonLineEntry ←
[popUpButton["Debug2", PUChoiceList [
],
-1, FALSE, popUpFont, debugMenuDoc, disableDecoding]];
edgeFitMenuDoc: PopUpButtons.Help ← PopUpButtons.HelpFromDoc[doc, LIST["EdgeFit Menu"]];
edgeFitMenu: AtomButtons.ButtonLineEntry ←
[popUpButton["EdgeFit", PUChoiceList [
Choice[List [$FitCurves], "FitCurves [G]", "Fit cubic splines to regions within bounding box of Gargoyle selection"],
Choice[List [$ShowFitParameters], "ShowParameters", "Show parameters for edge fitting"],
Choice[List [$FitLines], "FitLines [G]", "Fit straight lines to regions within bounding box of Gargoyle selection"],
Choice[List [$FitTolerance], "SetTolerance [T]", "Set fit tolerance (in pixels) to value in Tioga selection"],
Choice[List [$SetFitParameters], "SetParameters [T]", "Set all fit parameters from Tioga selection"],
Choice[List [$SetFitPolyPenalty], "SetPolyPenalty [T]", "Set Polygon fit control parameter. Bigger is fewer vertices"],
Choice[List [$SetFitAngle], "SetCornerAngle [T]", "Set minimum turning angle (in degrees) to indicate corner. Smaller makes more corners"],
Choice[List [$SetFitThreshold], "SetThreshold [T]", "Set edge finding threshold between 0.0 (black) and 1.0 (white)"],
noOpChoice,
Choice[List [$SetFitIterations], "SetIterations [T]", "Set maximum number of iterations. Longer is better but slower"],
Choice[List [$SetFitMinDistance], "SetMinDistance [T]", "Set minimum distance between samples"]
],
-1, FALSE, popUpFont, edgeFitMenuDoc, disableDecoding]];
[] ← AtomButtons.BuildButtonLine[ggData.controls.panel, nextX+entryHSpace, ggData.height, ggData, GGUserInput.EventNotify, LIST[
textMenu, fontsMenu, groupsMenu, edgeFitMenu, debugMenu,
[twoState["Palette", LIST[$TogglePalette], FALSE, PaletteInGGData]]
]];
ggData.height ← ggData.height + entryHeight;
};
>>
<<PaletteInGGData: AtomButtons.InitTwoStateProc = {
ggData: GGData ← NARROW[clientData];
ggData.controls.paletteButton ← twoState;
};
>>
<<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", substituteQuietly];
};
Init[];>>
END.