Fundamentals of component-based GUI development
Component-Based GUI Development
A window is a
rectangular area on the screen. A window can be considered to be a
virtual screen, in the sense that it provides an interface to the user for
carrying out independent activities, e.g. one window can be used for editing a
program and another for drawing pictures, etc.
A window can be
divided into two parts: client part, and non-client part. The client area makes
up the whole of the window, except for the borders and scroll bars. The client
area is the area available to a client application for display. The non-client
part of the window determines the look and feel of the window. The look and
feel defines a basic behavior for all windows, such as creating, moving,
resizing, and iconifying the windows. A basic window with its different parts.
Window with client and
user areas marked
![]()
Window Management
System
A graphical user
interface typically consists of a large number ofwindows. Therefore, it is
necessary to have some systematic way to manage these windows. Most graphical
user interface development environments do this through a window management
system (WMS). A window management system is primarily a resource manager. It
keeps track of the screen area resource and allocates it to the different
windows that seek to use the screen. From a broader perspective, a WMS can be
considered as a user interface management system (UIMS) – which not only does
resource management, but also provides the basic behavior to the windows and provides
several utility routines to the application programmer for user interface
development. A WMS simplifies the task of a GUI designer to a great extent
by providing the basic behavior to the various windows such as move,
resize, iconify, etc. as soon as they are created and by providing the basic
routines to manipulate the windows from the application such as creating,
destroying, changing different attributes of the windows, and drawing text,
lines, etc.
• a
window manager, and
• a
window system.
Window Management
System
Window Manager and
Window System
Window manager
is the component of WMS with which the end user interacts to do various
window-related operations such as window repositioning, window
resizing, iconification, etc. The window manager is built on the top of
the window system in the sense that it makes use of various services provided
by the window system. The window manager and not the window system determines
how the windows look and behave. In fact, several kinds of window managers can
be developed based on the same window system. The window manager can be
considered as a special kind of client that makes use of the services (function
calls) supported by the window system. The application programmer can also
directly invoke the services of the window system to develop the user
interface. The relationship between the window manager, window system, and the
application program. This figure shows that the end-user can either interact
with the application itself or with the window manager (resize, move, etc.) and
both the application and the window manager invoke services of the window
manager.
Window Manager
The window
manager is responsible for managing and maintaining the non-client area of a
window. Window manager manages the real-estate policy, provides look and feel
of each individual window.
Types of widgets
(window objects)
Different
interface programming packages support different widget sets. However, a
surprising number of them contain similar kinds of widgets, so that one can
think of a generic widget set which is applicable to most interfaces. The
following widgets are representatives of this generic class.
Label widget. This is probably one
of the simplest widgets. A label widget does nothing except to display a label,
i.e. it does not have any other interaction capabilities and is not sensitive
to mouse clicks. A label widget is often used as a part of other widgets.
Container widget. These widgets do not
stand by themselves but exist merely to contain other widgets. Other widgets
are created as children of the container widget. When the container widget is
moved or resized, its children widget also get moved or resized. A container
widget has no callback routines associated with it.
Pop-up menu. These are
transient and task specific. A pop-up menu appears upon pressing the mouse
button, irrespective of the mouse position.
Pull-down menu. These
are more permanent and general. You have to move the cursor to a
specific location and pull down this type of menu.
Dialog boxes. We often need to
select multiple elements from a selection list. A dialog box remains visible
until explicitly dismissed by the user. A dialog box can include areas for
entering text as well as values. If an apply command is supported in a dialog box,
the newly entered values can be tried without dismissing the box. Through most
dialog boxes ask you to enter some information, there are some dialog boxes
which are merely informative, alerting you to a problem with your system or an
error you have made. Generally, these boxes ask you to read the information
presented and then click OK to dismiss the box.
Push button. A push button
contains key words or pictures that describe the action that is triggered when
you activate the button. Usually, the action related to a push button occurs
immediately when you click a push button unless it contains an ellipsis (…). A
push button with an ellipsis generally indicates that another dialog box will
appear.
Radio buttons. A set of radio
buttons is used when only one option has to be selected out of many
options. A radio button is a hollow circle followed by text describing the
option it stands for. When a radio button is selected, it appears filled and
the previously selected radio button from the group is unselected. Only one
radio button from a group can be selected at any time. This operation
is similar tothat of the band selection buttons that were available in old
radios.
Combo boxes. A combo box looks
like a button until the user interacts with it. When the user presses or clicks
it, the combo box displays a menu of items to choose from. Normally a combo box
is used to display either one-of-many choices when space is limited, the number
of choices is large, or when the menu items are computed at run-time.

Comments
Post a Comment