Syntax:
WindowInformation = window(expr)
Description:
This function returns information related to a window (usually the current output window). The value you specify in expr
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
window(_activeWnd)
returns the window ID number of the currently active window, or zero if no window is active.
window(_activeDoc)
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 _keepInBack
.
window(_activePlt)
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 _keepInBack
. At that point, all non-_keepInBack
windows become palettes and float over the document windows.
window(_outputWnd)
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
window(_width)
returns the width (in pixels) of the content region of the current output window.
window(_height)
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)
window(_kFBstructureTop)
returns the distance from the top of the screen to the top of the structure region of the window.
window(_kFBstructureLeft)
returns the distance from the left of the screen to the left of the structure region of the window.
window(_kFBstructureWidth)
returns the width of the window's structure region.
window(_kFBstructureHeight)
returns the height of the window's structure region.
window(_kFBcontentTop)
returns the distance from the top of the screen to the top of the content region of the window.
window(_kFBcontentLeft)
returns the distance from the left of the screen to the left of the content region of the window.
window(_kFBcontentWidth)
returns the width of the window's content region. This is normally the same as window(_width)
.
window(_kFBcontentHeight)
returns the height of the window's content region. This is normally the same as window(_height)
.
Pen Position
window(_penH)
returns the horizontal position (in pixels) of the pen in the current output window.
window(_penV)
returns the vertical position (in pixels) of the pen in the current output window.
Window Record Pointer
window(_wndPointer
or _wndRef)
returns a pointer to the Window Record of the current output window.
For information about the contents of the Window Record, see the get window statement.
window(_wndPort)
return the current grafport being used for output.
Window Class
window(_outputWClass)
returns the "class number" assigned to the current output window.
window(_activeWClass)
returns the "class number" assigned to the currently active window.
window(_outputWCategory)
returns the "class number" assigned to the current output window for the Appearance Manager runtime.
window(_activeWCategory)
returns the "class number" assigned to the currently active window for the Appearance Manager runtime. (See the appearance window statement for more information about class numbers).
Other Window Info (Appearance Manager)
window(_kFBMacWClass)
returns the toolbox window class. Return values might include things like _kDocumentWindowClass
or _kMovableModalWindowClass
window(_kFBMacWAttributes)
returns toolbox attributes about a window. Values might include _kWindowResizableAttribute
or _kWindowCloseBoxAttribute
window(_kFBFloatingWndPtr)
returns the window pointer of the frontmost floating window.
Screen Borders in Local Coordinates
window(_toLeft)
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).
window(_toTop)
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).
window(_toRight)
returns the horizontal pixel position of the screen's right edge, expressed in the local coordinate system of the current output window.
window(_toBottom)
returns the vertical pixel position of the bottom of the screen, expressed in the local coordinate system of the current output window.
(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 expr
, window(expr)
returns a nonzero value if there exists a window whose ID number is abs(expr)
; 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 window
statement) and not yet closed (using the window close
statement).
Edit Field and Picture Field Information
window(_efNum)
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.
window(_selStart)
returns the character position of the beginning of the selected text or insertion point in the currently active edit field (if any).
window(_selEnd)
returns the character position of the end of the selected text or insertion point in the currently active edit field (if any).
window(_efClass)
returns the efClass
parameter assigned to the currently active edit field (if any); or the negative of the just
parameter assigned to the currently active picture field (if any).
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.
Some expressions not supported, including:
_textClip
_pictClip
_kFBwDescHandle
_kFBwClickThru
_efHandle
_lastEfNum
_efTextLen
_teBlock
See Also:
window statement; edit field; SetSelect; get window; system function; appearance window