Application Developer Guide > Building VDA Tools > Creating a Navigator
  

Creating a Navigator
A Navigator is an interface for VDA Tools. For instance, a Navigator can be created to combine several VDA Tools into a single application. A Navigator is provided with PV‑WAVE; however, an application programmer can easily modify this prewritten Navigator or create an entirely new Navigator.
The PV-WAVE Navigator
The PV‑WAVE Navigator is a prewritten application that is provided with PV‑WAVE. To run the PV‑WAVE Navigator, enter  Navigator  at the PV‑WAVE command line.
The PV‑WAVE Navigator is located in the directory shown in PV-WAVE Navigator Directory Structure.
 
Figure 4-6: PV-WAVE Navigator Directory Structure
 
PV‑WAVE Navigator Files
The PV‑WAVE Navigator consists of the following three files.
*navmenus.pro—Contains definitions for the menus on the Navigator and specifies the menu item callbacks.
*navtools.pro—Contains a list of the names of the VDA Tools, the number of variables that each VDA Tool can accept, and the position coordinates of each VDA Tool in the Navigator.
*navigator.pro—This is the main program file for the Navigator. It contains the callback procedures for all of the callbacks in navmenus.pro. This file contains routines that handle session saving and restoring. In addition, this file contains the main startup routine for the Navigator.
If you create your own Navigator, we recommend that you follow this basic design; however, you might not need all the components of the PV‑WAVE Navigator. For instance, you could create a Navigator that does not have a menu bar.
Modifying the PV‑WAVE Navigator
You can modify the existing PV‑WAVE Navigator in a number of ways. For instance, you can add or remove VDA Tools from the Navigator.
To modify the Navigator, edit the appropriate files in the navigator-1_1 directory. (We recommend that you make a copy of any file you change.)
For example, to remove the WzSurface Tool from the Navigator, edit the file navtools.pro to remove the WzSurface name, number of variables that the VDA Tool can accept, and position elements. You do not need to modify the navigator.pro file to add or remove a VDA Tool.
 
note
You can also use the Configure menu on the Navigator to add or remove VDA Tools. The Configure menu provides an interactive way to perform the same task described in this section.
Creating a New Navigator
The most basic requirements for a Navigator are that it must be able to call VDA Tools and determine which variable is currently selected. The second requirement is important so that the Navigator knows what variable to load when a particular VDA Tool is called.
The PV‑WAVE Navigator is only one possible way in which a Navigator could be configured. Depending on the application you have in mind, you may want to create an entirely different Navigator.
1. Decide what tools you want your Navigator to have.
2. Decide what kind of user interface you want. You might choose not to have a menu bar, for instance.
3. Write the main Navigator procedures. To do this, we recommend that you look at the existing PV‑WAVE Navigator files for guidance. These files define menus and buttons, specify the VDA Tools in the Navigator, implement callbacks, and initialize the Navigator.
Resources for the Navigator
The user interface resources for the PV‑WAVE Navigator are located in the same area as the other VDA Tool resources as shown in X Resource Locations.
 
Figure 4-7: X Resource Locations

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