<> <> <> <> <> DIRECTORY Imager, PopUpButtons, Rope, ViewerClasses; PopUpSelection2: CEDAR DEFINITIONS = <<>> <> BEGIN ROPE: TYPE = Rope.ROPE; <> Create: PROC [choices: ChoiceS, doc: ROPE, allMayBeUp: BOOL, header: Image _ NIL, left, top: Label _ nullLabel, columns: NAT _ 1, fullRows: NAT _ 0, timeOut: NAT _ 0] RETURNS [Menu]; <> <> <> ChoiceList: TYPE ~ LIST OF RECORD [key: ROPE, doc: ROPE _ NIL]; 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 ~ PopUpButtons.ImagePrivate; defaultFont: Imager.Font; Colors: TYPE ~ PopUpButtons.Colors; defaultColors, inverseColors: Colors; dontPaint: READONLY Imager.Color; Align: TYPE ~ PopUpButtons.Align; bottomLeft: Align ~ [0.0, 0.0]; center: Align ~ [0.5, 0.5]; ImageForRope: PROC [rope: ROPE, colors: Colors _ NIL, font: Imager.Font _ NIL, align: Align _ bottomLeft] RETURNS [image: Image]; 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 ]; MouseButton: TYPE ~ ViewerClasses.MouseButton; 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, MouseButton]; <> <> << 0 if selected outside menu or on header-line>> << -1 if timed out>> <> <> <> Consumer: TYPE = PROC [INT, MouseButton, REF ANY]; <> Sequify: PROC [list: ChoiceList] RETURNS [seq: ChoiceS]; PopRopes: PROC [ choices: ChoiceList, doc: ROPE, allMayBeUp: BOOL, default: NAT _ 0, header: ROPE _ NIL, left, top: Label _ nullLabel, columns: NAT _ 1, fullRows: NAT _ 0, timeOut: NAT _ 0, position: REF _ NIL, InNotifier: Consumer _ NIL, notifyData: REF ANY _ NIL] RETURNS [sel: INT, mb: MouseButton]; <> END.