PtGrid

PtGrid — A grid of horizontal and vertical lines.

Synopsis

class PtGrid PtBasic
{
    dash_list;          // char array  (Pt_ARG_DASH_LIST)    
    dash_scale;         // long  (Pt_ARG_DASH_SCALE)    
    grid_horizontal;    // unsigned short  (Pt_ARG_GRID_HORIZONTAL)    
    grid_vertical;      // unsigned short  (Pt_ARG_GRID_VERTICAL)    
    line_cap;           // unsigned short  (Pt_ARG_LINE_CAP)    
    line_join;          // unsigned short  (Pt_ARG_LINE_JOIN)    
    line_width;         // long  (Pt_ARG_LINE_WIDTH)    
}
		

Base Classes

PtWidget <-- PtBasic <-- PtGrid

Description

This widget is a grid of horizontal and vertical lines.

[Note]

For detailed information, please refer to PtGrid in the Photon documentation.

Instance Variables

dash_list

This variable is identical to the dash_list variable of PtGraphic widget.

dash_scale

This variable is identical to the dash_scale variable of PtGraphic widget.

grid_horizontal

An integer specifying the number of horizontal grid lines. Default is 4.

grid_vertical

An integer specifying the number of vertical grid lines. Default is 4.

line_cap

This instance variable determines the shape of line ends (mainly visible for wide lines), and may have one of the following values:

ConstantDescription
Pg_BUTT_CAPThe default, leaves line capless, with square-cut ends.
Pg_ROUND_CAPPuts on a round cap.
Pg_SQUARE_CAPPuts on a square cap.

line_join

This instance variable determines the shape of line joints (mainly visible for wide lines), and may have one of the following values:

ConstantDescription
Pg_MITER_JOINMakes a squared-off joint.
Pg_ROUND_JOINMakes a small-radius rounded joint.
Pg_BEVEL_JOINMakes a beveled joint.
Pg_QROUND_JOINMakes a large-radius rounded joint.
Pg_BUTT_JOINMakes a butt joint (outside line edges don't join).

line_width

A number specifying the width of the grid lines, in pixels.

Example

This example, ex_PtGrid.g, is included in the product distribution.

#!/usr/cogent/bin/phgamma

/*
 * This example demonstrates a PtGrid.
 */

require_lisp("PhotonWidgets.lsp");
PtInit(nil);

win = new(PtWindow);
grid = new(PtGrid);

grid.SetDim(350,350);
grid.fill_color = 0xccddff;
grid.grid_vertical = 12;
grid.grid_horizontal = 20;
grid.line_width = 1;


PtRealizeWidget(win);
PtMainLoop();