Inherits fltk::Valuator.
Inherited by fltk::FillDial, and fltk::LineDial.
Public Member Functions | |
void | angle1 (short a) |
void | angle2 (short a) |
void | angles (short a, short b) |
int | handle (int) |
Protected Member Functions | |
void | draw () |
The fltk::Dial widget provides a circular dial to control a single floating point value.
Use type() to change how it draws:
You can change the box() from the default of OVAL_BOX to draw different borders. The box() is filled with color(), the moving part is filled with selection_color(), and the border around the movint part is set by textcolor().
void Dial::angle1 | ( | short | a | ) | [inline] |
See angles()
void Dial::angle2 | ( | short | a | ) | [inline] |
See angles()
void Dial::angles | ( | short | a, |
short | b | ||
) | [inline] |
Sets the angles used for the minimum and maximum values. The default values are 45 and 315 (0 degrees is straight down and the angles progress clockwise). Normally angle1 is less than angle2, but if you reverse them the dial moves counter-clockwise.
void Dial::draw | ( | void | ) | [protected, virtual] |
Fltk calls this virtual function to draw the widget, after setting up the graphics (current window, xy translation, etc) so that any drawing functions will go into this widget.
User code should not call this! You probably want to call redraw().
The default version calls draw_box() and draw_label(), thus drawing the box() to fill the widget and putting the label() and image() inside it to fill it, unless the align() flags are set to put it outside.
Information on how to write your own version is here.
Reimplemented from fltk::Widget.
int Dial::handle | ( | int | event | ) | [virtual] |
The base class handle() accepts FOCUS and recognizes a number of keystrokes that adjust the value. A subclass can call this to get these keystrokes, it can also do it's own keystroke handling if it wants.
Reimplemented from fltk::Valuator.