OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
About Gauges

Gauges are controls that display duration or other information about an ongoing process.

Class TGauge implements gauges, and is derived from class TControl. Horizontal gauges are usually used to display process information, and vertical gauges are usually used to display analog information.

Generally, a broken bar gauge is recommended for processes lasting less than 10 seconds. A solid bar (with text) is recommended for longer processes. The internal implementation can create a solid bar with text, and it can also have a vertical orientation. This implementation is used for the upper gauge in the illustration below.

The native control for Windows 95 is the Progress Bar common control. This is used for the bottom gauge in the illustration below.

Using the Gauge Control

  1. Construct the control.
    • Use the general constructor to construct a solid bar, a bar with text, or a vertical bar:
      SolidGauge = new TGauge(this, "%d%%",
      IDC_SOLIDGAUGE, 20, 20, 240, 34, true);
    • Use the common control constructor to construct a horizontal LED bar:
      LedGauge = new TGauge(this, IDC_LEDGAUGE, 20, 60, 240, 40);
  2. Set the options:
    SolidGauge->SetRange(0, 100);
    LedGauge->SetRange(0, 100);
    LedGauge->SetLed(4, 80);
    LedGauge->SetStep(8);
  3. Periodically update the gauge, using the control properties:
    SolidGauge->SetValue(Setting);
    LedGauge->SetValue(Setting);