This chapter describes the widgets in the Photon library. It includes:
as well as descriptions of the following widget classes:
AwFileSelect
AwMessage
PtArc
PtBasic
PtBezier
PtBitmap
PtBkgd
PtButton
PtCalendar
PtClock
PtComboBox
PtCompound
PtContainer
PtDBContainer
PtDivider
PtEllipse
PtFileSel
PtFontSel
PtGauge
PtGenList
PtGenTree
PtGraphic
PtGrid
PtGroup
PtHtml
PtIcon
PtLabel
PtLine
PtList
PtMenu
PtMenuBar
PtMenuButton
PtMessage
PtMultiText
PtNumeric
PtNumericFloat
PtNumericInteger
PtOnOffButton
PtPane
PtPixel
PtPolygon
PtPrintSel
PtRaw
PtRect
PtRegion
PtScrollArea
PtScrollbar
PtSeparator
PtSlider
PtTab
PtTerminal
PtText
PtTimer
PtToggleButton
PtTree
PtTty
PtUpDown
PtWidget
PtWindow
RtMeter
RtProgress
RtTrend
If your browser supports image maps, you can select a widget from this diagram:
The Photon widget hierarchy.
The widget hierarchy is important because classes inherit resources and behavior from their ancestors. When you're working with a particular class, be sure to look at the descriptions of its ancestors, too. |
Many widgets define flags resources that allow you to change the widget's appearance and/or behavior. This section discusses the flags used by all or most widget classes.
When you want to: | Use this bit: | See: |
---|---|---|
Have a widget consume events | Pt_CONSUME_EVENTS (Pt_ARG_EFLAGS) | PtWidget |
Display help information in a balloon, not in the Helpviewer | Pt_INTERNAL_HELP (Pt_ARG_EFLAGS) | PtWidget |
Propagate damage to a widget's parent | Pt_DAMAGE_PARENT (Pt_ARG_EFLAGS) | PtWidget |
Invoke certain callbacks when setting resources | Pt_CALLBACKS_ACTIVE (Pt_ARG_FLAGS) | PtWidget |
Use any mouse button to activate a widget | Pt_ALL_BUTTONS (Pt_ARG_FLAGS) | PtWidget |
Have a widget highlight and get focus when pointed to | Pt_AUTOHIGHLIGHT (Pt_ARG_FLAGS) | PtWidget |
Block a widget and its non-window children | Pt_BLOCKED (Pt_ARG_FLAGS) | PtWidget |
Prevent brothers in front of a widget from intersecting with its extent | Pt_CLEAR (Pt_ARG_FLAGS) | PtWidget |
Clip the corners of a widget's highlighting rectangle | Pt_CLIP_HIGHLIGHT (Pt_ARG_FLAGS) | PtWidget |
Determine if the widget needs to be repaired | Pt_DAMAGED (Pt_ARG_FLAGS) | PtWidget |
Determine if a widget and its family need repairing | Pt_DAMAGE_FAMILY (Pt_ARG_FLAGS) | PtWidget |
Delay realization until done explicitly | Pt_DELAY_REALIZE (Pt_ARG_FLAGS) | PtWidget |
Determine if a widget is marked for destruction | Pt_DESTROYED (Pt_ARG_FLAGS) | PtWidget |
Highlight a widget with an etched-line style | Pt_ETCH_HIGHLIGHT (Pt_ARG_FLAGS) | PtWidget |
Clip the corners of a widget's highlighting rectangle | Pt_CLIP_HIGHLIGHT (Pt_ARG_FLAGS) | PtWidget |
Automatically free any memory associated with a widget | Pt_FREE_MEMORY (Pt_ARG_FLAGS) | PtWidget |
Draw a dotted line around a widget to indicate focus | Pt_FOCUS_RENDER (Pt_ARG_FLAGS) | PtWidget |
Grant focus to a widget when appropriate | Pt_GETS_FOCUS (Pt_ARG_FLAGS) | PtWidget |
Dim a widget | Pt_GHOST (Pt_ARG_FLAGS) | PtWidget |
Highlight a widget with a beveled or etched rectangle | Pt_HIGHLIGHTED (Pt_ARG_FLAGS) | PtWidget |
Determine if a call to PtContainerHold() has been made on a widget | Pt_IN_FLUX (Pt_ARG_FLAGS) | PtWidget |
Have a widget respond to right-mouse-button clicks | Pt_MENUABLE (Pt_ARG_FLAGS) | PtWidget |
Indicate that a widget is a menu item | Pt_MENU_BUTTON (Pt_ARG_FLAGS) | PtWidget |
Determine if a widget is completely hidden by its brothers | Pt_OBSCURED (Pt_ARG_FLAGS) | PtWidget |
Determine if a widget completely obscures anything behind it | Pt_OPAQUE (Pt_ARG_FLAGS) | PtWidget |
Determine if a widget is a procreated child of a compound widget | Pt_PROCREATED (Pt_ARG_FLAGS) | PtWidget |
Determine if a widget is realized | Pt_REALIZED (Pt_ARG_FLAGS) | PtWidget |
Determine if a widget is in the process of being realized | Pt_REALIZING (Pt_ARG_FLAGS) | PtWidget |
Force a widget to have a region | Pt_REGION (Pt_ARG_FLAGS) | PtWidget |
Allow the user to select a widget | Pt_SELECTABLE (Pt_ARG_FLAGS) | PtWidget |
Prevent a widget from changing its appearance when selected | Pt_SELECT_NOREDRAW (Pt_ARG_FLAGS) | PtWidget |
Determine if a widget is "set" | Pt_SET (Pt_ARG_FLAGS) | PtWidget |
Make a widget toggle between set and unset when selected | Pt_TOGGLE (Pt_ARG_FLAGS) | PtWidget |
Determine if a widget will be rerealized when resource changes are applied | Pt_WIDGET_REBUILD (Pt_ARG_FLAGS) | PtWidget |
Determine if a widget will be resized when resource changes are applied | Pt_WIDGET_RESIZE (Pt_ARG_FLAGS) | PtWidget |
Control how a widget is resized | All bits (Pt_ARG_RESIZE_FLAGS) | PtWidget |
Prevent balloons from being inflated in a container and its child containers | Pt_DISABLE_BALLOONS (Pt_ARG_CONTAINER_FLAGS) | PtContainer |
Prevent hotkey searches from going to parents of a container | Pt_HOTKEY_TERMINATOR (Pt_ARG_CONTAINER_FLAGS) | PtContainer |
Process key events as hotkeys before passing them to children of a container | Pt_HOTKEYS_FIRST (Pt_ARG_CONTAINER_FLAGS) | PtContainer |
Prevent CUA from focusing on a container | Pt_BLOCK_CUA_FOCUS (Pt_ARG_CONTAINER_FLAGS) | PtContainer |
Cause a container to reextent when any of its children are realized | Pt_AUTO_EXTENT (Pt_ARG_CONTAINER_FLAGS) | PtContainer |
Allow CUA keys to function in a container (and its children) | Pt_ENABLE_CUA (Pt_ARG_CONTAINER_FLAGS) | PtContainer |
Allows arrow key navigation in a container (and its children) | Pt_ENABLE_CUA_ARROWS (Pt_ARG_CONTAINER_FLAGS) | PtContainer |
Force a group of widgets to be the same size | Pt_GROUP_EQUAL_SIZE (Pt_ARG_GROUP_FLAGS) | PtGroup |
Allow only one widget of a group to be selected | Pt_GROUP_EXCLUSIVE (Pt_ARG_GROUP_FLAGS) | PtGroup |
Allow an exclusive group to choices to have no selected item | Pt_GROUP_NO_SELECT_ALLOWED (Pt_ARG_GROUP_FLAGS) | PtGroup |
Prevent movement among a group using the arrow keys | Pt_GROUP_NO_KEYS (Pt_ARG_GROUP_FLAGS) | PtGroup |
Prevent horizontal wrapping using arrow keys | Pt_GROUP_NO_KEY_WRAP_HORIZONTAL (Pt_ARG_GROUP_FLAGS) | PtGroup |
Prevent vertical wrapping using arrow keys | Pt_GROUP_NO_KEY_WRAP_VERTICAL (Pt_ARG_GROUP_FLAGS) | PtGroup |
Prevent horizontal and vertical wrapping using arrow keys | Pt_GROUP_NO_KEY_WRAP (Pt_ARG_GROUP_FLAGS) | PtGroup |
Make a group of widgets the same width | Pt_GROUP_EQUAL_SIZE_HORIZONTAL (Pt_ARG_GROUP_FLAGS) | PtGroup |
Make a group of widgets the same height | Pt_GROUP_EQUAL_SIZE_VERTICAL (Pt_ARG_GROUP_FLAGS) | PtGroup |
Stretch the rightmost of a group of widgets | Pt_GROUP_STRETCH_HORIZONTAL (Pt_ARG_GROUP_FLAGS) | PtGroup |
Stretch the bottommost of a group of widgets | Pt_GROUP_STRETCH_VERTICAL (Pt_ARG_GROUP_FLAGS) | PtGroup |
Stretch the last of a group of widgets | Pt_GROUP_STRETCH_FILL (Pt_ARG_GROUP_FLAGS) | PtGroup |
Shift text down and to the right when selected | Pt_LABEL_SELECT_SHIFT (Pt_ARG_LABEL_FLAGS) | PtLabel |
Show a balloon if the pointer remains motionless over text | Pt_SHOW_BALLOON (Pt_ARG_LABEL_FLAGS) | PtLabel |
Show a balloon if the pointer remains motionless over clipped text | Pt_BALLOON_AS_REQUIRED (Pt_ARG_LABEL_FLAGS) | PtLabel |
You'll find the following sections in a typical widget-class description:
The ancestral classes a widget inherits its resources and behavior from.
The icon in PhAB's widget bar for the widget.
The name of the header file containing the resource manifests, data structures, and defines associated with the widget class.
How to use the widget. This section may include sample code as well as an example of the widget's appearance.
The new resources introduced by this widget class. The "New resources" table for each widget contains the following columns of information:
The Pt types are:
The specific resources a widget class inherits from its ancestors, or in the case of a compound widget, from its exported subordinate children. The default values that a widget class inherits can be overridden. The Inherited resources table contains the following columns of information:
The value in the Default override column may start with |=, as in the following example:
|=Pt_SELECTABLE | Pt_HIGHLIGHTED
This symbol indicates that the flags listed are added to the resource without destroying any flags already set in it (i.e. the new flags and the default value are combined in an OR operation).
A &=~ symbol means that one or more flags are cleared. In the following example, the Pt_SELECTABLE flag is added to the resource and the Pt_HIGHLIGHTED flag is cleared:
|=Pt_SELECTABLE &=~Pt_HIGHLIGHTED
If the widget does anything special with an inherited resource, it's described after the table.
The functions you can use to control the widget once it has been created.