<> <> <> <> DIRECTORY CD USING [Design, Technology, Number, Layer], CDSequencer USING [CommandProc, QueueMethod], Rope USING [ROPE], ViewerClasses USING [Viewer]; CDPanel: CEDAR DEFINITIONS = BEGIN <> <> CreatePanel: PROC [design: CD.Design] RETURNS [ViewerClasses.Viewer]; <<--only one panel-viewer per design is created>> <<--if panel-viewer already exists, simply return it>> DefineNewLine: PROC [tech: CD.Technology_NIL]; <<--the next features will be defined on a new line>> DefineLayerEntry: PROC [tech: CD.Technology_NIL, layer: CD.Layer, text: Rope.ROPE, min, default: CD.Number _ 1]; <<--introduces a layer entry>> <<--only layers of technology tech may be used>> <<--use CDLayers to querry or update values; display is updated automatically>> DefineIntEntry: PROC [tech: CD.Technology _ NIL, cdValueKey: REF, text: Rope.ROPE _ NIL, min: INT _ FIRST[INT], max: INT _ LAST[INT], default: INT _ 0, lambda: INT _ 1, redisplay: BOOL _ TRUE]; <<--cdValueKey must have been correctly registered with CDValue! CDPanel does NOT itself. >> <<--(allows hooking entries onto already used keys)>> <<--Restriction: displayed value does not follow changes of CDValue.StoreInt>> <<--lambda=0: use lambda of technology>> DefineButton: PROC [tech: CD.Technology _ NIL, name: Rope.ROPE _ NIL, proc: CDSequencer.CommandProc _ NIL, command: ATOM _ NIL, queue: CDSequencer.QueueMethod _ useDefault, topLine: BOOL _ FALSE, border: BOOL _ FALSE, data: REF _ NIL, cdValueKey: REF _ NIL, redisplay: BOOL _ TRUE]; <<--button is always forked>> <<--data is hanged on comm.data>> <<--cdValueKey # NIL: overwrites name field by using CDValue >> DefineLabel: PROC [tech: CD.Technology _ NIL, name: Rope.ROPE, border: BOOL _ FALSE, cdValueKey: REF _ NIL, redisplay: BOOL _ TRUE]; <<--if cdValueKey # NIL: overwrites name field by using CDValue>> DefineRopeEntry: PROC [tech: CD.Technology _ NIL, cdValueKey: REF, button: Rope.ROPE _ NIL, width: INT _ -1, editable: BOOL _ TRUE, redisplay: BOOL _ FALSE]; <<--cdValueKey must have been correctly registered with CDValue>> <<-- value on design typical a ROPE; technology may have LIST OF ROPE>> <<--width: of field for text; in viewer units; -1 means: use total width of panel>> <<--Usually it is bad to set redisplay to true: user edited text may get lost>> FromDisplayRope: PROC [design: CD.Design, cdValueKey: REF] RETURNS [rope: Rope.ROPE]; <<--Shortcut for text entries>> <<--Takes the displayed rope, stores it using CDValue.Store, and also returns it>> ToDisplayRope: PROC [design: CD.Design, cdValueKey: REF, rope: Rope.ROPE]; <<--Shortcut for text entries>> <<--Takes the given rope, stores it using CDValue.Store and updates the display on the panel>> FromDisplay: PROC [design: CD.Design, cdValueKey: REF] RETURNS [REF]; <<--Takes any displayed entry, stores it using CDValue.Store and also returns it>> ToDisplay: PROC [design: CD.Design, cdValueKey: REF] RETURNS [REF]; <<--Takes any value using CDValue.Fetch, displays and returns it>> Redisplay: PROC [design: CD.Design]; <<--fetches with CDValue and update display for all entries which have a redisplay flag>> END.