Inkscape
Vector Graphics Editor
|
A labelled text box, with spin buttons and optional icon, for entering arbitrary number values. More...
#include <scalar.h>
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 |
SpinButton & | getSpinButton () |
![]() | |
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. | |
A labelled text box, with spin buttons and optional icon, for entering arbitrary number values.
Inkscape::UI::Widget::Scalar::Scalar | ( | Glib::ustring const & | label, |
Glib::ustring const & | tooltip, | ||
Glib::ustring const & | icon = {} , |
||
bool | mnemonic = true |
||
) |
label | Label, as per the Labelled base class. |
tooltip | Tooltip, as per the Labelled base class. |
icon | Icon name, placed before the label (defaults to empty). |
mnemonic | Mnemonic 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.
Inkscape::UI::Widget::Scalar::Scalar | ( | Glib::ustring const & | label, |
Glib::ustring const & | tooltip, | ||
unsigned | digits, | ||
Glib::ustring const & | icon = {} , |
||
bool | mnemonic = true |
||
) |
label | Label, as per the Labelled base class. |
tooltip | Tooltip, as per the Labelled base class. |
digits | Number of decimal digits to display. |
icon | Icon name, placed before the label (defaults to empty). |
mnemonic | Mnemonic 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.
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 |
||
) |
label | Label, as per the Labelled base class. |
tooltip | Tooltip, as per the Labelled base class. |
adjust | Adjustment to use for the SpinButton. |
digits | Number of decimal digits to display (defaults to 0). |
icon | Icon name, placed before the label (defaults to empty). |
mnemonic | Mnemonic 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.
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.
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().
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().
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().
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().
bool Inkscape::UI::Widget::Scalar::getSnapToTicks | ( | ) | const |
|
inline |
SpinButton const & Inkscape::UI::Widget::Scalar::getSpinButton | ( | ) | const |
Definition at line 177 of file scalar.cpp.
References Inkscape::UI::Widget::Labelled::getWidget().
Referenced by Inkscape::UI::Dialog::GuidelinePropertiesDialog::_setup(), addSlider(), getDigits(), getPage(), getRangeMax(), getRangeMin(), getStep(), getValue(), getValueAsInt(), Inkscape::UI::Widget::ScalarUnit::grabFocusAndSelectEntry(), Inkscape::LivePathEffect::LPESimplify::newWidget(), Inkscape::UI::Widget::ScalarUnit::ScalarUnit(), Inkscape::UI::Widget::ScalarUnit::setAlignment(), setDigits(), setIncrements(), setNoLeadingZeros(), setNoLeadingZerosOutput(), setRange(), setValue(), setWidthChars(), setWidthChars(), signal_value_changed(), and update().
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().
double Inkscape::UI::Widget::Scalar::getValue | ( | ) | const |
Get the value in the spin_button.
Definition at line 82 of file scalar.cpp.
References getSpinButton().
Referenced by Inkscape::UI::Dialog::Transformation::applyPageTransform(), Inkscape::UI::Widget::RenderingOptions::bitmap_dpi(), Inkscape::UI::Widget::ScalarUnit::getAsPercentage(), Inkscape::UI::Widget::ScalarUnit::getValue(), Inkscape::UI::Widget::Point::getXValue(), Inkscape::UI::Widget::Point::getYValue(), Inkscape::UI::Widget::PrefSpinUnit::on_my_value_changed(), Inkscape::UI::Widget::ScalarUnit::on_unit_changed(), Inkscape::UI::Widget::RegisteredScalarUnit::on_value_changed(), Inkscape::UI::Widget::RegisteredScalar::on_value_changed(), Inkscape::UI::Widget::RegisteredInteger::on_value_changed(), Inkscape::UI::Widget::RegisteredRandom::on_value_changed(), Inkscape::LivePathEffect::ScalarArrayParam::on_value_changed(), and Inkscape::UI::Dialog::Transformation::onReplaceMatrixToggled().
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().
void Inkscape::UI::Widget::Scalar::hide_label | ( | ) |
Definition at line 163 of file scalar.cpp.
References Inkscape::UI::Widget::Labelled::getLabel(), Inkscape::UI::Widget::Labelled::getWidget(), label, Inkscape::UI::pack_end(), and remove().
Referenced by Inkscape::UI::Dialog::Transformation::layoutPageTransform().
void Inkscape::UI::Widget::Scalar::setDigits | ( | unsigned | digits | ) |
Sets the precision to be displayed by the spin button.
Definition at line 93 of file scalar.cpp.
References getSpinButton().
Referenced by Inkscape::UI::Dialog::GuidelinePropertiesDialog::_setup(), Inkscape::UI::Dialog::GridArrangeTab::GridArrangeTab(), Inkscape::UI::Widget::PrefSpinUnit::init(), Inkscape::UI::Widget::ScalarUnit::initScalar(), Inkscape::UI::Dialog::Transformation::layoutPageMove(), Inkscape::UI::Dialog::Transformation::layoutPageRotate(), Inkscape::UI::Dialog::Transformation::layoutPageScale(), Inkscape::UI::Dialog::Transformation::layoutPageSkew(), Inkscape::UI::Dialog::Transformation::layoutPageTransform(), Inkscape::UI::Dialog::PolarArrangeTab::PolarArrangeTab(), Inkscape::UI::Widget::RegisteredRandom::RegisteredRandom(), Inkscape::UI::Widget::RegisteredScalar::RegisteredScalar(), Inkscape::UI::Widget::RegisteredScalarUnit::RegisteredScalarUnit(), Inkscape::UI::Widget::RenderingOptions::RenderingOptions(), and Inkscape::UI::Widget::Point::setDigits().
void Inkscape::UI::Widget::Scalar::setIncrements | ( | double | step, |
double | page | ||
) |
Sets the step and page increments for the spin button.
Definition at line 122 of file scalar.cpp.
References getSpinButton().
Referenced by Inkscape::UI::Dialog::GuidelinePropertiesDialog::_setup(), Inkscape::UI::Dialog::GridArrangeTab::GridArrangeTab(), Inkscape::UI::Widget::PrefSpinUnit::init(), Inkscape::UI::Widget::ScalarUnit::initScalar(), Inkscape::UI::Dialog::Transformation::layoutPageMove(), Inkscape::UI::Dialog::Transformation::layoutPageRotate(), Inkscape::UI::Dialog::Transformation::layoutPageScale(), Inkscape::UI::Dialog::Transformation::layoutPageSkew(), Inkscape::UI::Dialog::Transformation::layoutPageTransform(), Inkscape::UI::Dialog::PolarArrangeTab::PolarArrangeTab(), Inkscape::UI::Widget::RegisteredRandom::RegisteredRandom(), Inkscape::UI::Widget::RegisteredScalar::RegisteredScalar(), Inkscape::UI::Widget::RenderingOptions::RenderingOptions(), and Inkscape::UI::Widget::Point::setIncrements().
void Inkscape::UI::Widget::Scalar::setNoLeadingZeros | ( | ) |
remove leading zeros fron widget.
Definition at line 98 of file scalar.cpp.
References getDigits(), getSpinButton(), and setNoLeadingZerosOutput().
bool Inkscape::UI::Widget::Scalar::setNoLeadingZerosOutput | ( | ) |
Definition at line 108 of file scalar.cpp.
References getSpinButton().
Referenced by setNoLeadingZeros().
void Inkscape::UI::Widget::Scalar::setRange | ( | double | min, |
double | max | ||
) |
Sets the minimum and maximum range allowed for the spin button.
Definition at line 127 of file scalar.cpp.
References getSpinButton().
Referenced by Inkscape::UI::Dialog::GuidelinePropertiesDialog::_setup(), Inkscape::UI::Dialog::GridArrangeTab::GridArrangeTab(), Inkscape::UI::Widget::PrefSpinUnit::init(), Inkscape::UI::Widget::ScalarUnit::initScalar(), Inkscape::UI::Dialog::Transformation::layoutPageTransform(), Inkscape::UI::Dialog::PolarArrangeTab::PolarArrangeTab(), Inkscape::UI::Widget::RegisteredRandom::RegisteredRandom(), Inkscape::UI::Widget::RegisteredScalar::RegisteredScalar(), Inkscape::UI::Widget::RenderingOptions::RenderingOptions(), and Inkscape::UI::Widget::Point::setRange().
void Inkscape::UI::Widget::Scalar::setValue | ( | double | value, |
bool | setProg = true |
||
) |
Sets the value of the spin button.
Definition at line 132 of file scalar.cpp.
References getSpinButton(), and setProgrammatically.
Referenced by Inkscape::UI::Dialog::Transformation::layoutPageTransform(), Inkscape::UI::Widget::ScalarUnit::on_unit_changed(), Inkscape::UI::Dialog::Transformation::onClear(), Inkscape::UI::Dialog::Transformation::onReplaceMatrixToggled(), Inkscape::UI::Widget::RenderingOptions::RenderingOptions(), Inkscape::UI::Widget::ScalarUnit::setFromPercentage(), Inkscape::UI::Widget::ScalarUnit::setValue(), Inkscape::UI::Widget::ScalarUnit::setValue(), Inkscape::UI::Widget::RegisteredRandom::setValue(), Inkscape::UI::Widget::Point::setValue(), Inkscape::UI::Widget::ScalarUnit::setValueKeepUnit(), and Inkscape::UI::Dialog::Transformation::updatePageTransform().
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().
void Inkscape::UI::Widget::Scalar::setWidthChars | ( | unsigned | chars | ) |
Sets the width of the spin button by number of characters.
Definition at line 141 of file scalar.cpp.
References getSpinButton().
Referenced by Inkscape::UI::Dialog::GuidelinePropertiesDialog::_setup(), Inkscape::UI::Dialog::Transformation::layoutPageMove(), Inkscape::UI::Dialog::Transformation::layoutPageScale(), Inkscape::UI::Dialog::Transformation::layoutPageSkew(), and Inkscape::UI::Dialog::Transformation::layoutPageTransform().
Glib::SignalProxy< void()> Inkscape::UI::Widget::Scalar::signal_value_changed | ( | ) |
Signal raised when the spin button's value changes.
Definition at line 158 of file scalar.cpp.
References getSpinButton().
Referenced by Inkscape::UI::Dialog::GridArrangeTab::GridArrangeTab(), Inkscape::UI::Widget::PrefSpinUnit::init(), Inkscape::UI::Dialog::Transformation::layoutPageMove(), Inkscape::UI::Dialog::Transformation::layoutPageRotate(), Inkscape::UI::Dialog::Transformation::layoutPageScale(), Inkscape::UI::Dialog::Transformation::layoutPageSkew(), Inkscape::UI::Dialog::Transformation::layoutPageTransform(), Inkscape::LivePathEffect::LPEBSpline::newWidget(), Inkscape::LivePathEffect::LPEFilletChamfer::newWidget(), Inkscape::UI::Widget::RegisteredRandom::RegisteredRandom(), Inkscape::UI::Widget::RegisteredScalar::RegisteredScalar(), Inkscape::UI::Widget::RegisteredScalarUnit::RegisteredScalarUnit(), Inkscape::UI::Widget::Point::signal_x_value_changed(), and Inkscape::UI::Widget::Point::signal_y_value_changed().
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().
bool Inkscape::UI::Widget::Scalar::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.
Definition at line 178 of file scalar.h.
Referenced by Inkscape::UI::Widget::Point::clearProgrammatically(), Inkscape::UI::Widget::RegisteredScalarUnit::on_value_changed(), Inkscape::UI::Widget::RegisteredScalar::on_value_changed(), Inkscape::UI::Widget::RegisteredRandom::on_value_changed(), Inkscape::LivePathEffect::ScalarArrayParam::on_value_changed(), Inkscape::UI::Dialog::Transformation::onScaleProportionalToggled(), Inkscape::UI::Dialog::Transformation::onScaleXValueChanged(), Inkscape::UI::Dialog::Transformation::onScaleYValueChanged(), Inkscape::UI::Widget::RegisteredRandom::RegisteredRandom(), Inkscape::UI::Widget::RegisteredScalar::RegisteredScalar(), Inkscape::UI::Widget::RegisteredScalarUnit::RegisteredScalarUnit(), Inkscape::UI::Widget::Point::setProgrammatically(), and setValue().