This section describes the Common Widgets class hierarchy and provides an overview of the functionality provided by each class.
A is a user interface component, such as a top-level window (shell), button or list. A graphical user interface is built by creating a tree of widgets. Every widget except the topmost widget in a tree has a parent widget. In the user interface a child widget appears on top of the parent and is normally prevented from drawing outside the bounds of its parent. Each parent widget is responsible for sizing and positioning its children. The parent-child relationship defines the widget tree. The topmost widget in the tree is called a shell widget. Shell widgets are responsible for negotiating with the window manager for their position on the screen, and for the various window decorations that they display, such as a title, border, or close box.
All Common Widgets are subclasses of one of the following classes:
Primitive widgets are the simplest building blocks in Common Widgets. A primitive widget is always the child of another widget. The following table provides brief descriptions of the CwPrimitive class and its subclasses. Classes in italics are abstract classes (they are never instantiated).
Note: | The parent-child relationship is not the same as the class-subclass relationship. |
Class hierarchy | Responsibility |
---|---|
CwWidget | Defines common behavior for all widgets |
CwBasicWidget | Defines common behavior for widgets implemented directly by the platform |
CwPrimitive | Defines common behavior for widgets that do not have children |
CwArrowButton | Displays an arrow button |
CwComboBox | Combines a list and text area to provide a prompted entry field |
CwLabel | Displays a static label that can be a string, pixmap, or icon |
CwCascadeButton | Used as part of a menu system to trigger submenus |
CwDrawnButton | Displays a button drawn by the application |
CwPushButton | Displays a push button containing a string, pixmap, or icon |
CwToggleButton | Displays a button that has on and off state such as a radio or check button |
CwList | Displays a list of strings from which one or more can be selected |
CwScrollBar | Displays a vertical or horizontal scroll bar |
CwSeparator | Displays a separator line, normally between menu items |
CwText | Displays and provides editing capability for text |
Composite widgets can have zero or more child
widgets. A composite widget's children can include other composite
widgets, primitive widgets, or both. Different composite widgets
provide various kinds of layout capabilities for arranging children.
The following table briefly explains the CwComposite class and its
subclasses. Classes in italics are abstract classes.
Class hierarchy | Responsibility |
---|---|
CwWidget | Defines common behavior for all widgets |
CwBasicWidget | Defines common behavior for widgets implemented directly by the platform |
CwComposite | Defines common behavior for widgets that contain child widgets |
CwBulletinBoard | Allows application-defined child widget positioning |
CwCompositeBox | Defines common behavior for CwMessageBox and CwSelectionBox |
CwMessageBox | Provides a notification message, icon, and OK, Cancel, and Help buttons |
CwSelectionBox | Provides a list of items to select, a text box showing the selection, and OK, Cancel, Apply, and Help buttons |
CwForm | Provides a constraint-based mechanism for laying out child widgets |
CwDrawingArea | Performs no child layout and provides an area for performing graphic operations |
CwFrame | Provides an optionally labeled frame around its single child widget |
CwRowColumn | Provides a mechanism for laying out child widgets in rows or columns |
CwScale | Displays a numeric scale with a position indicator |
CwScrolledWindow | Allows a child widget to be scrolled using scrollbars |
CwMainWindow | Provides layout management for a menu bar and optionally scrollable work area |
Shell widgets provide the protocol between the application
interface and the window manager. The following table provides brief
descriptions of the CwShell class and its subclasses.
Classes in italics are abstract classes.
Class hierarchy | Responsibility |
---|---|
CwWidget | Defines common behavior for all widgets |
CwBasicWidget | Defines common behavior for widgets implemented directly by the platform |
CwShell | Defines common behavior for the top-level widgets of windows and dialogs |
CwOverrideShell | A pop-up window that bypasses window management, and normally appears on top of all other widgets |
CwWMShell | Defines common behavior for shell widgets that do not bypass window management |
CwTopLevelShell | Provides a normal window with standard appearance and decorations |
CwTransientShell | A pop-up dialog window that does not bypass window management |
CwDialogShell | A pop-up window used to implement modal and modeless dialog windows |