<<>> <> <> <> <> <<>> DIRECTORY XTk USING [Class, Event, TQ, Widget, WidgetSpec]; <<>> <> <> <> XTkScrollbar: CEDAR DEFINITIONS ~ BEGIN <<>> Scrollbar: TYPE = XTk.Widget; scrollbarClass: READONLY XTk.Class; Direction: TYPE = {horizontal, vertical}; State: TYPE = RECORD [start, next: REAL]; <<[start..next) denotes the displayed area, in range [0..1); . >> <<>> CreateScrollbar: PROC [widgetSpec: XTk.WidgetSpec ¬ [], direction: Direction ¬ vertical, state: State ¬ [0, 1]] RETURNS [Scrollbar]; <> <<>> IsScrollbar: PROC [widget: XTk.Widget] RETURNS [BOOL]; <> GetDirection: PROC [scrollbar: Scrollbar] RETURNS [direction: Direction]; <> GetState: PROC [scrollbar: Scrollbar] RETURNS [state: State]; <> ParentalSetState: PROC [scrollbar: Scrollbar, state: State, event: XTk.Event ¬ NIL]; <> <> PublicSetState: PROC [scrollbar: Scrollbar, action: Action, value: REAL, event: XTk.Event ¬ NIL]; <> <> <> stateChanged: READONLY ATOM; -- ¬ $ScrollbarState <> <<>> Action: TYPE = {none, backward, forward, thumb, configure}; ScrollProc: TYPE = PROC [scrollbar: Scrollbar, action: Action, value: REAL, event: XTk.Event, clientData: REF]; <> <> <<"action" is the reason this procedure is being called.>> <<"value" >> <> <> <<"event" cause of action, if available. Useful for time stamp, breaking recursive calls, etc.>> <<"clientData" from registration.>> SetScrollProc: PROC [scrollbar: Scrollbar, scrollProc: ScrollProc, clientData: REF ¬ NIL, tq: XTk.TQ ¬ NIL]; <> <> <> <> END.