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

Side by Side Diff: ui/views/examples/anchor_example.h

Issue 2230913003: Experimental alignment layout manager using a property on the views Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed AlignAttribute and associated types to FillAttribute Created 4 years, 2 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 | « ui/views/examples/BUILD.gn ('k') | ui/views/examples/anchor_example.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) 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 UI_VIEWS_EXAMPLES_ANCHOR_EXAMPLE_H_
6 #define UI_VIEWS_EXAMPLES_ANCHOR_EXAMPLE_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "ui/views/anchor_attribute.h"
12 #include "ui/views/controls/button/button.h"
13 #include "ui/views/controls/label.h"
14 #include "ui/views/examples/example_base.h"
15 #include "ui/views/view.h"
16 #include "ui/views/widget/widget.h"
17
18 namespace views {
19
20 class LabelButton;
21
22 namespace examples {
23
24 // AnchorExample demonstrates how to use anchors to handle size/position
25 // relative to the parent.
26 class VIEWS_EXAMPLES_EXPORT AnchorExample : public ExampleBase,
27 public ButtonListener {
28 public:
29 AnchorExample();
30 ~AnchorExample() override;
31
32 // ExampleBase:
33 void CreateExampleView(View* container) override;
34
35 private:
36 // ButtonListener:
37 void ButtonPressed(Button* sender, const ui::Event& event) override;
38 base::string16 FillText(Fill fill);
39 base::string16 AnchorText(Anchor anchor);
40 base::string16 AnchorsText(Anchors anchors);
41 void ClearAlignButtons(View *view);
42 void ReflectAnchors(View *view, AnchorAttribute *attribute);
43
44 Label* anchored_view_label_ = nullptr;
45 View* work_panel_ = nullptr;
46 Anchors current_anchors_ = {Anchor::Left, Anchor::Top};
47
48 DISALLOW_COPY_AND_ASSIGN(AnchorExample);
49 };
50
51 } // namespace examples
52 } // namespace views
53
54 #endif // UI_VIEWS_EXAMPLES_ANCHOR_EXAMPLE_H_
OLDNEW
« no previous file with comments | « ui/views/examples/BUILD.gn ('k') | ui/views/examples/anchor_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698