The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

IWL::Spinner - a number spinner widget

INHERITANCE

IWL::Error -> IWL::Object -> IWL::Widget -> IWL::Input -> IWL::Entry -> IWL::Spinner

DESCRIPTION

The spinner widget is a special entry, that can show a numerical counter

CONSTRUCTOR

IWL::Spinner->new ([%ARGS])

Where %ARGS is an optional hash parameter with with key-values.

readonly

Set to true if the spinner input is read-only

maxlength

The maximum number of characters the spinner can hold

size

The size of the spinner input

value

The starting value of the spinner. Defaults to 0

from

The lower range of the spinner. Defaults to 0

to

The upper range of the spinner. Defaults to 100

stepIncrement

The step increment of the spinner. Defaults to 1.0

pageIncrement

The page increment of the spinner. Defaults to 10.0

acceleration

The acceleration of the spinner. Defaults to 0.1

snap

True, if the spinner should snap. Defaults to false

wrap

True, if the spinner should wrap. Defaults to false

precision

The numeric precision of the spinner, in fixed-point notation

mask

The spinner mask

METHODS

setRange (FROM, TO)

Sets the range of the spinner

Parameter: FROM - the lower numeric value, TO - the upper numeric value

getRange

Returns an array with the lower and upper numeric limits of the spinner

setPrecision (PRECISION)

Sets the precision of the spinner, in fixed-point notation

Parameters: PRECISION - the precision number, between 0 and 20

getPrecision

Returns the precision of the spinner

setIncrements (STEP, PAGE)

Sets the step and page increments of the spinner

Parameters: STEP - a float number, corresponding to the step increment, PAGE - a float number, corresponding to the page increment (shift-click, shift-arrow)

getIncrements

Returns an array of the step and page increments

setAcceleration (ACCELERATION)

Sets the acceleration of the spinner incrementation

Parameters: ACCELERATION - a float number, corresponding to the acceleration of the spinner

getAcceleration

Returns the spinner acceleration

setValue (VALUE)

Sets the initial value of the spinner

Parameters: VALUE - the numerical value of the spinner

getValue

Returns the initial value of the spinner

setWrap (BOOL)

Sets whether the spinner will wrap if it gets an out-of-range value

Parameters: BOOL - true, if the spinner should wrap

isWrapping

Returns true if the spinner wraps

setSnap (BOOL)

Sets whether the spinner will try to adjust incorrect values to the nearest possible one

Parameters: BOOL - true, if the spinner should snap

isSnapping

Returns true if the spinner snaps

setMask (MASK)

Sets the mask of the spinner. A mask defines a string, a portion of which represents the numeric value, and the rest is text.

Parameters: MASK - a string mask. In order to display the spinner value, the string must contain #{number}. e.g.: "#{number} euro"

getMask

Returns the mask of the spinner

LICENCE AND COPYRIGHT

Copyright (c) 2006-2008 Viktor Kojouharov. All rights reserved.

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

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 377:

You forgot a '=back' before '=head1'