WITH thisSH.fieldList[field]
SELECT
FROM
it: AdobeOps.EnumFIO => {
numSubMenus, saveKey, currentEnum: CARD ¬ 0;
thisField.type ¬ enumerated;
thisField.dependentsSequence ¬ NEW[AdobeCommon.DependentsSequenceRec[5]];
IF it.field #
LAST[
CARD16]
THEN {
currentSubMenu: CARD ¬ 0;
thisField.dependentOn ¬ handle.fieldViewer.buttons[it.field];
numSubMenus ¬ CountRopes[thisField.dependentOn.allSelections[0].ropes];
BumpNumOfDeps[handle.fieldViewer.buttons[field], handle.fieldViewer.buttons[it.field]];
thisField.currentMenu ¬ numSubMenus - 1;
thisField.allSelections ¬ NEW[AdobeCommon.SelectionsSequence[numSubMenus]];
WITH thisSH.fieldList[it.field]
SELECT
FROM
dep: AdobeOps.EnumFIO => {
--tmp-- itkd, depit, foo: CARD;
did: BOOL ¬ FALSE;
-- tmp -- max: CARD ¬ dep.possibilities[0].enumRecs.length;
FOR index:
CARD
IN [0..dep.possibilities[0].enumRecs.length)
DO
did ¬ FALSE;
FOR itIndex:
CARD
IN [0..it.possibilities.length)
DO
-- tmp -- itkd ¬ it.possibilities[itIndex].keyedDependency;
-- tmp -- depit ¬ dep.possibilities[0].enumRecs[index].item;
IF it.possibilities[itIndex].keyedDependency =
dep.possibilities[0].enumRecs[index].item
THEN {
thisField.allSelections[currentSubMenu].num ¬ index;
-- tmp -- foo ¬ it.possibilities[itIndex].enumRecs.length;
FOR i:
CARD
IN [0..it.possibilities[itIndex].enumRecs.length)
DO
thisField.allSelections[currentSubMenu].ropes ¬
CONS[it.possibilities[itIndex].enumRecs[it.possibilities[itIndex].enumRecs.length - i - 1].tag, thisField.allSelections[currentSubMenu].ropes];
ENDLOOP;
currentSubMenu ¬ currentSubMenu + 1;
did ¬ TRUE;
EXIT
};
ENDLOOP;
IF ~did
THEN {
thisField.allSelections[currentSubMenu] ¬ [index, LIST["Nil"]];
currentSubMenu ¬ currentSubMenu + 1;
};
ENDLOOP;
};
ENDCASE => ERROR;
FOR index: CARD IN [0..numSubMenus) DO
IF currentEnum >= it.possibilities.length THEN
thisField.allSelections[index] ← [index, LIST["Nil"]]
ELSE
IF it.possibilities[currentEnum].keyedDependency = (saveKey + index) THEN {
thisField.allSelections[index].num ← index;
FOR i: CARD IN [0..it.possibilities[currentEnum].enumRecs.length) DO
thisField.allSelections[index].ropes ← CONS[it.possibilities[currentEnum].enumRecs[it.possibilities[currentEnum].enumRecs.length - i - 1].tag, thisField.allSelections[index].ropes];
ENDLOOP;
currentEnum ← currentEnum + 1;
}
ELSE {
thisField.allSelections[index] ← [index, LIST["Nil"]];
};
ENDLOOP;
}
ELSE {
thisField.dependentOn ¬ NIL;
thisField.currentMenu ¬ 0;
thisField.allSelections ¬ NEW[AdobeCommon.SelectionsSequence[1]];
thisField.allSelections[0].num ¬ it.possibilities[0].enumRecs[0].item;
FOR index:
CARD
IN [0..it.possibilities[0].enumRecs.length)
DO
thisField.allSelections[0].ropes ¬
CONS[
it.possibilities[0].enumRecs[it.possibilities[0].enumRecs.length - index - 1].tag, thisField.allSelections[0].ropes];
ENDLOOP;
thisField.currentSelection ¬ it.possibilities[0].enumRecs.length - 1;
};
thisField.button ¬ handle.makeButton[thisViewer, 0, lineIndex * fieldHeight, Rope.Concat[it.name, ": "], procData, FALSE, $CurrentButtonProc, procData];
[x, y, w, h] ¬ handle.getBoxGeometry[thisField.button];
thisField.controllerOf ¬ handle.newFieldBox[
parent: thisViewer,
x: w+5,
y: lineIndex * fieldHeight,
w: 400,
h: h,
border: FALSE,
scrollable: FALSE
];
handle.setContents[thisField.controllerOf, "{}"];
thisField.boolVal ¬ TRUE;
handle.inhibitEdits[thisField.controllerOf];
};
it: AdobeOps.ArFIO => {
handle.fieldViewer.buttons[field].type ¬ arId;
handle.fieldViewer.buttons[field].button ¬ handle.makeButton[thisViewer, 0, lineIndex * fieldHeight, Rope.Concat[it.name, ": "], procData, FALSE, $SubmitFieldButtonProc, procData];
[x, y, w, h] ¬ handle.getBoxGeometry[handle.fieldViewer.buttons[field].button];
handle.fieldViewer.buttons[field].controllerOf ¬ handle.newFieldBox[
parent: thisViewer,
x: w+5,
y: lineIndex * fieldHeight,
w: 400,
h: h,
border: FALSE,
scrollable: FALSE
];
handle.inhibitEdits[handle.fieldViewer.buttons[field].controllerOf];
};
it: AdobeOps.DateFIO => {
handle.fieldViewer.buttons[field].type ¬ dateTime;
handle.fieldViewer.buttons[field].button ¬ handle.makeButton[thisViewer, 0, lineIndex * fieldHeight, Rope.Concat[it.name, ": "], procData, FALSE, $SubmitFieldButtonProc, procData];
[x, y, w, h] ¬ handle.getBoxGeometry[handle.fieldViewer.buttons[field].button];
handle.fieldViewer.buttons[field].controllerOf ¬ handle.newFieldBox[
parent: thisViewer,
x: w+5,
y: lineIndex * fieldHeight,
w: 400,
h: h,
border: FALSE,
scrollable: FALSE
];
handle.inhibitEdits[handle.fieldViewer.buttons[field].controllerOf];
};
it: AdobeOps.NumFIO => {
handle.fieldViewer.buttons[field].type ¬ numeric;
handle.fieldViewer.buttons[field].button ¬ handle.makeButton[thisViewer, 0, lineIndex * fieldHeight, Rope.Concat[it.name, ": "], procData, FALSE, $SubmitFieldButtonProc, procData];
[x, y, w, h] ¬ handle.getBoxGeometry[handle.fieldViewer.buttons[field].button];
handle.fieldViewer.buttons[field].controllerOf ¬ handle.newFieldBox[
parent: thisViewer,
x: w+5,
y: lineIndex * fieldHeight,
w: 400,
h: h,
border: FALSE,
scrollable: FALSE
];
handle.inhibitEdits[handle.fieldViewer.buttons[field].controllerOf];
};
it: AdobeOps.FixFIO => {
handle.fieldViewer.buttons[field].type ¬ fixedLengthString;
handle.fieldViewer.buttons[field].button ¬ handle.makeButton[thisViewer, 0, lineIndex * fieldHeight, Rope.Concat[it.name, ": "], procData, FALSE, $SubmitFieldButtonProc, procData];
[x, y, w, h] ¬ handle.getBoxGeometry[handle.fieldViewer.buttons[field].button];
handle.fieldViewer.buttons[field].controllerOf ¬ handle.newFieldBox[
parent: thisViewer,
x: w+5,
y: lineIndex * fieldHeight,
w: handle.getBoxGeometry[handle.outer].w - w - 5,
h: h,
border: FALSE,
scrollable: TRUE
];
handle.fieldViewer.buttons[field].controllerOf ← ViewerTools.MakeNewTextViewer[
info:[
parent: thisViewer,
wx: handle.fieldViewer.buttons[field].button.ww+5,
wy: lineIndex * fieldHeight,
ww: handle.outer.ww - handle.fieldViewer.buttons[field].button.ww - 5,
wh: handle.fieldViewer.buttons[field].button.wh,
border: FALSE,
scrollable: TRUE
]
];
handle.xBoundBox[handle.fieldViewer.outer, handle.fieldViewer.buttons[field].controllerOf];
handle.fieldViewer.buttons[field].maxLength ¬ it.maxLength;
handle.inhibitEdits[handle.fieldViewer.buttons[field].controllerOf];
};
it: AdobeOps.StrFIO => {
thisField.type ¬ string;
thisField.button ¬ handle.makeButton[thisViewer, 0, lineIndex * fieldHeight, Rope.Concat[it.name, ": "], procData, FALSE, $SubmitFieldButtonProc, procData];
[x, y, w, h] ¬ handle.getBoxGeometry[thisField.button];
thisField.adjButton ¬ handle.makeButton[thisViewer, x + w - --VFonts.StringWidth["<Adj>"]-- 35 -5, (lineIndex+1) * fieldHeight, "<Adj>", handle.fieldViewer.buttons[field], TRUE, $AdjustStringHeight, handle.fieldViewer.buttons[field]];
thisField.controllerOf ¬ handle.newFieldBox[
parent: thisViewer,
x: w+5,
y: lineIndex * fieldHeight,
w: handle.getBoxGeometry[handle.outer].w - w - 5,
h: (h * handle.unboundFieldHeight) - 2,
border: FALSE,
scrollable: TRUE
];
handle.xBoundBox[handle.fieldViewer.outer, thisField.controllerOf];
Containers.ChildXBound[handle.fieldViewer.outer, thisField.controllerOf];
thisField.currentHeight ¬ handle.unboundFieldHeight;
thisField.stream ← ViewerIO.CreateViewerStreams[
name: Rope.Concat[it.name, ".stream"],
viewer: thisField.controllerOf,
editedStream: TRUE
].out;
lineIndex ¬ lineIndex + thisField.currentHeight - 1;
handle.inhibitEdits[thisField.controllerOf];
};
ENDCASE;