Window control
Windows are the main interface between the user and a PowerBuilder
application. Windows can display information, request information from a
user, and respond to the user’s mouse or keyboard actions.
The definition of a window includes properties, events, and
functions. The properties determine the style of the window — how it
looks. The events are actions in the window; when an event is triggered,
the associated script is executed. The functions can trigger events in the
window, manipulate or change the window, or provide information about the
window.
Dockable windows are obsolete
Dockable windows become obsolete at the release of PowerBuilder
2019 R2. Obsolete features are no longer eligible for technical support
and will no longer be enhanced. Customers who use dockable windows in
their applications can choose to continue using the feature without
support or migrate to normal floating windows.
Properties
Every window has a style that determines how it looks to the user.
That style is governed by values assigned to the properties of the
window.
|
Window property |
Datatype |
Description |
|---|---|---|
|
String |
A description of the control and/or its purpose for |
|
|
String |
A label that briefly describes the control, such as |
|
|
AccessibleRole (enumerated) |
Describes what kind of user interface element the |
|
|
Integer |
Specifies how long an animation specified with the |
|
|
Long |
Specifies the numerical value of the background |
|
|
Boolean |
Specifies whether the window has a border. Values
|
|
|
Boolean |
Specifies whether PowerBuilder moves the window to
|
|
|
Boolean |
Causes the window to be centered when it is created
|
|
|
ClassDefinition |
PowerObject |
An object of type PowerObject containing |
|
ClientEdge |
Boolean |
Specifies whether the client area of the window
|
|
WindowAnimationStyle (enumerated) |
Specifies an optional animation effect that |
|
|
Integer |
Specifies the number of columns on a page. The PowerBuilder multiplies |
|
|
ContextHelp |
Boolean |
When WindowType = Response!, this property
|
|
Control[ ] |
WindowObject |
Contains the controls in the window. You should not |
|
Boolean |
Specifies whether the Control Menu box displays in
|
|
|
Boolean |
Specifies whether the window is enabled (can send
|
|
|
Integer |
Specifies the height of the window, in PowerBuilder You cannot resize minimized or maximized |
|
|
Boolean |
Specifies whether a horizontal scroll bar displays
|
|
|
String |
Specifies a stock icon or an ICO file that displays The default value is |
|
|
Integer |
Specifies the number of lines on a page. The PowerBuilder multiplies UnitsPerLine |
|
|
Boolean |
Specifies whether a Maximize Box displays in the
|
|
|
MenuID |
Menu |
Specifies the ID of a PowerBuilder uses MenuID internally. To change |
|
String |
Specifies the name of a PowerBuilder uses MenuName internally. To |
|
|
Boolean |
Specifies whether a Minimize Box displays in the
|
|
|
WindowAnimationStyle (enumerated) |
Specifies an optional animation effect that |
|
|
PaletteWindow |
Boolean |
When WindowType = Popup!, this property specifies
|
|
String |
Specifies the name of the file containing the |
|
|
Boolean |
Specifies whether the window is resizable. Values
|
|
|
Boolean |
Specifies that characters should be displayed in
|
|
|
String |
Specifies the tag value assigned to the |
|
|
Tabs |
Enumerated |
Properties for the shapes of the
Location of the close button on a tab, if
Colors of tabs:
Icon and Scroll Button for tabbed windows
|
|
Tabbed Window and Document Title |
Enumerated |
Colors of tabbed window and document title
Title bar states:
|
|
String |
Specifies the text of the window |
|
|
Boolean |
Specifies whether a title bar displays. Values
The user can move a window only if it has |
|
|
ToolbarAlignment (enumerated) |
In an MDI frame window, specifies where the toolbar
|
|
|
Integer |
In an MDI frame window, specifies the height of the |
|
|
Boolean |
In an MDI frame window, specifies whether the
|
|
|
Integer |
In an MDI frame window, specifies the width of the |
|
|
Integer |
In an MDI frame window, specifies the X coordinate |
|
|
Integer |
In an MDI frame window, specifies the Y coordinate |
|
|
Integer |
Specifies the transparency of a window. Value is a |
|
|
Integer |
Specifies the number of PowerBuilder units to be To make the end of the scroll bar match the PowerBuilder multiplies |
|
|
Integer |
Specifies the number of PowerBuilder units to be To make the end PowerBuilder multiplies UnitsPerLine |
|
|
Boolean |
Specifies whether the window is visible. Values
|
|
|
Boolean |
Specifies whether a vertical scroll bar displays.
|
|
|
Integer |
Specifies the width of the window, in PowerBuilder You cannot resize minimized or maximized |
|
|
WindowDockOptions (enumerated) |
WindowDockOptions are for child windows to specify
|
|
|
WindowDockState (enumerated) |
Specifies the docking behaviors for the sheets that
|
|
|
WindowState (enumerated) |
Specifies the state in which you want to run a
Do not change the WindowState property in |
|
|
WindowType (enumerated) |
Specifies the type of window. Values
|
|
|
Integer |
Specifies the X position (distance from left edge The The workspace is the area between the You |
|
|
Integer |
Specifies the Y position (distance from the top of The values of the Y coordinates in all The workspace is the You cannot move a maximized window at |
Events
Scripts for events in a window and the controls in the window
determine how the window behaves. Scripts control the action that is
initiated when an event occurs within the window.
|
Window event |
Occurs |
|---|---|
|
Just before the window becomes active. When an |
|
|
When the user clicks in an unoccupied area of the |
|
|
When the window is closed. |
|
|
When you remove a window from display (close it). Closing any window causes PowerBuilder to |
|
|
When the window becomes inactive. |
|
|
When the user double-clicks in an unoccupied area |
|
|
When a dragged control is dropped on the |
|
|
When a dragged control enters the |
|
|
When a dragged control leaves the |
|
|
When a dragged control is within the |
|
|
When the user presses the F1 key or drags the |
|
|
Just before the window is hidden. |
|
|
After a Dynamic Data Exchange (DDE) server |
|
|
When the user presses a key and the insertion point |
|
|
When the user presses the left mouse button in an |
|
|
When the pointer is moved within the |
|
|
When the user releases the left mouse button in an |
|
|
When a script executes the Open function for a |
|
|
When a Windows message occurs that is not a |
|
|
When the right mouse button is pressed in an |
|
|
When a DDE client application has sent a |
|
|
When a DDE client application wants to start a hot |
|
|
When a DDE client application wants to end a hot |
|
|
When a DDE client application requests |
|
|
When a DDE client application has sent |
|
|
When the user or a script opens or resizes a |
|
|
When a script executes the Show function for this |
|
|
When the user presses Alt or Alt plus another key, |
|
|
When a specified number of seconds elapses after |
|
|
In an MDI frame window, when the user moves the |
Functions
The following functions can trigger events in a window, manipulate
or change a window, or provide information about a window.
PowerScript system functions
You can also use the PowerScript system functions in scripts for
a window. For a list of the PowerScript system functions, see the
Browser.
Opening and closing a window
Use the Open function to open a window and the Close function to
close a window. Open and Close are system functions and are not listed
here.
|
Window function |
Datatype returned |
Description |
|---|---|---|
|
Integer |
Arranges the sheets or icons in the specified MDI |
|
|
Integer |
Changes the menu associated with a |
|
|
String |
Returns the name assigned to the |
|
|
Integer |
Closes a DDE channel. |
|
|
Integer |
Removes the specified user object from view, closes |
|
|
Integer |
After all persisted sheets are opened, this |
|
|
Integer |
Asks a DDE server application to execute the |
|
|
Window |
Returns the currently active sheet in the specified |
|
|
Integer |
Obtains the command sent by the client application |
|
|
Integer |
When called by the DDE server application, obtains |
|
|
Integer |
Creates a reference to a context-specific instance |
|
|
Integer |
Obtains data sent from another DDE application and |
|
|
Integer |
Determines the origin of data from a hot-linked DDE |
|
|
Window |
Returns the top sheet in the MDI |
|
|
Window |
Returns the sheet that is behind the specified |
|
|
PowerObject |
Returns a reference to the name of the parent |
|
|
Integer |
Asks a DDE server application to provide data and |
|
|
Integer |
Gets the values of the Visible, Alignment, and |
|
|
Integer |
Gets position information (coordinates) for a |
|
|
Integer |
Makes the window invisible. |
|
|
Integer |
Loads two arrays of equal size: type names of |
|
|
Integer |
Places the window in a new location specified by The Move function does not |
|
|
Long |
Opens a channel to a DDE server |
|
|
Integer |
Opens a sheet within an MDI (multiple document |
|
|
Integer |
Opens a sheet as a document within an MDI frame |
|
|
Integer |
Opens a sheet docked in a specified position within |
|
|
Integer |
Opens one or more persisted sheets within an MDI |
|
|
Integer |
Opens a sheet in a tab group within an MDI frame |
|
|
Integer |
Opens a sheet within an MDI (multiple document |
|
|
Integer |
Opens a sheet as a document within an MDI frame |
|
|
Integer |
Opens a sheet docked in a specified position within |
|
|
Integer |
Opens one or more persisted sheets within an MDI |
|
|
Integer |
Opens a sheet in a tab group within an MDI frame |
|
|
Integer |
Displays the specified user object, making its |
|
|
Integer |
Displays the specified user object, making its |
|
|
Window |
Returns the parent window of the |
|
|
Integer |
Returns the distance from the left edge of the |
|
|
Integer |
Returns the distance from the top of the screen to |
|
|
Boolean |
Adds an event to the end of the message queue for |
|
|
Integer |
Prints the window. |
|
|
Integer |
Changes the size of the window to the size The |
|
|
Integer |
Sends a DDE message indicating whether the command |
|
|
Integer |
Stores the MDI state in the |
|
|
Integer |
Sends data to a DDE client application when |
|
|
Integer |
Sets focus to the specified window. |
|
|
Integer |
Sets the MicroHelp text in the specified MDI frame |
|
|
Integer |
Specifies the position of the window in the |
|
|
Integer |
Turns on or off automatic redrawing of the window |
|
|
Integer |
Asks a DDE server application to accept data and |
|
|
Integer |
Sets the unique identifier for an open |
|
|
Integer |
Sets the values of the Visible, Alignment, and |
|
|
Integer |
Sets the position of a fixed |
|
|
Integer |
Makes the window visible. |
|
|
Integer |
Establishes a hot link with a DDE server |
|
|
Integer |
Establishes your application as a DDE |
|
|
Integer |
Terminates a hot link with a DDE server |
|
|
Integer |
Causes your application to stop acting as a DDE |
|
|
Integer |
Sends an event to a window control and executes the |
|
|
Object |
Returns the type of the window. |
|
|
Integer |
Returns the height of the workspace of the The workspace is the area between |
|
|
Integer |
Returns the width of the workspace of the specified |
|
|
Integer |
Returns the distance from the left edge of the |
|
|
Integer |
Returns the distance from the top of the screen to |