]> git.lyx.org Git - lyx.git/blob - src/frontends/Toolbar.C
Fix xforms menus display problems
[lyx.git] / src / frontends / Toolbar.C
1 /* This file is part of
2  * ====================================================== 
3  * 
4  *           LyX, The Document Processor
5  *
6  *           Copyright 1995 Matthias Ettrich
7  *           Copyright 1995-2000 The LyX Team.
8  *
9  *           This file is Copyright 1996-1998
10  *           Lars Gullik Bjønnes
11  *
12  * ====================================================== */
13
14 //  Added pseudo-action handling, asierra 180296
15
16 #include <config.h>
17
18 #ifdef __GNUG__
19 #pragma implementation "Toolbar.h"
20 #endif
21
22 #include "Toolbar.h"
23 #include "Toolbar_pimpl.h"
24 #include "debug.h"
25 #include "LyXAction.h"
26
27 using std::endl;
28
29 extern LyXAction lyxaction;
30
31
32 Toolbar::Toolbar(LyXView * o, int x, int y, ToolbarDefaults const &tbd)
33 {
34         pimpl_ = new Pimpl(o, x, y);
35
36         pimpl_->reset();
37
38         // extracts the toolbar actions from tbd
39         for (ToolbarDefaults::const_iterator cit = tbd.begin();
40              cit != tbd.end(); ++cit) {
41                 pimpl_->add((*cit));
42                 lyxerr[Debug::GUI] << "tool action: "
43                                        << (*cit) << endl;
44         }
45 }
46
47 Toolbar::~Toolbar()
48 {
49         delete pimpl_;
50 }
51
52
53 void Toolbar::set(bool doingmain)
54 {
55         pimpl_->set(doingmain);
56 }
57
58
59 void Toolbar::activate()
60 {
61         pimpl_->activate();
62 }
63
64
65 void Toolbar::deactivate()
66 {
67         pimpl_->deactivate();
68 }
69
70
71 void Toolbar::update()
72 {
73         pimpl_->update();
74 }
75
76
77 void Toolbar::setLayout(int layout)
78 {
79         pimpl_->setLayout(layout);
80 }
81
82
83 void Toolbar::updateLayoutList(bool force)
84 {
85         pimpl_->updateLayoutList(force);
86 }
87
88                 
89 void Toolbar::openLayoutList()
90 {
91         pimpl_->openLayoutList();
92 }
93
94
95 void Toolbar::clearLayoutList()
96 {
97         pimpl_->clearLayoutList();
98 }
99
100
101 void Toolbar::push(int nth)
102 {
103         pimpl_->push(nth);
104 }
105
106
107 void Toolbar::add(string const & func, bool doclean)
108 {
109         int tf = lyxaction.LookupFunc(func);
110
111         if (tf == -1) {
112                 lyxerr << "Toolbar::add: no LyX command called`"
113                        << func << "'exists!" << endl; 
114         } else {
115                 pimpl_->add(tf, doclean);
116         }
117 }
118
119