NAME
Tk::MinMaxScale - Two Scale to get a (min, max) pair of values
SYNOPSIS
$mms = $parent->MinMaxScale(-option => value, ... );
$mms = $parent->MinMaxScale( -variablemin => \$vn, -variablemax => \$vx, -labelmin => ..., -labelmax => ..., ..., );
$varmin = $mms->minvalue;
$mms->minvalue(10);
$varmax = $mms->maxvalue;
$mms->maxvalue($var);
DESCRIPTION
Tk::MinMaxScale is a Frame-based widget wrapping two Scale widgets, the first acting as a 'minimum' and the second as a 'maximum'. The value of the 'minimum' Scale is always less than or equal to the value of the 'maximum' Scale.
The purpose of Tk::MinMaxScale is to get a range of values narrower than the whole range given by the options -from and -to (who are applied to both 'minimum' and 'maximum' Scale). This is done through the variables associated to the options -variablemin and -variablemax, or via the methods minvalue and maxvalues, see below.
In addition, dragging a slider while pressing a Shift key drags both sliders, locking their distance. You must hold down the Shift key before dragging a slider.
OPTIONS
The widget accepts all options accepted by Scale (except -variable option), and their default value (exception: option -orient defaults to 'horizontal').
In addition, the following option/value pairs are supported, but not required:
- -labelmin
-
The text used as a label for the 'minimum' Scale. Default none.
- -labelmax
-
The text used as a label for the 'maximum' Scale. Default none.
- -variablemin
-
A reference to a global variable linked with the 'minimum' Scale.
- -variablemax
-
A reference to a global variable linked with the 'maximum' Scale.
All other options are applied to both 'min' and 'max' Scale(s).
METHODS
The MinMaxScale method creates a widget object. This object supports the configure and cget methods described in Tk::options which can be used to enquire and modify the options described above. The widget also inherits all the methods provided by the generic Tk::Widget class.
The following additional methods are available for MinMaxScale widgets:
- $mms->minvalue(?value?)
-
Sets the 'min' Scale of the widget to value, if any (limited by '-from' value and the 'max' Scale value). Returns the value of the 'min' Scale.
- $mms->maxvalue(?value?)
-
Sets the 'max' Scale of the widget to value, if any (limited by the 'min' Scale value and '-to' values). Returns the value of the 'max' Scale.
HISTORY
- v0.09 - 2004/01/31
- - configure and cget methods implemented.
- v0.08 - 2004/01/04
- - compatibility with Tk804.xxx (dash before option).
- v0.07 - 2002/11/21
- - added tests.
- v0.06 - 2002/11/20
- - dropped "use warnings" and "use diagnostics".
- - cleaned up the distribution package.
- v0.05 - 2002/11/05
- - unlike Scale, '-orient' option defaults now to 'horizontal'.
- - like Scale, '-from' and '-to' options defaults now to 0 and 100, respectively.
- - definitely (:() fixed Shift-key binding problems.
- v0.04 - 2002/11/01
- - enhanced methods minvalue and maxvalue to set|get the scale values.
- v0.03 - 2002/11/01
- - fixed some problems when dragging while depressing shift key
- - added methods minvalue and maxvalue
- v0.02 - 2002/10/24
- - new feature added: dragging a slider while pressing a Shift key drags both sliders, locking their distance (an idea from Mark Lakata).
- v0.01 - 2002/10/17
- - first release.
TODO
- - switch to a 'one groove, two sliders' scale : I think it is not a so good idea.
- - make some test programs.
AUTHOR & LICENSE
Jean-Pierre Vidal, <jeanpierre.vidal@free.fr>
Feedback would be greatly appreciated, including corrections to my poor english.
This package is free software and is provided 'as is' without express or implied warranty. It may be used, modified, and redistributed under the same terms as Perl itself.
SEE ALSO
Tk::Scale
8 POD Errors
The following errors were encountered while parsing the POD:
- Around line 287:
'=item' outside of any '=over'
- Around line 305:
You forgot a '=back' before '=head1'
- Around line 314:
'=item' outside of any '=over'
- Around line 326:
You forgot a '=back' before '=head1'
- Around line 328:
'=item' outside of any '=over'
- Around line 386:
You forgot a '=back' before '=head1'
- Around line 388:
'=item' outside of any '=over'
- Around line 394:
You forgot a '=back' before '=head1'