From d5bf18637ffb0b73a0b54af9b30a88760aedee40 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 13 Aug 2002 12:49:10 +0000 Subject: [PATCH] fix disabling of submenu items git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4956 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/xforms/ChangeLog | 5 +++++ src/frontends/xforms/Menubar_pimpl.C | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 19a584d86d..f927cc22e8 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,8 @@ +2002-08-13 Jean-Marc Lasgouttes + + * Menubar_pimpl.C (create_submenu): fix code to disable submenu + entries. + 2002-08-12 Lars Gullik Bjønnes * FormDocument.C (saveParamsAsDefault): use proper constructment diff --git a/src/frontends/xforms/Menubar_pimpl.C b/src/frontends/xforms/Menubar_pimpl.C index 9538925585..e4d261a39e 100644 --- a/src/frontends/xforms/Menubar_pimpl.C +++ b/src/frontends/xforms/Menubar_pimpl.C @@ -237,6 +237,7 @@ int Menubar::Pimpl::create_submenu(Window win, XFormsView * view, it = extra_labels.begin(); size_type count = 0; + all_disabled = true; int curmenuid = menuid; for (Menu::const_iterator i = menu.begin(); i != end; ++i, ++it) { MenuItem const & item = (*i); @@ -318,14 +319,16 @@ int Menubar::Pimpl::create_submenu(Window win, XFormsView * view, } case MenuItem::Submenu: { + bool sub_all_disabled; int submenuid = create_submenu(win, view, *item.submenu(), smn, - all_disabled); + sub_all_disabled); + all_disabled &= sub_all_disabled; if (submenuid == -1) return -1; string label = fixlabel(item.label()); label += extra_label + "%m"; - if (all_disabled) + if (sub_all_disabled) label += "%i"; string shortcut = item.shortcut(); if (!shortcut.empty()) {