3 * Copyright 1995-2002 the LyX Team
4 * Read the file COPYING
6 * \author Lars Gullik Bjønnes <larsbj@lyx.org>
12 #pragma implementation "Toolbar.h"
16 #include "ToolbarDefaults.h"
17 #include "Toolbar_pimpl.h"
19 #include "LyXAction.h"
23 extern LyXAction lyxaction;
26 Toolbar::Toolbar(LyXView * o, int x, int y, ToolbarDefaults const &tbd)
29 pimpl_ = new Pimpl(o, x, y);
33 // extracts the toolbar actions from tbd
34 for (ToolbarDefaults::const_iterator cit = tbd.begin();
35 cit != tbd.end(); ++cit) {
37 lyxerr[Debug::GUI] << "tool action: "
49 void Toolbar::set(bool doingmain)
51 pimpl_->set(doingmain);
55 void Toolbar::activate()
61 void Toolbar::deactivate()
67 void Toolbar::update()
74 void Toolbar::setLayout(string const & layout)
76 pimpl_->setLayout(layout);
80 bool Toolbar::updateLayoutList(int textclass)
82 // update the layout display
83 if (last_textclass_ != textclass) {
84 pimpl_->updateLayoutList(true);
85 last_textclass_ = textclass;
88 pimpl_->updateLayoutList(false);
94 void Toolbar::openLayoutList()
96 pimpl_->openLayoutList();
100 void Toolbar::clearLayoutList()
102 pimpl_->clearLayoutList();
106 void Toolbar::push(int nth)
112 void Toolbar::add(string const & func, bool doclean)
114 int const tf = lyxaction.LookupFunc(func);
117 lyxerr << "Toolbar::add: no LyX command called`"
118 << func << "'exists!" << endl;
120 pimpl_->add(tf, doclean);