VisualAge RPG Tips - Using Plugins in VisualAge RPG
DISCLAIMER
These sample programs are provided by IBM as simple examples. These examples have not been thoroughly
tested under all conditions. IBM, therefore, can not guarantee or imply reliability, serviceability, or function of these samples.
All programs contained herein are provided to you "AS IS". The implied warranties of merchantability and
fitness for a particular purpose are expressly disclaimed.
Nudge.zip
(92K)
One of the more interesting features of VisualAge RPG V3R2M1 is the ability
to write programs that interact with the GUI designer. These "Plugins"
can be written in practically any language including C, REXX, and VARPG.
Plugins allow you to add your own functions to the GUI designer by
performing such operations as querying and creating parts in the GUI
designer as well as interacting with the LPEX editor by issuing editor
commands.
This sample plugin, was written in VisualAge RPG. The idea for this plugin was
'borrowed' from a similar program available for Visual Basic.
By pressing one of the arrow keys, the selected part or parts, will
move in the corresponding direction by the number of pixels in the entry
field. Registering the plugin
Once you have downloaded and installed this sample, as described in the
installation
instructions, you must register it with the GUI designer. Edit the
file NUDGE.PLG in the project's source directory and locate the
following statement:
Command_Line: "d:\myproj\nudge\rt_win32\nudge.exe &1 &2"
This statement tells the GUI designer where to look for the plugin
executable (nudge.exe). Change the directory name to reflect where you
have installed the plugin. For example:
Command_Line: "e:\vrpg\nudge\rt_win32\nudge.exe &1 &2"
Now, you must register the plugin with the builder:
- Choose Vendor->Plugins->Add plugin from the GUI
designer menu
- On the File open dialog, select the NUDGE.PLG file you just changed.
To invoke the plugin, select a part or multiple parts on a design
window, then press the right mouse button. From the pop-up menu choose Vendor
plugins->Plug-me-in Inc.->Nudge, or just press F2.
For more information about plugins, refer to the Creating plugins
section of the Visual Programming Guide. All VARPG manuals are
online and can be accessed by choosing the Help menu item from the GUI
designer menu.
|