~vaifrax/inkscape/bugfix170049

« back to all changes in this revision

Viewing changes to src/ui/widget/preferences-widget.h

  • Committer: mental
  • Date: 2006-01-16 02:36:01 UTC
  • Revision ID: mental@users.sourceforge.net-20060116023601-wkr0h7edl5veyudq
moving trunk for module inkscape

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * \brief Inkscape Preferences dialog
 
3
 *
 
4
 * Authors:
 
5
 *   Marco Scholten
 
6
 *
 
7
 * Copyright (C) 2004, 2006 Authors
 
8
 *
 
9
 * Released under GNU GPL.  Read the file 'COPYING' for more information.
 
10
 */
 
11
 
 
12
#ifndef INKSCAPE_UI_WIDGET_INKSCAPE_PREFERENCES_H
 
13
#define INKSCAPE_UI_WIDGET_INKSCAPE_PREFERENCES_H
 
14
 
 
15
#include <iostream>
 
16
#include <vector>
 
17
#include <gtkmm/table.h>
 
18
#include <gtkmm/comboboxtext.h>
 
19
#include <gtkmm/spinbutton.h>
 
20
#include <gtkmm/tooltips.h>
 
21
#include <gtkmm/treeview.h>
 
22
#include <gtkmm/radiobutton.h>
 
23
#include <gtkmm/frame.h>
 
24
#include <sigc++/sigc++.h>
 
25
//#include <glibmm/i18n.h>
 
26
 
 
27
namespace Inkscape {
 
28
namespace UI {
 
29
namespace Widget {
 
30
 
 
31
class PrefCheckButton : public Gtk::CheckButton
 
32
{
 
33
public:
 
34
    void init(const Glib::ustring& label, const std::string& prefs_path, const std::string& attr, 
 
35
              bool default_value);
 
36
protected:
 
37
    std::string _prefs_path;
 
38
    std::string _attr;
 
39
    bool _int_value;
 
40
    void on_toggled();
 
41
};
 
42
 
 
43
class PrefRadioButton : public Gtk::RadioButton
 
44
{
 
45
public:
 
46
    void init(const Glib::ustring& label, const std::string& prefs_path, const std::string& attr, 
 
47
              int int_value, bool default_value, PrefRadioButton* group_member);
 
48
    void init(const Glib::ustring& label, const std::string& prefs_path, const std::string& attr, 
 
49
              const std::string& string_value, bool default_value, PrefRadioButton* group_member);
 
50
    sigc::signal<void, bool> changed_signal;
 
51
protected:
 
52
    std::string _prefs_path;
 
53
    std::string _attr;
 
54
    std::string _string_value;
 
55
    int _value_type;
 
56
    enum
 
57
    {
 
58
        VAL_INT,
 
59
        VAL_STRING
 
60
    };
 
61
    int _int_value;
 
62
    void on_toggled();
 
63
};
 
64
 
 
65
class PrefSpinButton : public Gtk::SpinButton
 
66
{
 
67
public:
 
68
    void init(const std::string& prefs_path, const std::string& attr,
 
69
              double lower, double upper, double step_increment, double page_increment, 
 
70
              double default_value, bool is_int, bool is_percent);
 
71
protected:
 
72
    std::string _prefs_path;
 
73
    std::string _attr;
 
74
    bool _is_int;
 
75
    bool _is_percent;
 
76
    void on_value_changed();
 
77
};
 
78
 
 
79
class PrefCombo : public Gtk::ComboBoxText
 
80
{
 
81
public:
 
82
    void init(const std::string& prefs_path, const std::string& attr,
 
83
              Glib::ustring labels[], int values[], int num_items, int default_value);
 
84
protected:
 
85
    std::string _prefs_path;
 
86
    std::string _attr;
 
87
    std::vector<int> _values;
 
88
    void on_changed();
 
89
};
 
90
 
 
91
class DialogPage : public Gtk::Table
 
92
{
 
93
public:
 
94
    DialogPage();
 
95
    void add_line(bool indent, const Glib::ustring label, Gtk::Widget& widget, const Glib::ustring suffix, const Glib::ustring& tip, bool expand = true);
 
96
    void add_group_header(Glib::ustring name);
 
97
protected:
 
98
    Gtk::Tooltips _tooltips;
 
99
};
 
100
 
 
101
 
 
102
} // namespace Widget
 
103
} // namespace UI
 
104
} // namespace Inkscape
 
105
 
 
106
#endif //INKSCAPE_UI_WIDGET_INKSCAPE_PREFERENCES_H
 
107
 
 
108
/* 
 
109
  Local Variables:
 
110
  mode:c++
 
111
  c-file-style:"stroustrup"
 
112
  c-file-offsets:((innamespace . 0)(inline-open . 0))
 
113
  indent-tabs-mode:nil
 
114
  fill-column:99
 
115
  End:
 
116
*/
 
117
// vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :