WorkSpaceHeight PowerScript function
Description
Obtains the height of the workspace within the boundaries
of the specified window.
Controls
Window objects
Syntax
|
1 |
<span>windowname</span>.<span>WorkSpaceHeight</span> ( ) |
|
Argument |
Description |
|---|---|
|
windowname |
The name of the window for which you |
Return Values
Integer. Returns the height of the workspace
area in PowerBuilder units in windowname.
If an error occurs, WorkSpaceHeight returns -1.
If windowname is null, WorkSpaceHeight returns null.
Usage
The workspace height does not include the thickness of the
frame, the title bar, menu bar, horizontal scroll bar, or any toolbars
at the top or bottom. The workspace height includes the MicroHelp
status bar.
The workspace width does not include the thickness of the
frame, the vertical scroll bar, or any toolbars on the left or right.
Examples
This example returns the height of the workspace
area in the w_employee window:
|
1 |
Integer Height |
|
1 |
Height = W_employee.<span>WorkSpaceHeight</span>() |
This example resizes the client area of a custom
MDI frame window (that is, a frame window in which you have placed
controls). P_logo is the control that has
been placed on the window. The code belongs in the script for the
frame’s Resize event:
|
1 |
integer lw, lh |
|
1 |
// Get the current workspace measurements |
|
1 |
lw = This.WorkSpaceWidth() |
|
1 |
lh = This.<span>WorkSpaceHeight</span>() |
|
1 |
|
1 |
// Subtract the logo, MicroHelp from the height |
|
1 |
lh = lh - (p_logo.Y + p_logo.Height) |
|
1 |
lh = lh - MDI_1.MicroHelpHeight |
|
1 |
|
1 |
// Add the distance between the top of the frame |
|
1 |
// (just below the menu bar or toolbar, if any) |
|
1 |
// and top of the workspace. |
|
1 |
lh = lh + This.WorkspaceY( ) |
|
1 |
|
1 |
// Move the client area below the picture control |
|
1 |
MDI_1.Move(This.WorkspaceX( ), & |
|
1 |
p_logo.Y + p_logo.Height) |
|
1 |
|
1 |
// Resize the client area using the calculated dims |
|
1 |
mdi_1.Resize(lw, lh) |