summaryrefslogtreecommitdiffstats
path: root/views/examples
diff options
context:
space:
mode:
authorrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-06 18:30:53 +0000
committerrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-06 18:30:53 +0000
commita3aa55c8af222b7108f7ebd50f6f093fa7fc0996 (patch)
treebd355ecf6cae8bf19ecec20524d7ed2b286e08ff /views/examples
parent89df6eb95d00bd0b09e05a8914af930c0fe87f62 (diff)
downloadchromium_src-a3aa55c8af222b7108f7ebd50f6f093fa7fc0996.zip
chromium_src-a3aa55c8af222b7108f7ebd50f6f093fa7fc0996.tar.gz
chromium_src-a3aa55c8af222b7108f7ebd50f6f093fa7fc0996.tar.bz2
Add multi-line support to TextButtonBase since this is needed by the derived
checkbox and radio button classes. BUG=None TEST=There should be no visible changes to existing text buttons, since this option is off by default. It will be turned on for some radio buttons and checkboxes in a future CL. Review URL: http://codereview.chromium.org/6927023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84471 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/examples')
-rw-r--r--views/examples/button_example.cc25
1 files changed, 18 insertions, 7 deletions
diff --git a/views/examples/button_example.cc b/views/examples/button_example.cc
index 4ab7f80..4dcb73e 100644
--- a/views/examples/button_example.cc
+++ b/views/examples/button_example.cc
@@ -42,13 +42,24 @@ void ButtonExample::ButtonPressed(views::Button* sender,
if (event.IsControlDown()) {
if (event.IsShiftDown()) {
- switch(button_->icon_placement()) {
- case views::TextButton::ICON_ON_LEFT:
- button_->set_icon_placement(views::TextButton::ICON_ON_RIGHT);
- break;
- case views::TextButton::ICON_ON_RIGHT:
- button_->set_icon_placement(views::TextButton::ICON_ON_LEFT);
- break;
+ if (event.IsAltDown()) {
+ button_->SetMultiLine(!button_->multi_line());
+ if (button_->multi_line()) {
+ button_->SetText(L"Multi-line text\n"
+ L"is here to stay all the way!\n"
+ L"123");
+ } else {
+ button_->SetText(L"Button");
+ }
+ } else {
+ switch(button_->icon_placement()) {
+ case views::TextButton::ICON_ON_LEFT:
+ button_->set_icon_placement(views::TextButton::ICON_ON_RIGHT);
+ break;
+ case views::TextButton::ICON_ON_RIGHT:
+ button_->set_icon_placement(views::TextButton::ICON_ON_LEFT);
+ break;
+ }
}
} else if (event.IsAltDown()) {
if (button_->HasIcon())