From a2eb2cb91876d9759dabcf4a7c3076347a9157e7 Mon Sep 17 00:00:00 2001 From: John Levon Date: Tue, 8 Apr 2003 19:35:02 +0000 Subject: [PATCH] remove setPixmap and use the backend instead git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6739 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/xforms/ChangeLog | 5 ++++ src/frontends/xforms/Toolbar_pimpl.C | 39 +++------------------------- 2 files changed, 8 insertions(+), 36 deletions(-) diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index f44356e8f2..2288297e57 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,8 @@ +2003-04-08 John Levon + + * Toolbar_pimpl.C: remove setPixmap, use the backend + instead. + 2003-04-08 John Levon * Toolbar_pimpl.C: handle tooltip diff --git a/src/frontends/xforms/Toolbar_pimpl.C b/src/frontends/xforms/Toolbar_pimpl.C index 6126f53117..8ae85cb9c0 100644 --- a/src/frontends/xforms/Toolbar_pimpl.C +++ b/src/frontends/xforms/Toolbar_pimpl.C @@ -263,41 +263,6 @@ void C_Toolbar_ToolbarCB(FL_OBJECT * ob, long data) } - -void setPixmap(FL_OBJECT * obj, int action) -{ - string xpm_name; - FuncRequest ev = lyxaction.retrieveActionArg(action); - - string const name = lyxaction.getActionName(ev.action); - if (!ev.argument.empty()) - xpm_name = subst(name + ' ' + ev.argument, ' ','_'); - else - xpm_name = name; - - string fullname = LibFileSearch("images", xpm_name, "xpm"); - - if (ev.action == LFUN_INSERT_MATH && !ev.argument.empty()) { - string arg = ev.argument.substr(1); - fullname = LibFileSearch("images/math/", arg, "xpm"); - } - - if (!fullname.empty()) { - lyxerr[Debug::GUI] << "Full icon name is `" - << fullname << '\'' << endl; - fl_set_pixmapbutton_file(obj, fullname.c_str()); - return; - } - - lyxerr << "Unable to find icon `" << xpm_name << '\'' << endl; - fullname = LibFileSearch("images", "unknown", "xpm"); - if (!fullname.empty()) { - lyxerr[Debug::GUI] << "Using default `unknown' icon" - << endl; - fl_set_pixmapbutton_file(obj, fullname.c_str()); - } -} - } // namespace anon @@ -353,7 +318,9 @@ void Toolbar::Pimpl::add(int action, string const & tooltip) // The view that this object belongs to. obj->u_vdata = owner_; - setPixmap(obj, action); + string const xpm = toolbarbackend.getIcon(action); + fl_set_pixmapbutton_file(obj, xpm.c_str()); + // we must remember to update the positions xpos += buttonwidth; // ypos is constant -- 2.39.2