A data structure that provides information about the state of the system and of the current window at the time of the last event in that window.
The ThisWindow data structure provides information about the state of the system and of the current window at the time of the last event in that window.
The ThisWindow structure contains a number of fields that are reset when the current window changes. By trapping these values, the application enables the user to change the current window and later return to pick up where things were left.
If the current window is non-modal, note that the last event in the window is not necessarily the last event in the interface overall.
The fields in the ThisWindow structure are
AltKey, CtrlKey, ShiftKey, EventName, EventTag, EventType, KeyPressed, MouseClick, ScrollingKey, WindowCol, WindowHeight, WindowName, WindowNum, WindowRow, WindowState, WindowTag, WindowWidth
The state of the Alt, Ctrl or Shift key at the time of the last event in the current window.
thiswindow.altkey
thiswindow.ctrlkey
thiswindow.shiftkey
"1" ($True), or "0" ($False), character string (binary). Can be reset by an application program.
The variables indicate the state of the Alt, Ctrl and Shift keys at the time of the last event in the current window.
Each variable is set to '1' ($True) if the corresponding key was down when the last event in the current window occurred. Otherwise, each is set to '0' ($False).
Identifies the last event that occurred in the current window.
thiswindow.eventname
One of
Break, Canceled, Click, Closed, DoubleClick, GotFocus, HangUp, LostFocus, LostFocusModified, Modified, PanicExit, Timeout, WindowFocusSwitch, or keyname
Cannot be reset by an application program.
Character string (alpha). Can be reset by an application program.
Identifies, by name, the last event to occur in the current window.
This variable is not set in all operating environments.
ThisWindow.EventType gives additional information about the type of event, and ThisWindow.EventTag gives additional information about the type of object involved in the event.
Identifies the tag of the object in which the last event in the current window occurred.
thiswindow.eventtag
The identification tag of the object in which the last event in the current window occurred. Can be reset by an application program.
Identifies the object in which the last event in the current window occurred.
The identification tag selected varies with the type of object involved in the event.
ThisWindow.EventName names the event, and ThisWindow.EventType gives additional information about the type of event.
Can be, depending on the type of object involved
EventType Type | Source for EventTag Value |
Window | Event.WindowTag |
Menu | Event.MenuTag |
Menuitem | Event.MenuItemTag |
Form | Event.FormTag |
Formfield | Event.FieldTag |
Accelerator | Event.FieldTag |
System | Event.FieldTag |
Identifies the type of event that last occurred in the current window.
thiswindow.eventtype
One of
Window, Menu, MenuItem, Form, FormField, Accelerator, System
Character string (alpha). Can be reset by an application program.
Identifies the type of event that last occurred in the current window. ThisWindow.EventName names the event, and ThisWindow.EventTag identifies the object in which the event occurred.
Indicates the key that, pressed, caused the event that last occurred in the current window.
thiswindow.keypressed
Character string (alpha). Can be reset by an application program.
The name of the key that, pressed by the application user, caused the last event to occur in the current window. Can be reset by an application program.
For example, if the application user presses the a key in a form field and the Modified event is intercepted by the application program, then ThisWindow.KeyPressed is set to "a".
Note: The name of the key that caused an accelerator event is recorded in the ThisWindow.EventName variable.
Indicates if a mouse button accelerator caused the event that last occurred in the current window.
thiswindow.mouseclick
"1" ($True), or "0" ($False). Can be reset by an application program.
Set to "1" ($True) if the last event to occur in the current window was caused by the press of a mouse button that is defined as an accelerator for the window. Otherwise, set to "0" ($False).
If SET MOUSE is OFF, ThisWindow.MouseClick is 0.
Indicates if the accelerator that caused the event that last occurred was also a defined SCROLL key.
thiswindow.scrollingkey
"1" ($True), or "0" ($False). Can be reset by an application program.
Set to "1" ($True) if the accelerator key that caused the last event in the current window was also a defined SCROLL key. Otherwise, set to "0" ($False).
window set scroll Up up Down down
window set accelerator up down escape
form open fEmployee
form set scroll fEmployee from EmpSet
form display
while
if thiswindow.scrollingkey = $true
change EmpSet from fEmployee
form scroll
continue
endif
... other commands ...
endwhile
In the preceding code fragment, employee records are scrolled through a form and the application user can update the data. ThisWindow.ScrollingKey detects if a scrolling key was pressed, enabling the scrolling action to be performed under program control after any changes to the data are saved.
thiswindow.scrollingkey
Character string (binary). Can be reset by an application program.
The variable indicates if the accelerator that cased the event that last occurred was also a defined SCROLL key.
ThisWindow.ScrollingKey is set to '1' ($True) if the accelerator that caused the last event in the current window was also a defined SCROLL key. Otherwise, it is set to '0' ($False).
The character column or row position of the current window.
thiswindow.windowcol
thiswindow.windowrow
A number. Cannot be reset by an application program.
The variables indicate the physical size of the current window in character rows (WindowHeight) and character columns (WindowWidth).
The physical dimensions of a window determine the visible space inside the window (i.e., the client area). This area changes in size when the dimensions of the window change. An application user can change the size of a window by using the resize feature. A program can change the size of a window using the WINDOW SIZE command.
An application program can position a window using the WINDOW MOVE command.
The physical height or width of the current window in character rows.
thiswindow.windowheight
thiswindow.windowwidth
Number (INT). Cannot be reset by an application program.
The variables indicate the physical size of the current window in character rows (WindowHeight) and character columns (WindowWidth).
The physical dimensions of a window determine the visible space inside the window (i.e., the client area). This area changes in size when the dimensions of the window change. An application user can change the size of a window by using the resize feature. A program can change the size of a window using the WINDOW SIZE command.
The name of the current window.
thiswindow.windowname
A character string. Can be reset by an application program.
The variable identifies, by name, the current window.
You can use ThisWindow.WindowName to restore the focus to a window, making it the current window:
let SaveWin = ThisWindow.WindowName
window open Window2
... other commands ...
window set current SaveWin
The identification number of the current window.
thiswindow.windownum
A number. Can be reset by an application program.
The variable identifies, by identification number, the current window.
thiswindow.windownum
Character string (alpha). Can be reset by the application program.
The variable identifies, by identification tag, the current window.
Indicates whether the current window is maximized, minimized, or otherwise.
thiswindow.windownum
A number. Cannot be reset by an application program.
Indicates the state of the current window at the time of the last event in that window.
Value | Meaning |
-1 | The current window is minimized. |
0 | The current window is neither minimized nor maximized. |
1 | The current window is maximized. |