Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::UI::Widget::Scalar Class Reference

A labelled text box, with spin buttons and optional icon, for entering arbitrary number values. More...

#include <scalar.h>

Inheritance diagram for Inkscape::UI::Widget::Scalar:
Inkscape::UI::Widget::Labelled Inkscape::UI::Widget::RegisteredWidget< Scalar > Inkscape::UI::Widget::Random Inkscape::UI::Widget::ScalarUnit Inkscape::UI::Widget::RegisteredInteger Inkscape::UI::Widget::RegisteredScalar Inkscape::UI::Widget::RegisteredWidget< Random > Inkscape::UI::Widget::RegisteredWidget< ScalarUnit > Inkscape::UI::Widget::PrefSpinUnit Inkscape::UI::Widget::RegisteredRandom Inkscape::UI::Widget::RegisteredScalarUnit

Public Member Functions

 Scalar (Glib::ustring const &label, Glib::ustring const &tooltip, Glib::ustring const &icon={}, bool mnemonic=true)
 Construct a Scalar Widget.
 
 Scalar (Glib::ustring const &label, Glib::ustring const &tooltip, unsigned digits, Glib::ustring const &icon={}, bool mnemonic=true)
 Construct a Scalar Widget.
 
 Scalar (Glib::ustring const &label, Glib::ustring const &tooltip, Glib::RefPtr< Gtk::Adjustment > const &adjust, unsigned digits=0, Glib::ustring const &icon={}, bool mnemonic=true)
 Construct a Scalar Widget.
 
unsigned getDigits () const
 Fetches the precision of the spin button.
 
double getStep () const
 Gets the current step increment used by the spin button.
 
double getPage () const
 Gets the current page increment used by the spin button.
 
double getRangeMin () const
 Gets the minimum range value allowed for the spin button.
 
double getRangeMax () const
 Gets the maximum range value allowed for the spin button.
 
bool getSnapToTicks () const
 
double getValue () const
 Get the value in the spin_button.
 
int getValueAsInt () const
 Get the value spin_button represented as an integer.
 
void setDigits (unsigned digits)
 Sets the precision to be displayed by the spin button.
 
void setIncrements (double step, double page)
 Sets the step and page increments for the spin button.
 
void setRange (double min, double max)
 Sets the minimum and maximum range allowed for the spin button.
 
void setValue (double value, bool setProg=true)
 Sets the value of the spin button.
 
void setWidthChars (unsigned chars)
 Sets the width of the spin button by number of characters.
 
void update ()
 Manually forces an update of the spin button.
 
void addSlider ()
 Adds a slider (HScale) to the left of the spinbox.
 
void setNoLeadingZeros ()
 remove leading zeros fron widget.
 
bool setNoLeadingZerosOutput ()
 
void setWidthChars (gint width_chars)
 Set the number of set width chars of entry.
 
Glib::SignalProxy< void()> signal_value_changed ()
 Signal raised when the spin button's value changes.
 
void hide_label ()
 
SpinButton const & getSpinButton () const
 
SpinButtongetSpinButton ()
 
- Public Member Functions inherited from Inkscape::UI::Widget::Labelled
 Labelled (Glib::ustring const &label, Glib::ustring const &tooltip, Gtk::Widget *widget, Glib::ustring const &icon={}, bool mnemonic=true)
 Construct a Labelled Widget.
 
Gtk::Widget const * getWidget () const
 
Gtk::Widget * getWidget ()
 
Gtk::Label const * getLabel () const
 
Gtk::Label * getLabel ()
 

Public Attributes

bool setProgrammatically
 true if the value was set by setValue, not changed by the user; if a callback checks it, it must reset it back to false.
 

Detailed Description

A labelled text box, with spin buttons and optional icon, for entering arbitrary number values.

Definition at line 31 of file scalar.h.

Constructor & Destructor Documentation

◆ Scalar() [1/3]

Inkscape::UI::Widget::Scalar::Scalar ( Glib::ustring const &  label,
Glib::ustring const &  tooltip,
Glib::ustring const &  icon = {},
bool  mnemonic = true 
)

Construct a Scalar Widget.

Parameters
labelLabel, as per the Labelled base class.
tooltipTooltip, as per the Labelled base class.
iconIcon name, placed before the label (defaults to empty).
mnemonicMnemonic toggle; if true, an underscore (_) in the label indicates the next character should be used for the mnemonic accelerator key (defaults to true).

Definition at line 24 of file scalar.cpp.

◆ Scalar() [2/3]

Inkscape::UI::Widget::Scalar::Scalar ( Glib::ustring const &  label,
Glib::ustring const &  tooltip,
unsigned  digits,
Glib::ustring const &  icon = {},
bool  mnemonic = true 
)

Construct a Scalar Widget.

