name: Rope.ROPE = "EditHistory Tool";
IF viewer #
NIL
THEN {
-- already have an edit history tool around
IF viewer.iconic THEN ViewerOps.OpenIcon[viewer];
RETURN [NIL, "Opened existing EditHistory Tool."]};
{
OPEN layout;
entryLeft ← initLeft ← 5;
heightSoFar ← initHeight ← entryVSpace;
container ← Containers.Create[[name: name, iconic: TRUE, column: right, scrollable: FALSE]];
[] ← BuildButton[layout, "Show", DoShow];
[] ← BuildButton[layout, "Undo", DoUndo];
[,info.eventNumArg] ←
BuildDataFieldPair[layout, "since event number:", EventNumberButton, NIL, 1];
layout.heightSoFar ← layout.heightSoFar + layout.entryVSpace/2;
[] ← BuildButton[layout, "Get", DoGetSize];
[] ← BuildButton[layout, "Set", DoSetSize];
[,info.sliceSizeArg] ←
BuildDataFieldPair[layout, "history size:", SliceSizeButton, NIL, 1];
HRule[layout];
info.textField ← ViewerOps.CreateViewer[flavor: $Text, info: [parent: layout.container,
wx: entryLeft, wy: heightSoFar, wh: 700, ww: 200, border: FALSE, scrollable: TRUE],
paint: FALSE];
-- make the textField grow as the container grows
Containers.ChildYBound[container, info.textField];
Containers.ChildXBound[container, info.textField];
};