PtScale

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

# `PtScale`

`PtScale` -- A marked scale.

## Synopsis

    class PtScale PtGauge
    {
        scale_flags;                  // flag
        scale_font;                   // string
        scale_major_tick_color;       // color
        scale_major_tick_division;    // short
        scale_major_tick_length;      // short
        scale_minor_tick_color;       // color
        scale_minor_tick_division;    // short
        scale_minor_tick_length;      // short
    }

## Base Classes

`PtWidget` <-- `PtBasic` <-- `PtGauge` <-- `PtScale`

## Description

This widget is a horizontal or vertical scale that features major and minor ticks.

| This widget does not appear in the Photon documentation.

## Instance Variables

scale_flags

  This instance variable specifies the general features of the scale, and may be a combination of zero or more of the following flags:

  Constant | Description
  --- | ---
  `Pt_SCALE_HORIZONTAL` | The scale is oriented horizontally.
  `Pt_SCALE_VERTICAL` | The scale is oriented vertically.
  `Pt_SCALE_REVERSE` | The max and min values of the scale are reversed.
  `Pt_SCALE_DRAW_TOP_LINE` | Draw Top Line
  `Pt_SCALE_LABEL` | A label is associated with the scale.

scale_font

  A string specifying the font of the label.

scale_major_tick_color

  A number specifying the color of the major tick marks. Default is `0x0` (black).

scale_major_tick_division

  An integer specifying into how many equal-sized major parts the scale should be divided into. Default is 5.

scale_major_tick_length

  A number of pixels specifying the length of the major tick marks. Default is `10`.

scale_minor_tick_color

  A number specifying the color of the minor tick marks. Default is `0x0` (black).

scale_minor_tick_division

  An integer specifying into how many equal-sized minor parts each major division should be divided into. Default is `3`.

scale_minor_tick_length

  A number of pixels specifying the length of the minor tick marks. Default is `5`.

## Example

This example, `ex_PtScale.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 two PtScales, one using
     * user_defined values for instance variables, the other
     * with default values.
     */

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

    win = new(PtWindow);
    win.SetDim(300,300);

    scl = new(PtScale);
    scl.SetArea(20,25,50,250);
    scl.fill_color = 0xffffaa;
    scl.scale_flags = Pt_SCALE_VERTICAL;
    scl.scale_font = "helv12";
    scl.scale_major_tick_color = 0xff0000;
    scl.scale_major_tick_division = 10;
    scl.scale_major_tick_length = 15;
    scl.scale_minor_tick_color = 0x0000ff;
    scl.scale_minor_tick_division = 5;
    scl.scale_minor_tick_length = 6;

    scldeflt = new(PtScale);
    scldeflt.SetArea(80,25,200,20);

    PtRealizeWidget(win);
    PtMainLoop();

Prev | Home | Next
`PtRegion` | Up | `PtScrollArea`

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