TrcButtons.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Eric Nickell, April 9, 1986 10:42:20 pm PST
DIRECTORY
Buttons USING [ButtonProc],
Trc USING [Rectangle, TRC],
ViewerClasses USING [Viewer, ViewerRec];
TrcButtons: CEDAR DEFINITIONS
~ BEGIN
Create: PROC [trc: Trc.TRC, rectangle: Trc.Rectangle, dx: REAL, info: ViewerClasses.ViewerRec, proc: Buttons.ButtonProc, clientData: REFNIL, fork: BOOLTRUE, paint: BOOLTRUE] RETURNS [button: ViewerClasses.Viewer];
Create a trc viewer, but rather than using the Trc.NotifyProc found in trc.class, it will use that for the button class, thereby letting us see icon-sized (e.g.) trc's but have the mouse-clicks do non-standard things.
Note that the button is, in fact, a TrcViewers.Viewer, and therefore TrcViewers can be used to examine and modify the rectangle, dx, and clientData. HOWEVER, TrcViewers.InfoFromTRCViewer[v].trc will not return the initial trc passed in. Instead, use TrcFromButton below.
AttachNewTrcToButton: PROC [button: ViewerClasses.Viewer, trc: Trc.TRC, paint: BOOLTRUE];
Puts a different trc in the button.
TrcFromButton: PROC [button: ViewerClasses.Viewer] RETURNS [trc: Trc.TRC];
The right way to get at the underlying trc, given the button.
END.