File: SVEditToolMenusImplA.mesa
Last edited by Bier on August 1, 1985 5:09:18 pm PDT
Copyright © 1984 by Xerox Corporation. All rights reserved.
Contents: Procedures which build sections of the EditTool
DIRECTORY
Buttons,
Containers,
Rope,
Rules,
ViewerTools,
SVEditToolMenus,
SVEditUser,
SVEditUserB,
SVInterfaceTypes;
SVEditToolMenusImplA:
PROGRAM
IMPORTS Buttons, Containers, Rules, SVEditUser, SVEditUserB, ViewerTools
EXPORTS SVEditToolMenus =
BEGIN
EditToolData: TYPE = SVInterfaceTypes.EditToolData;
declare the standard distances between menu lines.
entryHeight: CARDINAL = SVEditToolMenus.entryHeight;
entryVSpace: CARDINAL = SVEditToolMenus.entryVSpace;
entryHSpace: CARDINAL = SVEditToolMenus.entryHSpace;
column0: CARDINAL = SVEditToolMenus.column0;
column1: CARDINAL = SVEditToolMenus.column1;
column2: CARDINAL = SVEditToolMenus.column2;
column3: CARDINAL = SVEditToolMenus.column3;
nameSize: CARDINAL = 130;
numberSize: CARDINAL = 80;
numberSize3: CARDINAL = 160;
BuildCompositeSection:
PUBLIC
PROC [editToolData: EditToolData] = {
This section implements a set of buttons, text windows, and options listers in this format:
ADDCOMPOSITE!
addComp: Buttons.Button;
addComp ← Buttons.Create[
info: [name: "Add Composite!", wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.AddComposite,
clientData: editToolData
];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
};
BuildHalfSpaceSection:
PUBLIC
PROC [editToolData: EditToolData] = {
This section implements a set of buttons, text windows, and options listers in this format:
AddHalfSpace!
addHalfSpace, addSteiner, addExtra1, addExtra2, addExtra3, addExtra4: Buttons.Button;
addHalfSpace ← Buttons.Create[
info: [name: "Add HalfSpace!", wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.AddHalfSpace,
clientData: editToolData
];
addSteiner ← Buttons.Create[
info: [name: "Add Steiner!",
wx: addHalfSpace.wx + addHalfSpace.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.AddSteiner,
clientData: editToolData
];
addExtra1 ← Buttons.Create[
info: [name: "Add1!",
wx: addSteiner.wx + addSteiner.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.AddExtra1,
clientData: editToolData
];
addExtra2 ← Buttons.Create[
info: [name: "Add2!",
wx: addExtra1.wx + addExtra1.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.AddExtra2,
clientData: editToolData
];
addExtra3 ← Buttons.Create[
info: [name: "Add3!",
wx: addExtra2.wx + addExtra2.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.AddExtra3,
clientData: editToolData
];
addExtra4 ← Buttons.Create[
info: [name: "Add4!",
wx: addExtra3.wx + addExtra3.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.AddExtra4,
clientData: editToolData
];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
}; -- end of BuildHalfSpaceSection
BuildSphereSection:
PUBLIC
PROC [editToolData: EditToolData] = {
This section implements a set of buttons, text windows, and options listers in this format:
ADDSPHERE RADIUS: <radius>
addSphere, radiusPrompt: Buttons.Button;
initialRadiusRope: Rope.ROPE ← "100";
addSphere ← Buttons.Create[
info: [name: "Add Sphere!", wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.AddSphere,
clientData: editToolData
];
radiusPrompt ← Buttons.Create[
info: [name: "radius:",
wx: addSphere.wx + column2,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.SphereRadiusPrompt,
clientData: editToolData
];
editToolData.sphereSection.radius ← ViewerTools.MakeNewTextViewer[[
parent: editToolData.outer,
wx: radiusPrompt.wx + radiusPrompt.ww + entryHSpace,
wy: editToolData.height,
ww: numberSize,
wh: entryHeight,
data: initialRadiusRope,-- "100"
scrollable: FALSE, border: FALSE]];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
}; -- end of BuildSphereSection
BuildBlockSection:
PUBLIC
PROC [editToolData: EditToolData] = {
This section implements a set of buttons, text windows, and options listers in this format:
ADDBLOCK x, y, z: <x, y, z>
addBlock, xyzPrompt: Buttons.Button;
initialXYZRope: Rope.ROPE ← "360, 40, 160";
addBlock ← Buttons.Create[
info: [name: "Add Block!", wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.AddBlock,
clientData: editToolData
];
xyzPrompt ← Buttons.Create[
info: [name: "x, y, z:",
wx: addBlock.wx + column2,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.BlockXYZPrompt,
clientData: editToolData
];
editToolData.blockSection.xyz ← ViewerTools.MakeNewTextViewer[[
parent: editToolData.outer,
wx: xyzPrompt.wx + xyzPrompt.ww + entryHSpace,
wy: editToolData.height,
ww: numberSize3,
wh: entryHeight,
data: initialXYZRope,
scrollable: FALSE, border: FALSE]];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
}; -- end of BuildBlockSection
BuildCylinderSection:
PUBLIC
PROC [editToolData: EditToolData] = {
This section implements a set of buttons, text windows, and options listers in this format:
ADDCYLINDER RADIUS: <radius>HEIGHT: <height>
addCyl, radiusPrompt, heightPrompt: Buttons.Button;
initialRadiusRope: Rope.ROPE ← "100";
initialHeightRope: Rope.ROPE ← "200";
addCyl ← Buttons.Create[
info: [name: "Add Cylinder!", wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.AddCyl,
clientData: editToolData
];
radiusPrompt ← Buttons.Create[
info: [name: "radius:",
wx: addCyl.wx + column2,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.CylinderRadiusPrompt,
clientData: editToolData
];
editToolData.cylinderSection.radius ← ViewerTools.MakeNewTextViewer[[
parent: editToolData.outer,
wx: radiusPrompt.wx + radiusPrompt.ww + entryHSpace,
wy: editToolData.height,
ww: numberSize,
wh: entryHeight,
data: initialRadiusRope,-- "100"
scrollable: FALSE, border: FALSE]];
heightPrompt ← Buttons.Create[
info: [name: "height:",
wx: addCyl.wx + column3,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.CylinderHeightPrompt,
clientData: editToolData
];
editToolData.cylinderSection.height ← ViewerTools.MakeNewTextViewer[[
parent: editToolData.outer,
wx: heightPrompt.wx + heightPrompt.ww + entryHSpace,
wy: editToolData.height,
ww: numberSize,
wh: entryHeight,
data: initialHeightRope,-- "100"
scrollable: FALSE, border: FALSE]];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
}; -- end of BuildCylinderSection
BuildConeSection:
PUBLIC
PROC [editToolData: EditToolData] = {
This section implements a set of buttons, text windows, and options listers in this format:
ADDCONE RADIUS: <radius>HEIGHT: <height>
addCone, radiusPrompt, heightPrompt: Buttons.Button;
initialRadiusRope: Rope.ROPE ← "100";
initialHeightRope: Rope.ROPE ← "200";
addCone ← Buttons.Create[
info: [name: "Add Cone!", wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.AddCone,
clientData: editToolData
];
radiusPrompt ← Buttons.Create[
info: [name: "radius:",
wx: addCone.wx + column2,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.ConeRadiusPrompt,
clientData: editToolData
];
editToolData.coneSection.radius ← ViewerTools.MakeNewTextViewer[[
parent: editToolData.outer,
wx: radiusPrompt.wx + radiusPrompt.ww + entryHSpace,
wy: editToolData.height,
ww: numberSize,
wh: entryHeight,
data: initialRadiusRope,-- "100"
scrollable: FALSE, border: FALSE]];
heightPrompt ← Buttons.Create[
info: [name: "height:",
wx: addCone.wx + column3,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.ConeHeightPrompt,
clientData: editToolData
];
editToolData.coneSection.height ← ViewerTools.MakeNewTextViewer[[
parent: editToolData.outer,
wx: heightPrompt.wx + heightPrompt.ww + entryHSpace,
wy: editToolData.height,
ww: numberSize,
wh: entryHeight,
data: initialHeightRope,-- "100"
scrollable: FALSE, border: FALSE]];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
}; -- end of BuildConeSection
BuildTorusSection:
PUBLIC PROC [editToolData: EditToolData] = {
This section implements a set of buttons, text windows, and options listers in this format:
ADDTorusbig radius: <real> section radius: <real>
addTorus, bigRadiusPrompt, sectionPrompt: Buttons.Button;
addTorus ← Buttons.Create[
info: [name: "Add Torus!", wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.AddTorus,
clientData: editToolData
];
bigRadiusPrompt ← Buttons.Create[
info: [name: "radius:",
wx: addTorus.wx + column2,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.BigRadiusPrompt,
clientData: editToolData
];
editToolData.torusSection.bigRadius ← ViewerTools.MakeNewTextViewer[[
parent: editToolData.outer,
wx: bigRadiusPrompt.wx + bigRadiusPrompt.ww + entryHSpace,
wy: editToolData.height,
ww: numberSize,
wh: entryHeight,
data: "100",
scrollable: FALSE, border: FALSE]];
sectionPrompt ← Buttons.Create[
info: [name: "section:",
wx: addTorus.wx + column3,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.SectionRadiusPrompt,
clientData: editToolData
];
editToolData.torusSection.sectionRadius ← ViewerTools.MakeNewTextViewer[[
parent: editToolData.outer,
wx: sectionPrompt.wx + sectionPrompt.ww + entryHSpace,
wy: editToolData.height,
ww: numberSize,
wh: entryHeight,
data: "50",
scrollable: FALSE, border: FALSE]];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
}; -- end of BuildTorusSection
BuildLinearSweepSection:
PUBLIC
PROC [editToolData: EditToolData] = {
This section implements a set of buttons, text windows, and options listers in this format:
ADDLINEAR depth: <depth>
addLinear, depthPrompt: Buttons.Button;
addLinear ← Buttons.Create[
info: [name: "Add Linear!", wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.AddLinear,
clientData: editToolData
];
depthPrompt ← Buttons.Create[
info: [name: "depth:",
wx: addLinear.wx + column2,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.LinDepthPrompt,
clientData: editToolData
];
editToolData.linSection.depth ← ViewerTools.MakeNewTextViewer[[
parent: editToolData.outer,
wx: depthPrompt.wx + depthPrompt.ww + entryHSpace,
wy: editToolData.height,
ww: numberSize,
wh: entryHeight,
data: "100",
scrollable: FALSE, border: FALSE]];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
}; -- end of BuildLinearSweepSection
BuildRevoluteSweepSection:
PUBLIC
PROC [editToolData: EditToolData] = {
This section implements a set of buttons, text windows, and options listers in this format:
ADDREVOLUTE
addRevo: Buttons.Button;
addRevo ← Buttons.Create[
info: [name: "Add Revolute!", wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.AddRevo,
clientData: editToolData
];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
}; -- end of BuildRevoluteSweepSection
BuildCopySection:
PUBLIC
PROC [editToolData: EditToolData] = {
This section implements a set of buttons, text windows, and options listers in this format:
COPY! Rename! NewParent!
copyButton, renameButton, newParentButton: Buttons.Button;
copyButton ← Buttons.Create[
info: [name: "Copy!", wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.Copy,
clientData: editToolData
];
renameButton ← Buttons.Create[
info: [
name: "Rename!",
wx: copyButton.wx + copyButton.ww + entryHSpace,
wy: editToolData.height,
wh: entryHeight,
parent: editToolData.outer, border: FALSE
],
proc: SVEditUser.Rename,
clientData: editToolData
];
newParentButton ← Buttons.Create[
info: [name: "NewParent!",
wx: renameButton.wx + renameButton.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.NewParent,
clientData: editToolData
];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
}; -- end of BuildCopySection
BuildListingSection:
PUBLIC
PROC [editToolData: EditToolData] = {
This section implements a set of buttons in this format:
ListScenes! ListAssemblies! ListCS! ListLights! ListMOs! ListViews!
scenesButton, assembliesButton, coordsysButton, lightsButton, moButton, viewersButton, camerasButton: Buttons.Button;
scenesButton ← Buttons.Create[
info: [name: "ListScenes!", wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUserB.ListScenes,
clientData: editToolData
];
assembliesButton ← Buttons.Create[
info: [name: "ListAssemblies!",
wx: scenesButton.wx + scenesButton.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUserB.ListAssemblies,
clientData: editToolData
];
coordsysButton ← Buttons.Create[
info: [name: "ListCoordSystems!",
wx: assembliesButton.wx + assembliesButton.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUserB.ListCoordSystems,
clientData: editToolData
];
lightsButton ← Buttons.Create[
info: [name: "ListLights!",
wx: coordsysButton.wx + coordsysButton.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUserB.ListLights,
clientData: editToolData
];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
moButton ← Buttons.Create[
info: [name: "ListMasterObjects!",
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUserB.ListMasterObjects,
clientData: editToolData
];
viewersButton ← Buttons.Create[
info: [name: "ListViews!",
wx: moButton.wx + moButton.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUserB.ListViewers,
clientData: editToolData
];
camerasButton ← Buttons.Create[
info: [name: "ListCameras!",
wx: viewersButton.wx + viewersButton.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUserB.ListCameras,
clientData: editToolData
];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
}; -- end of BuildListingSection
AddARule:
PUBLIC
PROC [editToolData: EditToolData] = {
rule: Rules.Rule;
rule ← Rules.Create[[
parent: editToolData.outer,
wy: editToolData.height,
ww: editToolData.outer.cw,
wh: 2
]];
Containers.ChildXBound[editToolData.outer, rule];
editToolData.height ← editToolData.height + rule.wh + entryVSpace;
}; -- end of AddARule
END.