Windows form the 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.
A window consists of:
-
Properties that define the window's appearance and behavior
For example, a window might have a title bar or a minimize box.
-
Events
Windows have events like other PowerBuilder objects.
-
Controls placed in the window
At the window level
When you create a window, you specify its properties in the Window painter's Properties view. You can also dynamically change window properties in scripts during execution.
You can write scripts for window events that specify what happens when a window is manipulated. For example, you can connect to a database when a window is opened by coding the appropriate statements in the script for the window's Open event.
At the control level
You place PowerBuilder controls, such as CheckBox, CommandButton, or MultiLineEdit controls, in the window to request and receive information from the user and to present information to the user.
After you place a control in the window, you can define the style of the control, move and resize it, and build scripts to determine how the control responds to events.
The Microsoft Windows operating environment has certain standards that graphical applications are expected to conform to. Windows, menus, and controls are supposed to look and behave in predictable ways from application to application.
This chapter describes some of the guidelines you should follow when designing windows and applications, but a full discussion is beyond the scope of this book. You should acquire a book that specifically addresses design guidelines for applications on the Windows platform and apply the rules when you use PowerBuilder to create your application.
When you build a window, you:
-
Specify the appearance and behavior of the window by setting its properties
-
Add controls to the window
-
Build scripts that determine how to respond to events in the window and its controls
To support these scripts, you can define new events for the window and its controls, and declare functions, structures, and variables for the window.
Two ways
There are two ways to build a window. You can:
-
Build a new window from scratch
You use this technique to create windows that are not based on existing windows.
-
Build a window that inherits its style, events, functions, structures, variables, and scripts from an existing window
You use inheritance to create windows that are derived from existing windows, thereby saving you time and coding.
For more information
For information on building windows from scratch, see Building a new window.
For information on using inheritance to build a window, see Using inheritance to build a window.