| 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_TABBED_PANE_EXAMPLE_H_ | |
| 6 #define VIEWS_EXAMPLES_TABBED_PANE_EXAMPLE_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "views/controls/button/text_button.h" | |
| 12 #include "views/controls/tabbed_pane/tabbed_pane_listener.h" | |
| 13 #include "views/examples/example_base.h" | |
| 14 | |
| 15 namespace views { | |
| 16 class TabbedPane; | |
| 17 } | |
| 18 | |
| 19 namespace examples { | |
| 20 | |
| 21 // A TabbedPane example tests adding/removing/selecting tabs. | |
| 22 class TabbedPaneExample : public ExampleBase, | |
| 23 public views::ButtonListener, | |
| 24 public views::TabbedPaneListener { | |
| 25 public: | |
| 26 explicit TabbedPaneExample(ExamplesMain* main); | |
| 27 virtual ~TabbedPaneExample(); | |
| 28 | |
| 29 // ExampleBase: | |
| 30 virtual void CreateExampleView(views::View* container) OVERRIDE; | |
| 31 | |
| 32 private: | |
| 33 // views::ButtonListener: | |
| 34 virtual void ButtonPressed(views::Button* sender, | |
| 35 const views::Event& event) OVERRIDE; | |
| 36 | |
| 37 // views::TabbedPaneListener: | |
| 38 virtual void TabSelectedAt(int index) OVERRIDE; | |
| 39 | |
| 40 // Print the status of the tab in the status area. | |
| 41 void PrintStatus(); | |
| 42 | |
| 43 void AddButton(const std::string& label); | |
| 44 | |
| 45 // The tabbed pane to be tested. | |
| 46 views::TabbedPane* tabbed_pane_; | |
| 47 | |
| 48 // Control buttons to add, remove or select tabs. | |
| 49 views::Button* add_; | |
| 50 views::Button* add_at_; | |
| 51 views::Button* remove_at_; | |
| 52 views::Button* select_at_; | |
| 53 | |
| 54 DISALLOW_COPY_AND_ASSIGN(TabbedPaneExample); | |
| 55 }; | |
| 56 | |
| 57 } // namespace examples | |
| 58 | |
| 59 #endif // VIEWS_EXAMPLES_TABBED_PANE_EXAMPLE_H_ | |
| OLD | NEW |