Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: views/examples/box_layout.h

Issue 2145001: views: Move BoxLayout class into views/examples directory. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: fix win2 Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | views/examples/box_layout.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 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_BOX_LAYOUT_H_
6 #define VIEWS_EXAMPLES_BOX_LAYOUT_H_
7
8 #include "views/layout_manager.h"
9
10 namespace examples {
11
12 // A layout manager that layouts child views vertically or horizontally.
13 class BoxLayout : public views::LayoutManager {
14 public:
15 enum Orientation {
16 kHorizontal,
17 kVertical,
18 };
19
20 BoxLayout(Orientation orientation, int margin);
21
22 virtual ~BoxLayout() {}
23
24 // Overridden from views::LayoutManager:
25 virtual void Layout(views::View* host);
26
27 virtual gfx::Size GetPreferredSize(views::View* host);
28
29 private:
30 const Orientation orientation_;
31
32 // The pixel distance between children.
33 const int margin_;
34
35 DISALLOW_COPY_AND_ASSIGN(BoxLayout);
36 };
37
38 } // namespace examples
39
40 #endif // VIEWS_EXAMPLES_BOX_LAYOUT_H_
OLDNEW
« no previous file with comments | « no previous file | views/examples/box_layout.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698