#endif
#include "LString.h"
-#include "support/LAssert.h"
+#include "support/lstrings.h"
#include <vector>
class LyXLex;
Documents
};
/// Create a Command type MenuItem
- MenuItem(Kind kind_, string const & label_ = string(),
- string const & command_ = string());
+ MenuItem(Kind kind,
+ string const & label = string(),
+ string const & command = string(),
+ bool optional = false);
/// The label of a given menuitem
- string const & label() const { return label_; }
+ string label() const { return token(label_, '|', 0); }
+ ///
+ string shortcut() const { return token(label_, '|', 1); }
/// The kind of entry
Kind kind() const { return kind_; }
/// the action (if relevant)
int action() const { return action_; }
/// the description of the submenu (if relevant)
string const & submenu() const { return submenu_; }
+ /// returns true if the entry should be ommited when disabled
+ bool optional() const { return optional_; }
private:
///
Kind kind_;
int action_;
///
string submenu_;
+ ///
+ bool optional_;
};
///
Menu & add(MenuItem const &);
///
- void read(LyXLex &);
+ Menu & read(LyXLex &);
///
bool menubar() const { return menubar_; }
///
bool menubar_;
///
string name_;
- ///
};
///
bool hasMenu (string const &) const;
///
+ Menu & getMenu (string const &);
+ ///
Menu const & getMenu (string const &) const;
//
bool empty() const { return menulist_.empty(); }