<> <> <<>> <> DIRECTORY Buttons USING [ButtonProc, Create], ViewerClasses USING [Viewer], ViewerTools USING [SelPos, GetSelection, GetSelectedViewer, SetSelection]; TestSelections: CEDAR MONITOR IMPORTS Buttons,ViewerTools = BEGIN TestButtonProc: ENTRY Buttons.ButtonProc = { <<[parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL]>> viewer: ViewerClasses.Viewer = ViewerTools.GetSelectedViewer[]; sel: ViewerTools.SelPos = ViewerTools.GetSelection[viewer]; IF sel # NIL AND (viewer.class.flavor =$Text OR viewer.class.flavor = $Typescript) THEN BEGIN ViewerTools.SetSelection[viewer, sel]; END }; [] _ Buttons.Create[ info: [ name: "Test", parent: NIL], proc: TestButtonProc, documentation: "Tests GetSelection/SetSelection."]; END. CHANGE LOG Created by Stolfi on April 5, 1984 10:50:34 pm PST