forked from hchenqi/ViewDesign
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewMirroring.cpp
More file actions
65 lines (62 loc) · 1.79 KB
/
Copy pathViewMirroring.cpp
File metadata and controls
65 lines (62 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <ViewDesign/view/widget/DefaultWindow.h>
#include <ViewDesign/view/frame/MirroringFrame.h>
#include <ViewDesign/view/frame/ScrollFrame.h>
#include <ViewDesign/view/frame/ClipFrame.h>
#include <ViewDesign/view/frame/MaxFrame.h>
#include <ViewDesign/view/frame/PaddingFrame.h>
#include <ViewDesign/view/frame/BackgroundFrame.h>
#include <ViewDesign/view/frame/StretchFrame.h>
#include <ViewDesign/view/frame/ScaleFrame.h>
#include <ViewDesign/view/layout/StackLayout.h>
#include <ViewDesign/view/control/TextEditor.h>
#include <ViewDesign/view/wrapper/Background.h>
#include <ViewDesign/view/wrapper/HitTestHelper.h>
using namespace ViewDesign;
void App() {
auto mirroring_frame = create<MirroringFrame<Fixed, Fixed>>(
new ClipFrame<Fixed, Fixed, Top>(
new ScrollFrame<Fixed, Bounded>(
new ClipFrame<Fixed, Auto, Left>(
new MaxFrame<Bounded, Auto>(
length_infinite,
new PaddingFrame(
Padding(10.0f),
new TextEditor(TextEditor::Style(), u"Type something here...")
)
)
)
)
)
);
auto& mirroring_frame_ref = *mirroring_frame;
desktop.AddWindow(
new DefaultBackground<DefaultWindow>(
DefaultWindow::Style(),
u"ViewMirroring",
new StackLayoutMultiple(
std::move(mirroring_frame),
create<HitThrough<ClipFrame<Fixed, Fixed, BottomRight>>>(
new BackgroundFrame(
Color(ColorCode::LightBlue, 0x80),
new MaxFrame<Auto, Auto>(
Size(400.0f, 400.0f),
new StretchFrameUniform(
mirroring_frame_ref.CreateMirrorView()
)
)
)
),
create<HitThrough<ClipFrame<Fixed, Fixed, TopRight>>>(
new BackgroundFrame(
Color(ColorCode::Fuchsia, 0x40),
new ScaleFrame(
Scale(0.3f),
mirroring_frame_ref.CreateMirrorView()
)
)
)
)
)
);
desktop.EventLoop();
}