MCPcopy Create free account
hub / github.com/aui-framework/aui / ExampleWindow

Method ExampleWindow

examples/ui/views/src/ExampleWindow.cpp:100–657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98};
99
100ExampleWindow::ExampleWindow() : AWindow("Examples", 800_dp, 700_dp) {
101 allowDragNDrop();
102
103 setLayout(std::make_unique<AVerticalLayout>());
104 AStylesheet::global().addRules({ {
105 c(".all_views_wrap") > t<AViewContainer>(),
106 Padding { 16_dp },
107 } });
108#if AUI_PLATFORM_IOS || AUI_PLATFORM_ANDROID
109 setCustomStyle({
110 Padding { 64_dp, {}, 16_dp },
111 });
112#endif
113
114 addView(Horizontal {
115 _new<ADrawableView>(IDrawable::fromUrl(":img/logo.svg")) with_style { FixedSize { 32_dp } },
116 AText::fromString("Building beautiful programs in pure C++ without chromium embedded framework") with_style {
117 Expanding(1, 0),
118 },
119 Horizontal {} let {
120 mAsync << async {
121 auto drawable = IDrawable::fromUrl(
122 "https://raster.shields.io/github/stars/aui-framework/aui?style=raster&logo=github");
123 ui_thread {
124 auto view = Icon { drawable } with_style {
125 FixedSize { 80_dp, 20_dp },
126 BackgroundImage { {}, {}, {}, Sizing::COVER },
127 Margin { 4_dp },
128 ACursor::POINTER,
129 };
130 connect(view->clicked, [] {
131 APlatform::openUrl("https://github.com/aui-framework/aui/stargazers");
132 });
133 it->addView(view);
134 };
135 };
136 },
137 });
138
139 _<ATabView> tabView;
140 _<AProgressBar> progressBar = _new<AProgressBar>();
141 _<ACircleProgressBar> circleProgressBar = _new<ACircleProgressBar>();
142
143 addView(tabView = _new<ATabView>() let {
144 it->addTab(
145 AScrollArea::Builder().withContents(std::conditional_t<
146 aui::platform::current::is_mobile(), Vertical, Horizontal> {
147 Vertical {
148 // buttons
149 GroupBox {
150 Label { "Buttons" },
151 Vertical {
152 _new<AButton>("Common button"),
153 _new<AButton>("Default button") let { it->setDefault(); },
154 _new<AButton>("Disabled button") let { it->setDisabled(); },
155 Button {
156 Icon { ":img/logo.svg" },
157 Label { "Button with icon" },

Callers

nothing calls this directly

Calls 15

fromStringFunction · 0.85
connectFunction · 0.85
makeFunction · 0.85
fillWindowFunction · 0.85
infoFunction · 0.85
HorizontalClass · 0.85
SpacerExpandingClass · 0.85
AMetricFunction · 0.85
FixedSizeClass · 0.85
addTabMethod · 0.80
setDefaultMethod · 0.80
clickedMethod · 0.80

Tested by

no test coverage detected