Page 466
Figure 17.8.
Power Objects Designer
requires commit
or rollback before closing the
window.
To exit the Browsing Table window, you can either close the window using typical Windows 95 methods or click on the Stop icon on the toolbar.
Now that you've created a new database session, let's see how a new application object is created. To create the new application objectwhich you will name Flugleyou can choose from these three methods:
A window, labeled Create as, will appear, prompting you for the directory where the application object should be stored. By default, the Power Objects Designer will save your objects in the Power Objects directory; however, you should save your objects in a directory that you have created for storing application-specific files. Enter Flugle in the File name field and click Save. You will then see the Flugle application object in the Main window (application objects are represented by a folder).
To view the property sheet for the application that you have just created, select the Flugle application in the Main window and perform one of the following steps:
Figure 17.9 displays the property sheet for the Flugle application.
Page 467
Figure 17.9.
Power Objects
application property
sheet.
Now that you've created the application object, you're ready to create your first form. You are going to create a simple form that will display the Student ID, last name, and first name, sorted by last name and first name. Before you create a form, you must select the application to which it will belong. Therefore, select the Flugle application in the Main window, and click the New Form icon on the left side of the horizontal toolbar (it looks like a miniature form with a blue band on top). You will see a window, labeled Form1, appear (see Figure 17.10). On the left side of the screen, you should also see the Object Palette.
There are certain form properties that you'll typically want to set. To change the properties for the new form, be sure that the form is selected, and then right-click the Property Sheet menu item. The properties dialog box appears (see Figure 12.11). Scroll down the property list until you see the RecSrcSession property. In the field to the right of the RecSrcSession label, enter Flugle. Scroll up the property list until you see the RecordSource property. In the field to the right of the RecordSource label, enter Student; the RecordSource identifies the table or view from which the form retrieves records.
Page 468
Figure 17.10.
New form is dis-
played.
Figure 17.11.
Setting the
RecSrcSession and
RecordSource form
properties.
Of course, the form is still emptyit contains no objects. There are three categories of objects that can be placed on a form:
Containers | These are objects that can contain other objects such as embedded forms, repeater displays, classes, OLE objects, and rectangles/ovals. |
Static objects | These are graphical elements such as lines, ovals, and static text. |
Page 469
Controls | These are objects that hold data values that are either retrieved from the database, derived from the database, or entered by the user. For example, text fields, list boxes, combo boxes, and popup lists are examples of this type of control. Controls also include objects that affect the behavior of the form such as pushbuttons and scrollbars. |
Using the Object Palette, let's add some controls to your form.
Figure 17.12. However, these text fields know nothing about the Student table; you need
to display the property sheet for each field.
Page 470 Figure 17.13. When you close the property sheet, your form should look like the one displayed in
Figure 17.15.
Adding text fields to
the form.
Setting the
DataSource property
for the text field.