CtrlLib, Tutorial: fixed 16.2 tutorial (Layouts - Upp agnostic implementation).

This commit is contained in:
Zbigniew Rębacz 2022-05-04 17:13:50 +02:00
parent b11938a43c
commit d670725115
7 changed files with 41 additions and 19 deletions

View file

@ -2,7 +2,7 @@
using namespace Upp;
#define LAYOUTFILE <Gui16/dlg.lay>
#define LAYOUTFILE <Gui16a/dlg.lay>
#include <CtrlCore/lay.h>
struct MyAppWindow : public WithDlgLayout<TopWindow> {

View file

@ -0,0 +1,12 @@
description "Layouts - Upp namespace agnostic\377";
uses
CtrlLib;
file
main.cpp,
dlg.lay;
mainconfig
"" = "GUI";

6
tutorial/Gui16b/dlg.lay Normal file
View file

@ -0,0 +1,6 @@
LAYOUT(DlgLayout, 208, 64)
ITEM(Upp::Label, dv___0, SetLabel(t_("Label")).LeftPosZ(8, 36).TopPosZ(8, 19))
ITEM(Upp::EditString, text, LeftPosZ(48, 92).TopPosZ(8, 19))
ITEM(Upp::Option, option, SetLabel(t_("Option")).LeftPosZ(8, 108).TopPosZ(32, 15))
END_LAYOUT

15
tutorial/Gui16b/main.cpp Normal file
View file

@ -0,0 +1,15 @@
#include <CtrlLib/CtrlLib.h>
#define LAYOUTFILE <Gui16b/dlg.lay>
#include <CtrlCore/lay.h>
struct MyAppWindow : public WithDlgLayout<Upp::TopWindow> {
MyAppWindow() {
CtrlLayout(*this, "MyDialog");
}
};
GUI_APP_MAIN
{
MyAppWindow().Run();
}