The WSWindow class is the base class for all window types. Classes deriving from WSWindow (directly or indirectly) should follow the following guidelines:
The following functions are available in WSWindow:
Const Function IsCreated : Boolean;
This function returns whether the window actually exists (i.e. the object is attached to a window)
Enum WSTypes { Native, Game }
Const Function WindowingSystemType : Enum WSTypes;
This function returns the windowing system type of the window. Top-level windows can have either type; child windows must have the type of the parent. The two windowing system modes provided are generally incompatible, except for sharing the same API in WSWindow.
The Native type is the type provided by the operating system. GUI elements created with this type will have a look-and-feel appropriate for the current OS. The Game type is intended for gaming and multimedia applications, and supports various special effects.
Const Function GetDimensions (X, Y: @ Integer (Null);
Width, Height: @ Integer (Null), RestoredDims: Boolean (False));
Const Direct Inline Function GetPosition (X, Y: @ Integer; RestoredDims: Boolean (False))
{ GetDimensions X, Y, , , RestoredDims; }
Const Direct Inline Function GetSize (Width, Height: @ Integer; RestoredDims: Boolean (False))
{ GetDimensions , , Width, Height, RestoredDims; }
These functions return the dimensions of the window, in pixels. Any of the parameters can be Null, indicating that you don't care about that aspect of the window. The "position" of a window is the coordinates of the top-left corner of the window's non-client area; the "size" is the size of the nonclient area. RestoredDims specifies that you want the dimensions of the window when it is not minimized or maximized; if False, the window's current dimensions are returned.
Const Function GetClientSize (Width, Height: @ Integer; RestoredDims: Boolean (False));
This function is the same as GetSize, except that it returns the dimensions only of the client area of the window, in pixels.
Const Function GetNonClientSize (Width, Height: @ Integer); Const Function GetNonClientSize (Left, Right, Top, Bottom: @ Integer);
These functions return the size of the non-client portion of the window.
Function SetDimensions (X, Y: @ Integer (Null); Width, Height: @ Integer (Null); Restore: Boolean (False));
Direct Inline Function SetPosition (X, Y: @ Integer; Restore: Boolean (False))
{ SetDimensions X, Y, , , Restore; }
Direct Inline Function SetSize (Width, Height: @ Integer; Restore: Boolean (False))
{ SetDimensions , , Width, Height, Restore; }
These functions change the dimensions of the window. Any of the parameters can be Null, indicating that you want to leave the dimension alone. The window will be queued for repainting. The size of the window includes the non-client area. For a maximized or minimized window, the dimensions are fixed, so calling these functions will actually modify the size that the window will be when the window is restored. If Restore is true, the window is un-maximized or un-minimized.
Function SetClientSize (Width, Height: @ Integer, Restore: Boolean (False));
This function sets the size of the rectangle such that the client area is the specified size. If Restore is true, the window is un-maximized or un-minimized.
Function RepaintWindow (X, Y: Integer; Width, Height: Integer; Immediately: Boolean (False)); Function RepaintWindow (Immediately: Boolean (False));
These functions cause some or all of a window to be repainted. The first function allows you to specify an area to be repainted; the latter causes a complete repaint. Immediately specifies whether you want it to be done now (before the function returns).
Function CanBeMinimized (): Boolean; Function CanBeMaximized (): Boolean;
These functions return whether or not a window can be maximized or minimized. Under Windows, a window can be maximized or minimized only if it is a top-level window (has no parent).
Function Minimize; Function Maximize; Function RestoreDimensions;
Minimize minimizes a window. Maximize maximizes a window. RestoreDimensions un-minimizes or un-maximizes a window, performing no action if the window is already restored.
Function IsMinimized: Boolean; Function IsMaximized: Boolean;
These functions return whether a window is currently minimized or maximized.
Function Show (ShowState: Boolean (True));
Inline Direct Function Hide() { Show (False); }
These functions show or hide a window. If ShowState is True, Show shows the window; otherwise it hides the window. If a window is hidden, all child windows (but not owned windows) are also hidden. The redrawing associated with showing or hiding a window may or may not be performed immediately.
Function IsShown: Boolean;
Returns whether the window is currently shown. Immediately after a call to Show, this function should return the specified show state, regardless of whether redrawing has occurred.
Event management functions:
Function AddHandler (
| Table of Contents | Qwertie's Site/Mirror |
|