Futurebasic/Language/Reference/window statement

Syntax
WINDOW [#]idExpr[,[title$][,[rect][,[type][,class]]]]

Description
Use this statement to do any of the following:  Create a new screen window;

Activate (highlight and bring to the front) an existing window;

Make an existing window visible or invisible;

Alter the title or rectangle of an existing window.

 The parameters should be specified as follows. They are interpreted slightly differently depending on whether you are creating a new window or altering an existing one.  - a positive or negative integer whose absolute value is in the range 1 through 255.

- a string expression.

- a rectangle in global screen coordinates. You can express it in either of two forms:

Two diagonally opposite corner points. Long integer expression or  variable which points to an 8-byte struct such as a   type.

- a positive or negative integer which specifies the general appearance of the window, and specifies whether it should be "modal" or not (a modal window is always active while it's open; it inhibits the user from selecting another window or a menubar item until the window is closed).

- an integer in the range 0 through 255.

 To Create a New Screen Window  Specify an  value such that   is different from the ID number of any existing window. A new window is created and is assigned an ID number of. You can use the window's ID number later to identify the window in other FB statements and functions. If  is negative, the window is created invisibly; it's sometimes useful to create a window invisibly if it will contain controls, edit fields and graphics that may take a long time to build. You can use the  statement again to make an invisible window visible (see below). When you create a new window, it becomes the current output window. If you create it visibly (and you don't specify the  attribute), it also becomes the current active window.

assigns a string to the window's title bar (if the window has a title bar). If you omit this parameter, the window will be created without a title.

specifies the initial size and location of the window's content rectangle. Note that rect does not include the window's frame. This parameter is interpreted in a special way if you specify an upper-left coordinate of (0,0) in ; in this case, the window is centered in the screen, and its width and height are determined by the right and bottom coordinates of. Note that this special interpretation applies only when you're creating a new window. If you omit this parameter, a window of a "default" size and location is created.

specifies the appearance, modality and special attributes of the window (see more below). If you omit this parameter, a non-modal window of type  is created, with no special attributes.

specifies an optional "class number" for the window. If your application creates several windows, it's useful to assign the same class number to each window that performs a given kind of function. Later, you can use the  function to determine the class number of the currently active window and the current output window; this can help your application determine what the window is used for and how to process it. If you omit this parameter, the new window is assigned a class number of zero.

To Activate an Existing Window

Specify the (positive) ID number of an existing window in. You do not need to specify any of the other parameters, unless you also wish to change some of the window's characteristics. The window also becomes the current output window. If the window was invisible, it becomes visible. Note: You can't activate the window if you specified the  attribute when the window was created, and there are other visible windows open.

To Make an Existing Window Visible or Invisible

To make a window visible, specify the (positive) ID number of an existing window in. The window also becomes the current active window (unless its  attribute is set), and it becomes the current output window.

To make a window invisible, specify the negative of an existing window's ID number in. The window becomes the current output window. If it was the active window, it becomes inactive (possibly forcing another window to become active). You do not need to specify any of the other parameters, unless you also want to change some of the window's characteristics.

To Alter the Characteristics of an Existing Window

Specify the ID number of an existing window (or its negative) in, and specify a new   and/or   parameter (you can't change the window's  nor   after it's been created). If you omit any parameter, the corresponding characteristic won't change. Note that the parameter is interpreted slightly differently when you're altering an existing window, as opposed to creating a new window; in particular, specifying an upper-left coordinate of (0,0) will not cause an existing window to be centered on the screen. If you want to change an existing window's rectangle so that it's centered on the screen, use a parameter that's calculated as follows:



Note: If you specify the window's (positive) ID number when you alter a window's characteristics, the window also becomes the current active window (unless its  attribute is set). If you specify the negative of the window's ID number, the window becomes invisible.

Side Effects of Activating the Window

The  statement always makes the window active, unless you specify a negative , or you specified the   attribute when you created the window. When you activate a window using the  statement, the following things also happen:

 The window also becomes the current output window. (See the  statement to learn how to specify an output window that's different from the active window.)

A DIALOG event of type  is generated. (There are also other kinds of actions which generate  events; see the   function for more information.)

Any previously-active window becomes inactive (this also generates a separate  DIALOG event).



Side Effects of Making a Window Visible

If  is the (positive) ID of a window that currently exists but is invisible, the   statement makes the window visible, and also generates a   event of type. A  event is also generated when you create a new window visibly. (Note: There are also other kinds of actions which generate events; see the   function for more information.)

Side Effects of Making a Window Invisible

If  is negative, the window becomes invisible, and it becomes the current output window. If the window was previously active, it becomes inactive; if your program has other visible windows, one of them becomes the active window.

More about the type Parameter

The parameter is a positive or negative integer. The absolute value of determines the general appearance of the window and determines some special attributes of it. The sign of  determines whether the window will be modal or non-modal. If  is negative, the window will be modal, which means the user won't be able to switch to a different window until the modal window is closed; if the user clicks in an inactive window while a modal window is active, a beep is generated, but a  event is notgenerated. can be expressed as follows:

can be any of the following: (1)

Document window with room for scrollbars.

<image was here

Framed dialog window.

<image was here

(3)

(4)

(5)

(6)

(9)

Plain dialog window.

Shadowed dialog window.

Document window with no grow box.

Movable dialog window.

Document window with zoom box and room for scrollbars.

<image was here

(17)

Rounded-corner window. Add 1 through 7 to this variant to increase the roundness of the corners.

<image was here

(129)

Palette window with close box. You can add the constant  (8) to this variant to give the window a zoom <image was here (131) Sideways palette. You can add the constant  (8) to this variant to give the window a zoom box. 176 through 191 These values are mapped to Appearance Manager window types 1984 through 1999. 192 through 255 These values are mapped to Appearance Manager window types 1024 through 1087.

The  can be any of the following (you can specify as many of these as apply):