Extended About and System Dialogs

A Data Access Worldwide White Paper
by Vincent Oorsprong

January 2003
Last Edited: February 6th, 2003

Overview
A Windows application should have an About dialog that displays information about the application to the user. Since the release of Visual DataFlex 4.0 in 1996, Data Access provided a package called dfabout.pkg that can be used for this purpose. This document shows a newer version of the About and System Information dialogs that you can include in your Visual DataFlex application. The new code is fully IDE compliant which makes the dialogs easy to maintain and change.

Current information dialogs
When you create a new Visual DataFlex application with the IDE the following code is automatically added - in the main panel object - to your program code:

Use DfAbout.pkg

Object oAbout is an AboutDialog
   Set ProductName to "Order Sample Application"
   Set Copyright   to "Copyright: 2002 Data Access Corporation"
   Set Author      to "Author: Data Access Worldwide"
End_Object

Procedure Activate_About
   Send Popup_Modal of oAbout
End_Procedure

If you include HELPA_PM.INC in the menu, the help pulldown contains a menu choice that invokes the Activate_About method.


Figure 1: Old About Dialog.

The version information string shown is no longer hardcoded (since the VDF8.1 release). Instead, it is read from the version resource included in the EXE file. This means that the value shown is always in sync with the current EXE version.

If the user clicks the "System Info" button when the about dialog is active a new dialog is opened which shows important information about the system. Important information such as what workspace paths are currently active, what the behavior of the ENTER key is and what Connectivity Kit drivers are loaded. In the following screenshot you will see an example of the information.


Figure 2: Old System Information Dialog.

The current About and System dialogs are coded in package format and are not editable as components of your application. You need to open them in full source code mode to make changes in content and size.

New information dialogs
Why new ones? The new set of About and System Information dialogs presented in this white paper are fully editable via the IDE and can be loaded as components. Both dialogs have the file extension DG (About.dg and SysInfoDialog.dg).


Figure 3: New About Dialog.

As you can see there is visually not much difference between the old and the new About dialog. The tiny visible difference is a better - equal - distance between the four text strings in the box. The new About dialog includes the code for the System Information dialog. If you want to save your sysinfo.dg under a different name you need to change the reference inside this component at two locations. The first is the USE statement and the second location is the objectname reference in the System Information button.


Figure 4: About Dialog in Code Editor Overview.

As you can see in figure 4, the IDE is now capable of loading the About dialog in the component outline mode instead of only in full source code mode as before. Calling the About dialog has been changed from the prior code to only include this component.


Figure 5: How to Call the About Dialog.


While the changes to the About dialog are minimal, the changes to the system information dialog are huge. The old System Information dialog used an editor object to show the information and the new dialog uses a treeview. In this way we can categorize the information. The current main groups are:


Figure 6: A Treeview with the System Information Stored in Groups.

GroupDescription of contents
WorkSpace

All the individual path settings of the workspace object together making the DF_OPEN_PATH are shown here.
Application

Application properties such as the name of the helpfile, the registry path for storing application information, and how the ENTER key operates in your application are shown in this part of the System Information dialog.
Database Drivers

this shows the database drivers that are currently loaded. The tree will always show at least one driver because it is not possible to unload the DataFlex database driver.
Versions

Here we will show the version information read from the version resource of the current program



extended with version information from the EXE and DLL files present in the bin directory.



