Previous | Table of Contents | Next

Page 303

Designer usually creates a default canvas that is not the size of a normal maximized window. It also has a layout area larger than the window, which makes it difficult for the developer to know if the objects are properly placed. Sometimes they are placed out of the window view where you need a scroll bar to see them.

In order to place the fields properly, I change the layout settings to 8.5 inches wide and 5.5 inches high. I then change the height and width properties for both the canvas and window objects so that they cover the layout area. I now have a work area exactly the size of the window of my user. This helps me to properly place items without having to run the form to see how the fields are displayed.

Not all PC monitors have the same resolution. The settings change depending on the resolution. You should use trial and error to come up with the property size values you desire, and place them into the form when you first create it.

The Show View optionTurning on the Show View option places a frame around the current view. The view is the area of the form that can be seen at a given time when the form is executed in Forms Runtime. Selecting the view by clicking it causes drag handles to appear. This allows you to change the size of the selected view. You can move the view drag handles to change the width and height. The view of the EMPCH13.FMB form was reduced horizontally and vertically. The form was then executed by using the Run menu option. Figure 13.12 shows the executed form. Notice the effect of changing the size of the view. A blank border appears between the edge of the view and the window.

This option is turned on when a check mark exists to the left of the option on the menu. It is turned off when the check mark is missing.

The Show Canvas optionThe Show Canvas option shows or hides the canvas. The main purpose for removing the canvas is to show the underlying grid lines, demonstrated earlier in this section. When the canvas is removed, the objects that lay on the canvas, such as boilerplate text and fields, remain.

The Show Stacked Views optionThe Show Stacked Views option displays stacked views. A form can simultaneously display multiple views and canvases. There are four types of canvas-views in forms: content, stacked, horizontal toolbar, and vertical toolbar. The Canvas Type property determines how the canvas will be viewed. The content canvas-view is the default type. It is the base of the form and covers the entire window.

Multiple canvases can be assigned to a window and displayed at the same time. When this is done, one canvas is a content canvas and the remainder must be stacked canvas-views. A stacked canvas can overlay a content canvas. The Show Stacked Views option enables the developer to design the display of multiple canvases. It brings additional views to the layout area in order to coordinate their placement.

The SHOWVIEW.FMB file was created to demonstrate this concept. This file is available on the CD. The file contains three canvas-views: canvas1, canvas2, and canvas3. The first is a content canvas-view and the remaining two are stacked canvas-views. Figure 13.13 shows canvas1 after the Stacked Views option has been selected. Selecting this option brings up the Stacked Canvas-Views dialog box. Canvas2 has been selected, as shown by the highlighted item. If you press the OK button, canvas2 appears and overlays canvas1.

Page 304

FIG. 13.12
Using the Show View
option to shrink the area
of the form that can be
seen.




NOTE
The Stacked Canvas-Views dialog box is used to overlay stacked canvases over the content canvas. The canvases that are highlighted will appear. The canvases that are not highlighted will not appear. If you want all of the stacked canvases to appear, you must select all of the canvases.
When there are multiple stacked canvases, as in our example, selecting one canvas will deselect the other. To select both canvases, select the first canvas by clicking it. To select a subsequent canvas without deselecting the original selection, press the control key while clicking the canvas. This procedure should also be followed when de-selecting canvases. Use the control key to enable you to deselect the last canvas.

When you first display stacked canvases, they cover a part of the content canvas depending upon their size and position. However, the size can be modified and the canvas position changed. Views are resized by selecting the stacked canvas and using the drag handles to resize them. Figure 13.14 shows canvas2 after it has been resized and is being dragged to the right of canvas1. Notice the drag handles around canvas2.

The showview form has a third canvas. This canvas-view can be displayed by opening the Stacked Canvas-Views dialog. Select canvas3 while pressing the control key. Press the OK button. The results of this are shown in Figure 13.15. All three canvas-views are shown. Canvas1 is at the top-left, canvas2 at the top-right, and canvas3 at the bottom-middle.

NOTE
A stacked canvas can be displayed without having to overlay it on the content canvas. You can open any canvas by selecting the canvas on the Object Navigator and double clicking the item.

Page 305

FIG. 13.13
Using the Stacked
Views option to overlay
canvas1 with canvas2.


FIG. 13.14
Resizing and moving
the stacked view.


Using the Format Pull-Down Menu

The Layout Editor Format pull-down menu contains options used to format items on the canvas. To format an item, select the item(s) by clicking it. The next step is to select an option from the Format pull-down menu. Figure 13.16 illustrates the pull-down menu and the formatting options.

The Font OptionThe Font option is at the top of the menu. Pressing this option produces the Font dialog box, as shown in Figure 13.17. It contains four sets of settings: Font, Font Style, Size, and Effects.

The Font is set by using a list box located at the top-left of the dialog box. The list box contains the font types available to the developer, who can view any font by clicking on its name. A sample of the formatted text appears in the sample window on the bottom-right. In Figure 13.17, the text in the sample window is in the MS Sans Serif font.

Previous | Table of Contents | Next