Futurebasic/Language/Reference/window function

Syntax
WindowInformation = WINDOW(expr)

Revision: February, 2002 (Release 6)

Description
This function returns information related to a window (usually the current output window). The value you specify in  determines what kind of information is returned, as described in the following paragraphs.

ID's of Active Window, Active Document Window, Active Palette Window and Output Window  returns the window ID number of the currently active window, or zero if no window is active.

returns the window ID number of the currently active document window or zero if no document window is active. In searching for the active document, this function bypasses all palettes in search of a window with the type attribute set to include.

returns the window ID number of the frontmost palette. In order for there to be a palette, one or more document windows must be open with the type attribute set to include. At that point, all non- windows become palettes and float over the document windows.

returns the window ID number of the current output window, or zero if output is currently directed to somewhere besides a FutureBasic-created screen window (e.g., to the printer).

 Window Size  returns the width (in pixels) of the content region of the current output window.

returns the height (in pixels) of the content region of the current output window. (Note: The content region does not include the window's frame.)

 Window Position (Appearance manager)  returns the distance from the top of the screen to the top of the structure region of the window.

returns the distance from the left of the screen to the left of the structure region of the window.

returns the width of the window's structure region.

returns the height of the window's structure region.

returns the distance from the top of the screen to the top of the content region of the window.

returns the distance from the left of the screen to the left of the content region of the window.

returns the width of the window's content region. This is normally the same as.

returns the height of the window's content region. This is normally the same as.

 Pen Position  returns the horizontal position (in pixels) of the pen in the current output window.

returns the vertical position (in pixels) of the pen in the current output window.

 Window Record Pointer  OR  returns a pointer to the Window Record of the current output window. For information about the contents of the Window Record, see the  statement, and the "Window Manager" chapter of Inside Macintosh: Macintosh Toolbox Essentials, as well as the descriptions of grafPort and CGrafPort data structures in Inside Macintosh</a>: <a href="http://developer.apple.com/documentation/mac/QuickDraw/QuickDraw-2.html">Imaging with QuickDraw</a>.

return the current grafport being used for output.

</ul> Clipboard Contents <ul> returns a nonzero value if there is information of type "TEXT" on the clipboard; returns zero otherwise.

returns a nonzero value if there is information of type "PICT" on the clipboard; returns zero otherwise.

</ul> Window Class (Standard BASIC only) <ul> returns the "class number" assigned to the current output window.

returns the "class number" assigned to the currently active window.

returns the "class number" assigned to the current output window for the Appearance Manager runtime.

returns the "class number" assigned to the currently active window for the Appearance Manager runtime. (See the  statement for more information about class numbers).

</ul> Other Window Info (Appearance Manager) <ul> returns the toolbox window class. Return values might include things like  or    returns toolbox attributes about a window. Values might include  or    returns the handle to a FBwindowDescription record which is stored in the window's refcon. While this information is subject to change, it currently contains the following data:

</ul> <ul> returns a non-zero value if this attribute bit is set.

returns the window pointer of the frontmost floating window.

</ul> Screen Borders in Local Coordinates <ul> returns the horizontal pixel position of the screen's left edge, expressed in the local coordinate system of the current output window (note this will be negative if the window lies entirely on the screen).

returns the vertical pixel position of the top of the screen, expressed in the local coordinate system of the current output window (note this will be negative if the window lies entirely on the screen).

returns the horizontal pixel position of the screen's right edge, expressed in the local coordinate system of the current output window.

returns the vertical pixel position of the bottom of the screen, expressed in the local coordinate system of the current output window.

</ul> (Note that these numbers are meaningless if output is currently directed to some place other than a screen window.)

Checking Whether a Window Exists If you specify a negative value in,   returns a nonzero value if there exists a window whose ID number is  ; it returns zero otherwise. The returned value does not depend on whether the window is currently visible or not; it only depends on whether the window has been created (using the  statement) and not yet closed (using the   statement).

Edit Field and Picture Field Information <ul> returns the ID number of the currently active edit field or picture field; or zero if there is no currently active edit field or picture field.

returns the character position of the beginning of the selected text or insertion point in the currently active edit field (if any).

returns the character position of the end of the selected text or insertion point in the currently active edit field (if any).

returns a handle to the TextEdit record of the currently active edit field (if any); this is the same as the value returned by.

returns the ID number of the previously active edit field (or zero, if no other edit field was previously active).

returns the number of characters in the currently active edit field (if any).

returns a handle to the Edit Field Descriptor for the currently active edit field or picture field (if any).

returns the  parameter assigned to the currently active edit field (if any); or the negative of the   parameter assigned to the currently active picture field (if any).

</ul>

Note
If output is currently directed to a graphics port other than a screen window (e.g. to the printer, or to an offscreen GWorld), then references to the "current output window" apply to the current port, unless otherwise specified.