Prima::Sliders - sliding bars, spin buttons and input lines, dial widget etc. |
Prima::Sliders - sliding bars, spin buttons and input lines, dial widget etc.
The module is a set of widget classes, with one common property; - all of these provide input and / or output of an integer value. This property unites the following set of class hierarchies:
Prima::AbstractSpinButton Prima::SpinButton Prima::AltSpinButton
Prima::SpinEdit
Prima::Gauge
Prima::AbstractSlider Prima::Slider Prima::CircularSlider
Provides a generic interface to spin-button class functionality, which includes
range definition properties and events. Neither Prima::AbstractSpinButton
, nor
its descendants store the integer value. These provide a mere possibility for
the user to send incrementing or decrementing commands.
The class is not usable directly.
state
is defined in the descendant classes.
A rectangular spin button, consists of three parts, divided horizontally.
The upper and the lower parts are push-buttons associated with singular
increment and decrement commands. The middle part, when dragged by mouse,
fires Increment
events with delta value, based on a vertical position
of the mouse pointer.
A rectangular spin button, consists of two push-buttons, associated
with singular increment and decrement command. Comparing to Prima::SpinButton
,
the class is less functional but has more stylish look.
The class is a numerical input line, paired with a spin button. The input line value can be change three ways - either as a direct traditional keyboard input, or as spin button actions, or as mouse wheel response. The class provides value storage and range selection properties.
If 0, the value does not change.
Default value: 0
Create-only property.
Default value: Prima::InputLine
Create-only property.
Create-only property.
value
.
Default value: 100.
value
.
Default value: 0
Default value: 10
Create-only property.
Default value: Prima::AltSpinButton
Create-only property.
Create-only property.
Default value: 1
min
to max
, reflected in the input line.
Default value: 0.
min
and max
values.
value
is changed.
An output-only widget class, displays a progress bar and an eventual percentage string. Useful as a progress indicator.
Default value: 1
value
.
Default value: 100.
value
.
Default value: 0
gr::XXX
constants:
gr::Sink - 3d sunken look gr::Border - uniform black border gr::Raise - 3d risen look
Default value: gr::Sink
.
value
are reflected immediately or deferred until the value is changed more
significantly. When 0, all calls to value
result in an immediate
repaint request.
Default value: 0
min
and max
, reflected in the progress bar and
eventual text.
Default value: 0.
Default value: 0
min
and max
values.
sprintf("%2d%%")
one.
The class provides basic functionality of a sliding bar, equipped with tick marks. Tick marks are supposed to be drawn alongside the main sliding axis or circle and provide visual feedback for the user.
The class is not usable directly.
Change
notification is executed as soon as value
is changed. If 0, Change
is deferred until the user finished the mouse drag;
instead, Track
notification is executed when the bar is moved.
This property can be used when the action, called on Change
performs very
slow, so the eventual fast mouse interactions would not thrash down the program.
Default value: 1
scheme
for marking the key ticks.
See scheme for details.
Default value: 10
value
.
Default value: 100.
value
.
Default value: 0
Default value: 0
value
key, with integer value. The two additional keys,
height
and text
, select the height of a tick mark in pixels
and the text drawn near the mark, correspondingly.
If ARRAY is undef
, no ticks are drawn.
scheme
is a write-only property, that creates a set of tick marks
using one of the predefined scale designs, selected by ss::XXX
constants.
Each constant produces different scale; some make use of increment
integer
property, which selects a step by which the additional
text marks are drawn. As an example, ss::Thermometer
design with
default min
, max
, and increment
values would look like that:
0 10 20 100 | | | | |||||||||||||||....|||
The module defines the following constants:
ss::Axis - 5 minor ticks per increment ss::Gauge - 1 tick per increment ss::StdMinMax - 2 ticks at the ends of the bar ss::Thermometer - 10 minor ticks per increment, longer text ticks
value
cannot accept values that are not on the tick scale.
When set such a value, it is rounded to the closest tick mark.
If 0, value
can accept any integer value in range from min
to max
.
Default value: 0
value
when snap
value is 0.
Default value: 1
min
and max
and the corresponding sliding bar
position.
Default value: 0.
value
value is changed, with one exception:
if the user moves the sliding bar while autoTrack
is 0, Track
notification is called instead.
autoTrack
value is 0;
this notification is a substitute to Change
.
Presents a linear sliding bar, movable along a linear shaft.
Default value: 0
Default value: 6
tka::XXX
constants, that correspond to the situation of tick marks:
tka::Normal - ticks are drawn on the left or on the top of the shaft tka::Alternative - ticks are drawn on the right or at the bottom of the shaft tka::Dual - ticks are drawn both ways
The ticks orientation ( left or top, right or bottom ) is dependant on vertical
property value.
Default value: tka::Normal
Default value: 0
undef
, the user-driven positioning is not possible ( min
equals to max
).
If 1, the point is located on the slider.
If 0, the point is outside the slider.
info
is 0 or 1, contains the corresponding value
.
Presents a slider widget with the dial and two increment / decrement buttons. The tick marks are drawn around the perimeter of the dial; current value is displayed in the center of the dial.
Default values: 0
Default value: 0
min
to max
into
the corresponding angle, and return two real values:
cosine and sine of the angle.
min
to max
into the
point coordinates, with the RADIUS and dial center coordinates
X and Y. Return the calculated point coordinates
as two integers in (X,Y) format.
min
to max
, and return two scalars: the value and the boolean flag,
which is set to 1 if the (X,Y) point is inside the dial circle,
and 0 otherwise.
Default conversion routine simply copies VALUE to REF as is.
Dmitry Karasik, <dmitry@karasik.eu.org>, Anton Berezin <tobez@tobez.org>.
Prima, examples/fontdlg.pl
Prima::Sliders - sliding bars, spin buttons and input lines, dial widget etc. |