Types of windows – PB Docs 70

Types of windows

PowerBuilder provides the following types of windows:

  • Main
  • Popup
  • Child
  • Response
  • Multiple Document Interface (MDI) frame
  • MDI frame with MicroHelp

Main
windows

Main windows are standalone windows that are independent of
all other windows. They can overlap other windows and can be overlapped
by other windows.

You use a main window as the anchor for your application.
The first window your application opens is a main window–unless
you are building a Multiple Document Interface (MDI) application,
in which case the first window is an MDI frame.

note.gif On UNIX On UNIX, if you open a window of type main as a child of another
window, clicking on its parent can place the parent on top of the
child. This is because a main window in Motif is a top-level widget
that can be raised or lowered independently of its parent.

For more on building MDI applications, see Application
Techniques

.

Using main windows

Define your independent windows as main windows.

For example, assume your application contains a calculator
or scratch pad window that you want always available to the user.
Make it a main window, which can be displayed anytime, anywhere
on the screen. As a main window, it can overlap other windows on
the screen.

Popup windows

Popup windows are typically opened from another window, which
in most cases becomes the popup window’s parent.

note.gif Using the application’s Open event If you open a popup window from the application’s
Open event, the popup window doesn’t have a parent and
works the same way a main window works.

A popup window can display outside its parent window. It cannot
be overlaid by its parent. A popup window is hidden when its parent
is minimized and when its parent is closed. When you minimize a
popup window, the button for the window displays at the bottom of
the screen.

Using popup windows

Popup windows are often used as supporting windows. For example,
say you have a window containing master information, such as film
listings. You can use a popup window to allow a user to see details
of a particular entry.

Win2.gif

Explicitly naming a parent

In most cases, the window that opens a popup window becomes
that window’s parent. For example, say a script in w_go
has this statement:

That statement defines w_go as the parent of w_popup.

You can also explicitly name a popup window’s parent
when you use Open in this way:

For example, the following statement opens w_popup
and makes w_parent its parent:

However, there are also other considerations regarding which
window becomes the parent of an opened window.

For more information, see the Open function
in the PowerScript Reference
.

Child windows

Child windows are always opened from within a main or popup
window, which becomes the child window’s parent.

A child window exists only within its parent. You can move
the child window within the parent window, but not outside the parent.
When you move a portion of a child window beyond the parent, PowerBuilder clips
the child so only the portion within the parent window is visible.
When you move the parent window, the child window moves with the
parent and maintains the same position relative to the parent.

win1.gif

Child windows cannot have menus and are never considered the
active window. They can have title bars and can be minimizable,
maximizable, and resizable. When they are maximized, they fill the
space of their parent; when they are minimized, their button displays
at the bottom of their parent.

The initial position of the child is relative to the parent
and not to the entire screen. A child window closes when you close
its parent.

Using child windows

Child windows are used by the PowerBuilder window plugin and PowerBuilder window
ActiveX tools that you can use when you are building applications
for the Internet.

For more about these tools, see Using
the PowerBuilder Internet Tools

.

You will probably not use child windows very often in other
applications. Typically, if you want to display windows inside other
windows, you will write MDI applications, where much of the window
management happens automatically.

For more on building MDI applications, see Application
Techniques

.

Response windows

Response windows request information from the user. They are
always opened from within another window (its parent). Typically,
a response window is opened after some event occurs in the parent
window.

Response windows are application modal.
That is, when a response window displays, it is the active window
(it has focus) and no other window in the application is accessible
until the user responds to the response window. The user can
go
to other applications. But when the user returns to the application, the
response window is still active.

Response windows act like modal popup windows.

Using response windows

For example, if you want to display a confirmation window
when a user tries to close a window with unsaved changes, use a
response window. The user is not allowed to proceed until the response
window is closed.

win3.gif

Using message boxes

PowerBuilder also provides message boxes, which are predefined
windows that act like response windows in that they are application
modal. You open message boxes using the PowerScript MessageBox function.

For more information, see MessageBox in the PowerScript
Reference

.

MDI
frames

An MDI window is a frame window in which you can open multiple
document windows (sheets) and move among the sheets. There are two
types of MDI frame windows: MDI frame and MDI frame with MicroHelp.

For more on building MDI applications, see Application
Techniques

.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x