<> <> <> DIRECTORY Imager, ImagerFont, IO, List, Menus, Rope, TIPUser, ViewerClasses; Controls: CEDAR DEFINITIONS ~ BEGIN <> ClickProc: TYPE ~ Menus.ClickProc; -- proc called if entry button is pressed Viewer: TYPE ~ ViewerClasses.Viewer; -- buttons, controls, typescripts, graphics Context: TYPE ~ Imager.Context; Detents: TYPE ~ RECORD [t, val: REAL]; -- special positions within a control <<>> Entry: TYPE ~ RECORD [ -- specifications for a menu button name: Rope.ROPE, proc: ClickProc, row: INTEGER _ 0, x, y, w, h: INTEGER _ 0, font: Imager.Font _ NIL, fork: BOOL _ TRUE, documentation: REF ANY _ NIL, paint: BOOL _ TRUE, guarded: BOOL _ FALSE, style: ATOM _ $BlackOnWhite, viewer: Viewer _ NIL ]; MouseButton: TYPE ~ {none, left, middle, right}; -- which mouse button was operated MouseState: TYPE ~ {none, down, held, up}; -- state of mouse button operated Mouse: TYPE ~ RECORD [ -- complete mouse information x, y: INTEGER, state: MouseState, button: MouseButton ]; ControlProc: TYPE ~ PROC [control: ControlData]; -- proc called if control adjusted ControlType: TYPE ~ {horiz, vert, circ}; -- horiz. or vertical sliders, circular dial ControlTaper: TYPE ~ {log, lin, exp}; -- logarithmic, linear, or exponential ControlSizes: TYPE ~ RECORD [ horizWid: INTEGER, vertWid: INTEGER, circDia: INTEGER ]; ControlData: TYPE ~ REF ControlDataRec; -- complete control information ControlDataRec: TYPE ~ RECORD [ name: Rope.ROPE _ NIL, type: ControlType _ horiz, taper: ControlTaper _ lin, min, max, init: REAL _ 0.0, truncate: BOOL _ FALSE, report: BOOL _ TRUE, detents: LIST OF Detents _ NIL, proc: ControlProc _ NIL, data: REF ANY _ NIL, row: INTEGER _ 0, x, y, w, h: INTEGER _ 0, cx, cy, rad: REAL _ 0.0, t, val, preval: REAL _ 0.0, predetented: BOOL _ FALSE, detented: BOOL _ FALSE, mouse: Mouse _ [0, 0, none, none], dummy: BOOL _ FALSE, -- if true, don't paint this control outerData: OuterData _ NIL, viewer: Viewer _ NIL, title, status: Viewer _ NIL, graphics, parent: Viewer _ NIL ]; ControlList: TYPE ~ LIST OF ControlData; DestroyProc: TYPE ~ PROC [outer: OuterData]; -- call when outer viewer destroyed GraphicsProc: TYPE ~ PROC [graphics: GraphicsData]; -- call if graphics viewer mouse act GraphicsShow: TYPE ~ PROC [ context: Context, w, h: INTEGER, data: REF ANY _ NIL, whatChanged: REF ANY _ NIL ]; GraphicsData: TYPE ~ REF GraphicsDataRec; -- complete graphics viewer specs GraphicsDataRec: TYPE ~ RECORD [ proc: GraphicsProc _ NIL, show: GraphicsShow _ NIL, mouse: Mouse _ [0, 0, none, none], data: REF ANY _ NIL, viewer, parent: Viewer _ NIL ]; OuterData: TYPE ~ REF OuterDataRec; -- complete outer data OuterDataRec: TYPE ~ RECORD [ parent: Viewer _ NIL, graphics: Viewer _ NIL, typeScript: Viewer _ NIL, graphicsData: GraphicsData _ NIL, destroyProc: DestroyProc _ NIL, controls: ControlList _ NIL, entries: LIST OF Entry _ NIL, controlY: INTEGER _ 0, controlH: INTEGER _ 0, graphicsY: INTEGER _ 0, graphicsH: INTEGER _ 0, tsY: INTEGER _ 0, tsH: INTEGER _ 0, entryY: INTEGER _ 0, entryH: INTEGER _ 0, outerY: INTEGER _ 0, outerH: INTEGER _ 0, tSin: IO.STREAM _ NIL, tSout: IO.STREAM _ NIL, tSclear: BOOL _ TRUE, val: REAL _ 0.0, destroyed: BOOL _ FALSE, data: REF ANY _ NIL, directory: Rope.ROPE _ NIL, cmdOut: IO.STREAM _ NIL ]; <> OuterViewer: PROC [ name: Rope.ROPE _ NIL, column: ViewerClasses.Column _ left, entries: LIST OF Entry _ NIL, controls: ControlList _ NIL, controlSizes: ControlSizes _ [200, 25, 60], graphicsHeight: INT _ 0, graphicsProc: GraphicsProc _ NIL, graphicsShow: GraphicsShow _ NIL, destroyProc: DestroyProc _ NIL, typeScript: BOOL _ FALSE, data: REF ANY _ NIL, noOpen: BOOL _ FALSE] RETURNS [Viewer]; <<>> <> <<>> <> <> <<>> <> <> <<>> <> <<>> <> <> <> <> <<>> <> <> GraphicsViewer: PROC [ parent: Viewer, y, h: INT _ 0, proc: GraphicsProc, show: GraphicsShow, data: REF ANY] RETURNS [Viewer]; <> <<>> NewControl: PUBLIC PROC [ name: Rope.ROPE _ NIL, type: ControlType _ horiz, taper: ControlTaper _ lin, min, max, init: REAL _ 0.0, report: BOOL _ TRUE, truncate: BOOL _ FALSE, detents: LIST OF Detents _ NIL, proc: ControlProc _ NIL, data: REF ANY _ NIL, row: INTEGER _ 0, x, y, w, h: INTEGER _ 0, dummy: BOOL _ FALSE] RETURNS [ControlData]; << Return a control. The name will appear above the control if the type is vert or circl, or to the right of the control if the type is horiz. If report is true, the current control value appears below the control name. If truncate is true, the reported value is given as an integer. proc, if non-nil, is called everytime the control is adjusted. The controls are normally ordered by OuterViewer, from right to left, beginning new rows as needed; if row is non-zero, however, the control will appear in the specified row and all subsequent controls will follow it. If y is non-zero, however, the control will appear at the specified y value, regardless of the value of row. If dummy is true, just use this control for positioning, not to be painted.>> EntryReLabel: PROC [outerData: OuterData, oldName, newName: Rope.ROPE]; <> <<>> EntryToggle: PROC [outerData: OuterData, state: BOOL, trueName, falseName: Rope.ROPE]; <> <<>> EntryStyle: PROC [outerData: OuterData, name: Rope.ROPE, style: ATOM]; <> <<$BlackOnWhite - black letters on white background (default)>> <<$WhiteOnBlack - white letters on black background>> <<$BlackOnGrey - black letters on grey background>> <<>> EntryPositions: PUBLIC PROC [entries: LIST OF Entry] RETURNS [entryHeight: INTEGER]; <> <<>> EntryViewerList: PUBLIC PROC [parent: Viewer, entries: LIST OF Entry, data: OuterData]; <> <<>> EntryViewer: PROC [parent: Viewer, e: Entry, data: OuterData] RETURNS [Viewer]; <> <<>> TypeScriptClear: PROC [outerData: OuterData]; <> <<>> TypeScriptWrite: PROC [outerData: OuterData, rope: Rope.ROPE]; <> <<>> TypeScriptRead: PROC [outerData: OuterData] RETURNS [Rope.ROPE]; <> <<>> TypeScriptReadFileName: PROC [outerData: OuterData] RETURNS [Rope.ROPE]; <> <<>> ControlRow: PROC [c: ControlData, row: INTEGER]; <> <<>> ControlPositions: PROC [controls: ControlList, sizes: ControlSizes] RETURNS [height: INTEGER]; <> <<>> ControlViewerList: PROC [ parent, graphics: Viewer _ NIL, controls: Controls.ControlList, data: REF ANY]; <> <<>> ControlViewer: PROC [ parent, graphics: Viewer _ NIL, control: ControlData, data: REF ANY _ NIL, outerData: OuterData _ NIL]; <> <<>> SetControlVal: PROC [c: ControlData, val: REAL, repaint: BOOL _ TRUE]; <> <<>> GetControlVal: PROC [c: ControlData] RETURNS [REAL]; <> <<>> GetControlValInt: PROC [c: ControlData] RETURNS [INTEGER]; <> <<>> ControlReset: PROC [c1, c2, c3, c4, c5, c6: Controls.ControlData _ NIL]; <> <<>> SetMouse: PROC [a: ATOM, t: TIPUser.TIPScreenCoords] RETURNS [Mouse]; <> <<>> Quit: ClickProc; <> <<>> Restore: ClickProc; <> <<>> EndViewer: PROC [viewer: REF ANY]; <> UnTick: PROC [context: Context, c: ControlData]; <> <<>> Tick: PROC [context: Context, c: ControlData, val: REAL, detent: BOOL _ FALSE, width: INT _ 1]; <> Circle: PROC [context: Context, x, y, rad: REAL, fill: BOOL _ FALSE]; <> Square: PROC [context: Context, x, y, size: REAL]; <> Append: PROC [control: ControlData, list: ControlList _ NIL] RETURNS [ControlList]; <> END.