Last but not least the loaded modules (DLL's etc) and their version information are shown here.
Memory

Current Memory status consisting of the approximate percentage of total physical memory that is in use, the percentage of available physical memory and page file and virtual memory usage. The last item shows the total amount of available memory in bytes.
Paths

Windows keeps track of several paths. For each path we list the long and short pathname (8.3 notation). The Windows current directory, the Windows system directory and the temporary files path are shown in all situations. The three profile values are only retrieved for Windows 2000 and Windows XP machines. The logical drives information is enumerated from your system and changes each time as drive mappings become available.
KeyBoard

Which keyboard is connected? How much function keys are defined and which layout is in use? This latter one is the name of the active input locale identifier (formerly called the keyboard layout).
AcceleratorKeys

The Virtual Machine allows you to define up to 54 so called FlexKeys to be able to redefine access such as save or delete without recompiling the program. This part of the system information shows what physical key is behind a particular accelerator key in your current Visual DataFlex application
Registration

What Data Access Worldwide license is in use for executing this program?
User

Here we show the username currently logged in, the name of your computer, the double click time and the language in use.
WindowsLocale

This part shows various information from the Windows locale such as currency symbol, country code, language, day and month names.
GlobalAttributes

The global runtime attributes are shown here. See the Visual DataFlex documentation for any of the attributes.
GlobalVariables

The important global DataFlex integer variables defined by Data Access. It is not possible to enumerate your own global variables.
SystemMetrics

System metric information such as screen resolution, presence of mouse, mouse wheel, number of display monitors, and size of the scrollbar thumbs.
SystemConfiguration

Here we list the values of the system configuration such as Windows version, operating system name and  directory and path separators.
DataFiles

Which tables are currently opened, which fields and indexes are defined for those tables, what is the relationship between the tables, which connectivity kit driver is used for a particular table etc.

Export to XML
The System Information dialog contains a button labeled "XML Export" and this makes it possible to store all the system information in XML format.


Figure 25: The Export to XML was Ready.

The location of the XML file will be the first path from your DataPath workspace property. The name of the XML file is always SysInfo.XML. You can let an end user send this file to the helpdesk in order to duplicate, find and solve problems. The contents of the XML can be seen here.

Translation
Visual DataFlex 8.2 removed the constant text strings written in the English language from the packages into an include file per language. The new About and System Information dialogs are doing the same for the parts that are not visually editable. So the button labels and captionbar texts are - like with the rest of your views, reportviews and components - able to be translated via the IDE. All text strings used by the program code of the SysInfoDialog.Dg and its support functions are stored in a file called SysInfo_Language_English.Inc. This file can be translated into the languages Visual DataFlex supports. This has not yet been done.

OEM / ANSI
In the export of information from the treeview to XML, there is currently one problem present with no solution. In any Windows control in your own Visual DataFlex application the data is shown in the ANSI character set. DataFlex works internally with the OEM character set. The DataFlex Virtual Machine converts the OEM data to ANSI data for you. Some information however - especially the information retrieved from the Windows Locale - is already in ANSI. Some characters are present in the ANSI character set and not in the OEM character set (for example, the currency symbol for 12 European countries, the '€' character). We cannot convert these exceptions from ANSI to OEM and back without loosing the information. For the treeview the solution is quite simple, the oem_translate_state is set to false. The connection to XML however does not know this property and expects the data in the OEM character set. This means that the ANSI specific characters get lost during export to XML. In a future release of Visual DataFlex DAW will make the conversion to OEM not automatically anymore.

How to use
The code behind this white paper consist of the following 3 files.

FilenameWhere to copy
About dialog templateUnzip the contents of this file to the local or global IDESrc directory on your system. Use the template to create a new About dialog. You can also create a component from this template and place it in the Usr\New\AppSrc directory. This way the component will be copied to your workspace AppSrc directory automatically when creating a new workspace. You can not edit the component visually until registered as a component in your workspace.
System Information dialogIf you want to modify (translate the buttons), unzip the contents of this file to the workspace AppSrc directory. For visual editing you need to register the dialog as a component in your workspace. Another way is to unzip the contents of this file to a sharable directory such as ..\Visual DataFlex\SysInfo.



In that case add the directory to the MakePath settings of the IDE
Functions used by SysInfo DialogThe recommended method is to copy these files to a shareable directory. There is no direct need to edit any function in a workspace. Again when in a shareable directory make sure (as above) that the files can be found by the compiler.


^top

Data Access Worldwide
14000 SW 119 Ave
Miami, FL 33186
305-238-0012
Domestic Sales: 800-451-3539
Fax: 305-238-0017
email: sales@dataaccess.com
Newsgroup Server: news.dataaccess.com
Internet: http://www.dataaccess.com

Data Access Worldwide - Asia Pacific
Suite 5, 333 Wantirna Road, Wantirna VIC 3152 Australia
Phone: +61 3 9800 4233 f: +61 3 9800 4255
Sales: asiapacific@DataAccess.com
Support: support.asiapacific@DataAccess.com
Internet: http://www.DataAccess.com/AsiaPacific

Data Access Worldwide - Brasil
Av.Paulista, 1776 - 21st.Floor
São Paulo -SP - Brazil
CEP 01310-921
Phone: 5511-3262-2000
Fax 5511-3284-1579
Sales: info@dataaccess.com.br
Support: suporte@dataaccess.com.br
Internet: http://www.dataaccess.com.br

Data Access Worldwide - Europe
Lansinkesweg 4
7553 AE Hengelo
The Netherlands
Telephone: +31 (0)74 - 255 56 09
Fax: +31 (0)74 - 250 34 66
Sales: info@dataaccess.nl
Support: support@dataaccess.nl
Internet: http://www.dataaccess.nl

Data Access Technical Support
800-451-3539 / 305-232-3142
email: support@dataaccess.com
Visit our Support Home page to see all of our Support options: http://www.dataaccess.com/support

Copyright Notice
This document is property of Data Access Corporation. With credit to Data Access Corporation for its authorship, you are encouraged to reproduce this information in any format either on paper or electronically, in whole or in part. You may publish this paper as a stand alone document within your own publications conditional on the maintenance of the intent, context, and integrity of the material as it is presented here.

DataFlex is a registered trademark of Data Access Corporation.
Windows
is a registered trademark of Microsoft Corporation.

NO LIABILITY FOR CONSEQUENTIAL DAMAGES
To the maximum extent permitted by applicable law, in no event shall Data Access Corporation be liable for any special, incidental, indirect, or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use any information provided in this document, even if Data Access Corporation has been advised of the possibility of such damages. Because some states and jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.

^ top