]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GBox.h
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / gtk / GBox.h
1 // -*- C++ -*-
2 /**
3  * \file GBox.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Spray
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef GBOX_H
13 #define GBOX_H
14
15 #include "GViewBase.h"
16
17 #include "lyxlength.h"
18
19 #include <vector>
20 #include <string>
21
22 namespace lyx {
23 namespace frontend {
24
25 class ControlBox;
26
27 class GBox
28         : public GViewCB<ControlBox, GViewGladeB>
29 {
30 public:
31         GBox(Dialog &);
32
33         // This dialog is instant-apply
34         virtual void apply() {}
35         // update
36         virtual void update();
37         // build the dialog
38         virtual void doBuild();
39
40         // Put strings into combo
41         void PopulateComboBox(Gtk::ComboBox * combo,
42                                   std::vector<std::string> const & strings);
43
44         // add or remove special lengths in widthunits combo
45         void setSpecial(bool ibox);
46         // only show valid inner box options
47         void updateInnerBoxCombo();
48
49         // Signal handlers
50         void onTypeComboChanged();
51         void onInnerBoxComboChanged();
52         void onAlignChanged();
53         void onHeightChanged();
54         void onWidthChanged();
55
56         // Some event handlers are disabled when this is true
57         bool applylock_;
58
59         // The 'type' field keys and display strings
60         std::vector<std::string> ids_;
61         std::vector<std::string> gui_names_;
62
63         // The special units for width and height
64         std::vector<std::string> ids_spec_;
65         std::vector<std::string> gui_names_spec_;
66
67         // Widgets from glade
68         Gtk::ComboBox * typecombo_;
69         Gtk::ComboBox * innerboxcombo_;
70         Glib::RefPtr<Gtk::ListStore> innerboxstore_;
71         Gtk::ComboBox * widthunitscombo_;
72         Glib::RefPtr<Gtk::ListStore> widthunitsstore_;
73         Gtk::ComboBox * heightunitscombo_;
74         Gtk::ComboBox * boxvertcombo_;
75         Gtk::ComboBox * contentvertcombo_;
76         Gtk::ComboBox * contenthorzcombo_;
77         Gtk::SpinButton * widthspin_;
78         Gtk::SpinButton * heightspin_;
79
80         // Treemodel objects for use in combobox liststores
81         Gtk::TreeModelColumn<Glib::ustring> stringcol_;
82         Gtk::TreeModel::ColumnRecord cols_;
83 };
84
85 } // namespace frontend
86 } // namespace lyx
87
88 #endif // GBOX_H