For an overview of the changes to the software and docs, see "What's new in Photon 1.14 (as of June 01, 2000)." |
The Photon Widget Reference describes the global data structures and the widgets defined in the Photon toolkit, along with their resources and any associated convenience functions. It's intended for developers of Photon applications.
For: | See: |
---|---|
Information about data structures | Global Data Structures |
A diagram of the widget class hierarchy | Widgets |
Descriptions of common flags | Widgets |
An alphabetical list of all flags | Widgets |
An overview of what's in a widget description | Widgets |
Descriptions of widget classes | Widgets |
Explanations of Photon terms | Glossary |
Since widgets inherit a lot of behavior from their parent classes, you should make yourself familiar with the fundamental classes: PtWidget, PtBasic, PtContainer, and so on.
This reference doesn't include contributed widgets. You'll find the documentation for them (if any) in the source files in /qnx4/phtk/src/contrib. |
General changes:
The following data structures are now described in this reference:
Specific changes:
Pt_ARG_LINE_STYLE has been removed from the list of inherited resources.
If you multi-click on a widget, its Pt_CB_ACTIVATE callbacks are invoked once for each click. The callback data includes the click count (1 for the first click, 2 for the second, and so on).
The Pt_CB_LOST_FOCUS callbacks should return Pt_CONTINUE to relinquish focus, or Pt_END to keep it (for example, if the user has to type something in a text widget).
The default value of Pt_ARG_CLOCK_SECOND_COLOR is Pg_RED.
The description now includes a summary of the callbacks associated with the text and list parts of the combo box.
The Pt_CB_FILTER callbacks are invoked before the event is passed to the child. Contrast this resource with the Pt_CB_RAW resource defined for PtWidget.
The Pt_CB_RESIZE callbacks are invoked when the container's size changes.
Pt_ARG_MEMORY_CONTEXT_TYPE should be Pt_ARG_DB_MEMORY_CONTEXT_TYPE
You can show hidden files or directories by combining the Pt_FS_SHOW_HIDDEN flag with Pt_FS_SHOW_DIRS or Pt_FS_SHOW_FILES.
Set the Pt_CB_FS_BKGD_HANDLER callback resource before the Pt_ARG_FS_ROOT_DIR resource in order to translate all the filenames.
PtFSAddFirst() automatically sets the Pt_TREE_ITEM_EXPANDABLE flag in the parent item.
PtFSRemoveItem() never clears the Pt_TREE_ITEM_EXPANDABLE flag in the item's parent.
For Pt_CB_FS_BKGD_HANDLER callbacks, cbdata points to a structure of type PtFileSelBkgdCallback_t, and reason_subtype is one of:
Prototypes have changed for:
Pt_ARG_LIST_ITEM_COUNT and Pt_ARG_LIST_SEL_COUNT are of type unsigned short, not short.
For more information on supporting images, see PxLoadImage() in the Photon Library Reference.
Pt_ARG_HTML_PAGE_N, Pt_ARG_HTML_PAGES, and the Pt_HTML_PAGE_MODE flag (see Pt_ARG_HTML_FLAGS) have been added to support printing.
Pt_BACKFILL_TEXT has been added to the flags for Pt_ARG_LABEL_FLAGS
PtListDeletePositions() is deprecated; use PtListRemovePositions() instead.
You can use the Pt_ARG_MENU_TEXT_FONT resource to control what font is used for displaying menu items. This resource overrides the normal default font for text items placed in the menu.
The Pt_DELAY_ACTIVATION bit in the inherited resource Pt_ARG_FLAGS is now called Pt_DELAY_REALIZE.
The resource names have been corrected in the "Changing the attributes of a range of text" section of the Description.
The default value of Pt_ARG_MULTITEXT_FLAGS is Pt_EMT_SCROLL_TO_CURSOR.
The default value of Pt_ARG_MULTITEXT_TABS is { 20 }.
Pt_ARG_HORIZONTAL_ALIGNMENT and Pt_ARG_VERTICAL_ALIGNMENT are inherited from PtLabel.
Pt_CB_MODIFY_VERIFY and Pt_CB_MOTION_VERIFY are inherited from PtText. PtMultiTextControl_t, PtMultiTextCallback_t, and PtMultiTextInfo_t are the same structure.
Instructions for calculating the "virtual dimensions" of a multitext widget have been added.
To display a horizontal scrollbar in a PtMultiText widget:
The example in "Hyperlinks using cursor-motion callbacks" has been corrected; the attr argument has been added to the call to PtMultiTextModifyText().
A list of the bits in the attributes_mask has been added to the descriptions of PtMultiTextModifyAttributes() and PtMultiTextModifyText().
Prototypes have changed for:
If both Pt_EMT_WORD and Pt_EMT_CHAR are set in the widget's Pt_ARG_MULTITEXT_WRAP_FLAGS, word wrapping is applied.
The Pt_CB_ACTIVATE callback is invoked only when the user presses Enter when the text field has focus and the value has been changed.
The Pt type for Pt_ARG_NUMERIC_INCREMENT, Pt_ARG_NUMERIC_MAX, Pt_ARG_NUMERIC_MIN, and Pt_ARG_NUMERIC_VALUE is Struct.
The Pt_CB_ACTIVATE callback is invoked only when the user presses Enter when the text field has focus and the value has been changed.
Pt_ARG_LINE_STYLE has been removed from the list of inherited resources.
If the widget has the Pt_CALLBACKS_ACTIVE bit set in its Pt_ARG_FLAGS resource, the Pt_CB_SLIDER_MOVE callbacks are invoked when the handle position is changed by a call to PtSetResources().
The C type for Pt_ARG_TERM_CONSOLE is PtTerminalConsoleWrite_t The C type for Pt_ARG_TERM_PROTOCOL is int.
PtTerminal now includes internal and ANSI character sets. See:
as well as the following functions described in the Photon Library Reference:
A section on PtTerminal and PtTty has been added to the description.
PtTerminal works only with fixed-width fonts. It ignores any attempts to change Pt_ARG_TERM_FONT to a proportional font.
The description and callback structure for Pt_CB_ACTIVATE have been corrected.
PtTextControl_t and PtTextCallback_t are the same structure.
The default setting for Pt_ARG_RESIZE_FLAGS is Pt_RESIZE_Y_AS_REQUIRED | Pt_RESIZE_Y_INITIAL.
The prototype has changed for PtTextModifyText().
The descriptions of Pt_ARG_SELECTION_RANGE and Pt_ARG_TEXT_SUBSTRING have been expanded.
The example in "Handling deletions" has been improved.
The C type for Pt_ARG_CURSOR_POSITION is int, not short.
If you multi-click on an item, the tree's Pt_CB_TREE_SELECTION callbacks are invoked once for each click. The callback data includes the click count (1 for the first click, 2 for the second, and so on).
Prototypes have changed for:
Sections on PtTerminal and PtTty, setting PtTty resources and colors have been added to the description.
The Pt_ARG_DATA resource is used internally by the Photon libraries as well as by compound widgets.
The following resources can't be edited in PhAB:
The Pt_OBSCURED bit in Pt_ARG_FLAGS is set only if the widget is completely covered by one other widget, or it's completely beyond its parent container's canvas.
The Pt_CB_RAW callbacks are invoked after the widget has processed the event, and then only for events that the widget doesn't consume. Contrast this with the Pt_CB_FILTER resource defined by PtContainer.
The Pt type for Pt_ARG_WINDOW_CURSOR_OVERRIDE is Boolean, not Scalar.
PtWindowToBack() and PtWindowToFront() move the given window and all its child windows to the back or front of the workspace. There's no way to move a parent window in front of its children.
The Pt_CB_WINDOW callbacks are invoked for only those events specified in the Pt_ARG_WINDOW_NOTIFY_FLAGS.
The window hasn't been completely realized when the Pt_CB_WINDOW_OPENING callbacks are invoked; don't change the window's widget family hierarchy in these callbacks. If you need to adjust the widgets' stacking order, do it in the Pt_CB_REALIZED callbacks.
The C type for the number of entries in the Rt_ARG_TREND_COLOR_LIST array is short.