Toolbar_App Class

The Toolbar_App class is the blueprint for the standard VPM Enterprise Application Toolbar. It is a subclass of the Toolbar_ class.

Creating and Displaying the Application Toolbar

When the application is run, here’s how the VPM Enterprise Application Toolbar is created and displayed:

·       The application’s main program calls the Start method of the application object (_SCREEN.oApp).

·       The Start method runs the InstantiateApplicationToolbar method.

·       The InstantiateApplicationToolbar method checks for entries in the cAppToolbar and cAppToolbar_ClassLibrary properties. The cAppToolbar and cAppToolbar_ClassLibrary properties identify the toolbar class that will be used to create the application’s toolbar. The name of the toolbar class is, of course, normally Toolbar_App.

Tip: If you want to use a different toolbar, store the name of the class and class library from which the toolbar should be created in the cAppToolbar and cAppToolbar_ClassLibrary properties. If you do not want to use an Application Toolbar, simply blank-out the cAppToolbar property.

·       The InstantiateApplicationToolbar method instantiates the toolbar object from the Toolbar_App class. The code looks like this:

·                         This.oAppToolbar = CREATEOBJECT(This.cAppToolbar)

·       The InstantiateApplicationToolbar method then displays the toolbar object with this line of code, which calls the Show method of the toolbar object:

·                         This.oAppToolbar.Show()

Properties

The following table lists the class properties. The properties listed include the standard Visual FoxPro class properties that the VPM Enterprise class uses and the VPM Enterprise custom properties. Where appropriate, the Comments column of the table describes a property and provides suggestions for its use.

Property & Initial Value

Comments

Standard Properties Used:

 

Caption = “Application Toolbar”

 

Custom Properties:

 

nReportManagerOptionNumber = 45

Contains the menu option number of the Report Manager menu option as seen in the menu option’s Comment. This number is used to disable the Report Manager button on the toolbar when Menu Security has been used to disable the corresponding menu option. See the comments for the Init event for more information.

Methods

The following table lists the class methods. The methods listed include the standard Visual FoxPro class methods that the VPM Enterprise class uses and the VPM Enterprise custom methods. Where appropriate, the Comments column of the table describes a method and provides suggestions for its use.

Method

Comments

Standard Methods Used:

 

Init

Disables the Report Manager button when Menu Security has been used to disable the corresponding menu option. See the comments for the nReportManagerOptionNumber property for more information.

Custom Methods:

None

Toolbar Button Click Methods:

 

cmdReportManager.Click

Checks to see if there is a modal form on the desktop. If so, the Report Manager cannot be brought up.

If the Report Manager form is already active, bring it on top. Otherwise, runs the RunReportManagerForm method of the application object, _SCREEN.oApp. In turn, the Report Manager form is brought up.

cmdHelp.Click

Brings up the F1 Help window.

cmdPrintForm.Click

Prints an image of the currently active form.

cmdStartupToolbar.Click

Checks to see if there is a modal form on the desktop. If so, the Startup Toolbar cannot be brought up.

If the Startup Toolbar is not active, runs the InstantiateStartupToolbar method of the application object to instantiate the Startup Toolbar.

cmdStartupToolbar.Init

If the Startup Toolbar is not used, makes the Startup Toolbar button invisible.

 

 

More:

Toolbar_Startup Class