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 }
This widget is a horizontal or vertical scale that features major and minor ticks.
![]() | This widget does not appear in the Photon documentation. |
| 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. |
This example, ex_PtScale.g, is included in the product distribution.
#!/usr/cogent/bin/phgamma
/*
* This example demonstrates two PtScales, one using
* user_defined values for instance variables, the other
* with default values. The PtScale widget is only
* available in QNX 4.
*/
if (_os_ == "QNX6")
princ ("\nThis widget is not available for QNX 6.", "\n\n");
else
{
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();
}
Copyright © 1995-2006 by Cogent Real-Time Systems, Inc. All rights reserved.