The constructtabpanel statement creates a tab panel in the current form.


This statement has one parameter:

template – text and tags that contains options for constructing a tab panel (see discussion below).


This statement creates a tab panel in the current form (and also creates any additional forms necessary for the operation of the tab panel). The template parameter allows you to customize how form elements are generated. At a minimum, the template must specify the names of the panels. This simple example generates a tab panel with four panels.

constructtabpanel "<panels:English, Spanish, French, German>"

There are a variety of tags that can be used to customize the tab panel. These tags are discussed below. Tags can be arranged any way you want – all one one line, each on a separate line, or a combination.

Keep in mind that this statement generates regular form objects, just as if you had created them manually. Once the objects are generated, you can manipulate these objects in Graphics Mode any way you like.

Panel Names

A tab panel usually has two or more panels, each with a name. Use the <panels:name,name,name> tag to specify all the names. You can optionally included spaces in between the names, but they aren’t required.

constructtabpanel "<panels:Football, Baseball, Basketball>"

You can also specify panel names with separate <panel:name> tags. This is useful if the names contain commas.

constructtabpanel "<panel:Los Angeles, CA>
    <panel:Phoenix, AZ>
    <panel:Denver, CO>"

In the example above, each <panel> tag is on a separate line, but that is not required.


To work properly, the tab panel must be linked with a variable that stores the currently selected panel name. The default variable name is tabPanelChoice, but you should change that with the <variable:name> tag.

constructtabpanel "<variable:sportChoice><panels:Football, Baseball, Basketball>"

Panorama will automatically create and update the variable for you. (A program can also modify the variable to switch between tab panels. It must use the showvariables statement after modifying the variables value.)

Auxiliary Form Names

Panorama requires that a separate form be set up for each tab panel. The constructor will do this for you. Each form must be named with a prefix that is unique for this particular tab panel (it must be unique within the database). The default prefix is TabPanel_, but you should change that with the <prefix:text> tag.

constructtabpanel |||<prefix:Language><panels:English, Spanish, French>|||

The <prefix> tag automatically adds an underscore to the end of the prefix you specify, so this template will cause three forms to be created with the names:


We recommend that you always use an underscore at the end of the prefix name, but if you don’t want to do that for some reason you can use the <rawprefix:text> tag, which doesn’t add a prefix.

Once the forms are created, it’s up to you to fill them with content.


If not specified, the tab panel will be 4 inches high by 6 inches wide. Use the <height:value> and <width:value> tags to specify different dimensions. These values are normally expressed in points (1 point = 1/72 inch) but you can also specify values in inches (1 in or 2.5 inch or 0.75") or centimeters (20 cm). This example creates a panel that is 5 inches high by 7 inches wide.

constructtabpanel |||<height:5"><width:7"><panels:English, Spanish, French, German>|||

Button Appearance

The <size> tag allows you to choose from three different button sizes: <size:regular> (the default), <size:small>, and <size:mini>.

Normally the buttons are “scrunched” up in the center, with each button taking up the minimum possible space. If your template includes the <widebuttons> tag, the buttons will expand to fill the entire width of the tab panel. In that case, each button will have the same width, so that a button named Pie will be the same width as a button named Ice Cream Sundae.

If you don’t want any buttons at all, use the <hidebuttons> tag. For example, you might want to link the tab panel to a text list or matrix object, or switch panels only under the control of a program.

Content Location

Panorama normally centers the content within the tab panel. If you want the content placed relative to the upper left hand corner, use the <center:false> tag.

Border and Background

A tab panel normally has a one-point gray border with rounded corners and a white background. All of this can be customized.

Use the <border:width> tag to customize the thickness of the border. For a thicker border, use larger values. If you don’t want any border at all, set the thickness to zero.

Use the <bordercolor:color> tag to customize the color of the border. You can use the name of the color (blue, black, teal, etc.) or an HTML color value. The default color is CCCCCC (light gray).

Use the <radius:dimension> tag to customize the radius of the border corners. If you want sharp, square corners, set the radius to zero.

Use the <background:percentage> tag to customize the background color of the border. The percentage can be set from 0 (black) to 100 (white). 99 is a nice value that gives a very light gray, and is the default if you use the <background> tag without any percentage.

If you include the tags <border:0><hidebuttons> in your template, the tab panel object will be completely invisible. You could still use a separate object (Text List, Pop-up Menu) or a program to switch panels.

Use the <shadow> tag if you would like the tab panel to have a drop shadow.


Tab panels normally don’t require any programming. But using the <code:program> tag you can set up a program that will run when an item is clicked.

<code:message "You picked "+fruitChoice>

The code can be self contained or it can call a separate procedure with the call statement.

See Also


10.0NewNew in this version.