Foundation 6

Fnd_Wnd

25 shared methods.

Fnd_Wnd_BringToFront

Fnd_Wnd_BringToFront ($windowID_i : Integer)

Pass a window ID and that window is brought to the front, a more precise version than bringing an entire process to the front. If the window's process is hidden it is shown first. Does nothing when the window does not exist.

ParameterTypeDirectionDescription
windowIDIntegerinA Window ID

Fnd_Wnd_Cancel

Fnd_Wnd_Cancel

Calls the CANCEL command.

Exists so that CANCEL can be reached from CALL FORM, which takes a method name and cannot be given a bare command.

No parameters.

Fnd_Wnd_CancelCloseAll

Fnd_Wnd_CancelCloseAll

Call this to end Foundation's attempts to close all windows.

No parameters.

Fnd_Wnd_CloseAllWindows

Fnd_Wnd_CloseAllWindows ({wait?}) --> Boolean

This process tries to tell all of the other processes to close their windows.

Called as a new process from Fnd_Shell_Quitter, and when the user Option-clicks a window's close box.

If the wait parameter is passed and is True, this process will wait until all of the windows have been closed, and then return True. If it takes too long for the windows to close, or the user cancels the closing, then False is returned.

Do not pass True to this routine from a process that's displaying a window that needs to be closed. It won't work properly.

ParameterTypeDirectionDescription
waitBooleaninWait for all windows to close? (optional)
ResultBooleanoutDid all windows close?

Fnd_Wnd_CloseAllWindows2

Fnd_Wnd_CloseAllWindows2

This process asks every closeable window to close, one request each, and keeps looking for new ones until none are left, Close All is cancelled, or 30 seconds pass.

Called as a new process from Fnd_Wnd_CloseAllWindows.

Called with a window by Fnd_Wnd_CloseWindow, it asks only that window's process, and only asks that window (a prime) once every closeable sibling has closed. Close All is untouched.

ParameterTypeDirectionDescription
targetWindowIntegerinA prime window to close after its siblings (optional)

Fnd_Wnd_CloseBox

Fnd_Wnd_CloseBox ({add close box?}) --> Boolean

Adds a close box to the upcoming window. Also returns the current setting.

This method replaces the original Fnd_Wnd_SetCloseBox method, which is now obsolete.

ParameterTypeDirectionDescription
closeBoxBooleaninAdd a close box? (optional)
ResultBooleanoutCurrent setting

Fnd_Wnd_CloseBoxMethod

Fnd_Wnd_CloseBoxMethod

A generic method with no code. Used by the Fnd_Wnd_OpenWindow method as the close box method for new windows (handle the close in the form method).

No parameters.

Fnd_Wnd_CloseNow

Fnd_Wnd_CloseNow --> Boolean

Returns True if Foundation is trying to close all windows due to the user Option-clicking a window's close box, or if the current form's window has been asked to close by Fnd_Wnd_CloseWindow or Close All.

ParameterTypeDirectionDescription
$0BooleanoutTrue if it's time to close the window

Fnd_Wnd_CloseWindow

Fnd_Wnd_CloseWindow (window)

Asks one window to close, as if it had been closed with Close All: its onClose method, its On Outside Call handler, or a plain CANCEL. The window may veto.

A prime window with closeable siblings waits: the siblings are asked first, and the prime only once they have all closed. That happens in a background process. Does nothing if the window does not exist.

ParameterTypeDirectionDescription
windowIntegerinThe window reference

Fnd_Wnd_GetNextStackElement

Fnd_Wnd_GetNextStackElement --> Number

Gets (and reserves) the number of the next available slot in the window cascade. The slot's position is the seed plus (slot-1) times the offset.

ParameterTypeDirectionDescription
$0LongintoutThe cascade slot number to use, from 1

Fnd_Wnd_GetProcessWindowRef

Fnd_Wnd_GetProcessWindowRef (process number) --> Number

Returns the window ref for the frontmost window of the specified process.

ParameterTypeDirectionDescription
processNumberLongintinA process number
ResultLongintoutA window reference or 0

Fnd_Wnd_Info

Fnd_Wnd_Info (label) --> Text

Returns requested information. See the Fnd_Gen_ComponentInfo method for more information.

ParameterTypeDirectionDescription
requestTextinInfo desired ("version" or "name" or "position" or "title")
ResultTextoutResponse

Fnd_Wnd_MoveOnScreen

Fnd_Wnd_MoveOnScreen (->left; ->top; ->right; ->bottom; {window type})

Modifies the window coordinates so the window will be opened completely onscreen.

Alternate syntax #1: pass no parameters and the per-process properties Fnd.Wnd.Left_i, Fnd.Wnd.Top_i, Fnd.Wnd.Right_i, Fnd.Wnd.Bottom_i and Fnd.Wnd.WindowType_i are used and updated Alternate syntax #2: pass an object with the desired parameters; the property names are capitalised, as below, and the object is updated in place

ParameterTypeDirectionDescription
numberOnePointerinPointer to the left side of the window
topPointerinPointer to the top of the window
rightPointerinPointer to the right side of the window
bottomPointerinPointer to the bottom of the window
windowTypeLongintinThe window type (optional)
numberOneObjectinObject containing parameters
numberOneLongintinLeft side of the window
numberOneLongintinTop of the window
numberOneLongintinRight side of the window
numberOneLongintinBottom of the window
numberOneLongintinThe window type (optional)

Fnd_Wnd_OpenFormWindow

Fnd_Wnd_OpenFormWindow (->table; form name)

Opens a new window using the specified form's width and height.

