summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-20 20:12:05 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-20 20:12:05 +0000
commitb335f5ea6da983c3736442594fc0684ca37c3601 (patch)
treed6ddc2fa86fabf598348f69f54b57d2fb3a195f6 /views
parent17c0ce7883d423b33e1515345fd131f6f4f31433 (diff)
downloadchromium_src-b335f5ea6da983c3736442594fc0684ca37c3601.zip
chromium_src-b335f5ea6da983c3736442594fc0684ca37c3601.tar.gz
chromium_src-b335f5ea6da983c3736442594fc0684ca37c3601.tar.bz2
submenu example
BUG=none TEST=none Review URL: http://codereview.chromium.org/549101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36663 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/examples/menu_example.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/views/examples/menu_example.h b/views/examples/menu_example.h
index 80e276d..c316e2e 100644
--- a/views/examples/menu_example.h
+++ b/views/examples/menu_example.h
@@ -38,6 +38,7 @@ class ExampleMenuContents : public menus::SimpleMenuModel,
ExampleMenuContents() :
ALLOW_THIS_IN_INITIALIZER_LIST(menus::SimpleMenuModel(this)),
current_encoding_command_id_(kCommandSelectAscii) {
+
AddItem(kCommandDoSomething, WideToUTF16(L"Do Something"));
AddSeparator();
AddRadioItem(kCommandSelectAscii,
@@ -52,6 +53,10 @@ class ExampleMenuContents : public menus::SimpleMenuModel,
AddCheckItem(kCommandCheckKiwi, WideToUTF16(L"Kiwi"));
AddSeparator();
AddItem(kCommandGoHome, WideToUTF16(L"Go Home"));
+
+ submenu_.reset(new menus::SimpleMenuModel(this));
+ submenu_->AddItem(kCommandDoSomething, WideToUTF16(L"Do Something 2"));
+ AddSubMenu(ASCIIToUTF16("Submenu"), submenu_.get());
menu_.reset(new views::Menu2(this));
}
@@ -138,6 +143,7 @@ class ExampleMenuContents : public menus::SimpleMenuModel,
private:
scoped_ptr<views::Menu2> menu_;
+ scoped_ptr<menus::SimpleMenuModel> submenu_;
std::set<int> checked_fruits_;
int current_encoding_command_id_;
@@ -196,4 +202,3 @@ class MenuExample : public ExampleBase {
} // namespace examples
#endif // VIEWS_EXAMPLES_MENU_EXAMPLE_H_
-