RichText: Fixed problem with GetWidth and paragraphs not aligned left

This commit is contained in:
Mirek Fidler 2025-01-22 14:20:50 +01:00
parent 8fc23a3bf3
commit 93d4e8571d
5 changed files with 37 additions and 50 deletions

View file

@ -6,43 +6,30 @@ class HelloWorld : public TopWindow {
MenuBar menu;
StatusBar status;
void FileMenu(Bar& bar);
void MainMenu(Bar& bar);
void About();
public:
typedef HelloWorld CLASSNAME;
HelloWorld();
};
void HelloWorld::About()
{
PromptOK("{{1@5 [@9= This is the]::@2 [A5@0 Ultimate`+`+ Hello world sample}}");
}
void HelloWorld::FileMenu(Bar& bar)
{
bar.Add("About..", THISBACK(About));
bar.Separator();
bar.Add("Exit", THISBACK(Close));
}
void HelloWorld::MainMenu(Bar& bar)
{
menu.Add("File", THISBACK(FileMenu));
}
HelloWorld::HelloWorld()
{
Title("Hello world!");
AddFrame(menu);
AddFrame(status);
menu.Set(THISBACK(MainMenu));
menu.Set([=](Bar& bar) {
menu.Sub("File", [=](Bar& bar) {
bar.Add("About..", [=] {
PromptOK("{{1@5 [@9= This is the]::@2 [A5@0 Ultimate`+`+ Hello world sample}}");
});
bar.Separator();
bar.Add("Exit", [=] { Close(); });
});
});
status = "Welcome to the Ultimate++ !";
}
GUI_APP_MAIN
{
SetLanguage(LNG_ENGLISH);
HelloWorld().Run();
}