Application Developer Guide > Developing Portable Applications > Writing Portable VDA Tools
  

Writing Portable VDA Tools
In addition to the topics covered previously on writing portable Wave Widgets applications, several special considerations need to be made when developing VDA Tools for use on Microsoft Windows and Motif platforms.
VDA Utilities and Tools Manager Routines
First, the VDA Utilities (Wo) and Tools Manager (Tm) routines have been specifically designed to work on all PV-WAVE platforms and their use is highly encouraged. In situations where differences exist between systems, for instance in file-naming conventions, VDA Utilities routines help bridge the differences.
VDA Tools Resource Files
VDA Tools make extensive use of resource files for internationalization and customization. These resource files are portable between the Motif and Microsoft Windows systems. However, a few notable differences exist. First, the VDA Tools’ global resource file is different between the various systems. The following table defines this usage:
(UNIX) $WAVE_DIR/xres/american/vdatools/VDATools
(WIN) %WAVE_DIR%\xres\american\vdatools\windows\wzglobal.ad
The appropriate global resource file is loaded automatically when the VDA Tools environment is initialized, so knowledge of this difference is only important when changes or additions are made to the global resources.
Secondly, the bitmap format used for drawn buttons and icons is different between the Motif and Microsoft Windows systems. Motif uses the xbm (X Bitmap) format to specify bitmaps and the pm (Pixmap) format for pixmaps. Microsoft Windows uses the BMP format for both. The VDA Utility routine WoBuildResourceFilename can be used to construct the correct path given the filename. WoBuildResourceFilename builds a path internally, which it then searches to locate the files. For Microsoft Windows platforms, the vdatools\windows directory will be searched prior to the vdatools directory. Exploiting this feature, the following code segment from the file $WAVE_DIR/lib/vdatools/wographicsbuttons.pro shows one method of specifying drawn buttons by using the WoBuildResourceFilename routine:
ext = '.xbm'
IF STRMATCH(GETPLATFORM(), 'win') THEN ext = '.bmp'
graphics_buttons_toggle = {, $
LAYOUT_NAME: 'graphicsButtons_1', $
DESCRIPTOR: 'redraw', $
CALLBACK: 'WoGBBRedrawCB', $
STATUS_CALLBACK: 'WoGBBRedrawStatusCB', $
INSENSITIVE_PIXMAP: $
WoBuildResourceFilename$
('redrawoperationx'+ext), $
PIXMAP: WoBuildResourceFilename$
(&'redrawoperation'+ext), $
DESCRIPTOR: 'cut', $
CALLBACK: 'WoGBBCutCB', $
STATUS_CALLBACK: 'WoGBBCutStatusCB', $
INSENSITIVE_PIXMAP: $
WoBuildResourceFilename$
('cutoperationx'+ext), $
PIXMAP: WoBuildResourceFilename$
('cutoperation'+ext), $
               .
               .
               .
 
note
The VDA utilities routine WoSetToolIcon requires a filename without an extension and constructs the correct path name in all systems.

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.