1 module w95.demo;
2 
3 import w95;
4 import fluid;
5 
6 @safe:
7 
8 NodeSlot!Window95 w95Demo() {
9 
10     auto root = nodeSlot!Window95(.layout!"fill");
11 
12     auto window = window95(
13         .layout!"center",
14         titlebar("Welcome"),
15         gridFrame(
16             .segments!2,
17             vspace(
18                 label("Welcome to Windows95"),
19             ),
20             [
21                 hframe(
22                     .layout!(1, "fill"),
23                     .tags!(W95Tag.note),
24                     imageView("resources/tip-of-the-day.png"),
25                     vspace(
26                         label("Did you know..."),
27                         label("You now smell something not unlike rotting meat every time you boot "
28                             ~ "me up.\n"
29                             ~ "I cannot promise that the smell will ever go away  or that you will "
30                             ~ "ever find its source."),
31                         label("But I can promise that you will learn to love it."),
32                     ),
33                 ),
34                 vspace(
35                     .layout!"fill",
36                     .tags!(W95Tag.column),
37                     button(.layout!"fill", "What's new", delegate { }),
38                     button(.layout!"fill", "Online registration", delegate { }),
39                     button(.layout!"fill", "Next tip", delegate { }),
40                     vspace(.layout!1),
41                     hseparator(),
42                 ),
43             ],
44             [
45                 fieldSlot!hspace(
46                     .layout!1,
47                     checkbox(true),
48                     label("Show this Welcome Screen next time you start Windows"),
49                 ),
50                 vspace(
51                     .layout!"fill",
52                     button(
53                         .layout!("fill", "start"),
54                         .tags!(W95Tag.column),
55                         "Close",
56                         delegate {
57                             root = w95Demo2(root);
58                         }
59                     )
60                 ),
61             ],
62         ),
63     );
64 
65     root.tree = new LayoutTree(root);
66     root.io.scale = 1;
67     return root = window;
68 
69 }
70 
71 Window95 w95Demo2(NodeSlot!Window95 root) {
72 
73     return window95(
74         .layout!"center",
75         titlebar(
76             .tags!(W95Tag.teal),
77             "Missing Skin"
78         ),
79         hspace(
80             imageView("resources/dialog-icons/flashlight.png"),
81             vspace(
82                 .layout!"fill",
83                 label("Windows is searching for your skin.\n"
84                     ~ "To locate the skin yourself  click Browse."),
85                 hspace(
86                     .layout!"end",
87                     button("Browse", delegate { }),
88                     button("Cancel", delegate { }),
89                 ),
90             ),
91         ),
92     );
93 
94 }