1 /**
2 * \brief Point Widget - A labelled text box, with spin buttons and optional
3 * icon or suffix, for entering arbitrary coordinate values.
4 *
5 * Authors:
6 * Johan Engelen <j.b.c.engelen@utwente.nl>
7 * Carl Hetherington <inkscape@carlh.net>
8 * Derek P. Moore <derekm@hackunix.org>
9 * Bryce Harrington <bryce@bryceharrington.org>
10 *
11 * Copyright (C) 2007 Authors
12 * Copyright (C) 2004 Authors
13 *
14 * Released under GNU GPL. Read the file 'COPYING' for more information.
15 */
17 #ifndef INKSCAPE_UI_WIDGET_POINT_H
18 #define INKSCAPE_UI_WIDGET_POINT_H
20 #include <gtkmm/adjustment.h>
21 #include <gtkmm/spinbutton.h>
23 #include "ui/widget/labelled.h"
24 #include "ui/widget/scalar.h"
26 namespace Inkscape {
27 namespace UI {
28 namespace Widget {
30 class Point : public Labelled
31 {
32 public:
33 Point( Glib::ustring const &label,
34 Glib::ustring const &tooltip,
35 Glib::ustring const &suffix = "",
36 Glib::ustring const &icon = "",
37 bool mnemonic = true);
38 Point( Glib::ustring const &label,
39 Glib::ustring const &tooltip,
40 unsigned digits,
41 Glib::ustring const &suffix = "",
42 Glib::ustring const &icon = "",
43 bool mnemonic = true);
44 Point( Glib::ustring const &label,
45 Glib::ustring const &tooltip,
46 Gtk::Adjustment &adjust,
47 unsigned digits = 0,
48 Glib::ustring const &suffix = "",
49 Glib::ustring const &icon = "",
50 bool mnemonic = true);
52 unsigned getDigits() const;
53 double getStep() const;
54 double getPage() const;
55 double getRangeMin() const;
56 double getRangeMax() const;
57 bool getSnapToTicks() const;
58 double getXValue() const;
59 double getYValue() const;
60 int getXValueAsInt() const;
61 int getYValueAsInt() const;
63 void setDigits(unsigned digits);
64 void setIncrements(double step, double page);
65 void setRange(double min, double max);
66 void setValue(double xvalue, double yvalue);
68 void update();
70 Glib::SignalProxy0<void> signal_x_value_changed();
71 Glib::SignalProxy0<void> signal_y_value_changed();
73 bool setProgrammatically(); // true if the value was set by setValue, not changed by the user;
74 // if a callback checks it, it must reset it back to false
75 void clearProgrammatically();
77 protected:
78 Scalar xwidget, ywidget;
80 };
82 } // namespace Widget
83 } // namespace UI
84 } // namespace Inkscape
86 #endif // INKSCAPE_UI_WIDGET_POINT_H
88 /*
89 Local Variables:
90 mode:c++
91 c-file-style:"stroustrup"
92 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
93 indent-tabs-mode:nil
94 fill-column:99
95 End:
96 */
97 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :