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:
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. |
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 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-2010 by Cogent Real-Time Systems, Inc. All rights reserved.