Previous | Table of Contents | Next

Page 402

  1. Open the Object Navigator.
  2. Select the canvas object and click the Create icon twice. This creates two default canvases.
  3. The new canvases should be renamed canvas2 and canvas3.
  4. Open the property sheet for each of the new canvases and change the following properties:
Property Setting
Canvas-view type stacked
Bevel none
Background cyan
Stacked View Width 592
Stacked View Height 210
Display Y Position 90

The next step is to place the image item and the block-three items used for the Glasses records on the new canvases.

  1. Open the Layout Editor and select each of the block-three items (Glasses records). Items will not be deselected if the shift key is held down while selecting additional items.

  2. Double-click any of the selected items to open a multiple item property sheet.

  3. Change the canvas property to canvas2. This causes the items to disappear from the Layout Editor.

  4. Select all of the block-three boilerplate items.

  5. Select the Edit, Cut menu options, which removes the boilerplate from the original canvas.

  6. Open canvas2 and select the Edit, Paste menu option. The boilerplate appears on canvas two with its original spacing.

  7. Format the canvas to your taste.

  8. Open the block-three property sheet and change the records displayed property to 10.

    Figure 15.22 displays canvas2 after the changes have been made.

  9. The image item, image37, is placed on canvas3 by changing the item's canvas property to canvas3.

  10. Open the Layout Editor for canvas3 and reformat the position of the image item. Canvas1 now has sufficient space.

  11. The block-two property, records displayed, should be changed to 10.

    The reformatted canvas is shown in Figure 23.
    A form displays a canvas when the input focus moves into an item contained on the canvas. This can occur by tabbing from one item to another or by navigating to another

Page 403

block. The Employee Update form uses buttons and the go_block subprogram to display the various canvases. The go_block subprogram is placed in a When-button-pressed trigger linked to a button. When the button is clicked, Forms Runtime navigates to the block specified in the subprogram and displays the canvas for the first item on the block. Figure 15.24 shows the trigger that calls canvas2 or the Glasses records.


FIG. 15.22
Canvas2 after the
block-three items have
been formatted.




FIG. 15.23
The reformatted
canvas1 displaying 10
Tools records.



  1. Create the button and trigger that will call canvas2 or the Glasses records.

  2. Create a similar button that call canvas1 or the Tools records.

    The default canvas in the Employee Update form is canvas1, containing the Tools record. The Glasses records are displayed by clicking the Glasses button. This causes

Page 404

    block-three/canvas2 to appear. Because it is a stacked canvas, it overlays the Tools records on canvas1. Clicking the Tools button causes block-one/canvas1 to appear. Because it is a content canvas, it covers the entire screen. Figure 15.25 displays the Employee Update form after the Glasses button is clicked.

FIG. 15.24
The PL/SQL script for
the Glasses button that
causes the display of
the canvas containing
the Glasses records.



  1. Generate and run the form. Try pressing the Glasses button.

FIG. 15.25
The Employee Update
for after he Glasses
button is clicked.



    The Employee photo is still displayed by the Employee Photo button. The When-button-pressed trigger for this button needed to be modified. This button requires the go_block subprogram but also requires a go_item subprogram. The reason for the go_item subprogram is that image37 is contained on block one but is not the first navigation item

Page 405

    on the block. When the go_block (`one') subprogram is executed, the input focus is moved to the payroll_number field because it is the first item on the block. The canvas property for payroll_number is canvas1. Thus, the Tools block will appear. The go_item subprogram is necessary to move the input focus to the Image37 item after it is moved to block one. Image37 is located on canvas3 and navigation to the item displays canvas3. Figure 15.26 illustrates the trigger for calling this canvas.

  1. Modify the trigger for the image button so that it displays the canvas3.

FIG. 15.26
The Employee Photo
button trigger script that
displays canvas3.



I find this technique very useful and preferable over scroll bars and small text. The users of the application seem to really appreciate the ease of obtaining different views of data.

NOTE
Form module EMPCH15B.FMB, on the CD, contains the final application with the additional canvases.n

Using Property Classes

A property class is a set of properties that can pass its property values to other objects. Each object that has been reviewed in this part of the book contains a property class property. When this property is populated with the name of a property class, the values of the property class override those contained in the object. A property class is similar to a visual attribute in that it can supply property values to an object. It differs in that the visual attribute has a set number of properties. These properties only pertain to formatting attributes. A property class can have as few or as many properties as needed, and they can consist of properties other than formatting properties.

The next several subsections discuss some special tools that exist on the property sheet form. Several of these tools are used to create and modify a property class.

Page 406

Using the Property Sheet Tools

The property sheet dialog box contains eight icon buttons on a tool bar at the top-left of the box. From left to right, the buttons are as follows (see Figure 15.27):


FIG. 15.27
The Property Sheet
toolbar.



Button Description
Copy property The tool on the far left, which copies an object's properties into the property clipboard.
Paste property The properties in the clipboard can be transferred into the current object by clicking the tool. It is the second tool from the left.
Add property Adds properties to a property class.
Delete property The fourth button is the tool. It deletes properties from the property class.
Property class The fifth button (with the white figure) is the tool. Clicking this button causes Designer to create a new property class. The new class contains the same properties as the original property sheet.
Inherit The sixth button (with the red figure) is the tool. Clicking this button causes the properties on the property sheet to return to their original default value.
Intersection/Union The tool with the intersection symbol is the tool, which changes the list of properties displayed in a multi-object property list. This button can be toggled, causing the property sheet to display either an intersection list or a union list. The intersection list displays the properties common to all of the

Previous | Table of Contents | Next