<* PRAGMA SPEC *>A
ToolBox.T is a collection of buttons that activate drawing tools.
INTERFACEToolBox ; IMPORT Drawing, View, Editor; IMPORT VBT, ButtonVBT, MenuBtnVBT; TYPE T = VBT.Split; Button <: ButtonPublic; ButtonPublic = ButtonVBT.T OBJECT METHODS init(root: View.Root; name: TEXT; tl: Drawing.ArgTool): Button END; SetButton <: SetButtonPublic; SetButtonPublic = MenuBtnVBT.T OBJECT METHODS init(root: View.Root; name: TEXT; tl: Drawing.SetTool): SetButton END;
NEW(Button).init(rt, nm, tl) returns a button displaying the name nm
that applies the drawing tool tl to the drawing view of root.
The call NEW(SetButton).init(rt, nm, tl) does the same thing, but is
activated by selecting it while dragging through a menu.
<* SPEC Update REQUIRES sup(LL) = VBT.mu *> PROCEDURE Update(t: T; ed: Editor.T; rt: View.Root; n := 0; anon := TRUE);
Replace all children intafter the firstnwith buttons for the public predicates, (functions), and procedures defined in the editored. All of these buttons apply to the rootrt. Ifanon = TRUE, then theMODULEdeclaration (if any) is ignored, so all the button names will be unqualified.
PROCEDURE Unselect(rt: View.Root);
Unhighlight and unselect (in the drawing view) the currently selected tool
rt.currButton. <* SPEC SwapButton REQUIRES sup(LL) = VBT.mu *> PROCEDURE SwapButton(t: T; curr, new: Drawing.ArgTool; newLabel: TEXT);
Letbbe the button inTwith associated toolcurr. Install a new button inb's place with the new labelnewLabeland associated toolnew. Requirescurrto be a tool inT.
END ToolBox.