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. |
This instance variable specifies the general features of the scale, and may be a combination of zero or more of the following flags:
A string specifying the font of the label.
A number specifying the color of the major tick marks. Default is 0x0 (black).
An integer specifying into how many equal-sized major parts the scale should be divided into. Default is 5.
A number of pixels specifying the length of the major tick marks. Default is 10.
A number specifying the color of the minor tick marks. Default is 0x0 (black).
An integer specifying into how many equal-sized minor parts each major division should be divided into. Default is 3.
A number of pixels specifying the length of the minor tick marks. Default is 5.
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();