Customize Toolbar Controls

The Customize Toolbar Controls form makes it easy for you to customize the properties of the controls (buttons) that VPME and you put on the Form Toolbar (see the Creating Forms: Form Toolbar) and Application Toolbar (see the Application Toolbar). 

Tip Ė Use Your Own Icons: Many developers like to use their own icons for toolbar controls. The Customize Toolbar Controls form makes it easy to use your own icons. Simply add your icon picture file to the Project Manager, select a toolbar control on the Customize Toolbar Controls form and change itís Picture File property to the toolbar picture file that you want to use. Adjust other properties to fit your picture file. Thatís it!

Property Values: Each record displayed on the Customize Toolbar Controls form shows the settings of certain property values for a single toolbar button. The properties included are those that define the interface elements such as the size, caption, picture, and tooltip text. The section of the form for Dual Mode Display defines additional property settings for buttons with dual modes (On/Off) like the Parent Mode and Filter buttons.

Default Controls: When you first install VPM Enterprise and create a new application, the default Form and Application Toolbar controls that come with VPME are displayed on the Customize Toolbar Controls form. You can modify the properties of an applicationís Form and Application default toolbar controls on the Customize Toolbar Controls form.

Your Toolbar Controls: If you create your own toolbar controls based on the VPME CommandButton_Toolbar class, you can add it to the controls displayed on the Customize Toolbar Controls so that you can use the Customize Toolbar Controls form to customize its properties as well.

Customize Toolbar Controls Form Fields

The fields on the Customize Toolbar Controls form are explained below.

∑       Control ID: A unique ID of up to 30 characters that identifies the toolbar control.

∑       Size: Properties that determine the size of the toolbar control.

∑       Auto Size: Specifies whether the control should be automatically resized to fit its contents. In most cases, you would leave the Auto Size check box unchecked and enter the height and width you want for your toolbar control in the Control Height and Control Width boxes below. With Auto Size checked, the toolbar controls probably wonít be the size you want, and you run the risk that the controls on a toolbar will not be all the same size.

∑       Control Height: Specifies the height of the toolbar control.

∑       Control Width: Specifies the width of the toolbar control.

Tip: Your control height and width entries need to take into account the size of the picture that a control will use and the length of the caption the control will use, if any.

∑       Display: Properties that determine what is displayed on a toolbar control and how it is displayed.

∑       Caption: Contains the text to be displayed in the caption of the control. Whether the caption is displayed is determined by the Picture Position entry.

∑       Caption Alignment: Specifies the alignment of the caption in the toolbar control. The alignments that you can select are listed in the Caption Aligment combo box.

∑       Picture File: Specifies the image to display on the toolbar control. Use the ellipses button to use an Open Picture dialog to find a picture file. Important: When you enter your own picture file, you must also add the picture file to the Project Manager.

∑       Disabled Picture File: Specifies the image to display on the toolbar control when the control is disabled. Use the ellipses button to use an Open Picture dialog to find a picture file. Important: When you enter your own picture file, you must also add the picture file to the Project Manager.

∑       Picture Position: Specifies the location of the picture relative to the caption. The picture and caption, as a unit, appear centered on the control. If no caption exists, the picture is located relative to the center of the control. The options that you can select are listed in the Picture Position combo box.

∑       Picture Margin: Specifies the margin in pixels between the image specified by the Picture File property and the edge of the toolbar control as determined by the Picture Position property.

∑       Picture Spacing: Specifies the margin in pixels between the image specified by the Picture File property and text specified by the Caption property on a control.

∑       Tooltip Text: Contains the text that appears as a ToolTip for the control. You can set the ToolTip Text property only if the ShowTips property of the toolbar that contains the control is set to True (.T.), which is the case for the VPME Form and Application Toolbars.

∑       Dual Mode Display: Properties for buttons with dual modes (On/Off) like the Parent Mode and Filter buttons.

∑       Caption: Contains the text to be displayed in the caption of the control when the control is in the On (.T.) position. Whether the caption is displayed is determined by the controls Picture Position entry above.

∑       Picture File: Specifies the image to display on the toolbar control when the control is in the On (.T.) position. Use the ellipses button to use an Open Picture dialog to find a picture file. Important: When you enter your own picture file, you must also add the picture file to the Project Manager.

∑       Tooltip Text: Contains the text that appears as a ToolTip for the control when the control is in the On (.T.) position. You can set the ToolTip Text property only if the ShowTips property of the toolbar that contains the control is set to True (.T.).

Adding Your Toolbar Controls

If you create your own toolbar controls for the Form Toolbar, the Application Toolbar or your own toolbar, you can use the Customize Toolbar Controls functionality for your toolbar controls.

ō How to use the Customize Toolbar Controls functionality for your toolbar controls

1.   When you create a toolbar button control, base it on the CommandButton_Toolbar class or a subclass thereof.

2.   Fill in the buttonís cControlID property with a unique ID of up to 30 characters.

3.  Create a record on the Customize Toolbar Controls form for the toolbar button control. Enter the control properties. Make sure the Control ID field contains the ID you entered into the cControlID property of the toolbar button control.

Technical Info

The SetToolbarControlProperties method of the Application object sets property values for the toolbar control whose object reference is passed to the method. The Init event code of the CommandButton_Toolbar class calls the SetToolbarControlProperties method of the Application object.

The records displayed on the Customize Toolbar Controls form are stored in the SVPMToolbarControls table. The cControlID property of the CommandButton_Toolbar class links a toolbar control to its record in the SVPMToolbarControls table.

The Customize Toolbar Controls properties entries override the class-level entries for a toolbar control based on the CommandButton_Toolbar class. Accordingly, the properties that you see when viewing a toolbar control button in the Class Designer will not be the properties used for the button where the Customize Toolbar Controls properties are different.

More:

New Project Customize Toolbar Controls