Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: ui/views/examples/tabbed_pane_example.cc

Issue 10827271: Replace views::Event with ui::Event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/examples/tabbed_pane_example.h ('k') | ui/views/examples/table_example.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/examples/tabbed_pane_example.h" 5 #include "ui/views/examples/tabbed_pane_example.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" 8 #include "ui/views/controls/tabbed_pane/tabbed_pane.h"
9 #include "ui/views/layout/grid_layout.h" 9 #include "ui/views/layout/grid_layout.h"
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 1.0f, GridLayout::USE_PREF, 0, 0); 47 1.0f, GridLayout::USE_PREF, 0, 0);
48 } 48 }
49 49
50 layout->StartRow(0 /* no expand */, button_column); 50 layout->StartRow(0 /* no expand */, button_column);
51 layout->AddView(add_); 51 layout->AddView(add_);
52 layout->AddView(add_at_); 52 layout->AddView(add_at_);
53 layout->AddView(remove_at_); 53 layout->AddView(remove_at_);
54 layout->AddView(select_at_); 54 layout->AddView(select_at_);
55 } 55 }
56 56
57 void TabbedPaneExample::ButtonPressed(Button* sender, const Event& event) { 57 void TabbedPaneExample::ButtonPressed(Button* sender, const ui::Event& event) {
58 if (sender == add_) { 58 if (sender == add_) {
59 AddButton("Added"); 59 AddButton("Added");
60 } else if (sender == add_at_) { 60 } else if (sender == add_at_) {
61 const string16 label = ASCIIToUTF16("Added at 1"); 61 const string16 label = ASCIIToUTF16("Added at 1");
62 tabbed_pane_->AddTabAtIndex(1, label, new TextButton(NULL, label), true); 62 tabbed_pane_->AddTabAtIndex(1, label, new TextButton(NULL, label), true);
63 } else if (sender == remove_at_) { 63 } else if (sender == remove_at_) {
64 if (tabbed_pane_->GetTabCount() > 1) 64 if (tabbed_pane_->GetTabCount() > 1)
65 delete tabbed_pane_->RemoveTabAtIndex(1); 65 delete tabbed_pane_->RemoveTabAtIndex(1);
66 } else if (sender == select_at_) { 66 } else if (sender == select_at_) {
67 if (tabbed_pane_->GetTabCount() > 1) 67 if (tabbed_pane_->GetTabCount() > 1)
(...skipping 13 matching lines...) Expand all
81 tabbed_pane_->GetSelectedTabIndex()); 81 tabbed_pane_->GetSelectedTabIndex());
82 } 82 }
83 83
84 void TabbedPaneExample::AddButton(const std::string& label) { 84 void TabbedPaneExample::AddButton(const std::string& label) {
85 TextButton* button = new TextButton(NULL, ASCIIToUTF16(label)); 85 TextButton* button = new TextButton(NULL, ASCIIToUTF16(label));
86 tabbed_pane_->AddTab(ASCIIToUTF16(label), button); 86 tabbed_pane_->AddTab(ASCIIToUTF16(label), button);
87 } 87 }
88 88
89 } // namespace examples 89 } // namespace examples
90 } // namespace views 90 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/tabbed_pane_example.h ('k') | ui/views/examples/table_example.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698