| 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/strings/utf_string_conversions.h" | 7 #include "base/strings/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/gfx/font_list.h" | 10 #include "ui/gfx/font_list.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 example_combobox_model_.push_back(combobox_model); | 180 example_combobox_model_.push_back(combobox_model); |
| 181 Combobox* combobox = new Combobox(combobox_model); | 181 Combobox* combobox = new Combobox(combobox_model); |
| 182 combobox->SetSelectedIndex(0); | 182 combobox->SetSelectedIndex(0); |
| 183 combobox->set_listener(this); | 183 combobox->set_listener(this); |
| 184 layout->AddView(combobox, kNumColumns - 1, 1); | 184 layout->AddView(combobox, kNumColumns - 1, 1); |
| 185 return combobox; | 185 return combobox; |
| 186 } | 186 } |
| 187 | 187 |
| 188 void TextExample::CreateExampleView(View* container) { | 188 void TextExample::CreateExampleView(View* container) { |
| 189 text_view_ = new TextExampleView; | 189 text_view_ = new TextExampleView; |
| 190 text_view_->set_border(Border::CreateSolidBorder(1, SK_ColorGRAY)); | 190 text_view_->SetBorder(Border::CreateSolidBorder(1, SK_ColorGRAY)); |
| 191 | 191 |
| 192 GridLayout* layout = new GridLayout(container); | 192 GridLayout* layout = new GridLayout(container); |
| 193 container->SetLayoutManager(layout); | 193 container->SetLayoutManager(layout); |
| 194 | 194 |
| 195 layout->AddPaddingRow(0, 8); | 195 layout->AddPaddingRow(0, 8); |
| 196 | 196 |
| 197 ColumnSet* column_set = layout->AddColumnSet(0); | 197 ColumnSet* column_set = layout->AddColumnSet(0); |
| 198 column_set->AddPaddingColumn(0, 8); | 198 column_set->AddPaddingColumn(0, 8); |
| 199 column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, | 199 column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, |
| 200 0.1f, GridLayout::USE_PREF, 0, 0); | 200 0.1f, GridLayout::USE_PREF, 0, 0); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 text_flags |= gfx::Canvas::HIDE_PREFIX; | 323 text_flags |= gfx::Canvas::HIDE_PREFIX; |
| 324 break; | 324 break; |
| 325 } | 325 } |
| 326 } | 326 } |
| 327 text_view_->set_text_flags(text_flags); | 327 text_view_->set_text_flags(text_flags); |
| 328 text_view_->SchedulePaint(); | 328 text_view_->SchedulePaint(); |
| 329 } | 329 } |
| 330 | 330 |
| 331 } // namespace examples | 331 } // namespace examples |
| 332 } // namespace views | 332 } // namespace views |
| OLD | NEW |