]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/Menubar_pimpl.C
Bugfixes: checkboxes to radiobuttons (from J�rgen S) and remove a little
[lyx.git] / src / frontends / xforms / Menubar_pimpl.C
index 53de1a19765c169fb559a434ddd6b1c0b2a96ba1..868554508e511f3cf729c7cc199e21a89f07920f 100644 (file)
@@ -43,6 +43,7 @@ namespace {
 
 // Some constants
 int const MENU_LABEL_SIZE = FL_NORMAL_SIZE;
+int const MENU_LABEL_STYLE = FL_NORMAL_STYLE;
 int const mheight = 30;
 int const mbheight= 22;
 // where to place the menubar?
@@ -62,7 +63,7 @@ int const action_offset = 1000;
 inline
 int string_width(string const & str) 
 {
-       return fl_get_string_widthTAB(FL_NORMAL_STYLE, MENU_LABEL_SIZE,
+       return fl_get_string_widthTAB(MENU_LABEL_STYLE, MENU_LABEL_SIZE,
                                      str.c_str(),
                                      static_cast<int>(str.length()));
 }
@@ -134,7 +135,7 @@ void Menubar::Pimpl::makeMenubar(Menu const & menu)
                fl_set_object_boxtype(obj, FL_FLAT_BOX);
                fl_set_object_color(obj, FL_MCOL, FL_MCOL);
                fl_set_object_lsize(obj, MENU_LABEL_SIZE);
-               fl_set_object_lstyle(obj, FL_NORMAL_STYLE);
+               fl_set_object_lstyle(obj, MENU_LABEL_STYLE);
                fl_set_object_resize(obj, FL_RESIZE_ALL);
                fl_set_object_gravity(obj, NorthWestGravity, 
                                      NorthWestGravity);
@@ -425,8 +426,7 @@ int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
                if (i->kind() == MenuItem::Separator)
                        *last = "%l";
                else if (!i->optional() ||
-                        !(view->getLyXFunc()->getStatus(i->action()) 
-                          & func_status::Disabled))
+                        !(view->getLyXFunc()->getStatus(i->action()).disabled()))
                        last = it;
 
        it = extra_labels.begin();
@@ -436,12 +436,12 @@ int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
 
                switch (item.kind()) {
                case MenuItem::Command: {
-                       func_status::value_type flag = 
+                       FuncStatus flag = 
                                view->getLyXFunc()->getStatus(item.action()); 
 
                        // handle optional entries.
                        if (item.optional() 
-                           && (flag & func_status::Disabled)) {
+                           && (flag.disabled())) {
                                lyxerr[Debug::GUI] 
                                        << "Skipping optional item " 
                                        << item.label() << endl; 
@@ -467,12 +467,11 @@ int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
                        
                        // Modify the entry using the function status
                        string pupmode;
-                       if (flag & (func_status::Disabled 
-                                   | func_status::Unknown))
+                       if (flag.disabled() || flag.unknown())
                                pupmode += "%i";
-                       if (flag & func_status::ToggleOn)
+                       if (flag.onoff(true))
                                pupmode += "%B";
-                       if (flag & func_status::ToggleOff)
+                       if (flag.onoff(false))
                                pupmode += "%b";
                        label += pupmode;
 
@@ -583,7 +582,7 @@ void Menubar::Pimpl::MenuCallback(FL_OBJECT * ob, long button)
                // If the action value is too low, then it is not a
                // valid action, but something else.
                if (choice >= action_offset + 1) {
-                       view->getLyXFunc()->dispatch(choice - action_offset);
+                       view->getLyXFunc()->verboseDispatch(choice - action_offset, true);
                } else {
                        lyxerr[Debug::GUI]
                                << "MenuCallback: ignoring bogus action "