ultimatepp/examples/CustomTitlebar/main.cpp
2025-05-29 10:20:10 +02:00

34 lines
535 B
C++

#include <CtrlLib/CtrlLib.h>
using namespace Upp;
struct MyApp : TopWindow {
void Paint(Draw& w) override {
Size sz = GetSize();
w.DrawRect(sz, LtCyan());
}
void MainMenu(Bar& bar)
{
bar.Sub("File", [=](Bar& bar) {
bar.Add("Exit", [=] { Break(); });
});
}
MenuBar bar;
MyApp() {
CustomTitleBar();
Add(bar.LeftPos(0, 300).TopPos(0, 30));
bar.Set([=](Bar& bar) {
MainMenu(bar);
});
};
};
GUI_APP_MAIN
{
TopWindow win;
win.Sizeable().Zoomable().OpenMain();
MyApp().Sizeable().Zoomable().Run();
}