| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |