Futurebasic/Language/Reference/appearance window

Statement
✔ Appearance χ Standard χ Console

Syntax
appearance window [#][-] id&[, [title$][, [rect][, ¬ [windowClass][, [windowAttributes] [, [FBAttributes]]]]]]

Revised
Feb 2002 (Release 6)

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  statement closely follows the older   statement, but is used primarily for the creation of windows. You may freely mix  functions and   statements with windows that are created via the   statement. For instance, after creating a window with the  statement, you could determine its size with the   and   functions.

You may notice that windows in most modern applications have a background that is something other than white. This is not accomplished by drawing into the window with graphic commands. It is put in place with a simple call to the Theme Manager. The following line will be useful in many programs. def SetWindowBackground( _kThemeActiveDialogBackgroundBrush, _zTrue ) The parameters for  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 2147483647. - 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   - an unsigned long integer that specifies the Macintosh window class. This is not the same value as FB's user definable class for the standard runtime. It more closely represents the layer in which a window will reside. To create a  variable use the following syntax: dim wc as WindowClass The  table introduces some new terms which may not be familiar to those new to OS X. A sheet window is attached to a parent window. It drops from the title bar of the parent and is used to force some decision relative to the parent window.

1     I need your attention now. 2     I need your attention now, but I'm kind enough to let you switch out of this app to do other things 3     system modal, not draggable 4     application modal, draggable 5     floats above all other application windows. Available in OS 8.6 or later 6     document windows 7     the desktop 10     help windows 11     sheets 12     floats above docs, below floating windows 13     plain 14     overlays 15     sheet alerts 16     plain alerts

  - this long integer sets up handling procedures that are used by the runtime. Some of the features used in the Standard BASIC runtime are not carried forward for the Appearance Runtime. For example,  is not used because there is no such thing as   in Appearance.

2048    This attribute affects how the window’s clip region will be set when FutureBASIC calls your dialog-event handling routine with a   event. If you specify this attribute, the clip region will be set to include only that part of the window which was identified as actually needing a refresh (the clip region will be reset to its previous value when the routine exits). If you omit this attribute, the clip region will be set to include the entire window (possibly excluding controls, edit fields, etc.) 4096    This attribute affects what happens when your program activates the window in response to a   event. If the  attribute is set, the activating click will be “passed through” to the window; this may cause other events (such as   or  ) to be generated, depending on what was clicked on. If you omit this attribute, two separate clicks are required to activate the window and to interact with its contents. 32768    Use this attribute to prevent the tab key from advancing the keyboard focus in edit fields 65536    This attributes insures that the window will never be activated. Controls in the window will not function If you bring the window forward under program control ( statement) it will behave normally. This type of window is intended for use as a backdrop.  

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  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.</li> specifies the layer in which a window will reside.</li> specifies the types of window widgets (close box, grow box) that a window will include.</li> specifies runtime handling parameters that determine how the window will behave.</li> </ul>