PtSlider

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

# `PtSlider`

`PtSlider` -- A sliding-scale input mechanism.

## Synopsis

    class PtSlider PtGauge
    {
        slider_flags;             // flag  (Pt_ARG_SLIDER_FLAGS)
        slider_handle_height;     // unsigned short  (Pt_ARG_SLIDER_HANDLE_HEIGHT)
        slider_handle_width;      // unsigned short  (Pt_ARG_SLIDER_HANDLE_WIDTH)
        slider_image;             // PhImage  (Pt_ARG_SLIDER_IMAGE)
        slider_increment;         // unsigned short  (Pt_ARG_SLIDER_INCREMENT)
        slider_label_br;          // string  (Pt_ARG_SLIDER_LABEL_BR)
        slider_label_br_col;      // color  (Pt_ARG_SLIDER_LABEL_BR_COL)
        slider_label_tl;          // string  (Pt_ARG_SLIDER_LABEL_TL)
        slider_label_tl_col;      // color  (Pt_ARG_SLIDER_LABEL_TL_COL)
        slider_multiple;          // unsigned short  (Pt_ARG_SLIDER_MULTIPLE)
        slider_tick_major_col;    // color  (Pt_ARG_SLIDER_TICK_MAJOR_COL)
        slider_tick_major_div;    // long  (Pt_ARG_SLIDER_TICK_MAJOR_DIV)
        slider_tick_major_len;    // unsigned short  (Pt_ARG_SLIDER_TICK_MAJOR_LEN)
        slider_tick_minor_col;    // color  (Pt_ARG_SLIDER_TICK_MINOR_COL)
        slider_tick_minor_div;    // long  (Pt_ARG_SLIDER_TICK_MINOR_DIV)
        slider_tick_minor_len;    // unsigned short  (Pt_ARG_SLIDER_TICK_MINOR_LEN)
        slider_trough_col;        // color  (Pt_ARG_SLIDER_TROUGH_COL)
        slider_trough_size;       // unsigned short  (Pt_ARG_SLIDER_TROUGH_SIZE)
    }

## Base Classes

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

## Description

This widget is a sliding scale that accepts numerical data input in analog fashion. It consists of a handle that moves along a trough and points to optional tick marks.

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

## Instance Variables

slider_flags

  This instance variable specifies the location of the tick marks, and may be a combination of zero or more of the following flags:

  Constant | Description
  --- | ---
  `Pt_TICKS_ON_TOP` | Put the scale marks on top of the trough.
  `Pt_TICKS_ON_LEFT` | Put the scale marks to the left of the trough.
  `Pt_TICKS_ON_BOTTOM` | Put the scale marks on the bottom of the trough.
  `Pt_TICKS_ON_RIGHT` | Put the scale marks to the right of the trough.
  `Pt_TICKS_TOUCH_TROUGH` | Make the scale marks touch the trough.
  `Pt_TICKS_ETCHED_IN` | Give the scale marks an etched-in appearance.
  `Pt_TICKS_ETCHED_OUT` | Give the scale marks an etched-out appearance.
  `Pt_SLIDER_POINT_LEFT` | The handle will point left.
  `Pt_SLIDER_POINT_UP` | The handle will point up.
  `Pt_SLIDER_POINT_RIGHT` | The handle will point right.
  `Pt_SLIDER_POINT_DOWN` | The handle will point down.
  `Pt_SLIDER_IMAGE` | The slider handle is an image specified by `slider_image.`.
  `Pt_SLIDER_MASK` | Internal informational bit.

slider_handle_height, slider_handle_width

  A number of pixels specifying the height or width of the handle. Defaults are 40 and 15 respectively.

slider_image

  A `PhImage` to display on the handle. You must set the `slider_flags` `Pt_SLIDER_IMAGE` in order to use this variable.

slider_increment

  An integer specifying the increment for the slider to move when the arrow keys are pressed. Default is `1`.

slider_label_br

  A string comprising the label to display on the bottom or right of the slider, depending on its orientation.

slider_label_br_col

  A number specifying the color of the bottom or right label. Default is `0x0` (black).

slider_label_tl

  A string comprising the label to display on the top or left of the slider, depending on its orientation.

slider_label_tl_col

  A number specifying the color of the top or left label. Default is `0x0` (black).

slider_multiple

  An integer specifying the increment for the slider to move when you press PgUp or PgDn, or click on the trough. Default is `0`.

slider_tick_major_col, slider_tick_minor_col

  A number specifying a color for the major or minor ticks. Default is `0x0` (black).

slider_tick_major_div

  The number of major tick divisions. Default is `10`.

slider_tick_major_len, slider_tick_minor_len

  A number of pixels specifying the length of the major or minor ticks. Defaults are 10 and 0 respectively.

slider_tick_minor_div

  The number of minor tick divisions per major division. Default is `0`.

slider_trough_col

  A number specifying the color of the trough. Default is `0xc0c0c0` (grey).

slider_trough_size

  A number of pixels specifying the width of the trough. Default is `4`.

## Callbacks

The following callback is associated with this widget:

Callback | Description
--- | ---
`Pt_CB_SLIDER_MOVE` | This callback is generated when the position of the slider handle changes.

## Associated Classes

`PtSliderCallback`, `PtCallbackInfo`

Prev | Home | Next
`PtSeparator` | Up | `PtTerminal`

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