Sanko Robinson > FLTK-0.532009 > FLTK::ValueInput

Download:
FLTK-0.532009.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.532006   Source  

NAME ^

FLTK::ValueInput - Text field for inputing a floating-point number

Description ^

Controls a single floating point value through a combination of a FLTK::FloatInput and two up/down buttons. Other toolkits call this a "Spin Box".

Clicking the buttons increments/decrements by the linesize( ). Holding down any shift key and clicking increments/decrements by the pagesize( ).

The user can type a new value into the input area. If step( ) is greater or equal to 1.0 an FLTK::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 FLTK::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-gtstatic_text('word').

Functions ^

new

my $input = $valueinput->new( $x, $y, $w, $h, $label );

Author ^

Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/

License and Legal ^

Copyright (C) 2008-2010 by Sanko Robinson <sanko@cpan.org>

This program is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. See the LICENSE file included with this distribution or notes on the Artistic License 2.0 for clarification.

When separated from the distribution, all original POD documentation is covered by the Creative Commons Attribution-Share Alike 3.0 License. See the clarification of the CCA-SA3.0.

syntax highlighting: