✔ Appearance χ Standard χ Console
appearance window [#][-] id&[, [title$][, [rect][, ¬ [windowClass][, [windowAttributes] [, [FBAttributes]]]]]]
Feb 2002 (Release 6)
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
appearance windowstatement closely follows the older
windowstatement, but is used primarily for the creation of windows. You may freely mix
windowstatements with windows that are created via the
appearance windowstatement. For instance, after creating a window with the
appearance windowstatement, you could determine its size with the
window( _width )and
window( _height )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 )
|<img src="a/appearancewindow01.gif" alt="" height="98" width="311">|
|<img src="a/appearancewindow02.gif" alt="" height="98" width="312">|
Windows with and without theme backgrounds
The parameters for
appearance window should be specified as follows. They are interpreted slightly differently depending on whether you are creating a new window or altering an existing one.
id- a positive or negative integer whose absolute value is in the range 1 through 2147483647.
title$- a string expression.
rect- a rectangle in global screen coordinates. You can express it in either of two forms:
Two diagonally opposite corner points.
Long integer expression or
pointervariable which points to an 8-byte struct such as a
windowClass- 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
windowClassvariable use the following syntax:
dim wc as WindowClass
windowClasstable introduces some new terms which may not be familiar to those new to OS X.
<img src="a/appearancewindow03.gif" alt="" height="67" width="237">
Window with toolbar
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.
<img src="a/appearancewindow04.gif" alt="" height="159" width="197">Sheet window windowClassValue Description
I need your attention now.
I need your attention now, but I'm kind enough to let you switch out of this app to do other things
system modal, not draggable
application modal, draggable
floats above all other application windows. Available in OS 8.6 or later
floats above docs, below floating windows
FBAttributes- 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,
_noAutoClipis not used because there is no such thing as
Constant Value FB Attribute
2048 This attribute affects how the window’s clip region will be set when FutureBASIC calls your dialog-event handling routine with a
_wndRefreshevent. 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
_wndClickevent. If the
_clickThruattribute is set, the activating click will be “passed through” to the window; this may cause other events (such as
_efClick) 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 (
WINDOWstatement) it will behave normally. This type of window is intended for use as a backdrop.
To Create a New Screen WindowEdit
- Specify an
idvalue such that
abs( id )is different from the ID number of any existing window. A new window is created and is assigned an ID number of
ABS(id). You can use the window's ID number later to identify the window in other FB statements and functions. If
idis 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
windowstatement 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
_keepInBackattribute), it also becomes the current active window.
title$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.
rectspecifies the initial size and location of the window's content rectangle. Note that
rectdoes 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
rect; in this case, the window is centered in the screen, and its width and height are determined by the right and bottom coordinates of
rect. 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.
windowClassspecifies the layer in which a window will reside.
windowAttributesspecifies the types of window widgets (close box, grow box) that a window will include.
FBAttributesspecifies runtime handling parameters that determine how the window will behave.
No special notes.