ValueSlider Class Reference

Inherits Slider.

List of all members.

Public Member Functions

int handle (int)
void draw ()
 ValueSlider (int x, int y, int w, int h, const char *l=0)
void layout ()
virtual void value_damage ()

Public Attributes

FloatInput input


Detailed Description

Controls a single floating point value through a combination of a FloatInput and a Slider.

value_slider.gif

As this is a subclass of Slider, all slider methods work, for setting the slider size, tick marks, etc.

The user can type a new value into the input area. If step() is greater or equal to 1.0 an IntInput is used, this prevents the user from typing anything other than digits. If step() is less than one then the user can type floating point values with decimal points and exponents.

The user can type any value they want into the text field, including ones outside the range() or non-multiples of the step(). If you want to prevent this, make the callback function reset the value to a legal one.

By default the callback is done when the user moves the slider, when they use up/down keys to change the number in the text, or if they edit the text, when they hit the Enter key or they click on another widget or put the focus on another widget. Changing when() to WHEN_CHANGED will make it do the callback on every edit of the text.

You can get at the input field by using the public "input" instance variable. For instance you can clobber the text to a word with value_input->input.static_text("word"). You can also set the size of it (call layout() first).


The documentation for this class was generated from the following files:
Sun Jan 7 00:55:18 2007. FLTK ©2006 Bill Spitzak and others.
Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.