Adding menus.

This commit is contained in:
Ben Vanik
2015-06-22 23:30:34 -07:00
parent b9c39d1b33
commit 9441808b40
12 changed files with 210 additions and 67 deletions

View File

@@ -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