mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-21 06:14:08 -06:00
RichText: Fixed problem with GetWidth and paragraphs not aligned left
This commit is contained in:
parent
8fc23a3bf3
commit
93d4e8571d
5 changed files with 37 additions and 50 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue