graph TD
A[project_template_ui_xmake] --> B[xmake.lua]
A --> C[src/]
C --> D[MainWindow.h]
C --> E[MainWindow.cpp]
C --> F[main.cpp]
A --> G[.vscode/]
G --> H[c_cpp_properties.json]
-- Specify available build configurationsadd_rules("mode.release","mode.debug")-- Specify compile commands output directory and LSP to analyze C++ code files and highlight IntelliSenseadd_rules("plugin.compile_commands.autoupdate",{outputdir=".vscode",lsp="clangd"})-- Specify C++ standard to use, as AUI uses C++20 by defaultset_languages("c++20")-- Download aui package to use for targets lateradd_requires("aui")-- Define our target executable to buildtarget("aui-minimal-example")-- Add source code and headers to targetadd_files("src/*.cpp")add_includedirs("src")-- Add AUI package to target while linking only required componentsadd_packages("aui",{components={"core","image","views","xml"}})-- Resolve linking by grouping AUI components into link groupsadd_linkgroups("aui.views","aui.xml","aui.image","aui.core",{whole=true})
#include"MainWindow.h"#include<AUI/Util/UIBuildingHelpers.h>#include<AUI/View/ALabel.h>#include<AUI/View/AButton.h>#include<AUI/Platform/APlatform.h>usingnamespacedeclarative;MainWindow::MainWindow():AWindow("Project template app",300_dp,200_dp){setContents(Centered{Vertical{Centered{Label{"Hello world from AUI!"}},_new<AButton>("Visit GitHub repo").connect(&AView::clicked,this,[]{APlatform::openUrl("https://github.com/aui-framework/aui");}),_new<AButton>("Visit docs").connect(&AView::clicked,this,[]{APlatform::openUrl("https://aui-framework.github.io/");}),_new<AButton>("Submit an issue").connect(&AView::clicked,this,[]{APlatform::openUrl("https://github.com/aui-framework/aui/issues/new");}),}});}
#include<AUI/Util/UIBuildingHelpers.h>#include<AUI/View/ALabel.h>#include<AUI/View/AButton.h>#include<AUI/Platform/APlatform.h>usingnamespacedeclarative;MainWindow::MainWindow():AWindow("Project template app",300_dp,200_dp){setContents(Centered{Vertical{Centered{Label{"Hello world from AUI!"}},_new<AButton>("Visit GitHub repo").connect(&AView::clicked,this,[]{APlatform::openUrl("https://github.com/aui-framework/aui");}),_new<AButton>("Visit docs").connect(&AView::clicked,this,[]{APlatform::openUrl("https://aui-framework.github.io/");}),_new<AButton>("Submit an issue").connect(&AView::clicked,this,[]{APlatform::openUrl("https://github.com/aui-framework/aui/issues/new");}),}});}