Building Custom Widgets
About This Manual
What's new in Photon 1.14 (as of June 01, 2000)
Overview
Subclassing widgets
Design considerations
A quick look at a widget
Widget header file
Instance structure members
Widget source file
Class structure members
Types of widgets
Class hierarchy
Basic widgets
Container widgets
Compound widgets
Life Cycle of a Widget
Basic widgets
Instantiating the widget
Creating and initializing the widget class
Setting default values
Setting application resources
Realizing a widget instance
Processing methods
Initialization method
Extent method
Connection method
Realization method
Draw method
After realizing a widget
Destroying a widget
Unrealization method
Destruction method
Other methods
Container widgets
Anchoring
Child constraints
Child redirection
Compound widgets
Exporting subordinate widgets
Anatomy of a Widget
Defining resources
Resource manifests
PtResourceRec_t resource records
type member
mod_f member
query_f member
arg_value and arg_len members
Scalar resources
Flags resources
String resources
Struct resources
Pointer resources
Alloc resources
Link resources
Callback resources
Boolean resources
Array resources
Examples
Defining the widget class
Widget class structure
Widget class structure description
Widget class resource table
PtBasic class resource additions
Class methods
Defaults method
Initialization method
Extent method
Connection method
Realization method
Draw method
Using the Pg library safely
Unrealization method
Destruction method
Set Resources method
Get Resources method
Got Focus method
Lost Focus method
Calc Opaque Rect method
Widget actions
Raw callback list
Container widget anatomy
Child-constraint support
Child Created method
Child Realized method
Child Moved/Resized method
Child Unrealized method
Child Destroyed method
Child Setting Resource method
Child Getting Resource method
Child Getting Focus method
Child Losing Focus method
Child-redirector function
Fundamental methods
Defaults method
Extent method
Realization method
Compound widget anatomy
Blocking resources
Compound redirection
Fundamental methods
Defaults method
Realization method
Get Resources and Set Resources methods
Destruction method
Using Widget Superclasses
PtWidget
Class hierarchy
Class flags
Methods
Defaults method
Initialization method
Extent method
Connection method
Realization method
Unrealization method
Destruction method
Widget actions
Resource definitions
Functions
PtBasic
Class hierarchy
Class extensions
Methods
Defaults method
Initialization method
Extent method
Connection method
Realization method
Draw method
Unrealization method
Destruction method
Got Focus method
Lost Focus method
Calc Opaque Rect method
Widget actions
Resource definitions
Functions
PtContainer
Class hierarchy
Class extensions
Methods
Defaults method
Initialization method
Extent method
Connection method
Realization method
Draw method
Unrealization method
Destruction method
Got Focus method
Lost Focus method
Calc Opaque Rect method
Child Created method
Child Realized method
Child Moved/Resized method
Child Unrealized method
Child Destroyed method
Child Setting Resources method
Child Getting Resources method
Child Getting Focus method
Child Losing Focus method
Widget actions
Resource definitions
Functions
PtCompound
Class hierarchy
Class extensions
Methods
Defaults method
Initialization method
Extent method
Connection method
Realization method
Draw method
Unrealization method
Destruction method
Got Focus method
Lost Focus method
Calc Opaque Rect method
Widget actions
Resource definitions
Functions
PtGenList
Class hierarchy
Class extensions
Methods
Defaults method
Initialization method
Extent method
Connection method
Realization method
Draw method
Unrealization method
Destruction method
Got Focus method
Lost Focus method
Calc Opaque Rect method
Child Created method
Child Realized method
Child Moved/Resized method
Child Unrealized method
Child Destroyed method
Child Setting Resources method
Child Getting Resources method
Child Getting Focus method
Child Losing Focus method
List Draw method
List Mouse method
List Key method
List Select method
List Inflate method
Widget actions
Resource definitions
Functions
PtGenTree
Class hierarchy
Class extensions
Methods
Defaults method
Initialization method
Extent method
Connection method
Realization method
Draw method
Unrealization method
Destruction method
Got Focus method
Lost Focus method
Calc Opaque Rect method
Child Created method
Child Realized method
Child Moved/Resized method
Child Unrealized method
Child Destroyed method
Child Setting Resources method
Child Getting Resources method
Child Getting Focus method
Child Losing Focus method
List Draw method
List Mouse method
List Key method
Tree Draw Item method
Tree Item State method
Widget actions
Resource definitions
Functions
PtLabel
Class hierarchy
Methods
Defaults method
Initialization method
Extent method
Connection method
Realization method
Draw method
Unrealization method
Destruction method
Got focus method
Lost Focus method
Calc Opaque Rect method
Widget actions
Resource definitions
Functions
PtGraphic
Class hierarchy
Methods
Defaults method
Initialization method
Extent method
Connection method
Realization method
Draw method
Unrealization method
Destruction method
Got Focus method
Lost Focus method
Calc Opaque Rect method
Widget actions
Resource definitions
Functions
PtGauge
Class hierarchy
Methods
Defaults method
Initialization method
Extent method
Connection method
Realization method
Draw method
Unrealization method
Destruction method
Got Focus method
Lost Focus method
Calc Opaque Rect method
Widget actions
Resource definitions
Functions
Creating a List Widget
Overview
Item structure
Widget instance structure
Methods
List Draw method
List Mouse method
List Key method
List Select method
List Inflate method
Convenience functions
PtGenListAddItems
Synopsis:
Description:
Classification:
Safety:
PtGenListAllItems
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenListClearSelection
Synopsis:
Description:
Classification:
Safety:
PtGenListDamageItem
Synopsis:
Description:
Classification:
Safety:
PtGenListDrawBackground
Synopsis:
Description:
Classification:
Safety:
PtGenListDrawString
Synopsis:
Description:
Examples:
Classification:
Safety:
PtGenListFirstItem
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenListGetCurrent
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenListGetSelIndexes
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenListGoto
Synopsis:
Description:
Classification:
Safety:
PtGenListHold
Synopsis:
Description:
Classification:
Safety:
See also:
PtGenListItemIndex
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenListItemRealloc
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenListLastItem
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenListLockItem
Synopsis:
Description:
Classification:
Safety:
PtGenListRelease
Synopsis:
Description:
Classification:
Safety:
See also:
PtGenListRemoveItems
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenListResize
Synopsis:
Description:
Classification:
Safety:
See also:
PtGenListSelect
Synopsis:
Description:
Classification:
Safety:
PtGenListSelectedItems
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenListSetGflags
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenListSetSelIndexes
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenListShow
Synopsis:
Description:
Classification:
Safety:
PtGenListUnlockItem
Synopsis:
Description:
Classification:
Safety:
PtGenListUnselect
Synopsis:
Description:
Classification:
Safety:
PtSuperClassGenListDraw
Synopsis:
Description:
Classification:
Safety:
PtSuperClassGenListInflate
Synopsis:
Description:
Returns:
Classification:
Safety:
PtSuperClassGenListKey
Synopsis:
Description:
Returns:
Classification:
Safety:
PtSuperClassGenListMouse
Synopsis:
Description:
Returns:
Classification:
Safety:
PtSuperClassGenListSelect
Synopsis:
Description:
Classification:
Safety:
Creating a Tree Widget
Overview
Item structure
Methods
Tree Draw Item method
Tree Item State method
Convenience functions
PtGenTreeAddAfter
Synopsis:
Description:
Classification:
Safety:
PtGenTreeAddFirst
Synopsis:
Description:
Classification:
Safety:
PtGenTreeAllItems
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenTreeClearSelection
Synopsis:
Description:
Classification:
Safety:
PtGenTreeCollapse
Synopsis:
Description:
Classification:
Safety:
PtGenTreeDamageItem
Synopsis:
Description:
Classification:
Safety:
PtGenTreeExpand
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenTreeExpandParents
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenTreeFreeAllItems
Synopsis:
Description:
Classification:
Safety:
PtGenTreeFreeItems
Synopsis:
Description:
Classification:
Safety:
PtGenTreeGetCurrent
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenTreeGetSelIndexes
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenTreeGoto
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenTreeItemIndex
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenTreeItemRealloc
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenTreeItemResize
Synopsis:
Description:
Classification:
Safety:
PtGenTreeRemoveChildren
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenTreeRemoveItem
Synopsis:
Description:
Classification:
Safety:
PtGenTreeRemoveList
Synopsis:
Description:
Classification:
Safety:
PtGenTreeResize
Synopsis:
Description:
Classification:
Safety:
PtGenTreeRootItem
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenTreeSelect
Synopsis:
Description:
Classification:
Safety:
PtGenTreeSelectedItems
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenTreeSetSelIndexes
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenTreeShow
Synopsis:
Description:
Returns:
Classification:
Safety:
PtGenTreeUnselect
Synopsis:
Description:
Classification:
Safety:
PtGenTreeUnselectNonBrothers
Synopsis:
Description:
Classification:
Safety:
PtSuperClassGenTreeDrawItem
Synopsis:
Description:
Classification:
Safety:
PtSuperClassGenTreeItemState
Synopsis:
Description:
Returns:
Classification:
Safety:
Binding Widgets into PhAB
Widget design considerations
Single-value resources
When to add custom widgets to palette files
Displaying your custom widget
Creating an icon for the PhAB widget bar
Importing a picture module
Creating a widget description table
Widget class name (w=)
Widget hierarchy (h=)
List of resources (r=)
Option and flag pairs
Pointer-to-function resources
List of callbacks (c=, k=, e=)
Inherited resources and callbacks (i=, n=)
Base widget (b=)
Create-type definition (t=)
Cursor styles (s=)
Default values (d=)
Adding the widget palette file to PhAB
Widget Building Library API
PtAddWidgetData
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtAnchorWidget
Synopsis:
Description:
Classification:
Safety:
See also:
PtApplyAnchors
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtAttemptResize
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtCalcAnchorOffsets
Synopsis:
Description:
Classification:
Safety:
See also:
PtCalcRegion
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtChildBoundingBox
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtClipAdd
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtClipRemove
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtCompoundRedirect
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtContainerChildRedirect
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtContainerDeregister
Synopsis:
Description:
Classification:
Safety:
See also:
PtContainerRegister
Synopsis:
Description:
Classification:
Safety:
See also:
PtCoreChangeRegion
Synopsis:
Description:
Classification:
Safety:
See also:
PtCreateWidgetClass
Synopsis:
Description:
Returns:
Examples:
Classification:
Safety:
PtDamageExposed
Synopsis:
Description:
Examples:
Classification:
Safety:
See also:
PtDestroyCallbackList
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtDestroyHotkeyCallbacks
Synopsis:
Description:
Classification:
Safety:
See also:
PtDestroyRawCallbacks
Synopsis:
Description:
Classification:
Safety:
See also:
PtFindNextWidgetData
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtFindResourceRecord
Synopsis:
Description:
Returns:
Examples:
Classification:
Safety:
See also:
PtFindWidgetData
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtGetAnchoredExtent
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtGetStruct
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtInvokeCallbackList
Synopsis:
Description:
Returns:
Classification:
Safety:
PtInvokeResizeCallbacks
Synopsis:
Description:
Returns:
Classification:
Safety:
PtMoveResizeWidget
Synopsis:
Description:
Returns:
Classification:
Safety:
PtRemoveWidgetData
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtResizePolicy
Synopsis:
Description:
Returns:
Classification:
Safety:
PtSetExtentFromArea
Synopsis:
Description:
Returns:
Classification:
Safety:
PtSetStruct
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtSetValue
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
PtSuperClassCalcOpaque
Synopsis:
Description:
Classification:
Safety:
PtSuperClassChildCreated
Synopsis:
Description:
Classification:
Safety:
PtSuperClassChildDestroyed
Synopsis:
Description:
Classification:
Safety:
PtSuperClassChildGettingFocus
Synopsis:
Description:
Returns:
Classification:
Safety:
PtSuperClassChildGettingResources
Synopsis:
Description:
Returns:
Classification:
Safety:
PtSuperClassChildLosingFocus
Synopsis:
Description:
Returns:
Classification:
Safety:
PtSuperClassChildMovedResized
Synopsis:
Description:
Classification:
Safety:
PtSuperClassChildRealized
Synopsis:
Description:
Classification:
Safety:
PtSuperClassChildSettingResources
Synopsis:
Description:
Returns:
Classification:
Safety:
PtSuperClassChildUnrealized
Synopsis:
Description:
Classification:
Safety:
PtSuperClassConnect, PtSuperClassConnectFrom
Synopsis:
Description:
Returns:
Classification:
Safety:
PtSuperClassDraw
Synopsis:
Description:
Examples:
Classification:
Safety:
PtSuperClassExtent
Synopsis:
Description:
Examples:
Classification:
Safety:
PtSuperClassGetResources
Synopsis:
Description:
Classification:
Safety:
PtSuperClassGotFocus
Synopsis:
Description:
Classification:
Safety:
PtSuperClassInit, PtSuperClassInitFrom
Synopsis:
Description:
Returns:
Classification:
Safety:
PtSuperClassLostFocus
Synopsis:
Description:
Returns:
Classification:
Safety:
PtSuperClassRawEvent, PtSuperClassRawEventFrom
Synopsis:
Description:
Returns:
Classification:
Safety:
PtSuperClassRealized
Synopsis:
Description:
Classification:
Safety:
PtSuperClassSetResources
Synopsis:
Description:
Returns:
Examples:
Classification:
Safety:
PtUpdateVisibility
Synopsis:
Description:
Returns:
Classification:
Safety:
PtWidgetAbove
Synopsis:
Description:
Returns:
Classification:
Safety:
See also:
Miscellaneous Widget-Building Tips
Glossary