| ![[Previous]](image-lib/prev.gif) | ![[Contents]](image-lib/contents.gif) | ![[Index]](image-lib/keyword_index.gif) | ![[Next]](image-lib/next.gif) | 
A Photon region
PtWidget --> PtBasic --> PtContainer --> PtRegion
For more information, see the diagram of the widget hierarchy.
None - must be instantiated with PtCreateWidget().
<photon/PtRegion.h>
PtRegion is ideal for controlling a region without foregoing the convenience of the Photon widget library interface. With PtRegion, you can control a region without having to modify the standard main loop function.
|  | 
 | 
| Resource | C type | Pt type | Default | 
|---|---|---|---|
| Pt_ARG_REGION_DATA | PhRegionDataHdr_t * | Alloc | NULL | 
| Pt_ARG_REGION_FIELDS | long | Flag | 0 | 
| Pt_ARG_REGION_FLAGS | long | Flag | 0 | 
| Pt_ARG_REGION_HANDLE | long | Scalar | widget_pointer | 
| Pt_ARG_REGION_INFRONT | long | Scalar | 0 | 
| Pt_ARG_REGION_INPUT_GROUP | short | Scalar | 0 | 
| Pt_ARG_REGION_OPAQUE | long | Flag | 0 | 
| Pt_ARG_REGION_OWNER | PhConnectId_t | Scalar | 0 | 
| Pt_ARG_REGION_PARENT | long | Scalar | 0 | 
| Pt_ARG_REGION_SENSE | long | Flag | 0 | 
| C type | Pt type | Default | 
|---|---|---|
| PhRegionDataHdr_t * | Alloc | NULL | 
Defines the data to be attached to the region. For changes to this resource to take effect, you must set the corresponding bit in Pt_ARG_REGION_FIELDS.
| C type | Pt type | Default | 
|---|---|---|
| long | Flag | 0 | 
Indicates which portions of the region should be modified, including its flags, sensitivity, opacity, origin, position, etc. You must set these bits in addition to setting the corresponding resource; otherwise the setting of the resource will be ignored.
The following bits can be used to define a field in a region change (PhRegionChange()) or open (PhRegionOpen()). For more information, see <PhT.h>.
|  | The Ph_REGION_HANDLE, Ph_REGION_ORIGIN, and Ph_REGION_RECT bits are set up automatically when the widget is initialized. | 
| Bit | Corresponding resource | 
|---|---|
| Ph_REGION_OWNER | Pt_ARG_REGION_OWNER | 
| Ph_REGION_HANDLE | Pt_ARG_REGION_HANDLE | 
| Ph_REGION_FLAGS | Pt_ARG_REGION_FLAGS | 
| Ph_REGION_EV_OPAQUE | Pt_ARG_REGION_OPAQUE | 
| Ph_REGION_EV_SENSE | Pt_ARG_REGION_SENSE | 
| Ph_REGION_STATE | Read-only. Don't modify. | 
| Ph_REGION_ORIGIN | See below. | 
| Ph_REGION_PARENT | Pt_ARG_REGION_PARENT | 
| Ph_REGION_IN_FRONT | Pt_ARG_REGION_INFRONT | 
| Ph_REGION_BEHIND | See below. | 
| Ph_REGION_RECT | See below. | 
| Ph_REGION_DATA | Pt_ARG_REGION_DATA | 
| Ph_REGION_INPUT_GROUP | Pt_ARG_REGION_INPUT_GROUP | 
Any time you change PtRegion's Pt_ARG_POS or Pt_ARG_AREA resource, the Ph_REGION_ORIGIN bit is changed automatically.
The Ph_REGION_BEHIND bit defines which region this region will be opened in front of. The specified region becomes the brother in behind. A value of 0 makes the region the rearmost child of its parent when created.
Any time you change PtRegion's Pt_ARG_AREA or Pt_ARG_DIM resource, the Ph_REGION_RECT bit is changed automatically.
| C type | Pt type | Default | 
|---|---|---|
| long | Flag | 0 | 
Defines the region type and behavior:
For changes to this resource to take effect, you must set the corresponding bit in Pt_ARG_REGION_FIELDS.
| C type | Pt type | Default | 
|---|---|---|
| long | Scalar | widget_pointer | 
A widget pointer normally used by the widget library to determine which widget is associated with a region. This resource should either be set to 0 or left at its default. For changes to this resource to take effect, you must set the corresponding bit in Pt_ARG_REGION_FIELDS.
| C type | Pt type | Default | 
|---|---|---|
| long | Scalar | 0 | 
Defines which region (rid) this region will be opened behind. The specified region becomes the brother in front. A value of 0 makes the region the frontmost child of its parent when created. For changes to this resource to take effect, you must set the corresponding bit in Pt_ARG_REGION_FIELDS.
| C type | Pt type | Default | 
|---|---|---|
| short | Scalar | 0 | 
Associates the region with the specified input group. For changes to this resource to take effect, you must set the corresponding bit in Pt_ARG_REGION_FIELDS.
| C type | Pt type | Default | 
|---|---|---|
| long | Flag | 0 | 
Define which events this region is opaque to. For changes to this resources to take effect, you must set the corresponding bit(s) in Pt_ARG_REGION_FIELDS.
| C type | Pt type | Default | 
|---|---|---|
| PhConnectId_t | Scalar | 0 | 
Specifies the owner of the region. For changes to this resource to take effect, you must set the corresponding bit in Pt_ARG_REGION_FIELDS.
| C type | Pt type | Default | 
|---|---|---|
| long | Scalar | 0 | 
Specifies the ID (rid) of the region that will be this region's parent. For changes to this resource to take effect, you must set the corresponding bit in Pt_ARG_REGION_FIELDS.
| C type | Pt type | Default | 
|---|---|---|
| long | Flag | 0 | 
Define which events this region is sensitive to. For changes to this resources to take effect, you must set the corresponding bit(s) in Pt_ARG_REGION_FIELDS.
If the widget modifies an inherited resource, the "Default override" column indicates the new value. This modification affects any subclasses of the widget.
| ![[Previous]](image-lib/prev.gif) | ![[Contents]](image-lib/contents.gif) | ![[Index]](image-lib/keyword_index.gif) | ![[Next]](image-lib/next.gif) |