- // Create a copy of a given MenuItem
- MenuItem(MenuItem const &);
- // Create a Command type MenuItem
- MenuItem(Kind kind_, string const & label_ = string(),
- string const & command_ = string());
- //
- ~MenuItem() {}
-
- // The label of a given menuitem
- string const & label() const { return label_; }
- // The kind of entry
+ /// Create a Command type MenuItem
+ MenuItem(Kind kind,
+ string const & label = string(),
+ string const & command = string(),
+ bool optional = false);
+ MenuItem(Kind kind,
+ string const & label,
+ int action,
+ bool optional = false)
+ : kind_(kind), label_(label),
+ action_(action), submenu_(), optional_(optional) {}
+
+ /// The label of a given menuitem
+ string const label() const { return token(label_, '|', 0); }
+ /// The keyboard shortcut (usually underlined in the entry)
+ string const shortcut() const { return token(label_, '|', 1); }
+ /// The complete label, with label and shortcut separated by a '|'
+ string const fulllabel() const { return label_;}
+ /// The kind of entry