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, Dialogs & d,
27 int x, int y, ToolbarDefaults const &tbd)
30 pimpl_ = new Pimpl(o, d, x, y);
34 // extracts the toolbar actions from tbd
35 for (ToolbarDefaults::const_iterator cit = tbd.begin();
36 cit != tbd.end(); ++cit) {
38 lyxerr[Debug::GUI] << "tool action: "
50 void Toolbar::set(bool doingmain)
52 pimpl_->set(doingmain);
56 void Toolbar::update()
63 void Toolbar::setLayout(string const & layout)
65 pimpl_->setLayout(layout);
69 bool Toolbar::updateLayoutList(int textclass)
71 // update the layout display
72 if (last_textclass_ != textclass) {
73 pimpl_->updateLayoutList(true);
74 last_textclass_ = textclass;
77 pimpl_->updateLayoutList(false);
83 void Toolbar::openLayoutList()
85 pimpl_->openLayoutList();
89 void Toolbar::clearLayoutList()
91 pimpl_->clearLayoutList();
95 void Toolbar::add(string const & func, bool doclean)
97 int const tf = lyxaction.LookupFunc(func);
100 lyxerr << "Toolbar::add: no LyX command called`"
101 << func << "'exists!" << endl;
103 pimpl_->add(tf, doclean);