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

Side by Side Diff: views/examples/radio_button_example.cc

Issue 7057014: Variety of tweaks to View API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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 | « views/controls/textfield/textfield.cc ('k') | views/focus/focus_manager.cc » ('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 "views/examples/radio_button_example.h" 5 #include "views/examples/radio_button_example.h"
6 6
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "views/layout/grid_layout.h" 8 #include "views/layout/grid_layout.h"
9 #include "views/view.h" 9 #include "views/view.h"
10 10
(...skipping 17 matching lines...) Expand all
28 int group = 1; 28 int group = 1;
29 for (size_t i = 0; i < arraysize(radio_buttons_); ++i) { 29 for (size_t i = 0; i < arraysize(radio_buttons_); ++i) {
30 radio_buttons_[i] = new views::RadioButton( 30 radio_buttons_[i] = new views::RadioButton(
31 base::StringPrintf( L"Radio %d in group %d", i + 1, group), group); 31 base::StringPrintf( L"Radio %d in group %d", i + 1, group), group);
32 } 32 }
33 33
34 ++group; 34 ++group;
35 for (size_t i = 0; i < arraysize(radio_buttons_nt_); ++i) { 35 for (size_t i = 0; i < arraysize(radio_buttons_nt_); ++i) {
36 radio_buttons_nt_[i] = new views::RadioButtonNt( 36 radio_buttons_nt_[i] = new views::RadioButtonNt(
37 base::StringPrintf( L"Radio %d in group %d", i + 1, group), group); 37 base::StringPrintf( L"Radio %d in group %d", i + 1, group), group);
38 radio_buttons_nt_[i]->SetFocusable(true); 38 radio_buttons_nt_[i]->set_focusable(true);
39 } 39 }
40 40
41 views::GridLayout* layout = new views::GridLayout(container); 41 views::GridLayout* layout = new views::GridLayout(container);
42 container->SetLayoutManager(layout); 42 container->SetLayoutManager(layout);
43 43
44 views::ColumnSet* column_set = layout->AddColumnSet(0); 44 views::ColumnSet* column_set = layout->AddColumnSet(0);
45 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 45 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL,
46 1.0f, views::GridLayout::USE_PREF, 0, 0); 46 1.0f, views::GridLayout::USE_PREF, 0, 0);
47 for (size_t i = 0; i < arraysize(radio_buttons_); i++) { 47 for (size_t i = 0; i < arraysize(radio_buttons_); i++) {
48 layout->StartRow(0, 0); 48 layout->StartRow(0, 0);
(...skipping 20 matching lines...) Expand all
69 IntToOnOff(radio_buttons_[0]->checked()), 69 IntToOnOff(radio_buttons_[0]->checked()),
70 IntToOnOff(radio_buttons_[1]->checked()), 70 IntToOnOff(radio_buttons_[1]->checked()),
71 IntToOnOff(radio_buttons_[2]->checked()), 71 IntToOnOff(radio_buttons_[2]->checked()),
72 IntToOnOff(radio_buttons_nt_[0]->checked()), 72 IntToOnOff(radio_buttons_nt_[0]->checked()),
73 IntToOnOff(radio_buttons_nt_[1]->checked()), 73 IntToOnOff(radio_buttons_nt_[1]->checked()),
74 IntToOnOff(radio_buttons_nt_[2]->checked())); 74 IntToOnOff(radio_buttons_nt_[2]->checked()));
75 } 75 }
76 } 76 }
77 77
78 } // namespace examples 78 } // namespace examples
OLDNEW
« no previous file with comments | « views/controls/textfield/textfield.cc ('k') | views/focus/focus_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698