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

#include <registered-widget.h>

Inheritance diagram for Inkscape::UI::Widget::RegisteredVector:
Inkscape::UI::Widget::RegisteredWidget< Point > Inkscape::UI::Widget::Point Inkscape::UI::Widget::Labelled

Public Member Functions

 RegisteredVector (Glib::ustring const &label, Glib::ustring const &tip, Glib::ustring const &key, Registry &wr, Inkscape::XML::Node *repr_in=nullptr, SPDocument *doc_in=nullptr)
 
void setValue (Geom::Point const &p)
 
void setValue (Geom::Point const &p, Geom::Point const &origin)
 
void setPolarCoords (bool polar_coords=true)
 Changes the widgets text to polar coordinates.
 
- Public Member Functions inherited from Inkscape::UI::Widget::RegisteredWidget< Point >
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
 
- Public Member Functions inherited from Inkscape::UI::Widget::Point
 Point (Glib::ustring const &label, Glib::ustring const &tooltip, Glib::ustring const &icon={}, bool mnemonic=true)
 Construct a Point Widget.
 
 Point (Glib::ustring const &label, Glib::ustring const &tooltip, unsigned digits, Glib::ustring const &icon={}, bool mnemonic=true)
 Construct a Point Widget.
 
 Point (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 Point 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 getXValue () const
 Get the value in the spin_button.
 
double getYValue () const
 
Geom::Point getValue () const
 
int getXValueAsInt () const
 Get the value spin_button represented as an integer.
 
int getYValueAsInt () const
 
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 (Geom::Point const &p)
 Sets the value of the spin button.
 
void update ()
 Manually forces an update of the spin button.
 
Glib::SignalProxy< void()> signal_x_value_changed ()
 Signal raised when the spin button's value changes.
 
Glib::SignalProxy< void()> signal_y_value_changed ()
 
bool setProgrammatically ()
 Check 'setProgrammatically' of both scalar widgets.
 
void clearProgrammatically ()
 
- 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 ()
 

Protected Member Functions

void on_value_changed ()
 
- Protected Member Functions inherited from Inkscape::UI::Widget::RegisteredWidget< Point >
 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_x_changed_connection
 
sigc::scoped_connection _value_y_changed_connection
 
Geom::Point _origin
 
bool _polar_coords
 

Additional Inherited Members

- Protected Attributes inherited from Inkscape::UI::Widget::RegisteredWidget< Point >
Registry_wr
 
Glib::ustring _key
 
Inkscape::XML::Noderepr
 
SPDocumentdoc
 
Glib::ustring event_description
 
Glib::ustring icon_name
 
bool write_undo
 
std::string _undo_id
 
- Protected Attributes inherited from Inkscape::UI::Widget::Point
Scalar xwidget
 
Scalar ywidget
 

Detailed Description

Definition at line 350 of file registered-widget.h.

Constructor & Destructor Documentation

◆ RegisteredVector()

Member Function Documentation

◆ on_value_changed()

◆ setPolarCoords()

void Inkscape::UI::Widget::RegisteredVector::setPolarCoords ( bool  polar_coords = true)

Changes the widgets text to polar coordinates.

The SVG output will still be a normal cartesian vector. Careful: when calling getValue(), the return value's X-coord will be the angle, Y-value will be the distance/length. After changing the coords type (polar/non-polar), the value has to be reset (setValue).

Definition at line 603 of file registered-widget.cpp.

References _polar_coords, Inkscape::UI::Widget::Labelled::getLabel(), Inkscape::UI::Widget::Point::xwidget, and Inkscape::UI::Widget::Point::ywidget.

◆ setValue() [1/2]

void Inkscape::UI::Widget::RegisteredVector::setValue ( Geom::Point const &  p)

Definition at line 584 of file registered-widget.cpp.

References _polar_coords, Geom::Point::length(), Geom::X, and Geom::Y.

Referenced by setValue().

◆ setValue() [2/2]

void Inkscape::UI::Widget::RegisteredVector::setValue ( Geom::Point const &  p,
Geom::Point const &  origin 
)

Definition at line 597 of file registered-widget.cpp.

References _origin, origin, and setValue().

Member Data Documentation

◆ _origin

Geom::Point Inkscape::UI::Widget::RegisteredVector::_origin
private

Definition at line 376 of file registered-widget.h.

Referenced by on_value_changed(), and setValue().

◆ _polar_coords

bool Inkscape::UI::Widget::RegisteredVector::_polar_coords
private

Definition at line 377 of file registered-widget.h.

Referenced by on_value_changed(), setPolarCoords(), and setValue().

◆ _value_x_changed_connection

sigc::scoped_connection Inkscape::UI::Widget::RegisteredVector::_value_x_changed_connection
private

Definition at line 374 of file registered-widget.h.

Referenced by RegisteredVector().

◆ _value_y_changed_connection

sigc::scoped_connection Inkscape::UI::Widget::RegisteredVector::_value_y_changed_connection
private

Definition at line 375 of file registered-widget.h.

Referenced by RegisteredVector().


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