Re: Useing Forms 4.5 Create Tabs

From: <garethgadd_at_my-dejanews.com>
Date: Fri, 04 Sep 1998 15:42:24 GMT
Message-ID: <6sp1p0$ii$1_at_nnrp1.dejanews.com>


In article <6so4np$haf$1_at_news.ncu.edu.tw>,   "Casperstudio" <jiahorng_at_tp.silkera.net> wrote:

> Does anyone know how to use Forms 4.5 create Win95 Style TABS?
>
>

Try the following :
General Overview  ================

Sometimes, you may want to have a number of tabbed folders on a form that allow the user to navigate between different canvases by clicking on the tabs. This creates a nice look and feel for applications with multiple canvases. You can achieve this functionality by incorporating a third party VBX into the form, but you must purchase this VBX. You can also achieve this functionality in Forms alone. This document explains how tabbed folders can be achieved withoutusing a VBX.
Creating Folders  ================

To make this as easy as possible, determine how many folders your form will need before you begin. You can add new folders later, but this is not easy. This example will use 3 folders. A folder will simply be a drawing on a canvas. First, create 3 folder drawings. This is easily done if Grid Snap is turned on. Go to the layout editor, and
create the first fold by using the Polygon tool as follows:       _______
     /       \_________________________________________

| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|__________________________________________________|
Note: Apply a different fill color to each folder, so you can easily distinguish between folders.
Next, create Folder2. Using the Polygon tool and using Folder1 as a
guide, draw Folder2 as follows:       _______       _______
     /_______\____ /       \___________________________

| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|__________________________________________________|
Repeat the above step to create Folder3. When done, move Folder1 to the front by clicking on the tab of Folder1 and choosing "Arrange" ---> "Bring to Front" from the layout editor menu. You should now have 3 separate folders, all on the same canvas, with Folder1 on top and the tabs of the other two folders visible as follows:
      _______       _______       _______
     /       \____ /_______\____ /_______\_____________

| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|__________________________________________________|
Note: This is a good time to save the form.
Adding Display Items In Folder Tabs ===================================
1. In the layout editor, select the Display Item tool and create a

    display item in each folder tab. Make sure each display item fills as     much of the tab as possible without touching the edge of the polygon. 2. Set the fill color of each display item to "No Fill" and the

    Line Color to "No Line".
3. Set the Default Value property of each display item to be the

    desired label for the tab. This will be displayed as the tab's label.     Make sure that the default value is not too long for the display item. 4. Adding these display items causes a block to be created.

    Rename the block to Folder1_block.
Note: This is a good time to save the form. Creating Canvases And Blocks For Folders 2 And 3



Before you do the next step, make sure that your folders are placed in the position you want them on the form. This will make it much easier to create the other canvases. You may want to run the form to see exactly where the folders will be displayed. When you are satisfied with the location of the folders, copy the canvas to create two new canvases. In the Object Navigator, click on the canvas, then choose "Edit" ---> "Copy", then choose "Edit"---> "Paste" twice. You should rename these new canvases with meaningful names. Edit each canvas layout, and bring the appropriate form to the front. Switch to the layout editor for Canvas2. Click on the tab of Folder2, and choose "Arrange"---> "Bring to Front". Next, switch to Canvas3. Click on the tab of Folder3, and choose "Arrange" --->"Bring to Front". Copy block Folder1_block to create two new blocks. In the Object Navigator, click on block "Folder1_block", choose "Edit"---> "Copy", then choose "Edit" ---> "Paste" twice. You should rename these new blocks with meaningful names.
The display items in these new blocks need to have their canvas property changed to the correct canvas. To do this, edit each of the display item's properties and change the canvas property to the corresponding canvas. After this is done, edit the layout for each canvas and make sure that the display items are all visible; the display items may be hidden behind the folders. If they are hidden, select all three folders by holding down the CTRL key and clicking on each folder. After selecting the folders, choose "Arrange"---> "Send to Back"; this places the folders behind the display items. Note: This is a good time to save the form.
Adding Base Table Blocks To Folders ===================================
Now that the canvases and blocks are set up, add base table blocks to the different folders. You do not need to have base table blocks on the folder canvases, but you must have at least one navigable item on each folder canvas. This example creates the base table block EMP to be displayed on Folder1, DEPT to be displayed on Folder2, and just a button to be displayed on Folder2.
To create block EMP on Folder1, switch to the layout for Folder1_canvas and choose "Tools" ---> "New Block" from the layout editor menu. Type 'EMP' for Base Table and Block Name, and type 'Folder1_canvas' for Canvas. Click the OK button. Next, select all the items and boilerplate of block EMP and reposition them to fit inside the folder. If anything is hanging over the edge of the folder, you will not get a desirable result. To create block DEPT on Folder2, switch to Folder2_canvas in the layout editor. Choose "Tools" ---> "New Block" from the layout editor menu. Type 'DEPT' for Base Table and Block Name, and type 'Folder2_canvas' for Canvas. Click the OK button. Reposition items and boilerplate as necessary.
To create a button on Folder3, switch to Folder3_canvas in the layout editor. Select the Button tool from the toolbar, and drag out a button inside Folder3. Note: This is a good time to save the form.
Creating Triggers =================

The final step is to add triggers to navigate between the folders. These triggers will actually cause navigation between the blocks on the different canvases, but the folders will appear to pop in front of each other.
A When-Mouse-Click trigger will be needed for each folder tab displayitem. The When-Mouse-Click trigger for Folder1_displayitem in the EMP block is as follows: GO_BLOCK('EMP');
The When-Mouse-Click trigger for Folder2_displayitem in the EMP block is as follows: GO_BLOCK('DEPT');
The When-Mouse-Click trigger for Folder3_displayitem in the EMP block is as follows: GO_BLOCK('Folder3_block'); These triggers can now be copied to the corresponding display items in blocks DEPT and Folder3_block.
After this has been accomplished, make sure that block Folder1_block is the first navigable block in the Object Navigator. This will allow Folder1 to be in front initially.
Save, generate, and run the form to see the results. Click on the different tabs to switch between the folders.

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Fri Sep 04 1998 - 17:42:24 CEST

Original text of this message