Prima::Sliders(3)

πŸ“¦
version 1.74000 Β· 5 versions
, in opensuse-leap 16.0

πŸŽ€ 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 πŸ¦‹

  • state INTEGER β€” 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. DELTA is 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 πŸ¦‹

  • allowEmpty BOOLEAN β€” If set, allows an empty string as a valid value.

Default value: false

  • circulate BOOLEAN β€” 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

  • editClass STRING β€” Assigns the input line class.

A create-only property.

Default value: Prima::InputLine

  • editDelegations ARRAY β€” Assigns the input line list of the notifications.

A create-only property.

  • editProfile HASH β€” Assigns a hash of properties passed to the input line during the creation.

A create-only property.

  • max INTEGER β€” Sets the upper limit for value.

Default value: 100.

  • min INTEGER β€” Sets the lower limit for value.

Default value: 0

  • pageStep INTEGER β€” Determines the multiplication factor for incrementing and decrementing actions of the mouse wheel.

Default value: 10

  • spinClass STRING β€” Assigns the spin-button class.

A create-only property.

Default value: Prima::AltSpinButton

  • spinProfile ARRAY β€” Assigns the spin-button list of the delegated notifications.

A create-only property.

  • spinDelegations HASH β€” Assigns a hash of properties passed to the spin-button during the creation.

A create-only property.

  • step INTEGER β€” Determines the multiplication factor for incrementing and decrementing actions of the spin-button.

Default value: 1

  • value INTEGER β€” Selects the integer value in the range from min to max. The value is reflected in the input line.

Default value: 0.

🧚 Methods 🧚

  • set_bounds MIN, MAX β€” Simultaneously sets both min and max values.

🌸 Events 🌸

  • Change β€” Called when value is changed.

πŸŒ€ Prima::Gauge πŸŒ€

An output-only widget class, displays a progress bar and an eventual percentage string. Useful as a progress indicator.

πŸ¦‹ Properties πŸ¦‹

  • indent INTEGER β€” Selects the width of the border around the widget.

Default value: 1

  • max INTEGER β€” Sets the upper limit for value.

Default value: 100.

  • min INTEGER β€” Sets the lower limit for value.

Default value: 0

  • relief INTEGER β€” Selects the style of the border around the widget. Can be one of the following gr::XXX constants:
gr::Sink    - 3d sunken look
gr::Border  - uniform black border
gr::Raise   - 3d raised look

Default value: gr::Sink.

  • threshold INTEGER β€” Selects the threshold value used to determine if the changes to value are reflected immediately or are deferred until the value is changed more significantly. When 0, all calls to value result in an immediate repaint request.

Default value: 0

  • value INTEGER β€” Selects the integer value between min and max, reflected in the progress bar and eventual text.

Default value: 0.

  • vertical BOOLEAN β€” 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 both min and max values.

🌸 Events 🌸

  • Stringify VALUE, REF β€” Converts the integer VALUE into a string format and stores it in the REF scalar reference. Default stringifying conversion is identical to a call to sprintf("%2d%%").

πŸŒ€ Prima::ProgressBar πŸŒ€

Displays a progress bar.

πŸ¦‹ Properties πŸ¦‹

  • max INTEGER β€” Sets the upper limit for value.

Default value: 100.

  • min INTEGER β€” Sets the lower limit for value.

Default value: 0

  • value INTEGER β€” Selects the integer value between min and max, reflected in the progress bar and an eventual text.

Default value: 0.

🧚 Methods 🧚

  • set_bounds MIN, MAX β€” Simultaneously sets both min and max values.

πŸŒ€ 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 πŸ¦‹

  • autoTrack BOOLEAN β€” A boolean flag, selects the way notifications are executed when the user mouse-drags the sliding bar. If 1, the Change notification is executed as soon as value is changed. If 0, Change is deferred until the user finishes the mouse drag; instead, the Track notification 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

  • increment INTEGER β€” A step range value used in scheme for marking the key ticks. See scheme for details.

Default value: 10

  • max INTEGER β€” Sets the upper limit for value.

