Previous | Table of Contents | Next

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.

Creating a New Application

Now that you've created a new database session, let's see how a new application object is created. To create the new application object—which you will name Flugle—you 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.

Creating a Form

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 empty—it 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.

Adding Controls to a Form

Using the Object Palette, let's add some controls to your form.

  1. Select the Text Item icon from the Object Palette (it is directly below the red pointer icon in the left corner of the palette), and left-click the mouse on the form.
  2. Do this three times so that you have three fields on the form.
  3. Align the fields so that the form appears as shown in Figure 17.12.

Figure 17.12.
Adding text fields to
the form.

However, these text fields know nothing about the Student table; you need to display the property sheet for each field.

  1. Select the first field, and right-click Property Sheet.
  2. In the DataSource property, enter Student_ID (see Figure 17.13). You should also change the name of the field; scroll down to the Name property and enter Student_ID. Exit the property sheet for this field.

Page 470

Figure 17.13.
Setting the
DataSource property
for the text field.

  1. For the second field, enter Last_Name in both the DataSource and Name properties. Also, set the Datatype property to String.
  2. For the third field, enter First_Name in both the DataSource and Name properties. As with the second field, set the Datatype property to String.
  3. To add column headings for the three fields, select the Static Text tool from the Object Palette (it is to the right of the red pointer icon).
  4. Left-click the mouse over the Student_ID text item. Change the text from static1 to Student ID.
  5. In the same way, create two other column headings: one over the Last_Name text field and the other over the First_Name text field.
  6. To format the static text objects, select them by pressing Shift and clicking all three objects. Right-click Property Sheet; the property sheet will appear with a label of Multiple Selection Properties, signifying that the properties will be applied to all three static text objects. Set the FontSize property to 10 and the FontBold property to True (see Figure 17.14).

When you close the property sheet, your form should look like the one displayed in Figure 17.15.

Previous | Table of Contents | Next

Используются технологии uCoz