Getting Started


Customer Information window

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.

  1. Select the Data Entry category artwork, and drop a Text part artwork and a Label part artworkinside the top portion of the Window.

    See Figure 97 for placement of these parts. These parts are for the Customer Number label and its corresponding text area.

  2. Place the mouse pointer on the word Label1 in your Customer Information window, and press ALT+mouse button 1. Type the name Customer Number. Click anywhere except on the label to end text edit mode.

    The Label is automatically resized and now says Customer Number.

  3. Click mouse button 2 on the customer number Text part.

    A context menu is displayed.

  4. Select Open Settings.
    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.

  5. Locate converter in the Name column and click beside it in the Value column.

    A push button is displayed.

  6. Select the push button.

    The Converter window is displayed.

  7. From the Data Type drop-down list box, select String.
  8. Select OK.

    The Converter window closes.

  9. Ensure that the notifyChangeOnEachKeystroke property is set to false. If it is set to true, click in the Value field with mouse button 1 to display the radio buttons. Select false.

    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.

  10. Close the Properties window to accept the values you have changed.

    The changes have now taken effect.

  11. Select the CUSTOMER record with mouse button 2.

    A context menu is displayed.

  12. Select Connect from the context menu.

    The Start connection from (CUSTOMER) window is displayed.

  13. Select CUSNUM data from the Attribute column; then select OK.

    The mouse pointer is displayed as artworkconnected to a dashed line. This indicates that you are in the process of making a connection.

  14. Select the Customer Number Text part.

    A context menu is displayed.

  15. Select object.

    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:

  1. Build the Label part.
  2. Change the label to the data item description from the record.
  3. Build the Text part.
  4. Set the correct data type using the data item definition from the record.
  5. Make an attribute-to-attribute connection between the Text part and the appropriate data item in the CUSTOMER record.

To add the parts:

  1. Select the CUSTOMER record part with mouse button 2

    A context menu for the VAGen Record part is displayed.

  2. Select Quick Form.

    A list of the data item names is displayed. These data items are defined in the VAGen record part.

  3. Select CUSNAME.

    Your mouse pointer is now in the form of a cross-hair.

  4. Click on the Window where you want this field positioned.

    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.

  5. Repeat the previous four steps for the CUSCONTACT and CUSPHONE data items.

    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:

  1. Select the Buttons category artwork.

    The parts palette shows a list of all parts in the Buttons category.

  2. Select the Push Button part artwork. Select the Sticky checkbox and click once at the bottom of the Window.

    A Push Button is displayed at the bottom of the Window. The Push Button part remains selected and your mouse pointer remains loaded.

  3. Click to the right of your first Push Button.

    A second Push Button is displayed on the Window. The Push Button part remains selected and your mouse pointer remains loaded.

  4. Deselect the Sticky checkbox.

    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 artworkfrom the tool bar.
  5. To change the Push Button labels, select the button label by placing your mouse pointer over one of the Push Buttons and pressing ALT+mouse button 1.

    The cursor is now at the end of the default name of the Push Button.

  6. Type Find on the first Push Button and click anywhere in the editor except on the part you just changed.

    The Push Button is now labeled Find and has automatically resized to fit the text.

  7. Select the button label on the next Push Button and change it to Cancel. Click anywhere to exit the text edit mode.

    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.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]