Default value: 100.

  • min INTEGER β€” Sets the lower limit for value.

Default value: 0

  • readOnly BOOLEAN β€” If 1, the user cannot change the value by moving the bar or otherwise.

Default value: 0

  • ticks ARRAY β€” Selects the tick marks representation along the sliding axis or the dialing circle. ARRAY consists of hashes, each for one tick. The hash must contain at least a value key with an integer value. The two additional keys height and text, 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.

  • scheme INTEGER β€” scheme is a property that creates a set of tick marks using one of the predefined scale designs selected by the ss::XXX constants. Each constant produces a different scale; some make use of the increment integer property that selects a step that is used to place additional text marks. As an example, the ss::Thermometer design with the default min, max, and increment values 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.

  • snap BOOLEAN β€” If 1, value cannot 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, value can accept any integer value in the range from min to max.

Default value: 0

  • step INTEGER β€” An integer delta for singular increment and decrement commands, and also a threshold for value when the snap value is 0.

Default value: 1

  • value INTEGER β€” Selects an integer value between min and max and the corresponding sliding bar position.

Default value: 0.

🌸 Events 🌸

  • Change β€” Called when the value value is changed, with one exception: if the user moves the sliding bar while autoTrack is 0, the Track notification is called instead.
  • Track β€” Called when the user moves the sliding bar while the autoTrack value is 0; this notification is a substitute to Change.

πŸ’– Prima::Slider πŸ’–

okay bestie, this one is a linear sliding bar that moves along a linear shaft. iconic.

✨ Properties ✨

  • borderWidth INTEGER β€” in horizontal mode, this sets extra margin space between the slider line and the widget boundaries. It's there for fine-tuning text labels from ticks(), especially when the default spacing (0) or the spacing procedure (which drops overlapping labels) is not producing decent results. iykyk.
  • ribbonStrip BOOLEAN β€” if 1, parts of the shaft are painted with different colors to increase visual feedback. If 0, the shaft is painted with the single default background color. Default value: 0.
  • shaftBreadth INTEGER β€” the breadth of the shaft in pixels. Default value: 6.
  • tickAlign INTEGER β€” one of the tka::XXX constants, and it sets where the tick marks sit:
    • tka::Normal β€” ticks are drawn on the left or 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 dependent on the vertical property value. Default value: tka::Normal.
  • vertical BOOLEAN β€” if 1, the widget is drawn vertically, and the slider moves from bottom to top. If 0, the widget is drawn horizontally, and the slider moves from left to right. Default value: 0.

πŸ› οΈ Methods πŸ› οΈ

  • pos2info X, Y β€” translates the integer coordinate pair (X, Y) into the value corresponding to the scale, and returns three scalars:
    • info INTEGER β€” if undef, 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.
    • value INTEGER β€” if info is 0 or 1, it contains the corresponding value.
    • aperture INTEGER β€” 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 ✨

  • buttons BOOLEAN β€” if 1, 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. If 0, the buttons are not shown. Default values: 0.
  • stdPointer BOOLEAN β€” determines the style of the value indicator (pointer) on the dial. If 1, it is drawn as a black triangular mark. If 0, it is drawn as a small circular knob. Default value: 0.

πŸ› οΈ Methods πŸ› οΈ

  • offset2data VALUE β€” converts an integer value in the range from min to max into the corresponding angle, and returns two floating-point values: the cosine and the sine of the angle.
  • offset2pt X, Y, VALUE, RADIUS β€” converts an integer value in the range from min to max into point coordinates, using the RADIUS and the dial center coordinates X and Y. Returns the calculated point coordinates as two integers in the (X,Y) format.
  • xy2val X, Y β€” converts widget coordinates X and Y into a value in the range from min to max, and returns two scalars: the value, and the boolean flag, which is set to 1 if the (X,Y) point is inside the dial circle, and to 0 otherwise.

πŸŽ€ Events πŸŽ€

  • Stringify VALUE, REF β€” converts the integer VALUE into a string format and stores it in the REF scalar reference. The resulting string is displayed in the center of the dial. The default conversion routine simply copies VALUE to REF as 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