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 "Toolbar_pimpl.h"
18 #include "LyXAction.h"
22 extern LyXAction lyxaction;
25 Toolbar::Toolbar(LyXView * o, int x, int y, ToolbarDefaults const &tbd)
28 pimpl_ = new Pimpl(o, x, y);
32 // extracts the toolbar actions from tbd
33 for (ToolbarDefaults::const_iterator cit = tbd.begin();
34 cit != tbd.end(); ++cit) {
36 lyxerr[Debug::GUI] << "tool action: "
48 void Toolbar::set(bool doingmain)
50 pimpl_->set(doingmain);
54 void Toolbar::activate()
60 void Toolbar::deactivate()
66 void Toolbar::update()
73 void Toolbar::setLayout(string const & layout)
75 pimpl_->setLayout(layout);
79 bool Toolbar::updateLayoutList(int textclass)
81 // update the layout display
82 if (last_textclass_ != textclass) {
83 pimpl_->updateLayoutList(true);
84 last_textclass_ = textclass;
87 pimpl_->updateLayoutList(false);
93 void Toolbar::openLayoutList()
95 pimpl_->openLayoutList();
99 void Toolbar::clearLayoutList()
101 pimpl_->clearLayoutList();
105 void Toolbar::push(int nth)
111 void Toolbar::add(string const & func, bool doclean)
113 int const tf = lyxaction.LookupFunc(func);
116 lyxerr << "Toolbar::add: no LyX command called`"
117 << func << "'exists!" << endl;
119 pimpl_->add(tf, doclean);