]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Toolbar.C
namespace grfx -> lyx::graphics
[lyx.git] / src / frontends / Toolbar.C
index 9f4bfecc7f8ed224a3426898420260ee969f6f70..b243030f9049d20f085391061a4af0e1a3be14df 100644 (file)
 
 using std::endl;
 
-Toolbar::Toolbar(LyXView * o, int x, int y, ToolbarBackend const & backend)
+Toolbar::Toolbar(LyXView * o, int x, int y)
        : last_textclass_(-1)
 {
        pimpl_ = new Pimpl(o, x, y);
 
-       // extracts the toolbar actions from  the backend
-       for (ToolbarBackend::const_iterator cit = backend.begin();
-            cit != backend.end(); ++cit) {
-               pimpl_->add((*cit));
-               lyxerr[Debug::GUI] << "tool action: " << (*cit) << endl;
-       }
+       // extracts the toolbars from the backend
+       ToolbarBackend::Toolbars::const_iterator cit = toolbarbackend.begin();
+       ToolbarBackend::Toolbars::const_iterator end = toolbarbackend.end();
+
+       for (; cit != end; ++cit)
+               pimpl_->add(*cit);
 }
 
 
@@ -39,9 +39,20 @@ Toolbar::~Toolbar()
 }
 
 
-void Toolbar::update()
+void Toolbar::update(bool in_math, bool in_table)
 {
        pimpl_->update();
+
+       // extracts the toolbars from the backend
+       ToolbarBackend::Toolbars::const_iterator cit = toolbarbackend.begin();
+       ToolbarBackend::Toolbars::const_iterator end = toolbarbackend.end();
+
+       for (; cit != end; ++cit) {
+               if (cit->flags & ToolbarBackend::MATH)
+                       pimpl_->displayToolbar(*cit, in_math);
+               else if (cit->flags & ToolbarBackend::TABLE)
+                       pimpl_->displayToolbar(*cit, in_table);
+       }
 }