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_TABLE2_EXAMPLE_H_ | |
6 #define VIEWS_EXAMPLES_TABLE2_EXAMPLE_H_ | |
7 #pragma once | |
8 | |
9 #include <string> | |
10 | |
11 #include "base/basictypes.h" | |
12 #include "base/compiler_specific.h" | |
13 #include "third_party/skia/include/core/SkBitmap.h" | |
14 #include "ui/base/models/table_model.h" | |
15 #include "views/controls/button/button.h" | |
16 #include "views/controls/table/table_view_observer.h" | |
17 #include "views/examples/example_base.h" | |
18 | |
19 namespace views { | |
20 class Checkbox; | |
21 class Event; | |
22 class TableView2; | |
23 } | |
24 | |
25 namespace examples { | |
26 | |
27 class Table2Example : public ExampleBase, | |
28 public ui::TableModel, | |
29 public views::ButtonListener, | |
30 public views::TableViewObserver { | |
31 public: | |
32 explicit Table2Example(ExamplesMain* main); | |
33 virtual ~Table2Example(); | |
34 | |
35 // Overridden from ExampleBase: | |
36 virtual void CreateExampleView(views::View* container) OVERRIDE; | |
37 | |
38 // Overridden from TableModel: | |
39 virtual int RowCount() OVERRIDE; | |
40 virtual string16 GetText(int row, int column_id) OVERRIDE; | |
41 virtual SkBitmap GetIcon(int row) OVERRIDE; | |
42 virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; | |
43 | |
44 // Overridden from views::ButtonListener: | |
45 virtual void ButtonPressed(views::Button* sender, | |
46 const views::Event& event) OVERRIDE; | |
47 | |
48 // Overridden from views::TableViewObserver: | |
49 virtual void OnSelectionChanged() OVERRIDE; | |
50 virtual void OnDoubleClick() OVERRIDE; | |
51 virtual void OnMiddleClick() OVERRIDE; | |
52 virtual void OnKeyDown(ui::KeyboardCode virtual_keycode) OVERRIDE; | |
53 virtual void OnTableViewDelete(views::TableView* table_view) OVERRIDE; | |
54 virtual void OnTableView2Delete(views::TableView2* table_view) OVERRIDE; | |
55 | |
56 private: | |
57 // The table to be tested. | |
58 views::TableView2* table_; | |
59 | |
60 views::Checkbox* column1_visible_checkbox_; | |
61 views::Checkbox* column2_visible_checkbox_; | |
62 views::Checkbox* column3_visible_checkbox_; | |
63 views::Checkbox* column4_visible_checkbox_; | |
64 | |
65 SkBitmap icon1_; | |
66 SkBitmap icon2_; | |
67 | |
68 DISALLOW_COPY_AND_ASSIGN(Table2Example); | |
69 }; | |
70 | |
71 } // namespace examples | |
72 | |
73 #endif // VIEWS_EXAMPLES_TABLE2_EXAMPLE_H_ | |
OLD | NEW |