opendialog
opendialog
FORM
,
OPTION
,
VALUE

The opendialog statement opens a form from the current database as a modal dialog box.

Parameters

This statement has three parameters:

form – is the name of the form to open.

option – in addition to the form name, this statement can have one or more additional option/value parameter pairs that modify the operation of the statement. Each pair has two parts, the option name (this parameter) and the option value. See the discussion below for more information.

value – option value.

Description

This statement opens a form in a modal dialog window. As long as this window is open, all other Panorama windows are inactive. The only way to close this dialog window is with the closedialog statement. While the dialog window is open you cannot click on another Panorama window to bring it in front of the dialog window. The dialog window will not have any scroll bars or tool palette.

Note: In most cases you won’t want to use the opendialog statement directly. Instead, you should use the rundialog statement.

The procedure below opens the form Transaction Preferences in a 4 inch by 6 inch dialog window centered on the main screen. The procedure then pauses so the user can fill in the dialog (see pause and resume).

    local newWindowRect
    newWindowRect=rectanglecenter(
        info("screenrectangle"),
        rectanglesize(1,1,4*72,6*72))
    setwindowrectangle newWindowRect
    opendialog "Transaction Preferences"
    pause ""

Note: If the specified form is already open, it is simply brought to the front, and is not opened as a dialog.

#### Options

In addition to the form name, this statement can have one or more additional option/value parameter pairs that modify the operation of the statement. For example, these options can modify the appearance and operation of the dialog window. Each pair has two parts, the option name (this parameter) and the option value, like this:

    opendialog name,option1,value1,option2,value2,option3,value3,...

The available options are described below.

#### Database

To open a form in a different database, use the `database` option. This example opens the form Report from the Members database as a dialog.

    opendialog "Report","Database","Members"

The specified database must already be open.

#### Stay

Normally when you use the `database` option, the current database changes to the specified database while the dialog is open. However, if you also specify that `stay` is true, the current database will remain active. If you use this option, make sure that the form you are opening doesn’t display or edit fields that are not in the current database. Usually you will use this option with forms that don’t use any fields, only variables. In this example, the Status form from the Utility database is opened, but Utility does not become the current database – the current database stays the name (hence the name of the option).

    opendialog "Status","Database","Utility","Stay",true(),"Clone",true()

As shown in the example above, the `stay` option is often used with the `clone` option (see below).

#### Rectangle

This option allows you to specify the exact location and size of the new dialog. This example opens a 3“ by 5” dialog in the upper left hand corner of the screen.

    opendialog "Preferences","Rectangle",rectanglesize(20, 5, 72*3, 72*5)

Note: The location can also be specified with the setwindowrectangle statement. If both are used, the rectangle specified in the opendialog statement will be used.

#### Title

To customize the window title, use the `title` option. (The title normally displays the database and form name.) This example opens the window with the name Latest Report.

    opendialog "Report 183B","Title","Lastest Report"

If you want to change the title later, use the windowname statement.

#### Clone

This true/false option specifies whether the form should be opened as a “clone” dialog. Theoretically, this could allow you to open multiple clone dialogs with the same form. More importantly, this allows you to make programmatic changes to the dialog that will be discarded as soon as the dialog is closed. We recommend using this option, and in fact the rundialog statement defaults to this.

#### Maximizable

This true/false option controls whether or not the maximize button (the green button in the upper left corner of the window) is enabled. This button is enabled by default, so this option allows you to turn it off.

    opendialog "New Customer","Maximizable","no"

#### Closeable

