Progress
Application Development
Environment — Getting Started


Detailed Customer Section Procedure

The following sections lead you through assembling the Customer section in more detail.

Adding a SmartDataObject

The first SmartObject added in most applications is the SDO that acts as a data source for the rest of the application’s SmartObjects.

Follow these steps to add an SDO:

  1. Choose the SDO icon in the Object Palette to open the Choose SmartDataObject dialog box:
  2. Select dcust.w and choose OK.
  3. Move the object to the Customer section.
  4. As your pointer passes over the main window, the pointer resembles the SDO icon.

  5. Click once in the Customer section. You do not need to establish an exact position for an SDO because it is invisible when the application is running.
  6. The new SDO appears in the Customer section of the window:

Adding a SmartDataViewer

The next object to add is an SDV. The SDV displays the customer information retrieved by the SDO.

Follow these steps to add an SDV:

  1. Choose the SDV icon in the Object Palette to open the Choose SmartDataViewer dialog box:
  2. Select vcust.w and choose OK.
  3. Drag the object to the Customer section. As you pass the pointer over the main window, the pointer resembles the SDV icon.
  4. Click once in the Customer section.
  5. The Progress Advisor opens, notifies you that the SDV instance, h_vcust, should be a data target for another SmartObject, and offers to create a Data SmartLink from the SDO instance, h_dcust:

    NOTE: The Progress Advisor refers to SmartObjects with an h_ prefix, for example, vcust as h_vcust, to indicate a handle. A handle refers to an instance of a SmartObject in memory.

  6. Select the radio button to create the SmartLink and choose OK.
  7. The Progress Advisor opens again, notifies you that the SDV instance, h_vcust, should be an Update Source for some other SmartObject, and offers to create an Update SmartLink to the SDO instance, h_dcust:

  8. Select the radio button to create the SmartLink and choose OK.
  9. The SDV, vcust, appears in the Customer section.

  10. Position the SDV within the Customer section, aligning it on the right edge of the design window, as shown in the following figure:
  11. Double-click the SDV to open its property sheet:
  12. Choose the SmartLinks button to view SmartLink information:
  13. The SmartLinks dialog box opens showing a Data SmartLink from h_dcust to h_vcust and an Update SmartLink from h_vcust to h_dcust:

  14. Close the SmartLinks dialog box and property sheet.
  15. Save your work.

Your next task is to add two buttons to the Customer section, complete with ToolTips, images, and help text.

Creating and Positioning the Buttons

The first step in adding buttons to your application is to create and position them.

Follow these steps to create and position the buttons:

  1. Double-click the Button icon in the Object Palette.
  2. Click in the Customer section in two places to add two buttons, as shown. Do not position the buttons exactly. You will use a Properties Window to specify precise settings later. The main window should look something like the following figure:
  3. Choose the Pointer icon and, holding down the CTRL key, select both buttons. Then choose Window Properties Window from the AppBuilder menu.
  4. The Properties Window is a means to quickly set common attributes in many objects at once:

  5. Double-click to expand the options under the Geometry row:
  6. NOTE: In this Properties Window, you can only change one value at a time. Select a row, type a value in the fill-in field next to the check-mark button, and then choose the check-mark to commit the change.

  7. Set the following attributes for the buttons:
  8. Attribute
    Value
    Column
    14
    Height
    2.38
    Width
    10

    When you finish, the property sheet should looks like this:

  9. Close the Properties Window and manually adjust the buttons’ vertical positions to resemble the following figure:
Adding ToolTips, Help IDs, and Images To the Buttons

After creating and positioning the buttons, you are ready to add a ToolTip, a Help ID, and an image to each button.

Follow these steps to add ToolTips, images, and help IDs to the buttons:

  1. Open the property sheet for BUTTON-1 and set the following properties:
  2. Property
    Value
    Tooltip
    Find Customer
    Help ID
    1

  3. Choose the Up button in the Images section to open the Choose Image dialog box.
  4. Select Findcust.jpg in the images folder in your working directory.
  5. The button’s property sheet now looks like this:

  6. Repeat the procedure for BUTTON-2, setting the following properties:
  7. Property
    Value
    Tooltip
    Maintain Customer
    Help ID
    2
    Up Image
    mntcust.jpg

    When you finish, your SmartWindow should appear as follows:

Adding Help Text To the Window

Now that you have added Help IDs, you need to link a context-sensitive help file to your application. You add a help file for a window. All of the simple objects on that window reference the same context-sensitive help.

Follow these steps to add a context-sensitive help file:

  1. Choose the List Object icon on the AppBuilder toolbar to open the List Objects dialog box:
  2. Select wWin from the Name list to select the window object.
  3. Choose the Object Properties icon in the AppBuilder toolbar to open the property sheet for the window:
  4. Choose the Context Help toggle-box to activate context sensitive help.
  5. Type sports2000.hlp in the Help File text box and choose OK to close the dialog box.
  6. Save your work.
Coding Event Triggers For the Buttons

Your next step is to add code to the buttons. When the user clicks on either button, a CHOOSE event occurs. Using the Section Editor, you can quickly add code to launch the appropriate module when each CHOOSE event occurs.

To launch the appropriate module when the user chooses a button, follow these steps to add the trigger code:

  1. Select BUTTON-1 and open the Section Editor with the Edit Code icon in the AppBuilder toolbar:
  2. Between the DO and END statements, add the following code:
  3. RUN wfndcust.w  (h_dcust). 
    

    NOTE: This statement passes the handle for the dcust SDO to the module you are starting. As a result, the new module opens on the same customer record. Because the new module does not have an internal data source, it cannot run on its own.

  4. Select BUTTON-2 in the Object combo-box.
  5. Between the DO and END statements, add the following code:
  6.  RUN wmntcust.w (h_dcust). 
    

  7. Choose File Close Window or the Close Window button to save the new code and return to the workspace.
  8. NOTE: If you do not want to save code that you entered in the Section Editor, you must use the Edit Undo menu options.

  9. Save your work.

Now that you have built the Customer section of the SmartWindow, you can add SmartObjects to the Order section.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095