| 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_TEXT_EXAMPLE_H_ | 5 #ifndef UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_ |
| 6 #define UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_ | 6 #define UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "ui/views/controls/button/button.h" | 10 #include "ui/views/controls/button/button.h" |
| 11 #include "ui/views/controls/combobox/combobox_listener.h" | 11 #include "ui/views/controls/combobox/combobox_listener.h" |
| 12 #include "ui/views/examples/example_base.h" | 12 #include "ui/views/examples/example_base.h" |
| 13 | 13 |
| 14 namespace views { | 14 namespace views { |
| 15 class Checkbox; | 15 class Checkbox; |
| 16 class GridLayout; | 16 class GridLayout; |
| 17 | 17 |
| 18 namespace examples { | 18 namespace examples { |
| 19 | 19 |
| 20 class ExampleComboboxModel; | 20 class ExampleComboboxModel; |
| 21 | 21 |
| 22 class VIEWS_EXAMPLES_EXPORT TextExample : public ExampleBase, | 22 class VIEWS_EXAMPLES_EXPORT TextExample : public ExampleBase, |
| 23 public ButtonListener, | 23 public ButtonListener, |
| 24 public ComboboxListener { | 24 public ComboboxListener { |
| 25 public: | 25 public: |
| 26 TextExample(); | 26 TextExample(); |
| 27 virtual ~TextExample(); | 27 virtual ~TextExample(); |
| 28 | 28 |
| 29 // ExampleBase: | 29 // ExampleBase: |
| 30 virtual void CreateExampleView(View* container) OVERRIDE; | 30 virtual void CreateExampleView(View* container) override; |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 // Creates and adds a check box to the layout. | 33 // Creates and adds a check box to the layout. |
| 34 Checkbox* AddCheckbox(GridLayout* layout, const char* name); | 34 Checkbox* AddCheckbox(GridLayout* layout, const char* name); |
| 35 | 35 |
| 36 // Creates and adds a combobox to the layout. | 36 // Creates and adds a combobox to the layout. |
| 37 Combobox* AddCombobox(GridLayout* layout, | 37 Combobox* AddCombobox(GridLayout* layout, |
| 38 const char* name, | 38 const char* name, |
| 39 const char** strings, | 39 const char** strings, |
| 40 int count); | 40 int count); |
| 41 | 41 |
| 42 // ButtonListener: | 42 // ButtonListener: |
| 43 virtual void ButtonPressed(Button* button, const ui::Event& event) OVERRIDE; | 43 virtual void ButtonPressed(Button* button, const ui::Event& event) override; |
| 44 | 44 |
| 45 // ComboboxListener: | 45 // ComboboxListener: |
| 46 virtual void OnPerformAction(Combobox* combobox) OVERRIDE; | 46 virtual void OnPerformAction(Combobox* combobox) override; |
| 47 | 47 |
| 48 class TextExampleView; | 48 class TextExampleView; |
| 49 // The content of the scroll view. | 49 // The content of the scroll view. |
| 50 TextExampleView* text_view_; | 50 TextExampleView* text_view_; |
| 51 | 51 |
| 52 // Combo box for horizontal text alignment. | 52 // Combo box for horizontal text alignment. |
| 53 Combobox* h_align_cb_; | 53 Combobox* h_align_cb_; |
| 54 | 54 |
| 55 // Combo box for text eliding style. | 55 // Combo box for text eliding style. |
| 56 Combobox* eliding_cb_; | 56 Combobox* eliding_cb_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 83 // around until destruction time. | 83 // around until destruction time. |
| 84 ScopedVector<ExampleComboboxModel> example_combobox_model_; | 84 ScopedVector<ExampleComboboxModel> example_combobox_model_; |
| 85 | 85 |
| 86 DISALLOW_COPY_AND_ASSIGN(TextExample); | 86 DISALLOW_COPY_AND_ASSIGN(TextExample); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } // namespace examples | 89 } // namespace examples |
| 90 } // namespace views | 90 } // namespace views |
| 91 | 91 |
| 92 #endif // UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_ | 92 #endif // UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_ |
| OLD | NEW |