Prima::Sliders(3)
π NAME π
okay so this is Prima::Sliders(3), straight out of the User Contributed Perl Documentation, and it is literally all about sliding bars, spin buttons, dial widgets, etc π
. bestie, this module is a whole grab-bag of widget classes that do integer value input and/or output. that's the vibe.
β¨ DESCRIPTION β¨
The module contains a set of unrelated widget classes that provide input and/or output of an integer value. That is the only thing common in these classes, which are:
Prima::AbstractSpinButton
Prima::SpinButton
Prima::AltSpinButton
Prima::SpinEdit
Prima::Gauge
Prima::PrigressBar
Prima::AbstractSlider
Prima::Slider
Prima::CircularSlider
π Prima::AbstractSpinButton π
Provides a generic interface to the spin-button class functionality that includes events and range definition properties. Neither Prima::AbstractSpinButton nor its descendants store the integer value. These provide a mere possibility for the user to send the incrementing and decrementing commands.
The class is not usable directly.
π¦ Properties π¦
stateINTEGER β The property manages a common internal state that doesn't have an exact meaning, as it is only defined in the descendant classes. For example, the state can be set to non-zero when the user performs a mouse drag action.
πΈ Events πΈ
Increment DELTAβ Called when the user presses a part of the widget that is responsible for incrementing or decrementing commands.DELTAis an integer value that indicates how the associated value must be modified.TrackEndβ Called when the user finished the mouse transaction.
π Prima::SpinButton π
A rectangular spin button that 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 the mouse, fires the Increment events with delta value, based on the vertical position of the mouse pointer.
π Prima::AltSpinButton π
A rectangular spin button that consists of two push-buttons, associated with singular increment and decrement commands. Compared to Prima::SpinButton, the class is a bit less functional but has a more stylish look. highkey aesthetic.
π Prima::SpinEdit π
The widget contains a numerical input line and a spin button. The input line value can be changed in three ways β either as a direct traditional keyboard input, as a result of the spin button actions, or as the mouse wheel response. The class provides properties for value storage and range selection.
π¦ Properties π¦
allowEmptyBOOLEAN β If set, allows an empty string as a valid value.
Default value: false
circulateBOOLEAN β Selects the value modification rule when the increment or decrement action hits a range limit. If 1, the value is changed to the opposite limit value (for example, if the value is 100 in the range 2-100, and the user clicks on the 'increment' button, the value is changed to 2).
If 0, the value does not change.
Default value: 0
editClassSTRING β Assigns the input line class.
A create-only property.
Default value: Prima::InputLine
editDelegationsARRAY β Assigns the input line list of the notifications.
A create-only property.
editProfileHASH β Assigns a hash of properties passed to the input line during the creation.
A create-only property.
maxINTEGER β Sets the upper limit forvalue.
Default value: 100.
minINTEGER β Sets the lower limit forvalue.
Default value: 0
pageStepINTEGER β Determines the multiplication factor for incrementing and decrementing actions of the mouse wheel.
Default value: 10
spinClassSTRING β Assigns the spin-button class.
A create-only property.
Default value: Prima::AltSpinButton
spinProfileARRAY β Assigns the spin-button list of the delegated notifications.
A create-only property.
spinDelegationsHASH β Assigns a hash of properties passed to the spin-button during the creation.
A create-only property.
stepINTEGER β Determines the multiplication factor for incrementing and decrementing actions of the spin-button.
Default value: 1
valueINTEGER β Selects the integer value in the range frommintomax. The value is reflected in the input line.
Default value: 0.
π§ Methods π§
set_bounds MIN, MAXβ Simultaneously sets bothminandmaxvalues.
πΈ Events πΈ
Changeβ Called whenvalueis changed.
π Prima::Gauge π
An output-only widget class, displays a progress bar and an eventual percentage string. Useful as a progress indicator.
π¦ Properties π¦
indentINTEGER β Selects the width of the border around the widget.
Default value: 1
maxINTEGER β Sets the upper limit forvalue.
Default value: 100.
minINTEGER β Sets the lower limit forvalue.
Default value: 0
reliefINTEGER β Selects the style of the border around the widget. Can be one of the followinggr::XXXconstants:
gr::Sink - 3d sunken look
gr::Border - uniform black border
gr::Raise - 3d raised look
Default value: gr::Sink.
thresholdINTEGER β Selects the threshold value used to determine if the changes tovalueare reflected immediately or are deferred until the value is changed more significantly. When 0, all calls tovalueresult in an immediate repaint request.
Default value: 0
valueINTEGER β Selects the integer value betweenminandmax, reflected in the progress bar and eventual text.
Default value: 0.
verticalBOOLEAN β If 1, the widget is drawn vertically and the progress bar moves from bottom to top. If 0, the widget is drawn horizontally and the progress bar moves from left to right.
Default value: 0
π§ Methods π§
set_bounds MIN, MAXβ Simultaneously sets bothminandmaxvalues.
πΈ Events πΈ
Stringify VALUE, REFβ Converts the integerVALUEinto a string format and stores it in theREFscalar reference. Default stringifying conversion is identical to a call tosprintf("%2d%%").
π Prima::ProgressBar π
Displays a progress bar.
π¦ Properties π¦
maxINTEGER β Sets the upper limit forvalue.
Default value: 100.
minINTEGER β Sets the lower limit forvalue.
Default value: 0
valueINTEGER β Selects the integer value betweenminandmax, reflected in the progress bar and an eventual text.
Default value: 0.
π§ Methods π§
set_bounds MIN, MAXβ Simultaneously sets bothminandmaxvalues.
π Prima::AbstractSlider π
The class provides the basic functionality of a sliding bar, equipped with tick marks. The tick marks are supposed to be drawn alongside the main sliding axis or the dialing circle, and provide visual feedback for the user.
The class is not usable directly.
π¦ Properties π¦
autoTrackBOOLEAN β A boolean flag, selects the way notifications are executed when the user mouse-drags the sliding bar. If 1, theChangenotification is executed as soon asvalueis changed. If 0,Changeis deferred until the user finishes the mouse drag; instead, theTracknotification is executed when the bar is moved.
This property can be used when the Change notification handler performs very slowly, so the eventual fast mouse interactions would not thrash down the program.
Default value: 1
incrementINTEGER β A step range value used inschemefor marking the key ticks. See scheme for details.
Default value: 10
maxINTEGER β Sets the upper limit forvalue.
Default value: 100.
minINTEGER β Sets the lower limit forvalue.
Default value: 0
readOnlyBOOLEAN β If 1, the user cannot change the value by moving the bar or otherwise.
Default value: 0
ticksARRAY β Selects the tick marks representation along the sliding axis or the dialing circle.ARRAYconsists of hashes, each for one tick. The hash must contain at least avaluekey with an integer value. The two additional keysheightandtext, select the height of a tick mark in pixels, and the text is drawn near the mark, correspondingly.
If ARRAY is undef, no ticks are drawn.
schemeINTEGER βschemeis a property that creates a set of tick marks using one of the predefined scale designs selected by thess::XXXconstants. Each constant produces a different scale; some make use of theincrementinteger property that selects a step that is used to place additional text marks. As an example, thess::Thermometerdesign with the defaultmin,max, andincrementvalues would look like this:
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
When the tick property is explicitly set, scheme is reset to undef.
snapBOOLEAN β If 1,valuecannot accept values that are not on the tick scale. When such a value is attempted to be set, it is rounded to the closest tick mark. If 0,valuecan accept any integer value in the range frommintomax.
Default value: 0
stepINTEGER β An integer delta for singular increment and decrement commands, and also a threshold forvaluewhen thesnapvalue is 0.
Default value: 1
valueINTEGER β Selects an integer value betweenminandmaxand the corresponding sliding bar position.
Default value: 0.
πΈ Events πΈ
Changeβ Called when thevaluevalue is changed, with one exception: if the user moves the sliding bar whileautoTrackis 0, theTracknotification is called instead.Trackβ Called when the user moves the sliding bar while theautoTrackvalue is 0; this notification is a substitute toChange.
π Prima::Slider π
okay bestie, this one is a linear sliding bar that moves along a linear shaft. iconic.
β¨ Properties β¨
borderWidthINTEGERβ in horizontal mode, this sets extra margin space between the slider line and the widget boundaries. It's there for fine-tuning text labels fromticks(), especially when the default spacing (0) or the spacing procedure (which drops overlapping labels) is not producing decent results. iykyk.ribbonStripBOOLEANβ if1, parts of the shaft are painted with different colors to increase visual feedback. If0, the shaft is painted with the single default background color. Default value:0.shaftBreadthINTEGERβ the breadth of the shaft in pixels. Default value:6.tickAlignINTEGERβ one of thetka::XXXconstants, and it sets where the tick marks sit:tka::Normalβ ticks are drawn on the left or the top of the shafttka::Alternativeβ ticks are drawn on the right or at the bottom of the shafttka::Dualβ ticks are drawn both ways The ticks' orientation (left or top, right or bottom) is dependent on theverticalproperty value. Default value:tka::Normal.
verticalBOOLEANβ if1, the widget is drawn vertically, and the slider moves from bottom to top. If0, the widget is drawn horizontally, and the slider moves from left to right. Default value:0.
π οΈ Methods π οΈ
pos2infoX,Yβ translates the integer coordinate pair (X,Y) into the value corresponding to the scale, and returns three scalars:infoINTEGERβ ifundef, user-driven positioning is not possible (minequals tomax). If1, the point is located on the slider. If0, the point is outside the slider.valueINTEGERβ ifinfois0or1, it contains the correspondingvalue.apertureINTEGERβ offset in pixels along the shaft axis.
π‘ Prima::CircularSlider π‘
This one presents a slider widget with a dialing circle and two increment/decrement buttons. Tick marks are drawn around the perimeter of the dial, and the current value is displayed in the center of the dial. periodt.
β¨ Properties β¨
buttonsBOOLEANβ if1, the increment/decrement buttons are shown at the bottom of the dial, and the user can change the value either by the dial or by the buttons. If0, the buttons are not shown.Default values: 0.stdPointerBOOLEANβ determines the style of the value indicator (pointer) on the dial. If1, it is drawn as a black triangular mark. If0, it is drawn as a small circular knob. Default value:0.
π οΈ Methods π οΈ
offset2dataVALUEβ converts an integer value in the range frommintomaxinto the corresponding angle, and returns two floating-point values: the cosine and the sine of the angle.offset2ptX,Y,VALUE,RADIUSβ converts an integer value in the range frommintomaxinto point coordinates, using theRADIUSand the dial center coordinatesXandY. Returns the calculated point coordinates as two integers in the (X,Y) format.xy2valX,Yβ converts widget coordinatesXandYinto a value in the range frommintomax, and returns two scalars: the value, and the boolean flag, which is set to1if the (X,Y) point is inside the dial circle, and to0otherwise.
π Events π
StringifyVALUE,REFβ converts the integerVALUEinto a string format and stores it in theREFscalar reference. The resulting string is displayed in the center of the dial. The default conversion routine simply copiesVALUEtoREFas is.
π AUTHOR π
Dmitry Karasik, <dmitry@karasik.eu.org>, Anton Berezin <tobez@tobez.org>. π
π SEE ALSO π
Prima, examples/fontdlg.pl π¦
smooches, this page was served by perl v5.42.0 on 2024-08-20 and it's Prima::Sliders(3) π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms