TmLegend Procedure

Adds a legend to a VDA Tool. The exact size and position of the legend is determined interactively by the user.

Usage

TmLegend, tool_name 

Parameters

tool_name—A string containing the unique name of a VDA Tool.

Keywords

None.

Discussion

TmLegend is a graphical element (GRAEL) routine. GRAELs are predefined graphics routines used by VDA Tools. These routines allow you to add, configure, and remove graphical elements in the VDA Tool display area. The standard set of GRAELs includes axes, text, bitmaps, legends, lines, and rectangles. This standard set is accessible from the standard VDA Tool menu bar and button bar, which are provided by the VDA Utility routines WoMenuBar Function and WoButtonBar Function.

To draw a legend, the user presses and drags MB1 to define the legend border.

Example

The following example code is a callback routine for a menu bar. This callback executes TmLegend in response to a menu selection.

PRO CreateLegendCB, wid, index
   tool_name = GetMenuBarToolName(wid)
   toggle_buttons = ['dataselect', 'graelselect', 'text', $
      'line', 'rectangle',  'legend']
   buttons_up = [0, 0, 0, 0, 0, 0]
   WoButtonBarSet, tool_name, toggle_buttons, buttons_up
   WoButtonBarSet, tool_name, 'legend', 1
   WoAddMessage, tool_name, 'MSG_LegendCreate', /Clear
   WoAddStatus, tool_name, 'MSG_LegendCreateStatus', $
      Item='STATUS2'
   TmLegend, tool_name
END

See Also

TmAxis, TmBitmap, TmLine, TmRect, TmText