window
WINDOW
The window statement brings a Panorama window to the front. It can also open a “secret” invisible window.
Parameters
This statement has one parameter:
window – is the exact name of the window that is to be brought to the front, or the window ID number (see Window ID Numbers). This must be a window that is currently open. If necessary, the procedure can find out the name of the current window with the info(“windowname”) function. It can get a list of all open windows with the info(“windows”) or listwindows( function. To open a “secret” window, the window name should be databasename:Secret
. A secret window is just like any other window that contains a form, except that it is invisible. A procedure can flip to a secret window in another database (the database must be open), perform some operation on that database (search, sort, etc.) then go back to the original window – all without the flashing and updating that usually occur when you flip from window to window. Secret windows are temporary. The secret window ceases to exist as soon as the procedure brings another window to the top (or as soon as the procedure stops.) Note: The word Secret in the window name may be capitalized any way you want: secret, Secret or SECRET.
Description
This statement will bring a window to the front, on top of all other windows. The window must already be open (unless it is a secret window) and its name must be spelled correctly with all punctuation. If the window is not already open, an error will be generated, which can be trapped by if error (otherwise the procedure will stop). A window that is not already opened may be opened using the openform, opensheet, opencrosstab or openprocedure statements.
If you simply want to open any window in another database but you don’t care what window, use the topdatawindow statement or the openfile statement. If the database is already open these statement will simply bring one of its windows to the top.
This example prints using the Label form. If the Label window is already open it simply brings it to the top, otherwise it opens the form.
window "Clients:Label"
if error
openform "Label"
endif
print dialog
This example updates an inventory database. It temporarily switches to the Inventory data sheet window to do the update, then switches back to the original window when it is done.
local wasWindow
wasWindow=info("windowname")
window "Inventory"
if error
message "Sorry, cannot update inventory."
stop
endif
find Description=fieldvalue("Invoice",Description)
if info("found")
QtyOnHand=QtyOnHand-fieldvalue("Invoice","Qty")
endif
window wasWindow
This example is exactly the same as the previous example, except that it uses a secret invisible window instead of the data sheet.
local wasWindow
wasWindow=info("windowname")
window "Inventory:SECRET" // use secret window
if error
message "Sorry, cannot update inventory."
stop
endif
find Description= fieldvalue("Invoice",Description)
if info("found")
QtyOnHand=QtyOnHand-fieldvalue("Invoice","Qty")
endif
window wasWindow
Note: Another way to do the same thing is to use the setactivedatabase statement.
Instead of bringing a window forward by name, this statement can also use the unique window number. This is especially important if there is more than one window open with the same name. Using the ID number allows every window to be uniquely identified, independent of the window name.
Here is a example that opens two databases, then brings the original window back to the top.
let wasWindowNumber = info("windownumber")
opendatabase "Contacts"
opendatabase "Payroll"
window wasWindowNumber
Unlike the examples earlier on this page, this code will always come back to the original window, even if there are other windows with the same name.
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 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.
- opendialog -- opens a form from the current database as a modal dialog box.
- 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 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
10.2 | Update | Now allows the window to be specified by window ID number in addition to by name. |
10.0 | No Change | Carried over from Panorama 6.0. |