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