Form Design and Form Objects

www.altova.com このトピックを印刷 前のページ 1つ上のレベル 次のページ

ホーム >  プログラマーの レファレンス > Scripting Editor > Forms >

Form Design and Form Objects

Designing a Form consists of the following steps:

 

Placing an object from the Form Object Palette in the Form design.
Assigning values for the properties of individual Form Objects.
Assigning scripts for Form-based events.

 

 

The Form Object Palette

The Form Object Palette contains all the objects that are available for designing Forms and looks something like the screenshot below. Registered ActiveX controls can be added to the Form Object Palette by right-clicking the pane and selecting the Add ActiveX Control command

 

ScrFormObjectPalette

 

To insert an object from the Form Object Palette click the object you want in the palette, then click at the location in the Form where you wish to insert the object. The object will be placed at this location. In many cases you will need to supply some properties of the object via the Properties and Events pane. You can drag the object to other locations as well as resize it. Further, a number of editing commands, such as centering and stacking objects, can be accessed via the context menu of the selected Form object.

 

Some Form objects, such as Timer, are not added to the Form but are created as Tray Components in a tray at the bottom of the Main Window. You can select the object in the tray and set properties and event handlers for the object via the Properties and Events pane. For an example of how Tray Components are handled, see Form usage and commands.

 

 

Some of the most commonly used objects are described below:

 

scripting_statictextLabel: Adds text fields such as captions or field descriptions.

 

scripting_buttoniconButton:        Adds a button. It is possible to assign bitmaps as background images for these buttons.

 

scripting_checkboxCheck Box: Adds a check box, which enables Yes/No type selections.

 

scripting_comboboxCombo Box: Adds a combo box, which allows the user to select an option from a drop-down menu.

 

scripting_listboxList Box: Adds a list box, which displays a list of items for selection.

 

scripting_editiconTextBox: Enables the user to enter a single line of text.

 

scripting_multieditRich TextBox: Enables the user to enter multiple lines of text.

 

 

 

Creating objects and setting their properties

To create an object in the Form, first select the required object in the Form Object Palette and then click the location in the Form where you want to insert it. After the object has been inserted, you can resize it as well as drag it to another location in the Form.

 

When an object is selected in the design, you can specify its properties in the Properties and Events pane. In the toolbar of the Properties and Events pane, click the Properties icon to display a list of the object's properties.

 

For example, in the screenshot below, the Label object with the text Start Date has been selected in the design. In the Properties and Events pane, the name of the object (which is the name that is to be used to identify the object in code, Label1 in the screenshot below) is given in the Design category of properties; in this case, the name of the object is Label1.

 

The text of the label (which is what appears in the Form) must be entered as the value of the Text property in the Appearance category of properties.

 

ScrObjectProps1

 

To assign other object properties, enter values for them in the Properties and Events pane.

 

 

Testing a Form

You can test a form in the Scripting Editor by right-clicking it in the Project Overview pane and selecting the Test Form Command. The Form itself will load with all the Form objects present. However, note that code associated with various form controls will not be executed. To test the code you will have to run a macro containing the form, outside the Scripting Editor.

 


(C) 2019 Altova GmbH