PtGrid

Gamma/Photon: Using Gamma™ with the Photon microGUIŽ, Version 4.0
Prev |  | Next

# `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.

| 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:

  Constant | Description
  --- | ---
  Pg_BUTT_CAP | The default, leaves line capless, with square-cut ends.
  Pg_ROUND_CAP | Puts on a round cap.
  Pg_SQUARE_CAP | Puts 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:

  Constant | Description
  --- | ---
  Pg_MITER_JOIN | Makes a squared-off joint.
  Pg_ROUND_JOIN | Makes a small-radius rounded joint.
  Pg_BEVEL_JOIN | Makes a beveled joint.
  Pg_QROUND_JOIN | Makes a large-radius rounded joint.
  Pg_BUTT_JOIN | Makes 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 `gamma_ph_`#`_examples_1_QNX4.tgz` file available on the Cogent Web Site.

    #!/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();

Prev | Home | Next
`PtGraphic` | Up | `PtGroup`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.