Parameters
labelLabel, as per the Labelled base class.
tooltipTooltip, as per the Labelled base class.
digitsNumber of decimal digits to display.
iconIcon name, placed before the label (defaults to empty).
mnemonicMnemonic toggle; if true, an underscore (_) in the label indicates the next character should be used for the mnemonic accelerator key (defaults to true).

Definition at line 31 of file scalar.cpp.

◆ Scalar() [3/3]

Inkscape::UI::Widget::Scalar::Scalar ( Glib::ustring const &  label,
Glib::ustring const &  tooltip,
Glib::RefPtr< Gtk::Adjustment > const &  adjust,
unsigned  digits = 0,
Glib::ustring const &  icon = {},
bool  mnemonic = true 
)

Construct a Scalar Widget.

Parameters
labelLabel, as per the Labelled base class.
tooltipTooltip, as per the Labelled base class.
adjustAdjustment to use for the SpinButton.
digitsNumber of decimal digits to display (defaults to 0).
iconIcon name, placed before the label (defaults to empty).
mnemonicMnemonic toggle; if true, an underscore (_) in the label indicates the next character should be used for the mnemonic accelerator key (defaults to true).

Definition at line 39 of file scalar.cpp.

Member Function Documentation

◆ addSlider()

void Inkscape::UI::Widget::Scalar::addSlider ( )

Adds a slider (HScale) to the left of the spinbox.

Definition at line 151 of file scalar.cpp.

References getSpinButton(), Inkscape::UI::pack_start(), and scale.

◆ getDigits()

unsigned Inkscape::UI::Widget::Scalar::getDigits ( ) const

Fetches the precision of the spin button.

Definition at line 49 of file scalar.cpp.

References getSpinButton().

Referenced by Inkscape::UI::Widget::Point::getDigits(), and setNoLeadingZeros().

◆ getPage()

double Inkscape::UI::Widget::Scalar::getPage ( ) const

Gets the current page increment used by the spin button.

Definition at line 61 of file scalar.cpp.

References getSpinButton(), and page.

Referenced by Inkscape::UI::Widget::Point::getPage().

◆ getRangeMax()

double Inkscape::UI::Widget::Scalar::getRangeMax ( ) const

Gets the maximum range value allowed for the spin button.

Definition at line 75 of file scalar.cpp.

References getSpinButton().

Referenced by Inkscape::UI::Widget::Point::getRangeMax().

◆ getRangeMin()

double Inkscape::UI::Widget::Scalar::getRangeMin ( ) const

Gets the minimum range value allowed for the spin button.

Definition at line 68 of file scalar.cpp.

References getSpinButton().

Referenced by Inkscape::UI::Widget::Point::getRangeMin().

◆ getSnapToTicks()

bool Inkscape::UI::Widget::Scalar::getSnapToTicks ( ) const

◆ getSpinButton() [1/2]

SpinButton & Inkscape::UI::Widget::Scalar::getSpinButton ( )
inline

Definition at line 184 of file scalar.h.

◆ getSpinButton() [2/2]

◆ getStep()

double Inkscape::UI::Widget::Scalar::getStep ( ) const

Gets the current step increment used by the spin button.

Definition at line 54 of file scalar.cpp.

References getSpinButton(), and page.

Referenced by Inkscape::UI::Widget::Point::getStep().

◆ getValue()

◆ getValueAsInt()

int Inkscape::UI::Widget::Scalar::getValueAsInt ( ) const

Get the value spin_button represented as an integer.

Definition at line 87 of file scalar.cpp.

References getSpinButton().

Referenced by Inkscape::UI::Widget::Point::getXValueAsInt(), and Inkscape::UI::Widget::Point::getYValueAsInt().

◆ hide_label()

◆ setDigits()

◆ setIncrements()

◆ setNoLeadingZeros()

void Inkscape::UI::Widget::Scalar::setNoLeadingZeros ( )

remove leading zeros fron widget.

Definition at line 98 of file scalar.cpp.

References getDigits(), getSpinButton(), and setNoLeadingZerosOutput().

◆ setNoLeadingZerosOutput()

bool Inkscape::UI::Widget::Scalar::setNoLeadingZerosOutput ( )

Definition at line 108 of file scalar.cpp.

References getSpinButton().

Referenced by setNoLeadingZeros().

◆ setRange()

◆ setValue()

◆ setWidthChars() [1/2]

void Inkscape::UI::Widget::Scalar::setWidthChars ( gint  width_chars)

Set the number of set width chars of entry.

Definition at line 118 of file scalar.cpp.

References getSpinButton().

◆ setWidthChars() [2/2]

◆ signal_value_changed()

◆ update()

void Inkscape::UI::Widget::Scalar::update ( )

Manually forces an update of the spin button.

Definition at line 146 of file scalar.cpp.

References getSpinButton().

Referenced by Inkscape::UI::Widget::RenderingOptions::RenderingOptions(), and Inkscape::UI::Widget::Point::update().

Member Data Documentation

◆ setProgrammatically


The documentation for this class was generated from the following files: