Adding menus.
This commit is contained in:
@@ -35,6 +35,7 @@ class MenuItem {
|
||||
MenuItem* parent_item() const { return parent_item_; }
|
||||
Type type() { return type_; }
|
||||
const std::wstring& text() { return text_; }
|
||||
const std::wstring& hotkey() { return hotkey_; }
|
||||
|
||||
void AddChild(MenuItem* child_item);
|
||||
void AddChild(std::unique_ptr<MenuItem> child_item);
|
||||
@@ -45,7 +46,7 @@ class MenuItem {
|
||||
|
||||
protected:
|
||||
MenuItem(Type type);
|
||||
MenuItem(Type type, const std::wstring& text);
|
||||
MenuItem(Type type, const std::wstring& text, const std::wstring& hotkey);
|
||||
|
||||
virtual void OnChildAdded(MenuItem* child_item) {}
|
||||
virtual void OnChildRemoved(MenuItem* child_item) {}
|
||||
@@ -55,7 +56,8 @@ class MenuItem {
|
||||
Type type_;
|
||||
MenuItem* parent_item_;
|
||||
std::vector<MenuItemPtr> children_;
|
||||
std::wstring text_; // Text associated with this item (typically the title)
|
||||
std::wstring text_;
|
||||
std::wstring hotkey_;
|
||||
};
|
||||
|
||||
} // namespace ui
|
||||
|
||||
Reference in New Issue
Block a user