| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef VIEWS_EXAMPLES_TEXT_EXAMPLE_H_ | |
| 6 #define VIEWS_EXAMPLES_TEXT_EXAMPLE_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "views/controls/button/button.h" | |
| 12 #include "views/controls/combobox/combobox.h" | |
| 13 #include "views/examples/example_base.h" | |
| 14 | |
| 15 namespace views { | |
| 16 class Checkbox; | |
| 17 class GridLayout; | |
| 18 } | |
| 19 | |
| 20 namespace examples { | |
| 21 | |
| 22 class TextExample : public ExampleBase, | |
| 23 public views::ButtonListener, | |
| 24 public views::Combobox::Listener { | |
| 25 public: | |
| 26 explicit TextExample(ExamplesMain* main); | |
| 27 virtual ~TextExample(); | |
| 28 | |
| 29 // Overridden from ExampleBase: | |
| 30 virtual void CreateExampleView(views::View* container) OVERRIDE; | |
| 31 | |
| 32 private: | |
| 33 // Create and add a combo box to the layout. | |
| 34 views::Combobox* AddCombobox(views::GridLayout* layout, | |
| 35 const char* name, | |
| 36 const char** strings, | |
| 37 int count); | |
| 38 | |
| 39 // Overridden from views::ButtonListener: | |
| 40 virtual void ButtonPressed(views::Button* button, | |
| 41 const views::Event& event) OVERRIDE; | |
| 42 | |
| 43 // Overridden from views::Combobox::Listener: | |
| 44 virtual void ItemChanged(views::Combobox* combo_box, | |
| 45 int prev_index, | |
| 46 int new_index) OVERRIDE; | |
| 47 | |
| 48 | |
| 49 class TextExampleView; | |
| 50 // The content of the scroll view. | |
| 51 TextExampleView* text_view_; | |
| 52 | |
| 53 // Combo box for horizontal text alignment. | |
| 54 views::Combobox* h_align_cb_; | |
| 55 | |
| 56 // Combo box for vertical text alignment. | |
| 57 views::Combobox* v_align_cb_; | |
| 58 | |
| 59 // Combo box for text eliding style. | |
| 60 views::Combobox* eliding_cb_; | |
| 61 | |
| 62 // Combo box for ampersand prefix show / hide behavior. | |
| 63 views::Combobox* prefix_cb_; | |
| 64 | |
| 65 // Combo box to choose one of the sample texts. | |
| 66 views::Combobox* text_cb_; | |
| 67 | |
| 68 // Check box to enable/disable multiline text drawing. | |
| 69 views::Checkbox* multiline_checkbox_; | |
| 70 | |
| 71 // Check box to enable/disable character break behavior. | |
| 72 views::Checkbox* break_checkbox_; | |
| 73 | |
| 74 DISALLOW_COPY_AND_ASSIGN(TextExample); | |
| 75 }; | |
| 76 | |
| 77 } // namespace examples | |
| 78 | |
| 79 #endif // VIEWS_EXAMPLES_TEXT_EXAMPLE_H_ | |
| OLD | NEW |