| 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 <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // ExampleBase: | 31 // ExampleBase: |
| 32 void CreateExampleView(View* container) override; | 32 void CreateExampleView(View* container) override; |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 // Creates and adds a check box to the layout. | 35 // Creates and adds a check box to the layout. |
| 36 Checkbox* AddCheckbox(GridLayout* layout, const char* name); | 36 Checkbox* AddCheckbox(GridLayout* layout, const char* name); |
| 37 | 37 |
| 38 // Creates and adds a combobox to the layout. | 38 // Creates and adds a combobox to the layout. |
| 39 Combobox* AddCombobox(GridLayout* layout, | 39 Combobox* AddCombobox(GridLayout* layout, |
| 40 const char* name, | 40 const char* name, |
| 41 const char* const* strings, | 41 const char** strings, |
| 42 int count); | 42 int count); |
| 43 | 43 |
| 44 // ButtonListener: | 44 // ButtonListener: |
| 45 void ButtonPressed(Button* button, const ui::Event& event) override; | 45 void ButtonPressed(Button* button, const ui::Event& event) override; |
| 46 | 46 |
| 47 // ComboboxListener: | 47 // ComboboxListener: |
| 48 void OnPerformAction(Combobox* combobox) override; | 48 void OnPerformAction(Combobox* combobox) override; |
| 49 | 49 |
| 50 class TextExampleView; | 50 class TextExampleView; |
| 51 // The content of the scroll view. | 51 // The content of the scroll view. |
| 52 TextExampleView* text_view_; | 52 TextExampleView* text_view_; |
| 53 | 53 |
| 54 // Combo box for horizontal text alignment. | 54 // Combo box for horizontal text alignment. |
| 55 Combobox* h_align_cb_; | 55 Combobox* h_align_cb_; |
| 56 | 56 |
| 57 // Combo box for text eliding style. | 57 // Combo box for text eliding style. |
| 58 Combobox* eliding_cb_; | 58 Combobox* eliding_cb_; |
| 59 | 59 |
| 60 // Combo box for ampersand prefix show / hide behavior. | 60 // Combo box for ampersand prefix show / hide behavior. |
| 61 Combobox* prefix_cb_; | 61 Combobox* prefix_cb_; |
| 62 | 62 |
| 63 // Combo box to choose one of the sample texts. | 63 // Combo box to choose one of the sample texts. |
| 64 Combobox* text_cb_; | 64 Combobox* text_cb_; |
| 65 | 65 |
| 66 // Combo box to choose a font weight. | |
| 67 Combobox* weight_cb_; | |
| 68 | |
| 69 // Check box to enable/disable multiline text drawing. | 66 // Check box to enable/disable multiline text drawing. |
| 70 Checkbox* multiline_checkbox_; | 67 Checkbox* multiline_checkbox_; |
| 71 | 68 |
| 72 // Check box to enable/disable character break behavior. | 69 // Check box to enable/disable character break behavior. |
| 73 Checkbox* break_checkbox_; | 70 Checkbox* break_checkbox_; |
| 74 | 71 |
| 72 // Check box to enable/disable bold style. |
| 73 Checkbox* bold_checkbox_; |
| 74 |
| 75 // Check box to enable/disable italic style. | 75 // Check box to enable/disable italic style. |
| 76 Checkbox* italic_checkbox_; | 76 Checkbox* italic_checkbox_; |
| 77 | 77 |
| 78 // Check box to enable/disable underline style. | 78 // Check box to enable/disable underline style. |
| 79 Checkbox* underline_checkbox_; | 79 Checkbox* underline_checkbox_; |
| 80 | 80 |
| 81 // We create a model for each of the combobox, so we need to keep them | 81 // We create a model for each of the combobox, so we need to keep them |
| 82 // around until destruction time. | 82 // around until destruction time. |
| 83 std::vector<std::unique_ptr<ExampleComboboxModel>> example_combobox_model_; | 83 std::vector<std::unique_ptr<ExampleComboboxModel>> example_combobox_model_; |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(TextExample); | 85 DISALLOW_COPY_AND_ASSIGN(TextExample); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace examples | 88 } // namespace examples |
| 89 } // namespace views | 89 } // namespace views |
| 90 | 90 |
| 91 #endif // UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_ | 91 #endif // UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_ |
| OLD | NEW |