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]; Entry: PROC [menu: Menu, entry: ROPE_NIL, proc: EntryProc_NIL, entryData: REF_NIL, doc: ROPE_NIL] RETURNS [sameMenu: Menu]; Timeout: PROC [menu: Menu, time: INT_0, proc: EntryProc_NIL, entryData: REF_NIL] RETURNS [sameMenu: Menu]; 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]; ClientData: PROC [menu: Menu] RETURNS [REF]; END. ΦPopUpMenus.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Created by: Christian Jacobi, August 22, 1986 11:00:59 am PDT Last Edited by: Christian Jacobi, August 25, 1986 5:50:57 pm PDT Package which supports composition and invocation of popup menus. Type of procedure called on menu selection menu: popup menu used entryData: as defined for the menu entry callData: as given by call returned value is passed to caller of menu The NIL initializations are only of use for clients to call procedure directly Creates a new popup menu (class) (creates the handle, but does not invoke the created popup menu yet) header: header line of popup menu doc: documentation for header line and outside clientData: stored for the client Makes an entry line for a popup menu Replaces existing line if entry rope is already used entry: text for menu line proc: will be called on selection entryData: passed to proc on call a NIL proc and a NIL entryData: removes entry from menu a NIL proc: on call returns entryData doc: documentation for this line sameMenu: for conveniance returns menu again Defines behaviour of popup menu on timeout time: in seconds; 0 for no timeout proc: will be called on timeout when menu is called entryData: passed to proc on timeout call a NIL proc and a NIL entryData: no-op on time out (Normal case!) a NIL proc: on timeout returns entryData sameMenu: for conveniance returns menu again Defines behaviour of popup menu when called and skipped (no entry selected, no timeout) proc: will be called on timeout when menu is called entryData: passed to proc on timeout call, or returned if proc=NIL sameMenu: for conveniance returns menu again Most menus do NOT define a skipped behaviour Calls a popup menu (draws the menu, accepts interactive selection and calls the EntryProc) returns data returned from called EntryProc or entryData if EntryProc was NIL menu: popup menu to be used callData: passed to the EntryProc position: position of popup menu (see documentation) defaults to: the current mouse position default: entry line to select at the beginning; hint only! (see documentation) defaults to: no line selected at the beginning returns clientData as given on Create Κ˜codešœ™Kšœ Οmœ1™