OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #include "views/examples/single_split_view_example.h" | 5 #include "views/examples/single_split_view_example.h" |
6 | 6 |
7 #include "views/controls/single_split_view.h" | 7 #include "views/controls/single_split_view.h" |
8 #include "views/layout/grid_layout.h" | 8 #include "views/layout/grid_layout.h" |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 void SingleSplitViewExample::CreateExampleView(views::View* container) { | 63 void SingleSplitViewExample::CreateExampleView(views::View* container) { |
64 SplittedView* splitted_view_1 = new SplittedView; | 64 SplittedView* splitted_view_1 = new SplittedView; |
65 SplittedView* splitted_view_2 = new SplittedView; | 65 SplittedView* splitted_view_2 = new SplittedView; |
66 | 66 |
67 splitted_view_1->SetColor(SK_ColorYELLOW, SK_ColorCYAN); | 67 splitted_view_1->SetColor(SK_ColorYELLOW, SK_ColorCYAN); |
68 | 68 |
69 single_split_view_ = new views::SingleSplitView( | 69 single_split_view_ = new views::SingleSplitView( |
70 splitted_view_1, splitted_view_2, | 70 splitted_view_1, splitted_view_2, |
71 views::SingleSplitView::HORIZONTAL_SPLIT, | 71 views::SingleSplitView::HORIZONTAL_SPLIT, |
72 NULL); | 72 this); |
73 | 73 |
74 views::GridLayout* layout = new views::GridLayout(container); | 74 views::GridLayout* layout = new views::GridLayout(container); |
75 container->SetLayoutManager(layout); | 75 container->SetLayoutManager(layout); |
76 | 76 |
77 views::ColumnSet* column_set = layout->AddColumnSet(0); | 77 views::ColumnSet* column_set = layout->AddColumnSet(0); |
78 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, | 78 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, |
79 views::GridLayout::USE_PREF, 0, 0); | 79 views::GridLayout::USE_PREF, 0, 0); |
80 layout->StartRow(1, 0); | 80 layout->StartRow(1, 0); |
81 layout->AddView(single_split_view_); | 81 layout->AddView(single_split_view_); |
82 } | 82 } |
83 | 83 |
| 84 bool SingleSplitViewExample::SplitHandleMoved(views::SingleSplitView* sender) { |
| 85 PrintStatus("Splitter moved"); |
| 86 return true; |
| 87 } |
| 88 |
84 } // namespace examples | 89 } // namespace examples |
OLD | NEW |