[Previous] [Contents] [Index] [Next]

PtPolygon

A set of connected line segments

Class hierarchy:

PtWidget --> PtBasic --> PtGraphic --> PtPolygon

For more information, see the diagram of the widget hierarchy.

PhAB icon:

PtPolygon button in PhAB

Public header:

<photon/PtPolygon.h>

Description:

The PtPolygon widget may be used to draw a set of connected line segments, called a "polyline", from the vertices of the line segments.


Open and closed polygons


PtPolygon can display open or closed polygons.


The points provided to the widget in the Pt_ARG_POINTS resource specify the vertices of the polyline or polygon. These points are relative to the widget's Pt_ARG_ORIGIN. For more information, see PtGraphic.

For a polygon, the last vertex doesn't have to be the same as the first - the widget can close the polygon for you.

You can produce a polygon using this widget by specifying that the curve must be closed. This is controlled by the Pt_ARG_POLYGON_FLAGS resource.

You can use the flags to specify:

New resources:

Resource C type Pt type Default
Pt_ARG_POLYGON_FLAGS unsigned short Flag 0

Pt_ARG_POLYGON_FLAGS

C type Pt type Default
unsigned short Flag 0

This resource defines the type of polygon to be drawn. You can OR the following flag bits (defined in <photon/Pg.h>):

Pg_CLOSED
Connect the last point to the first.
Pg_POLY_STROKE
Stroke (outline) the polygon.
Pg_POLY_RELATIVE
Use relative coordinates to draw the polygon. Each point is relative to the previous point.
Pg_POLY_FILL
Fill the polygon.

The default setting of this resource is 0; that is, no flags have been set.

Inherited resources:

If the widget modifies an inherited resource, the "Default override" column indicates the new value. This modification affects any subclasses of the widget.

Resource Inherited from Default override
Pt_ARG_AREA PtWidget
Pt_ARG_BANDWIDTH_THRESHOLD PtBasic Not used by this class.
Pt_ARG_BITMAP_CURSOR PtWidget
Pt_ARG_BORDER_WIDTH PtWidget
Pt_ARG_BOT_BORDER_COLOR PtBasic
Pt_ARG_COLOR PtBasic
Pt_ARG_CURSOR_COLOR PtWidget
Pt_ARG_CURSOR_TYPE PtWidget
Pt_ARG_DASH_LIST PtGraphic
Pt_ARG_DASH_SCALE PtGraphic
Pt_ARG_DATA PtWidget
Pt_ARG_DIM PtWidget
Pt_ARG_EFLAGS PtWidget
Pt_ARG_FILL_COLOR PtBasic
Pt_ARG_FILL_PATTERN PtBasic
Pt_ARG_FLAGS PtWidget
Pt_ARG_GRAPHIC_FLAGS PtGraphic
Pt_ARG_HELP_TOPIC PtWidget
Pt_ARG_HIGHLIGHT_ROUNDNESS PtBasic
Pt_ARG_LINE_CAP PtGraphic
Pt_ARG_LINE_JOIN PtGraphic
Pt_ARG_LINE_WIDTH PtGraphic
Pt_ARG_MARGIN_HEIGHT PtBasic
Pt_ARG_MARGIN_WIDTH PtBasic
Pt_ARG_ORIGIN PtGraphic
Pt_ARG_POINTS PtGraphic
Pt_ARG_POS PtWidget
Pt_ARG_RESIZE_FLAGS PtWidget
Pt_ARG_TOP_BORDER_COLOR PtBasic
Pt_ARG_TRANS_PATTERN PtBasic
Pt_ARG_USER_DATA PtWidget
Pt_CB_ACTIVATE PtBasic
Pt_CB_ARM PtBasic
Pt_CB_BLOCKED PtWidget
Pt_CB_DESTROYED PtWidget
Pt_CB_DISARM PtBasic
Pt_CB_GOT_FOCUS PtBasic
Pt_CB_HOTKEY PtWidget
Pt_CB_LOST_FOCUS PtBasic
Pt_CB_MENU PtBasic
Pt_CB_RAW PtWidget
Pt_CB_REALIZED PtWidget
Pt_CB_REPEAT PtBasic
Pt_CB_RESCALE PtGraphic
Pt_CB_UNREALIZED PtWidget

[Previous] [Contents] [Index] [Next]