NAME

Fl::ValueOutput - Displays Floating Point Value

Description

The Fl::ValueOutput widget displays a floating point value.

If step() is not zero, the user can adjust the value by dragging the mouse left and right. The left button moves one step() per pixel, the middle by 10 * step(), and the right button by 100 * step().

This is much lighter-weight than Fl::ValueInput because it contains no text editing code or character buffer.

Methods

Fl::ValueOutput inherits from Fl::Valuator and Fl::Widget. On top of that, it exposes the following methods...

new(...)

my $val_a = Fl::ValueOutput->new(0, 0, 250, 500, 'Important Stuff');
my $val_b = Fl::ValueOutput->new(0, 0, 250, 500);

The constructor creates a new widget using the given position, size, and label.

The default boxtype is FL_NO_BOX.

The destructor removes the widget.

soft(...)

my $soft = $val_a->soft();
$val_b->soft( 0 );

If "soft" is turned on, the user is allowed to drag the value outside the range.

If they drag the value to one of the ends, let go, then grab again and continue to drag, they can get to any value. Default is 1 (on).

textcolor(...)

Sets or gets the color of the text in the value box.

my $color = $val_a->textcolor();
$val_b->textcolor(Fl::FL_RED);

textfont(...)

Sets or gets the typeface of the text in the value box.

my $font = $val_a->textfont();
$val_b->textfont(Fl::FL_HELVETICA);

textsize( )

Gets the size of the text in the value box.

my $size = $val_a->textsize();

LICENSE

Copyright (C) Sanko Robinson.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Sanko Robinson <sanko@cpan.org>