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::activate()
62 void Toolbar::deactivate()
68 void Toolbar::update()
75 void Toolbar::setLayout(string const & layout)
77 pimpl_->setLayout(layout);
81 bool Toolbar::updateLayoutList(int textclass)
83 // update the layout display
84 if (last_textclass_ != textclass) {
85 pimpl_->updateLayoutList(true);
86 last_textclass_ = textclass;
89 pimpl_->updateLayoutList(false);
95 void Toolbar::openLayoutList()
97 pimpl_->openLayoutList();
101 void Toolbar::clearLayoutList()
103 pimpl_->clearLayoutList();
107 void Toolbar::push(int nth)
113 void Toolbar::add(string const & func, bool doclean)
115 int const tf = lyxaction.LookupFunc(func);
118 lyxerr << "Toolbar::add: no LyX command called`"
119 << func << "'exists!" << endl;
121 pimpl_->add(tf, doclean);