Maintaining Product and Version Information

The VkApp class provides several access functions and constant data members that you can use to identify your application and the current ViewKit ObjectPak release.

Static integer constant

VkApp::ViewKitMajorRelease is a static integer constant that identifies the major release of ViewKit ObjectPak; VkApp::ViewKitMinorRelease is a static integer constant that identifies the minor release of ViewKit ObjectPak, and

Static character array constant

VkApp::ViewKitReleaseString is a static character array constant that contains the complete major and minor release information. For example, in a 1.2 release, the value of VkApp::ViewKitMajorRelease would be 1, the value of VkApp::ViewKitMinorRelease would be 2, and the value of VkApp::ViewKitReleaseString would be "ViewKit Release: 1.2". These values can be useful if you need to provide conditional statements in your code to handle different versions of the ViewKit ObjectPak library.

Setting version information

You can use VkApp::setVersionString() to set version information for an application based on ViewKit ObjectPak:

void setVersionString(const char *versionInfo)

Retrieving version information

You can retrieve the version string using VkApp::versionString():

const char *versionString()

ViewKit ObjectPak displays this version string in the Product Information dialog that is posted when a user selects "Product Info" from the default Help menu. (See "ViewKit Help Menu" for more information on the default Help menu.) For example, consider an application that you invoke with the command MapMaker that includes the following line of code:

theApplication->setVersionString("MapMaker 2.1");

If you select "Product Info" from the default Help menu, your application posts the dialog shown in Figure 9.

Figure 9. Example of the Product Information Dialog

Using custom information dialogs

You can use VkApp::setAboutDialog() to replace the standard Product Information dialog with your own custom dialog:

void setAboutDialog(VkDialogManager *dialog)

You must provide setAboutDialog() with a pointer to an object that is a subclass of VkDialogManager. Most frequently, you will actually create a subclass of VkGenericDialog, an abstract subclass of VkDialogManager that simplifies the process of creating custom dialogs. Refer to "Deriving New Dialog Classes Using the Generic Dialog" .

The VkApp::aboutDialog() function returns a pointer to the custom Product Information dialog you have installed:

VkDialogManager* aboutDialog()