PtGauge

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

# `PtGauge`

`PtGauge` -- A parent class for gauge widget resources.

## Synopsis

    class PtGauge PtBasic
    {
        gauge_flags;           // flag  (Pt_ARG_GAUGE_FLAGS)
        gauge_font;            // string  (Pt_ARG_GAUGE_FONT)
        gauge_h_align;         // unsigned char  (Pt_ARG_GAUGE_H_ALIGN)
        gauge_maximum;         // long  (Pt_ARG_GAUGE_MAXIMUM)
        gauge_minimum;         // long  (Pt_ARG_GAUGE_MINIMUM)
        gauge_orientation;     // char  (Pt_ARG_GAUGE_ORIENTATION)
        gauge_v_align;         // unsigned char  (Pt_ARG_GAUGE_V_ALIGN)
        gauge_value;           // long  (Pt_ARG_GAUGE_VALUE)
        gauge_value_prefix;    // string  (Pt_ARG_GAUGE_VALUE_PREFIX)
        gauge_value_suffix;    // string  (Pt_ARG_GAUGE_VALUE_SUFFIX)
    }

## Base Classes

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

## Derived Classes

`PtScale`, `PtSlider`, `RtProgress`

## Description

This class serves as a parent class of resources for gauge widgets, and is not normally instantiated.

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

## Instance Variables

gauge_flags

  This instance variable controls characteristics of the gauge display, and may have one of the following values:

  Constant | Description
  --- | ---
  `Pt_GAUGE_MAX_ON_TOP` | Position the maximum value on the top.
  `Pt_GAUGE_MAX_ON_BOTTOM` | Position the maximum value on the bottom.
  `Pt_GAUGE_MAX_ON_LEFT` | Position the maximum value on the left.
  `Pt_GAUGE_MAX_ON_RIGHT` | Position the maximum value on the right.

  In addition, it may have zero or more of the following values:

  Constant | Description
  --- | ---
  `Pt_SHOW_VALUE` | Display the gauge value. This flag must be set in order to access the `gauge_h_align` or `gauge_v_align` variables.
  `Pt_VALUE_XOR` | Invert the display and the background.

gauge_font

  A string specifying the font to use for the gauge value, title, and any text. Default is `"helv12"`.

gauge_h_align

  This instance variable controls horizontal alignment of the value display. It requires the constant `Pt_SHOW_VALUE` to be set in `gauge_flags`, and only works with gauges that support it.

  It may have one of the following values:

  Constant | Description
  --- | ---
  `Pt_LEFT` | Align the value display to the left edge.
  `Pt_RIGHT` | Align the value display to the right edge.
  `Pt_CENTER` | Center the value display horizontally.

gauge_maximum

  A number specifying the gauge's maximum value.

gauge_minimum

  A number specifying the gauge's minimum value.

gauge_orientation

  This instance variable specifies the axis for drawing the gauge, and may have one of the following values:

  Constant | Description
  --- | ---
  `Pt_VERTICAL` | Draw gauge on vertical axis.
  `Pt_HORIZONTAL` | Draw gauge on horizontal axis.

gauge_v_align

  This instance variable controls vertical alignment of the value display. It requires the constant `Pt_SHOW_VALUE` to be set in `gauge_flags`, and only works with gauges that support it.

  It may have one of the following values:

  Constant | Description
  --- | ---
  `Pt_TOP` | Align the value display to the top.
  `Pt_BOTTOM` | Align the value display to the bottom.
  `Pt_CENTER` | Center the value display vertically.

gauge_value

  A number specifying the current value of the gauge.

gauge_value_prefix

  A string that is attached to and displayed before the value of the gauge. For example, the string "Tank Level: " would give a display of `Tank Level: 155`.

gauge_value_suffix

  A string that is attached to and displayed after the value of the gauge. For example, the string " cm" would give a display of `155 cm`.

Prev | Home | Next
`PtFontSel` | Up | `PtGenList`

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