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