#include "Toolbar_pimpl.h"
#include "debug.h"
-#include "LyXView.h"
+#include "XFormsView.h"
#include "lyxfunc.h"
#include "func_status.h"
#include "BufferView.h"
Toolbar::Pimpl::Pimpl(LyXView * o, int x, int y)
- : owner(o), sxpos(x), sypos(y)
+ : owner(static_cast<XFormsView *>(o)), sxpos(x), sypos(y)
{
combox = 0;
#if FL_REVISION < 89
void Toolbar::Pimpl::layoutSelected(int sel)
{
string const tmp = tostr(sel);
- owner->getLyXFunc()->Dispatch(LFUN_LAYOUTNO, tmp);
+ owner->getLyXFunc()->dispatch(LFUN_LAYOUTNO, tmp);
}
LyXTextClass::const_iterator end = tc.end();
for (LyXTextClass::const_iterator cit = tc.begin();
cit != end; ++cit) {
- if ((*cit).obsoleted_by().empty())
- combox->addline(_((*cit).name()));
+ if (cit->obsoleted_by().empty())
+ combox->addline(_(cit->name()));
else
- combox->addline("@N" + _((*cit).name()));
+ combox->addline("@N" + _(cit->name()));
}
}
// we need to do this.
void ToolbarCB(FL_OBJECT * ob, long ac)
{
- LyXView * owner = static_cast<LyXView *>(ob->u_vdata);
+ XFormsView * owner = static_cast<XFormsView *>(ob->u_vdata);
- string res = owner->getLyXFunc()->Dispatch(int(ac));
+ string res = owner->getLyXFunc()->dispatch(int(ac));
if (!res.empty())
lyxerr[Debug::GUI] << "ToolbarCB: Function returned: "
<< res << endl;
}
-#if 0
-// What are we supposed to do with that??
-int Toolbar::get_toolbar_func(string const & func)
-{
- int action = lyxaction.LookupFunc(func);
- if (action == -1) {
- if (func == "separator"){
- action = TOOL_SEPARATOR;
- } else if (func == "layouts"){
- action = TOOL_LAYOUTS;
- } else action = 0;
- }
- return action;
-}
-#endif
-
-
namespace {
void setPixmap(FL_OBJECT * obj, int action, int buttonwidth, int height) {
// Set the tooltip
#if FL_REVISION >= 89
- string help = _(lyxaction.helpText(item->action));
+ string const help(_(lyxaction.helpText(item->action)));
fl_set_object_helper(obj, help.c_str());
#else
fl_set_object_posthandler(obj, C_Toolbar_BubblePost);
lightReset();
}
+
void Toolbar::Pimpl::lightReset() {
xpos = sxpos - standardspacing;
ypos = sypos;