You can add Text parts (data fields) to your Window, either manually or with the Quick Form function. The next section takes you through both techniques. In addition to the Text and Label parts, you will also add two Push Buttons to your Window.
See Figure 97 for placement of these parts. These parts are for the Customer Number label and its corresponding text area.
The Label is automatically resized and now says Customer Number.
A context menu is displayed.
Note: | If a Settings notebook is displayed, changing it to a Properties window will make the tutorial instructions easier to follow. To change the window, from the VisualAge Organizer window, select Options, then Preferences. On the General tab, under Preferred Settings View, select Properties Table. Select OK. In order to bring up the Properties Table, you will need to close the Settings notebook and repeat steps 3 and 4. |
The Properties window is displayed. Property names are listed in alphabetical order.
A push button is displayed.
The Converter window is displayed.
The Converter window closes.
By setting notifyChangeOnEachKeystroketo false, editing and other actions will not occur until the cursor moves out of the Text part field. Otherwise, every keystroke during data entry to the field will trigger a data edit check of the field by VisualAge Generator.
The changes have now taken effect.
A context menu is displayed.
The Start connection from (CUSTOMER) window is displayed.
The mouse pointer is displayed as
connected to a dashed line. This indicates that you are in the process
of making a connection.
A context menu is displayed.
A blue line now is displayed connecting the Customer Number Text part and the CUSNUM data attribute in the CUSTOMER record. By selecting the blue line, the description of the connection is displayed in the status area at the bottom of the Composition Editor. This attribute-to-attribute connection causes the data item CUSNUM in the CUSTOMER record to be updated when the Customer Number Text part is changed, and causes the Customer Number Text part (when displayed) to be updated when the data item CUSNUM is changed.
A faster way to add the parts and connections to the window is to use a function called Quick Form to complete the following steps:
To add the parts:
A context menu for the VAGen Record part is displayed.
A list of the data item names is displayed. These data items are defined in the VAGen record part.
Your mouse pointer is now in the form of a cross-hair.
A Text part and a Label (Customer Name) are added to the Window. An attribute-to-attribute connection is created, and the data type is set according to the CUSNAME data item definition.
The Window now has four Text parts with Labels, corresponding to those shown in Figure 97.
Complete the following steps to add Push Buttons to the bottom of your Window:
The parts palette shows a list of all parts in the Buttons category.
A Push Button is displayed at the bottom of the Window. The Push Button part remains selected and your mouse pointer remains loaded.
A second Push Button is displayed on the Window. The Push Button part remains selected and your mouse pointer remains loaded.
The Push Button part is no longer selected and your mouse pointer changes from a cross hair to an arrow.
Note: | You can unload the mouse pointer at any time by selecting the selection tool
|
The cursor is now at the end of the default name of the Push Button.
The Push Button is now labeled Find and has automatically resized to fit the text.
The Push Buttons have now been changed to Find and Cancel. The size of each Push Button automatically adjusts to the size of its label.
Now that you have most of the visual parts of your user interface on the Window, you can use the tool bar to align those parts in the window.