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 #ifndef UI_VIEWS_EXAMPLES_LABEL_EXAMPLE_H_ | 5 #ifndef UI_VIEWS_EXAMPLES_LABEL_EXAMPLE_H_ |
6 #define UI_VIEWS_EXAMPLES_LABEL_EXAMPLE_H_ | 6 #define UI_VIEWS_EXAMPLES_LABEL_EXAMPLE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "ui/views/controls/button/button.h" | 9 #include "ui/views/controls/button/button.h" |
10 #include "ui/views/controls/combobox/combobox_listener.h" | 10 #include "ui/views/controls/combobox/combobox_listener.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 class VIEWS_EXAMPLES_EXPORT LabelExample : public ExampleBase, | 24 class VIEWS_EXAMPLES_EXPORT LabelExample : public ExampleBase, |
25 public ButtonListener, | 25 public ButtonListener, |
26 public ComboboxListener, | 26 public ComboboxListener, |
27 public TextfieldController { | 27 public TextfieldController { |
28 public: | 28 public: |
29 LabelExample(); | 29 LabelExample(); |
30 virtual ~LabelExample(); | 30 virtual ~LabelExample(); |
31 | 31 |
32 // ExampleBase: | 32 // ExampleBase: |
33 virtual void CreateExampleView(View* container) OVERRIDE; | 33 virtual void CreateExampleView(View* container) override; |
34 | 34 |
35 // ButtonListener: | 35 // ButtonListener: |
36 virtual void ButtonPressed(Button* button, const ui::Event& event) OVERRIDE; | 36 virtual void ButtonPressed(Button* button, const ui::Event& event) override; |
37 | 37 |
38 // ComboboxListener: | 38 // ComboboxListener: |
39 virtual void OnPerformAction(Combobox* combobox) OVERRIDE; | 39 virtual void OnPerformAction(Combobox* combobox) override; |
40 | 40 |
41 // TextfieldController: | 41 // TextfieldController: |
42 virtual void ContentsChanged(Textfield* sender, | 42 virtual void ContentsChanged(Textfield* sender, |
43 const base::string16& new_contents) OVERRIDE; | 43 const base::string16& new_contents) override; |
44 | 44 |
45 private: | 45 private: |
46 // Add a customizable label and various controls to modify its presentation. | 46 // Add a customizable label and various controls to modify its presentation. |
47 void AddCustomLabel(View* container); | 47 void AddCustomLabel(View* container); |
48 | 48 |
49 // Creates and adds a combobox to the layout. | 49 // Creates and adds a combobox to the layout. |
50 Combobox* AddCombobox(GridLayout* layout, | 50 Combobox* AddCombobox(GridLayout* layout, |
51 const char* name, | 51 const char* name, |
52 const char** strings, | 52 const char** strings, |
53 int count); | 53 int count); |
54 | 54 |
55 Textfield* textfield_; | 55 Textfield* textfield_; |
56 Combobox* alignment_; | 56 Combobox* alignment_; |
57 Combobox* elide_behavior_; | 57 Combobox* elide_behavior_; |
58 ScopedVector<ExampleComboboxModel> example_combobox_models_; | 58 ScopedVector<ExampleComboboxModel> example_combobox_models_; |
59 Checkbox* multiline_; | 59 Checkbox* multiline_; |
60 Checkbox* shadows_; | 60 Checkbox* shadows_; |
61 Label* custom_label_; | 61 Label* custom_label_; |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(LabelExample); | 63 DISALLOW_COPY_AND_ASSIGN(LabelExample); |
64 }; | 64 }; |
65 | 65 |
66 } // namespace examples | 66 } // namespace examples |
67 } // namespace views | 67 } // namespace views |
68 | 68 |
69 #endif // UI_VIEWS_EXAMPLES_LABEL_EXAMPLE_H_ | 69 #endif // UI_VIEWS_EXAMPLES_LABEL_EXAMPLE_H_ |
OLD | NEW |