| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/text_example.h" | 5 #include "ui/views/examples/text_example.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "ui/base/resource/resource_bundle.h" | 8 #include "ui/base/resource/resource_bundle.h" |
| 9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
| 10 #include "ui/views/controls/button/checkbox.h" | 10 #include "ui/views/controls/button/checkbox.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 183 |
| 184 Combobox* TextExample::AddCombobox(GridLayout* layout, | 184 Combobox* TextExample::AddCombobox(GridLayout* layout, |
| 185 const char* name, | 185 const char* name, |
| 186 const char** strings, | 186 const char** strings, |
| 187 int count) { | 187 int count) { |
| 188 layout->StartRow(0, 0); | 188 layout->StartRow(0, 0); |
| 189 layout->AddView(new Label(ASCIIToUTF16(name))); | 189 layout->AddView(new Label(ASCIIToUTF16(name))); |
| 190 ExampleComboboxModel* new_model = new ExampleComboboxModel(strings, count); | 190 ExampleComboboxModel* new_model = new ExampleComboboxModel(strings, count); |
| 191 example_combobox_model_.push_back(new_model); | 191 example_combobox_model_.push_back(new_model); |
| 192 Combobox* combo_box = new Combobox(new_model); | 192 Combobox* combo_box = new Combobox(new_model); |
| 193 combo_box->SetSelectedItem(0); | 193 combo_box->SetSelectedIndex(0); |
| 194 combo_box->set_listener(this); | 194 combo_box->set_listener(this); |
| 195 layout->AddView(combo_box, kNumColumns - 1, 1); | 195 layout->AddView(combo_box, kNumColumns - 1, 1); |
| 196 return combo_box; | 196 return combo_box; |
| 197 } | 197 } |
| 198 | 198 |
| 199 void TextExample::CreateExampleView(View* container) { | 199 void TextExample::CreateExampleView(View* container) { |
| 200 text_view_ = new TextExampleView; | 200 text_view_ = new TextExampleView; |
| 201 | 201 |
| 202 GridLayout* layout = new GridLayout(container); | 202 GridLayout* layout = new GridLayout(container); |
| 203 container->SetLayoutManager(layout); | 203 container->SetLayoutManager(layout); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 text_flags |= gfx::Canvas::HIDE_PREFIX; | 363 text_flags |= gfx::Canvas::HIDE_PREFIX; |
| 364 break; | 364 break; |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 text_view_->set_text_flags(text_flags); | 367 text_view_->set_text_flags(text_flags); |
| 368 text_view_->SchedulePaint(); | 368 text_view_->SchedulePaint(); |
| 369 } | 369 } |
| 370 | 370 |
| 371 } // namespace examples | 371 } // namespace examples |
| 372 } // namespace views | 372 } // namespace views |
| OLD | NEW |