setformoptions
setformoptions
DATABASE
,
FORM
,
OPTION
,
VALUE

The setformoptions statement modifies one or more properties of a form (name, viewing mode, etc.).

Parameters

This statement has four parameters:

database – The database that contains the form you want to modify, or `""` for the currently active database.

form – The name of the form you want to modify, or `""` for the currently open form (if a form window is active).

option – The type of information you want to modify. See below for descriptions of each option. The option can be specified in either upper or lower case.

value – The new value for this option.

Description

This function modifies information about any form in any open database.

Note: You can specify multiple option/value pairs in a single setformoptions statement, like this:

    setformoptions database,form,option1,value1,option2,value2,option3,value3

#### NAME

This option changes the name of the specified form. This example changes the name of the form Report to Year End Report.

    setformoptions "","Report","NAME","Year End Report"

The database must not already contain a form with the new name. If it does, the setformoptions statement will stop with an error.

#### POSITION

This option moves the form to a new position in the list of forms. This is primarily useful for changing the order in which forms appear in the View Menu.

This example moves the Invoice form so that it appears before the Shipping Label form.

    setformoptions "","Invoice","POSITION","Shipping Label"

Use `""` to move a form to the end of the list, like this:

    setformoptions "","Data Entry","POSITION",""

#### WINDOWOPTIONS

This option controls whether the tool bar and scroll bars are enabled or disabled. The possible options are NoToolBar, NoHorzScroll and NoVertScroll. For example, this code removes the scroll bars but leaves the tool bar enabled.

    setformoptions "","Data Entry","WINDOWOPTIONS","NoVertScroll NoHorzScroll"

To enable both toolbars and scroll bars (the default appearance), this option should be set to empty text (`""`).

#### DELETE

This option deletes the specified form.

    setformoptions "","Top Secret","DELETE",""

Notice that even though the option value is not used, you must still supply it.

#### EXCLUDEFROMVIEWMENU

If this option is false, the form will be displayed in the View menu. If this option is true, the form will be excluded from the View menu.

#### BACKGROUNDCOLOR

This option sets the background color of the form (see Colors). The background color is usually white but can be set in the form Property Inspector, and can also be set with the formcolor statement. A formula can access the background color with either the info(“formcolor”) or getformoption( functions.

#### VIEWMODE

This option changes the view mode of the form, it may be either Individual Pages or View-as-List.

#### VIEWASLISTGRIDSTYLE

This option specifies whether there should be a border line between rows of a view-as-list form. The options are None, Solid and Dashed.

    setformoptions "","","viewaslistgridstyle","solid"

#### ALTERNATINGBACKGROUNDCOLORS

This option specifies whether the rows in a view-as-list form are displayed with alternating background colors. The parameter must be a Boolean value (0, -1, true(), false(), “yes”, “no”, “true”, “false”).

    setformoptions "","Product Info","alternatingbackgroundcolors","yes"

Note: If the entire surface of the data tile is covered with objects, the background color will not be visible.

#### VIEWASLISTBACKGROUNDCOLORS

This option specifies custom alternating background colors. This is a comma separated separated list of RGB colors in HTML format. You can specify 1, 2, 3 or more colors.

    setformoptions "","Info","viewaslistbackgroundcolors","ffeeff,ffffee"

Leave this option empty (`""`) if you want to use the standard background colors.

#### VIEWASLISTHIGHLIGHTCOLOR

In a view-as-list form the selected record is normally displayed with a blue highlight. Use this option to customize the highlight color. This example sets the highlight color to red.

    setformoptions "","","viewaslisthighlightcolor","ff0000"

#### TABMODE

This option changes the tab mode of the form, it may be either Natural, Data Sheet Order or Back to Front.

#### VARIABLETYPE

This option specifies the type of variable that will be created by objects on the form that need variables, it may be either Global, FileGlobal or WindowGlobal. This example changes this option for the current form (however, the change won’t take effect until the form is closed and re-opened, or for any new objects that are created.)

    setformoptions "","","variabletype","windowglobal"

#### REPORTCOLUMNS

This option specifies the number of columns when a report is printed (usually used for mailing labels). The default is `Automatic`, in which case the number of columns will be determined by the paper width and the width of the data tile. This option can also be set to `1 column`, `2 columns`, `3 columns` or `4 columns`.

#### REPORTCOLUMNDIRECTION

When printing multiple columns (for example mailing labels), this option specifies whether records will be printed down the page (`Down`) or from left to right (`Across`). The default is `Down`.

#### USESERVERFORLOOKUP

This option specifies whether objects that contain lookup( functions will perform the lookup on the server or the local client (this option is ignored for non-shared databasers). The parameter must be a Boolean value (0, -1, true(), false(), “yes”, “no”, “true”, “false”).

    setformoptions "","Product Info","useServerForLookup","yes"

#### EVENTCODE

This option sets up the source code that will be used for processing events related to the form (for example when the form opens, or is brought to the front). This code can use the info(“formevent”) function to determine what event just occurred. (Note: The code can only handle events that occur while the form is in in data mode, not graphics mode. This code replaces the `.OpenForm` and `.ActivateForm` procedures in Panorama 6 and earlier.)

#### TAG

This option assigns a tag to this form (if any). You can use the tag value for whatever you want, Panorama stores the tag for you but does not use or interpret it in any way.

#### NOTES

This option assigns notes to this form. You can use the notes for whatever you want, Panorama stores the notes for you but does not use or interpret them in any way.

#### MINIMUM/MAXIMUM HEIGHT and WIDTH

There are four options for setting the minimum and maximum size of the form window. This example sets the minimum height for an invoice form at 4 inches, the max height at 7 inches, and the minimum width at 500 points.

    setformoptions "","Invoice",
        "minimumheight",4*72,
        "maximumheight",7*72,
        "minimumwidth",500

#### Last Opened Position and Size

Panorama keeps track of the position and size of the window the last time it was open. You can change this with the windowtopedge, windowleftedge, windowheight and windowwidth options, though we generally would not recommend that since it will surprise the user if the form opens in a different position. Note that if the form is currently open, changing these settings will not have any effect, and in fact Panorama will overwrite the values you set with the actual window position and size.

#### INITIALDIMENSIONS

If specified, the initial dimensions will be used when opening the form (in that case the last opened position is ignored). The format of this option is either top,left,height,width or height,width (all dimensions are specified in points). This example will set the initial dimensions of the Label form to a height of 2 inches (2*72 points) and a width of 4 inches (4*72 points).

    setformoptions "","Label","initialdimensions","144,288"

The next time this form is opened (with the View Menu or simply by opening the database) it will open at its last position, but with dimensions of 2 by 4 inches.

This example will set the initial dimensions of Order Form to 800 points high by 500 points wide, in the upper left corner (30 points down from the top of the screen, and 10 points from the left edge).

    setformoptions "","Order Form","initialdimensions","30,10,800,500"

If the form is opened with the openform statement, the initial dimensions can be overridden by using the rectangle option.

    openform "Order Form","rectangle",rectanglesize(24,2,700,300)

If this property is empty, the form will open in whatever position it was in the last time it was closed.

    setformoptions "","Order Form","initialdimensions",""

Note: The initial dimensions can also be set with the Initial Dimensions form property. See Newly Opened Database Window Arrangement to learn more.

#### LASTTIMEWINDOWINFRONT

Panorama normally keeps track of this value itself, but you can override it with this option. The parameter must be a superdate (see the superdate( function. This example tricks Panorama into thinking that the current form hasn’t been used for 24 hours (keep in mind that this value will be updated the next time this form is opened.)

    setformoptions "","","lastTimeWindowInFront",supernow() - 60*60*24
    closewindow

See Also

- Adjusting Object Spacing -- adjust the spacing between multiple selected objects so that the same amount of space is in between each pair of objects.
- adjustobjectspacing -- adjusts the spacing of selected objects in a form.
- adjustobjectspacingdialog -- opens a dialog sheet to adjust the spacing of the currently selected objects.
- Aligning Objects -- so that two or more object edges are made even with each other.
- Automatic Form Construction -- creates a column of form elements for editing data fields (or variables).
- Automatic Mailing Label Construction -- creates a mailing label.
- Automatic Report Construction -- creates a tabular report with columns of data.
- automaticformname( -- returns an available form name.
- bringforward -- brings the selected form objects one layer towards the front.
- bringtofront -- brings the selected form objects to the front.
- Cocoa Objects -- discussion of how objects are implemented in Panorama X compared to earlier versions
- Construct Menu -- used to automatically construct complex form applications, including calendars, lists, mailing labels, and more.
- constructfieldssheet -- opens a sheet to add/insert multiple new fields into the database.
- Creating a New Form -- creating a new empty form, or a duplicate of an existing form.
- Creating a New Form Object -- with the Object Library.
- Data Button Object -- is used to create checkboxes and radio buttons.
- deleteformcustompreference -- deletes a form custom preference.
- Diagnosing a Formula embedded in a Form Object -- diagnosing problems with formulas embedded in form objects.
- Displaying Data in a Grid -- fundamentals of displaying data in a grid (Text List/Matrix).
- Duplicating Objects -- to make copies of one or more objects.
- exportform( -- exports a form and the form's meta data as a binary object that can be imported with the importform statement.
- fieldblueprintsheet -- opens a sheet to edit the blueprint of the current field.
- Fixed Image Object -- is used for fixed images (images that never change).
- Fonts -- setting the font and text size of form text objects.
- Form Object Appearance -- changing the color, fill, stroke, opacity and drop shadow attributes of selected objects.
- Form Object Blueprint -- display and edit raw object specifications
- Form Object Code -- associating programming code with an object
- Form Properties -- specify the name of the form, and various form options.
- formblueprintsheet -- opens a sheet to edit the blueprint of the current form.
- formcolor -- changes the background color of the current form.
- formoptionsblueprintsheet -- opens a dialog sheet to edit the blueprint of the current form options.
- Forms -- display data with a customizable graphic layout.
- formtodatamode -- switches the current form window to data mode.
- formtographicsmode -- switches the current form window to graphics mode.
- getformcustompreference( -- returns the value of a form custom preference.
- getformcustompreferencenames( -- returns a list of custom preferences associated with a form.
- getformoption( -- returns information about a form.
- goform -- switches the current window to a different form.
- Graphics Mode -- is used to edit the graphic design of a form.
- Grouping Objects -- allows you to manipulate multiple objects as if they were a single object.
- Image Display Animations -- animated images.
- Image Display Colors and Gradients -- displaying pure colors and gradients
- Image Display Data Buttons -- checkboxes and radio buttons created from custom images.
- Image Display Object -- is used for dynamic images (images that change depending on the data).
- Image Display Push Buttons -- push buttons created from custom images.
- importform -- imports a form into a database.
- info("formevent") -- returns the last event that occurred to the current form.
- info("formname") -- returns the name of the current form.
- Line Item Grid Constructor -- creates a grid of form elements for displaying and editing line item fields.
- Line Object -- draws a line within a form.
- Matrix Clicking -- handling clicks in a Matrix Object.
- Matrix Constructor -- quickly creating a Matrix Object from a template.
- Matrix Database Integration -- synchronizing a Matrix Object with a database.
- Matrix Geometry -- customizing the size and geometry of Matrix Object elements.
- Matrix Header and Horizontal Scrolling -- setting up a custom header for a Matrix Object grid.
- Matrix Object -- displaying a grid of items with a custom arrangement.
- Matrix Object Frame -- setting up the arrangement of items within a Matrix Object.
- Matrix Programming -- programming a Matrix object.
- Object Inspector Panel -- is used to view and modify the attributes of selected objects in a form.
- Object Library -- is used to create new objects in a form.
- Object Names -- can be used to identify an object in a program.
- Objects Menu -- used to select, modify and arrange graphics objects in a form.
- openclonewindow -- opens a clone of the current window.
- openfarform -- opens a form in another database.
- Oval Object -- draws an oval or circle within a form.
- Polygon Object -- draws a polygon within a form.
- Popup Menu Button Object -- is used to create popup menus anywhere on a form.
- printonemultiple -- prints a form over and over again without advancing from record to record. Instead of advancing from record to record, a variable is incremented each time the form is printed. This statement is designed for printing calendars or thumbnails.
- printtopdf -- prints the current database to a PDF file.
- printusingform -- allows the current database to be printed using a different form than the one currently being displayed.
- Progress Indicator Object -- is used to create progress indicators
- Push Button Object -- triggers a procedure when it is pushed.
- Rectangle Object -- draws a rectangle or square within a form.
- Report Tile Object -- component for assembling a custom report.
- Rounded Rectangle Object -- draws a rectangle with round corners within a form.
- Scroll Bar Object -- is used to create scroll bars.
- Segmented Button Object -- is used to created segmented buttons.
- selectedformobjectsblueprintsheet -- opens a sheet to edit the blueprint of the currently selected objects.
- Selecting Form Objects -- so that they can be modified.
- sendbackward -- sends the selected form objects one layer towards the back.
- sendtoback -- sends the selected form objects to the back.
- setformcustompreference -- sets the value of a form custom preference.
- setreportcolumns -- allows a procedure to control the number of columns of a report, and the direction (across or down).
- showrectangle -- refreshes all or part of the current form window.
- Slider Object -- is used to create sliders and knobs.
- Smart Resize -- adjusts the sizes and locations of the other selected objects to match the change of one object.
- Star Object -- draws a star within a form.
- Stepper Object -- is used to create numeric steppers for use with Text Editor objects.
- Tab Panel Appearance -- appearance options for a Tab Panel Object.
- Tab Panel Buttons and Selection -- button options for a Tab Panel Object.
- Tab Panel Constructor -- quickly creating a Tab Panel Object from a template.
- Tab Panel Content -- setting up the content for a Tab Panel Object.
- Tab Panel Forms -- setting up the forms for a Tab Panel Object.
- Tab Panel Object -- switchable tab panels.
- Text Display Object -- is used to display text using a formula.
- Text Editor Object -- is used to edit text in a field or variable.
- Text Label Object -- displays a short, fixed, text item within a form.
- Text List Appearance -- customizing the appearance of a Text List Object.
- Text List Constructor -- quickly creating a Text List Object from a template.
- Text List Database Integration -- synchronizing a Text List Object with a database.
- Text List Multiple Columns -- displaying multiple columns in a Text List Object
- Text List Object -- displaying a grid of text.
- Text List Programming -- programming a Text List Object.
- Text List Searching -- searching within a Text List Object.
- Text List Selection -- selecting items in a Text List Object.
- Text Object Background Color/Gradient -- text object background colors and gradients.
- textlisttableoptions -- sets up text list table options
- View-As-List Forms -- displaying a custom data layout as a continuous sheet.
- Web Browser Object -- is used to display web pages from within a Panorama form.

History

Version | Status | Notes
10.2 | New | New option excludefromviewmenu.
10.0 | New | This statement is new in this version.