MCPcopy Create free account
hub / github.com/AshampooSystems/boden / createContent

Method createContent

examples/KeyboardTest/source/MainViewController.cpp:29–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29std::shared_ptr<bdn::ui::ContainerView> MainViewController::createContent(int numItems,
30 std::shared_ptr<bdn::ui::Button> nextButton)
31{
32 auto container = std::make_shared<bdn::ui::ContainerView>();
33 container->stylesheet = FlexJsonStringify({
34 "direction" : "Column",
35 "justifyContent" : "SpaceBetween",
36 "alignItems" : "Stretch",
37 "flexGrow" : 1,
38 "flexShrink" : 0,
39 "padding" : {"left" : 10, "right" : 10, "top" : 100, "bottom" : 10}
40 });
41
42 for (int i = 0; i < numItems; i++) {
43 if (i == 0) {
44 auto label = std::make_shared<bdn::ui::Label>();
45 label->text = "Hello World";
46 label->stylesheet = FlexJsonStringify({"flexShrink" : 0});
47
48 container->addChildView(label);
49 } else if (i == 4 && nextButton) {
50 nextButton->stylesheet = FlexJsonStringify({"flexShrink" : 0});
51 container->addChildView(nextButton);
52 } else {
53 auto textField = std::make_shared<bdn::ui::TextField>();
54 textField->stylesheet = FlexJsonStringify({"flexShrink" : 0});
55 container->addChildView(textField);
56 }
57 }
58
59 return container;
60}
61
62std::shared_ptr<bdn::ui::View> MainViewController::createNavPage()
63{

Callers

nothing calls this directly

Calls 1

addChildViewMethod · 0.45

Tested by

no test coverage detected