Some developers like to provide user access to their applications by displaying an Access Panel (vertical toolbar) with command buttons that lead the user to important application functionality. The VPME Sample Application displays an Access Panel on the left side of the application window.
The Sample Application Access Panel provides access to important forms such as the Employees, Job Status, etc. forms. This left-hand Access Panel vertical toolbar display gives the application an MS Office look. The Sample Application Access Panel uses large command buttons and is not movable.
VPME makes it easy for you to display your own Access Panel toolbar. It is up to you to implement the controls you want on the Access Panel toolbar and to set the toolbar properties. However, VPME provides a “starter” toolbar class that you can modify to create your own Access Panel toolbar, and you can use the Sample Application Access Panel toolbar as a model.
How to Create and Display an Access Panel
When an application is started, the InstantiateStartupToolbar method of the Application object instantiates an Access Panel toolbar if its properties cStartupToolbar and cStartupToolbar_ClassLibrary contain the names of an Acess Panel toolbar class and its class library.
Default Property Entries: The cStartupToolbar and cStartupToolbar_ClassLibrary properties are empty by default, which means that an Access Panel toolbar will not be instantiated until you enter values for your own Access Panel toolbar class into the two properties.
Briefly then, if you want to display an Access Panel, you must:
1. Create an Access Panel toolbar class, and
2. Enter the the name of your Access Panel toolbar class and the class library that contains it into the cStartupToolbar and cStartupToolbar_ClassLibrary properties of the Application object.
Toolbar_Startup Class: The VPMAPP, DEVAPP and PROAPP class libraries contain a “Toolbar_Startup” class that you can modify to create an Access Panel. Add your own toolbar controls and set the toolbar properties so that the Access Panel is displayed as you want. The Access Panel used in the VPME Sample Application is based on the Toolbar_Startup class contained in the Sample Application’s PROAPP class library. You can use the Sample Application Access Panel toolbar as a model for your own Access Panel.
Where to Modify the Toolbar_Startup Class
If you decide to base your Access Panel on the Toolbar_Startup class, most of the time you will simply modify the Toolbar_Startup class in the application’s PROAPP.VCX class library. Normally, each application you create will need it’s own Access Panel.
However, if you want to create an Access Panel that can be inherited by all your applications, modify the Toolbar_Startup class in the VPMAPP or DEVAPP class library. Perhaps, you’ll develop a basic Access Panel style that you want to make available to all applications and that you will modify further at the PROAPP level for each application.
Where to Identify the Access Panel Toolbar Class to Use
Whatever approach you take to creating an Access Panel toolbar, make sure that when the InstantiateStartupToolbar method of the Application object is run for an application, the cStartupToolbar and cStartupToolbar_ClassLibrary properties of the application’s Application object identify the Access Panel toolbar class that you want the application to use. Since by default the Application object is instantiated from the PROApp class in the PROAPP.VCX class library, you need to make sure that the cStartupToolbar and cStartupToolbar_ClassLibrary properties of the PROApp class identify the Access Panel that you want to use when an application runs. The property entries at the PROApp class level are inherited from the VPMApp class.
Tip: Property entries at the VPM or DEV level affect all applications. Property entries at the PRO-level affect a specific application.
Tip: You can use the Class Browser or the Project Manager to enter values into the cStartupToolbar and cStartupToolbar_ClassLibrary properties. If you want to enter values into these properties through code, the code property references would be _SCREEN.oApp.cStartupToolbar and _SCREEN.oApp.cStartupToolbar_ClassLibrary.
Application Toolbar Access Panel Button & Help Menu Option: If you put an Access Panel toolbar that can be closed in your application, it’s a good idea to put an Access Panel button on the Application Toolbar to redisplay the Access Panel if it is closed.
In addition or alternatively, put an Access Panel option on the Help menu that redisplays the Access Panel.
Even though the Access Panel in the VPME Sample Application is not closeable, the Sample Application includes an Access Panel button and a Help menu option that you can copy. See the Application Toolbar chapter for info about modifying the Application Toolbar.