This true/false option controls whether or not the close button (the red button in the This true/false option controls whether or not the close button (the red button in the upper left corner of the window) is enabled. This button is disabled by default, so this option allows you to turn it on.

    opendialog "New Customer","Closeable","yes"

Normally modal dialogs are closed with a button in the dialog content, but this option gives you another technique for closing a dialog.

#### TitleBar

This true/false option option allows you to completely remove the title bar at the top of the window, including all of the buttons in the title bar.

    opendialog "New Customer","TitleBar","no"

See Also

- closeclonewindow -- is an alternative method to close the current window, works even if the window has no close box.
- closedialog -- closes a form window that was previously opened with the opendialog statement.
- closewindow -- closes the current window.
- datafocus -- makes sure that Panorama is focused on data, not on a property panel.
- formtodatamode -- switches the current form window to data mode.
- formtographicsmode -- switches the current form window to graphics mode.
- getmaxwindow -- retrieves the position and size of the of the largest possible window on the main screen.
- getwindow -- retrieves the position and size of the current window.
- goform -- switches the current window to a different form.
- hideaccessorypanel -- closes the current window's accessory panel.
- info("accessorypanelisopen") -- returns the status of the current window's accessory panel, if any.
- info("accessorypanelwidth") -- returns the current width of the current window's accessory panel, if any.
- info("clickedwindownumber") -- returns the window number of that was just clicked.
- info("clonewindow") -- returns true if the current window was opened as a "clone" window.
- info("datasheetwindownumbers") -- returns the unique ID numbers of all open data sheet windows.
- info("datasheetwindows") -- returns a carriage return separated list of all open Data Sheet windows.
- info("dialogsheet") -- returns true if the currently active window is a dialog sheet.
- info("dropwindownumber") -- returns the number of the window that contains the form data was dropped on.
- info("formwindownumbers") -- returns the unique ID numbers of all open form windows.
- info("formwindows") -- returns a carriage return separated list of all open form windows.
- info("horizontalscrollbar") -- returns true if the current window's horizontal scrollbar is enabled, false if it is disabled.
- info("magicwindow") -- returns the name of the currently designated "magic window," if any.
- info("procedurewindownumbers") -- returns the unique ID numbers of all open procedure windows.
- info("procedurewindows") -- returns a carriage return separated list of all open procedure windows.
- info("toolbar") -- returns true if the current window's toolbar is visible, false if it is hidden.
- info("toolbarvisible") -- returns true if the current window has a visible tool bar.
- info("typeofwindow") -- determines what type of view the current window contains.
- info("verticalscrollbar") -- returns true if the current window's vertical scrollbar is enabled, false if it is disabled.
- info("windowdepth") -- returns the color depth of the current window.
- info("windowname") -- returns the name of the current window.
- info("windownumber") -- returns the unique ID number of the current window.
- info("windownumbers") -- returns the unique ID numbers of all open windows.
- info("windowoptions") -- returns the names of any currently enabled window options,
- info("windowrectangle") -- returns a rectangle defining the edges of the current window. The rectangle is in screen relative coordinates.
- info("windows") -- builds a carriage return separated text array containing a list of all the currently open windows.
- info("windowtype") -- returns a numeric value based on what type of view the current window contains.
- info("windowvariables") -- returns a carriage return separated text array listing the windowglobal variables defined for the current window.
- info("windowview") -- determines what type of view the current window contains.
- listwindownumbers( -- builds a text array containing a list of window ID numbers for all the open windows associated with a particular file.
- listwindows( -- builds a text array containing a list of all the open windows associated with a particular file.
- magicformwindow -- designates an open window as the temporary active window for the purposes of info( functions and graphic statements.
- magicwindow -- designates an open window as the temporary active window for the purposes of info( functions and graphic statements.
- makesecret -- makes the current database disappear, while leaving it open in memory.
- openclonewindow -- opens a clone of the current window.
- opendialogsheet -- opens a form from the current database as a sheet dialog (attached to the current window).
- openform -- opens a form in the current database in a new window.
- openprocedure -- opens a procedure in the current database in a new window.
- opensavedwindows -- opens windows that were open the last time file was saved.
- opensheet -- opens the data sheet window for the current database in a new window.
- originalwindow -- goes back to the window remembered by the RememberWindow statement.
- rememberwindow -- remembers the currently active window, so that you can get back to it later.
- setactivedatabase -- makes a database active (without changing the configuration of the windows).
- setwindow -- specifies the dimensions (size and location) of the next window that is opened (with openform, opensheet, openprocedure etc.).
- setwindowoptions -- changes the attributes of the current window (tool bar, scroll bars, etc.).
- setwindowrectangle -- specifies the dimensions of the next window that is opened by a procedure.
- showaccessorypanel -- opens the current window's accessory panel.
- showrecordcounter -- forces Panorama to redisplay the record counter in all windows in the current database.
- showrectangle -- refreshes all or part of the current form window.
- size -- changes the data sheet text size.
- toggleaccessorypanel -- opens and closes the current window's accessory panel.
- topdatawindow -- brings the topmost data window in the specified database to the front.
- updatingwindow( -- returns true if in a formula that is being displayed on a form, otherwise false.
- views( -- lists views in open databases.
- window -- brings a Panorama window to the front. It can also open a "secret" invisible window.
- Window ID Numbers -- ID numbers for identifying windows.
- windowbox -- specifies the dimensions (size and location) of the next window that is opened (with openform, opensheet, openprocedure etc.).
- windowcornerinitialize -- shifts a window to an edge or corner of the main screen.
- windowinfo( -- returns information about an open window: its name, type, database, location, etc.
- windowname -- changes the name of the current window.
- windowtoback -- sends a Panorama window to the back, behind all other windows (including non-Panorama windows).
- windowtocorner -- shifts a window to an edge or corner of the main screen.
- zoomalign -- moves the current window to one of 9 positions on the computer's primary screen: *top left, top center, top right*, etc.
- zoomwindow -- moves (*"zooms"*) the current window to a new position and size.
- zoomwindowrectangle -- modifies the size, location, and options of the current window.

History

Version | Status | Notes
10.0 | Updated | Carried over from Panorama 6.0, but no longer suppoerts the .OutOfBounds procedure, and now includes options for opening forms from another database and modifying the appearance and operation of the form's window.