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/label_example.h" | 5 #include "ui/views/examples/label_example.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "ui/views/background.h" | 8 #include "ui/views/background.h" |
9 #include "ui/views/border.h" | 9 #include "ui/views/border.h" |
10 #include "ui/views/controls/button/checkbox.h" | 10 #include "ui/views/controls/button/checkbox.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 // A Label with a clamped preferred width to demonstrate eliding or wrapping. | 31 // A Label with a clamped preferred width to demonstrate eliding or wrapping. |
32 class PreferredSizeLabel : public Label { | 32 class PreferredSizeLabel : public Label { |
33 public: | 33 public: |
34 PreferredSizeLabel() : Label() { | 34 PreferredSizeLabel() : Label() { |
35 SetBorder(Border::CreateSolidBorder(1, SK_ColorGRAY)); | 35 SetBorder(Border::CreateSolidBorder(1, SK_ColorGRAY)); |
36 } | 36 } |
37 virtual ~PreferredSizeLabel() {} | 37 virtual ~PreferredSizeLabel() {} |
38 | 38 |
39 // Label: | 39 // Label: |
40 virtual gfx::Size GetPreferredSize() const OVERRIDE { | 40 virtual gfx::Size GetPreferredSize() const override { |
41 return gfx::Size(50, Label::GetPreferredSize().height()); | 41 return gfx::Size(50, Label::GetPreferredSize().height()); |
42 } | 42 } |
43 | 43 |
44 private: | 44 private: |
45 DISALLOW_COPY_AND_ASSIGN(PreferredSizeLabel); | 45 DISALLOW_COPY_AND_ASSIGN(PreferredSizeLabel); |
46 }; | 46 }; |
47 | 47 |
48 } // namespace | 48 } // namespace |
49 | 49 |
50 LabelExample::LabelExample() | 50 LabelExample::LabelExample() |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 example_combobox_models_.push_back(model); | 206 example_combobox_models_.push_back(model); |
207 Combobox* combobox = new Combobox(model); | 207 Combobox* combobox = new Combobox(model); |
208 combobox->SetSelectedIndex(0); | 208 combobox->SetSelectedIndex(0); |
209 combobox->set_listener(this); | 209 combobox->set_listener(this); |
210 layout->AddView(combobox); | 210 layout->AddView(combobox); |
211 return combobox; | 211 return combobox; |
212 } | 212 } |
213 | 213 |
214 } // namespace examples | 214 } // namespace examples |
215 } // namespace views | 215 } // namespace views |
OLD | NEW |