]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/Toolbar_pimpl.C
adjust
[lyx.git] / src / frontends / xforms / Toolbar_pimpl.C
index b80357e11e65564e6e62a09aedca88109ec4cb1d..dae43e651a1b96de5b3b063b6cec93d846436763 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "Toolbar_pimpl.h"
 #include "debug.h"
-#include "LyXView.h"
+#include "XFormsView.h"
 #include "lyxfunc.h"
 #include "func_status.h"
 #include "BufferView.h"
@@ -81,7 +81,7 @@ Toolbar::Pimpl::toolbarItem::operator=(toolbarItem const & ti) {
 
 
 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
@@ -157,7 +157,7 @@ void Toolbar::Pimpl::layoutSelectedCB(int sel, void * arg, Combox *)
 void Toolbar::Pimpl::layoutSelected(int sel)
 {
        string const tmp = tostr(sel);
-       owner->getLyXFunc()->Dispatch(LFUN_LAYOUTNO, tmp);
+       owner->getLyXFunc()->dispatch(LFUN_LAYOUTNO, tmp);
 }
  
 
@@ -237,10 +237,10 @@ void Toolbar::Pimpl::updateLayoutList(bool force)
                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.
@@ -268,9 +268,9 @@ namespace {
 
 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;
@@ -285,23 +285,6 @@ extern "C" void C_Toolbar_ToolbarCB(FL_OBJECT * ob, long data)
 }
 
 
-#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) {
@@ -409,7 +392,7 @@ void Toolbar::Pimpl::set(bool doingmain)
 
                        // 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);
@@ -530,6 +513,7 @@ void Toolbar::Pimpl::reset()
        lightReset();
 }
 
+
 void Toolbar::Pimpl::lightReset() {
        xpos = sxpos - standardspacing;
        ypos = sypos;