setwindowrectangle
RECTANGLE
,
OPTIONS

The setwindowrectangle statement specifies the dimensions of the next window that is opened by a procedure.


Parameters

This statement has two parameters:

rectangle – defines the size and location of the new window. Most procedures will use the rectangle( or rectanglesize( functions to create this rectangle.

options – is an item of text that optionally contains keywords that turn off elements of the new window. If the text contains NoToolBar (or NoPalette), the window will not have a tool bar. If the text contains NoScroll then the window will not have any scroll bars. If the text contains NoVerticalScroll, the window will not have a vertical scroll bar (this can also be abbreviated as novscroll or novertscroll). If the text contains NoHorizontalScroll, the window will not have a horizontal scroll bar (this can also be abbreviated as nohscroll or nohorzscroll). A procedure may combine several options separated by spaces. If the option text is empty (“”) the window will appear normal (the parameter can also be completely omitted, which also results in normal window appearance). Note: The keywords may be in either upper or lower case, for example, any of the keywords notoolbar, NoToolBar or NOTOOLBAR will eliminate the tool bar. The window location and options can now be set directly in most commands that open windows, making a separate setwindowrectangle statement unnecessary.


Description

This statement specifies the dimensions (size and location) of the next window that is opened with the openform, opensheet, opencrosstab, openprocedure, opendialog or opendialogsheet commands. It can also specify window options, for example whether the tool bar or scroll bars should be included in the window.

When a new window opens it normally reappears in the same position it last appeared in. By using the setwindowrectangle statement before opening the window, the procedure can explicitly control where the window appears on the screen.

The procedure below opens the form Check List in a new window. The new window is the same size as the current window, but offset 10 points down and to the right. The new Check List window will not have a tool palette or horizontal scroll bar.

local newWindowRect
newWindowRect=rectangleadjust( info("windowrectangle"),10,10,10,10)
setwindowrectangle newWindowRect,"nopalette nohorzscroll"
openform "Check List"

The procedure below opens the form Balance Options as a 3 inch by 4 inch dialog box centered on the main screen. Notice that since the form is opened with the opendialog statement, the options parameter of the setwindowrectangle statement is ignored, so it has been omitted.

local newWindowRect
newWindowRect=rectanglecenter(
    info("screenrectangle"),
    rectanglesize(1,1,3*72,4*72))
setwindowrectangle newWindowRect
opendialog "Balance Options"

Note: Panorama now allows the size and location to be specified directly in the the openform, openprocedure, opendialog and opendialogsheet statements – you no longer need a separate setwindowrectangle statement. You can also set the window options directly in the openform statement.


See Also


History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0. In Panorama 6.0 and earlier the keyword nopalette was used to disable the tool palette, now the keyword notoolbar can also be used (nopalette still works). In Panorama 6.0 and earlier the vertical and horizontal scroll bars had to be disabled separately. This can still be done, but you can also simply specify noscrollbars to disabled both the horizonatal and vertical scroll bars. In Panorama 6.0 and earlier the options parameter was required, now it is optional and will default to `""` if omitted. Note: The nodragbar option is no longer supported, and will be ignored.