DIRECTORY Imager, Rope; PopUpSelection2: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; Create: PROC [choices: ChoiceS, doc: ROPE, header: Image _ NIL, left, top: Label _ nullLabel, columns: NAT _ 1, timeOut: NAT _ 0] RETURNS [Menu]; ChoiceS: TYPE = REF ChoiceSequence; ChoiceSequence: TYPE = RECORD [elts: SEQUENCE length: NAT OF Choice]; Choice: TYPE = RECORD [ image: Image, doc: ROPE]; nullChoice: Choice = [NIL, NIL]; Image: TYPE = REF ImagePrivate; ImagePrivate: TYPE = RECORD [ size: Imager.VEC, Draw: Drawer, data: REF ANY _ NIL ]; Drawer: TYPE = PROC [image: Image, context: Imager.Context, bounds: Imager.Rectangle, highlight: BOOL]; nullLabel: Label = NIL; Label: TYPE = REF LabelPrivate; LabelPrivate: TYPE = RECORD [ minSpacing--parallel to edge being labelled--, minWidth--perpendicular--: NAT, Draw: PROC [context: Imager.Context, org: Imager.VEC, n, spacing, width: NAT, data: REF ANY], data: REF ANY ]; Menu: TYPE = REF MenuPrivate; MenuPrivate: TYPE; Pop: PROC [menu: Menu, default: NAT _ 0, position: REF _ NIL, InNotifier: Consumer _ NIL, notifyData: REF ANY _ NIL] RETURNS [INT]; Consumer: TYPE = PROC [INT, REF ANY]; END. PopUpSelection2.Mesa Copyright c 1983, 1985, 1986 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, August 3, 1983 9:47 am Last edited by: Christian Jacobi, August 26, 1986 10:21:13 am PDT Mike Spreitzer November 14, 1986 5:28:55 pm PST A pop-up menu abstraction. All coordinates and sizes are in pixels. bounds describes the area to paint, in the context's current coordinate system; the caller tried to make it same as image.size; it might well be bigger; it should only be smaller if there's real trouble making it big enough. Do not assume the area has been cleared. highlighted indicates the user is pointing at this image and wants it highlighted. Not called under DoSave, so please restore context's transformation upon exit; other context state variables may be changed (and of course you can't assume they have any particular value upon entry). Shows a pop-up menu and returns the number of the selected entry. returns: 1 for first choice, 2 for second... 0 if selected outside menu or on header-line -1 if timed out default: Hint for initial selection by implicit mouse movement. 0 if no default. position: Hint to override mouse position. See documentation for possible types. Pop must not be called from inside a viewers-repaint or a TIP-notify procedure. You can get the answer in the notifier process, however, by supplying InNotifier & notifyData. Must not be in a local frame, because it will be called from a different process (maybe even after Pop returns, depending on scheduling). ΚΉ˜codešœ™Kšœ Οmœ=™HKšœ3™3K™AK™/—K˜KšΟk œ˜K˜KšΟnœžœž œ˜%K™Kšœ™K˜Kšž˜K˜Kšžœžœžœ˜K˜K™(K˜KšŸœžœžœžœ)žœžœžœ˜‘K˜Kšœ žœžœ˜#Kš œžœžœžœ žœžœ ˜EK˜šœžœžœ˜K˜ Kšœžœ˜ —K˜Kšœžœžœ˜ K˜Kšœžœžœ˜šœžœžœ˜Kšœ žœ˜KšŸœ ˜ Kšœžœžœž˜K˜—K˜šœžœžœNžœ˜gKšΟeœn  œŽ  œ™§—K˜Kšœžœ˜Kšœžœžœ˜šœžœžœ˜Kšœ Οc#œ ‘œžœ˜NKš Ÿœžœ'žœžœžœžœ˜]Kšœžœž˜ K˜—K˜Kšœžœžœ ˜Kšœ žœ˜K˜šŸœžœžœžœžœŸ œ žœžœžœžœžœžœ˜ƒ™AKšœ,™,Kšœ-™-Kšœ™KšœQ™QKšœQ™QKšœ―™―——K˜š œ žœžœžœžœžœ˜%Kšœ‰™‰—K˜Kšžœ˜K˜K˜—…—’ O