lyx_mirror/src/frontends/Toolbar.C
Angus Leeming ffdb0baea3 Get rid of trailing whitespace 'noise' in future patches for the
forseeable future.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7724 a592a061-630c-0410-9148-cb99ea01b6c8
2003-09-09 18:27:24 +00:00

75 lines
1.4 KiB
C

/**
* \file Toolbar.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Lars Gullik Bjønnes
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "Toolbar.h"
#include "debug.h"
#include "LyXAction.h"
#include "ToolbarBackend.h"
Toolbar::Toolbar()
: last_textclass_(-1)
{
}
Toolbar::~Toolbar()
{
}
void Toolbar::init()
{
// extracts the toolbars from the backend
ToolbarBackend::Toolbars::const_iterator cit = toolbarbackend.begin();
ToolbarBackend::Toolbars::const_iterator end = toolbarbackend.end();
for (; cit != end; ++cit)
add(*cit);
}
void Toolbar::update(bool in_math, bool in_table)
{
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)
displayToolbar(*cit, in_math);
else if (cit->flags & ToolbarBackend::TABLE)
displayToolbar(*cit, in_table);
}
}
void Toolbar::clearLayoutList()
{
last_textclass_ = -1;
}
bool Toolbar::updateLayoutList(int textclass)
{
// update the layout display
if (last_textclass_ != textclass) {
updateLayoutList();
last_textclass_ = textclass;
return true;
} else
return false;
}