Inkscape
Vector Graphics Editor
|
#include <registered-widget.h>
Public Member Functions | |
RegisteredScalarUnit (Glib::ustring const &label, Glib::ustring const &tip, Glib::ustring const &key, RegisteredUnitMenu &rum, Registry &wr, Inkscape::XML::Node *repr_in=nullptr, SPDocument *doc_in=nullptr, RSU_UserUnits user_units=RSU_none) | |
![]() | |
void | set_undo_parameters (Glib::ustring _event_description, Glib::ustring _icon_name, std::string undo_id="") |
void | set_xml_target (Inkscape::XML::Node *xml_node, SPDocument *document) |
bool | is_updating () const |
![]() | |
ScalarUnit (Glib::ustring const &label, Glib::ustring const &tooltip, UnitType unit_type=UNIT_TYPE_LINEAR, Glib::ustring const &icon={}, UnitMenu *unit_menu=nullptr, bool mnemonic=true) | |
Construct a ScalarUnit. | |
ScalarUnit (Glib::ustring const &label, Glib::ustring const &tooltip, ScalarUnit &take_unitmenu, Glib::ustring const &icon={}, bool mnemonic=true) | |
Construct a ScalarUnit. | |
void | initScalar (double min_value, double max_value) |
Initializes the scalar based on the settings in _unit_menu. | |
Unit const * | getUnit () const |
Gets the object for the currently selected unit. | |
UnitType | getUnitType () const |
Gets the UnitType ID for the unit. | |
double | getValue (Glib::ustring const &units) const |
Returns the value in the given unit system. | |
bool | setUnit (Glib::ustring const &units) |
Sets the unit for the ScalarUnit widget. | |
void | setUnitType (UnitType unit_type) |
Adds the unit type to the ScalarUnit widget. | |
void | resetUnitType (UnitType unit_type) |
Resets the unit type for the ScalarUnit widget. | |
void | setAlignment (double xalign) |
allow align text in entry. | |
void | setValue (double number, Glib::ustring const &units) |
Sets the number and unit system. | |
void | setValueKeepUnit (double number, Glib::ustring const &units) |
Convert and sets the number only and keeps the current unit. | |
void | setValue (double number) |
Sets the number only. | |
void | grabFocusAndSelectEntry () |
Grab focus, and select the text that is in the entry field. | |
void | setHundredPercent (double number) |
void | setAbsoluteIsIncrement (bool value) |
void | setPercentageIsIncrement (bool value) |
double | PercentageToAbsolute (double value) |
Convert value from % to absolute, using _hundred_percent and *_is_increment flags. | |
double | AbsoluteToPercentage (double value) |
Convert value from absolute to %, using _hundred_percent and *_is_increment flags. | |
double | getAsPercentage () |
Assuming the current unit is absolute, get the corresponding % value. | |
void | setFromPercentage (double value) |
Assuming the current unit is absolute, set the value corresponding to a given %. | |
void | on_unit_changed () |
Signal handler for updating the value when unit is changed. | |
![]() | |
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 () |
Protected Member Functions | |
void | on_value_changed () |
![]() | |
RegisteredWidget (Args &&...args) | |
void | init_parent (Glib::ustring const &key, Registry &wr, Inkscape::XML::Node *const repr_in, SPDocument *const doc_in) |
void | write_to_xml (const char *const svgstr) |
Private Attributes | |
sigc::scoped_connection | _value_changed_connection |
UnitMenu const * | _um |
RSU_UserUnits | _user_units |
Additional Inherited Members | |
![]() | |
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. | |
![]() | |
Registry * | _wr |
Glib::ustring | _key |
Inkscape::XML::Node * | repr |
SPDocument * | doc |
Glib::ustring | event_description |
Glib::ustring | icon_name |
bool | write_undo |
std::string | _undo_id |
![]() | |
UnitMenu * | _unit_menu |
double | _hundred_percent |
bool | _absolute_is_increment |
bool | _percentage_is_increment |
Glib::ustring | lastUnits |
Definition at line 232 of file registered-widget.h.
Inkscape::UI::Widget::RegisteredScalarUnit::RegisteredScalarUnit | ( | Glib::ustring const & | label, |
Glib::ustring const & | tip, | ||
Glib::ustring const & | key, | ||
RegisteredUnitMenu & | rum, | ||
Registry & | wr, | ||
Inkscape::XML::Node * | repr_in = nullptr , |
||
SPDocument * | doc_in = nullptr , |
||
RSU_UserUnits | user_units = RSU_none |
||
) |
Definition at line 251 of file registered-widget.cpp.
References _um, _user_units, _value_changed_connection, Inkscape::UI::Widget::UnitMenu::getUnitAbbr(), Inkscape::UI::Widget::RegisteredUnitMenu::getUnitMenu(), Inkscape::UI::Widget::RegisteredWidget< ScalarUnit >::init_parent(), Inkscape::UI::Widget::ScalarUnit::initScalar(), key, on_value_changed(), Inkscape::UI::Widget::Scalar::setDigits(), Inkscape::UI::Widget::Scalar::setProgrammatically, Inkscape::UI::Widget::ScalarUnit::setUnit(), and Inkscape::UI::Widget::Scalar::signal_value_changed().
|
protected |
Definition at line 272 of file registered-widget.cpp.
References _um, _user_units, Inkscape::UI::Widget::RegisteredWidget< ScalarUnit >::_wr, Geom::are_near(), Inkscape::UI::Widget::RegisteredWidget< ScalarUnit >::doc, Geom::EPSILON, SPDocument::getRoot(), Inkscape::UI::Widget::UnitMenu::getUnitAbbr(), Inkscape::UI::Widget::Scalar::getValue(), Inkscape::UI::Widget::Registry::isUpdating(), root, Inkscape::UI::Widget::RSU_none, Inkscape::UI::Widget::RSU_x, scale, Inkscape::UI::Widget::Scalar::setProgrammatically, Inkscape::UI::Widget::Registry::setUpdating(), Inkscape::SVGOStringStream::str(), and Inkscape::UI::Widget::RegisteredWidget< ScalarUnit >::write_to_xml().
Referenced by RegisteredScalarUnit().
|
private |
Definition at line 248 of file registered-widget.h.
Referenced by on_value_changed(), and RegisteredScalarUnit().
|
private |
Definition at line 249 of file registered-widget.h.
Referenced by on_value_changed(), and RegisteredScalarUnit().
|
private |
Definition at line 247 of file registered-widget.h.
Referenced by RegisteredScalarUnit().