TmText Procedure
Adds text to a VDA Tool. The position of the text and the text itself are determined interactively by the user.
Usage
TmText, tool_name
Parameters
tool_name—A string containing the unique name of a VDA Tool.
Keywords
None.
Discussion
TmText 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 on page 1670 and WoButtonBar Function on page 1620.
To add text, the user clicks MB1 where the text is to start, enters the text, and presses <Return> when finished.
Embedded Functions in Text Graels
You can embed PV‑WAVE functions inside a string used in a text grael (a graphical element that includes the VDA Tools Manager function TmText). This feature is useful for embedding a calculated value to a string. When the string is displayed, the function is executed and the result is inserted into the string.
The format for embedded functions is:
%%FUNCTION(args):(FORMAT)%%
where:
*FUNCTION—Any valid PV‑WAVE function that returns a scalar value. All variables used by the function, including variables used as values for keywords, must exist at the $MAIN$ level of PV‑WAVE.
*FORMAT—A valid FORTRAN-style format. For detailed information on output formats, see Appendix A, FORTRAN and C Format Strings, in the PV-WAVE Programmer’s Guide.
Example 1
The following example code is a callback routine for a menu bar. This callback executes TmText in response to a menu selection.
PRO CreateTextCB, 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, 'text', 1
   WoAddMessage, tool_name, 'MSG_TextCreate', /Clear
   WoAddStatus, tool_name, 'MSG_TextCreateStatus', $	
      Item='STATUS2'
   TmText, tool_name
END
Example 2
Assume that the variable my_var exists at $MAIN$. When the following string is displayed in a text grael, the value of the AVG function is calulated and displayed in the specified format.
The average of my_var is: %%AVG(my_var):(F8.3)%% 
You can use additional arguments and keywords as long as all named parameters exist at $MAIN$. You can also use expressions as parameters, as follows:
The median of DIST(200) is: %%MEDIAN(DIST(200))%%
See Also