$createOptions => {
op: Tool.Operation = NARROW[param];
tool: Tool.DFTool = op.tool;
parameters: Tool.Parameters = tool.parameters;
prev: ViewerClasses.Viewer;
x: INTEGER;
data: REF BringOverData = NEW[BringOverData ← []];
initialChoice: Tool.Choice;
op.options ← data;
op.optionsContainer ← Containers.Create[info: [
wx: 0, wy: Tool.offScreenY,
ww: 9999, -- arbitrary; Containers.ChildXBound overrides
wh: 0,
parent: tool.inner,
border: FALSE,
scrollable: FALSE
]];
Containers.ChildXBound[tool.inner, op.optionsContainer];
Tool.MakeCenteredLabel[op, op.definer.opAlias.Concat[" Options"]];
[data.filterASelector, initialChoice, x] ← Tool.CreateSelector[
name: "Origin", proc: SelectBringOverFilterA, clientData: data,
choices:
LIST[
["all", NEW[Ops.BringOverFilterA ← $all]],
["derived", NEW[Ops.BringOverFilterA ← $derived]],
["source", NEW[Ops.BringOverFilterA ← $source]]
],
op: op
];
data.filter.filterA ← NARROW[initialChoice.value, REF Ops.BringOverFilterA]^;
[data.filterBSelector, initialChoice, x] ← Tool.CreateSelector[
name: "Access", proc: SelectBringOverFilterB, clientData: data,
choices:
LIST[
["all", NEW[Ops.BringOverFilterB ← $all]],
["private", NEW[Ops.BringOverFilterB ← $private]],
["public", NEW[Ops.BringOverFilterB ← $public]]
],
op: op,
x: x + parameters.entryHSpace
];
data.filter.filterB ← NARROW[initialChoice.value, REF Ops.BringOverFilterB]^;
[data.filterCSelector, initialChoice, x] ← Tool.CreateSelector[
name: "Reference", proc: SelectBringOverFilterC, clientData: data,
choices:
LIST[
["all", NEW[Ops.BringOverFilterC ← $all]],
["imported", NEW[Ops.BringOverFilterC ← $imported]],
["defining", NEW[Ops.BringOverFilterC ← $defining]]
],
op: op,
x: x + parameters.entryHSpace
];
data.filter.filterC ← NARROW[initialChoice.value, REF Ops.BringOverFilterC]^;
op.height ← op.height + parameters.entryHeight + parameters.entryVSpace;
data.usingList ← ViewerTools.MakeNewTextViewer[info: [
wx: 0, -- we'll move it soon
wy: op.height,
ww: 9999, -- arbitrary; Containers.ChildXBound overrides
wh: selectedFilesLines*tool.parameters.entryHeight,
data: NIL,
parent: op.optionsContainer,
scrollable: TRUE,
border: FALSE
]];
prev ← Buttons.Create[
info: [name: "Selected files:",
wx: parameters.entryHSpace,
wy: op.height,
wh: tool.parameters.entryHeight,
parent: op.optionsContainer,
border: FALSE
],
proc: SelectUsingList,
fork: FALSE,
clientData: data.usingList,
font: parameters.font
];
ViewerOps.MoveViewer[
viewer: data.usingList,
x: prev.wx + prev.ww + parameters.entryHSpace, y: data.usingList.wy,
w: data.usingList.ww, h: data.usingList.wh,
paint: FALSE
];
Containers.ChildXBound[op.optionsContainer, data.usingList];
op.height ← op.height + selectedFilesLines*tool.parameters.entryHeight + parameters.entryVSpace;
[data.actionSelector, initialChoice, x] ← Tool.CreateSelector[
name: "Action for each file", proc: SelectBringOverAction, clientData: data,
choices:
LIST[
["enter in directory as attachment", NEW[Ops.BringOverAction ← $enter]],
["check remote server", NEW[Ops.BringOverAction ← $check]],
["check remote server, then enter in directory",
NEW[Ops.BringOverAction ← $checkAndEnter]],
["enter in directory as attachment and fetch", NEW[Ops.BringOverAction ← $fetch]]
],
op: op
];
data.action ← NARROW[initialChoice.value, REF Ops.BringOverAction]^;
op.height ← op.height + tool.parameters.entryHeight + parameters.entryVSpace;
ViewerOps.MoveViewer[
viewer: op.optionsContainer,
x: op.optionsContainer.wx, y: op.optionsContainer.wy,
w: op.optionsContainer.ww, h: op.height,
paint: FALSE
];
};