Reference Guide > T Routines > TmSetMethod Procedure
  

TmSetMethod Procedure
Sets a method for a given VDA Tool.
Usage
TmSetMethod, tool_name, method_name, method_call
Parameters
tool_name—A string containing the unique name of a VDA Tool.
method_name—The name of the method to set for the given VDA Tool.
method_call—The name of a procedure to execute when the method is called.
Keywords
user_data—A string containing data associated with the method.
Discussion
A method is a program that is executed in response to a trigger in a VDA Tool, such as a menu or button selection or mouse click. Normally, a VDA Tool will have several methods defined for it.
When a method is executed, the Tools Manager helps direct the subsequent action. The Tools Manager keeps track of the unique instance of the VDA Tool to which to apply the method, the name of the program to execute, and any data associated with that specific tool that the method program needs.
Method Call Procedure Parameters
The method call procedure must have the following parameters:
tool_name—The name of the VDA Tool for which the method is set.
userdata—Any data you wish to pass to the procedure.
Example
The following TmSetMethod calls set methods for drawing, code generation, restore, and coordinate conversion. The function takes the unique name of the VDA Tool, the name of a method, and the name of the procedure to call whenever the method is activated.
For instance, it is necessary to program a graphical VDA Tool, such as a 2D plot tool, to activate the TM_DISPLAY method whenever the Tool window is opened or redrawn. When TM_DISPLAY is triggered by such an event, a procedure is executed that contains the actual graphics commands. For a 2D plot tool, the commands might include PLOT and OPLOT. For a 3D surface tool, the SURFACE command might be called as part of this drawing procedure. It is up to the VDA Tools developer to provide the appropriate drawing procedure.
TmSetMethod, unique, 'TM_DISPLAY', 'WzPlotDisplay'
TmSetMethod, unique, 'TM_CODEGEN', 'WzPlotCodgen'
TmSetMethod, unique, 'TM_RESTORE', 'WzPlot'
TmSetMethod, unique, 'TM_CONVERT', 'WzPlotConvert'
See Also
TmEnumerateMethods, TmExecuteMethod, TmGetMethod

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.