ParameterTypeDirectionDescription
var1PointerinA pointer to the form's table
var2TextinThe name of the form
ResultLongintoutThe window reference

Fnd_Wnd_OpenWindow

Fnd_Wnd_OpenWindow (width; height) --> Number Alternate parameters: Fnd_Wnd_OpenWindow (left; top; right; bottom)

Opens a new window centered on the screen or over the frontmost window (depending on the value of Fnd.Wnd.WindowPosition_i).

ParameterTypeDirectionDescription
fnd_Wnd_LeftLongintinWidth of the new window
fnd_Wnd_TopLongintinHeight of the new window
fnd_Wnd_LeftLongintinGlobal left coordinate
fnd_Wnd_TopLongintinGlobal top coordinate
fnd_Wnd_RightLongintinGlobal right coordinate
fnd_Wnd_BottomLongintinGlobal bottom coordinate
ResultLongintoutThe window reference number

Fnd_Wnd_Position

Fnd_Wnd_Position ({position setting}) --> Number Fnd_Wnd_Position (left; top; right; bottom) --> Number

Allows the developer to get and set the window position for the upcoming window. 1 = Fnd_Wnd_CenterOnScreen = Centered on screen 2 = Fnd_Wnd_CenterOnWindow = Centered over frontmost window 3 = Fnd_Wnd_MacOSXSheet = Sheet if possible, or centered over frontmost window 4 = Fnd_Wnd_Stack = Stacked with other stacked windows 5 = Fnd_Wnd_StackOnWindow = Stacked over the frontmost window

Optionally exact window coordinates can be passed.

This method replaces the original Fnd_Wnd_SetPosition method, which is now obsolete.

ParameterTypeDirectionDescription
leftLongintinWindow position (optional)
topLongintinRelative to Window (optional)
leftLongintinLeft
topLongintinTop
rightLongintinRight
bottomLongintinBottom
ResultLongintoutCurrent window position setting

Fnd_Wnd_Register

Fnd_Wnd_Register (window {; options})

Adds a window to the window registry, or merges the options into its entry if it is already there. Windows opened by Fnd_Wnd_OpenWindow are registered automatically, but are kept out of the Window menu and out of Close All until they opt in.

ParameterTypeDirectionDescription
windowIntegerinThe window reference
optionsObjectinAny of the properties below (optional)
optionsTextinThe Window-menu text
optionsBooleaninList the window in the Window menu
optionsBooleaninInclude the window in Close All
optionsBooleaninSee below
optionsBooleaninSee below
optionsTextinA project method run inside the window when it is asked to

Fnd_Wnd_SavePosition

Fnd_Wnd_SavePosition ({name{; window ref}})

Saves the frontmost window of the current process in the user's prefernces file (if the Foundation Preferences component is available).

This is basically the same as calling Fnd_Pref_SetWindow, but you don't have to check first to see if the Preferences component is available.

ParameterTypeDirectionDescription
preferenceNameTextinThe name of the preference item (optional)
windowReferenceLongintinThe window to save (optional)

Fnd_Wnd_SendCloseRequests

Fnd_Wnd_SendCloseRequests ({process number})

Marks the frontmost window of the current process (or of the process passed) as one that should be closed if the user option-closes a window or selects Close All Windows from a menu. A window already marked is not added again. If the current process has no window yet, the next one it opens with Fnd_Wnd_OpenWindow or Fnd_Wnd_OpenFormWindow is marked. Nothing happens if another process has no window. See Fnd_Wnd_Register for the prime window, which this claims in the same way.

ParameterTypeDirectionDescription
processNumberLongintinProcess number (optional)

Fnd_Wnd_Title

Fnd_Wnd_Title ({title}) --> Text

Gets and sets the window title for the upcoming window.

This method replaces the original Fnd_Wnd_Title method, which is now obsolete.

ParameterTypeDirectionDescription
windowTitleTextinWindow title (optional)
ResultTextoutNext window title

Fnd_Wnd_ToolbarHeight

Fnd_Wnd_ToolbarHeight --> longint

Returns the toolbar height (if it is currently being displayed)

ParameterTypeDirectionDescription
$0longintoutThe toolbar height

Fnd_Wnd_Type

Fnd_Wnd_Type ({window type}) --> Number

Sets and gets the window type for the next window to be opened.

This method replaces the original Fnd_Wnd_SetType method, which is now obsolete.

ParameterTypeDirectionDescription
windowTypeLongintinWindow type (optional)
ResultLongintoutWindow type Modified by Gary Boudreaux on Dec 21, 2008 Enhanced parameter description in header

Fnd_Wnd_Unregister

Fnd_Wnd_Unregister ({window})

Removes a window from the window registry. With no parameter it removes the current process's most recently registered window, which is the one CLOSE WINDOW would close. Does nothing if there is no such entry.

ParameterTypeDirectionDescription
windowIntegerinThe window reference (optional)

Fnd_Wnd_UseSavedPosition

Fnd_Wnd_UseSavedPosition ({pref name})

Tells the window routines we want to try to use a saved position.

If no preference name is specified, the current process name is used.

ParameterTypeDirectionDescription
processNameTextinThe name of the saved position (optional)

Fnd_Wnd_Windows

Fnd_Wnd_Windows ({filter}) --> Collection

Returns the live entries of the window registry, after dropping the dead ones. Each entry is an object: window, process, processName, title, inMenu, closeable, prime, disposable, slot and onClose.

The result is a copy: changing it does not change the registry.

ParameterTypeDirectionDescription
filterObjectinReturn only entries having every property of this object, e.g. {process: 3} or {inMenu: True} (optional)
ResultCollectionoutA non-shared collection of entry objects, oldest first