<> <> <> <> DIRECTORY Rope USING [ROPE]; PopUpMenus: CEDAR DEFINITIONS = BEGIN <> ROPE: TYPE = Rope.ROPE; Menu: TYPE = REF MenuRep; --handle representing a popup menu MenuRep: TYPE = PRIVATE RECORD [impl: REF]; EntryProc: TYPE = PROC [menu: Menu_NIL, entryData: REF_NIL, callData: REF_NIL] RETURNS [REF_NIL]; <> <> <> <> <> <> Create: PROC [header: ROPE_NIL, doc: ROPE_NIL, clientData: REF_NIL] RETURNS [Menu]; <> <<(creates the handle, but does not invoke the created popup menu yet)>> <> <> <> Entry: PROC [menu: Menu, entry: ROPE_NIL, proc: EntryProc_NIL, entryData: REF_NIL, doc: ROPE_NIL] RETURNS [sameMenu: Menu]; <> << Replaces existing line if entry rope is already used>> <> <> <> << a NIL proc and a NIL entryData: removes entry from menu>> << a NIL proc: on call returns entryData>> <> <> Timeout: PROC [menu: Menu, time: INT_0, proc: EntryProc_NIL, entryData: REF_NIL] RETURNS [sameMenu: Menu]; <> <> <> <> << a NIL proc and a NIL entryData: no-op on time out (Normal case!)>> << a NIL proc: on timeout returns entryData>> <> Skipped: PROC [menu: Menu, proc: EntryProc_NIL, entryData: REF_NIL] RETURNS [sameMenu: Menu]; <> <> <> <> <> Call: PROC [menu: Menu, callData: REF_NIL, position: REF_NIL, default: REF_NIL] RETURNS [REF]; <> << (draws the menu, accepts interactive selection and calls the EntryProc)>> <> << or entryData if EntryProc was NIL>> <> <> <> << defaults to: the current mouse position>> <> << defaults to: no line selected at the beginning>> ClientData: PROC [menu: Menu] RETURNS [REF]; <> END.