ultimatepp/uppsrc/CtrlLib/Complex.upt
cxl 263382f30b uppsrc: .upt removed CLASSNAME
git-svn-id: svn://ultimatepp.org/upp/trunk@15253 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2020-10-15 09:17:03 +00:00

64 lines
1.4 KiB
Text

template "U++ CtrlLib application with main window" main;
id "Main window class name" classname = PACKAGE;
select("No layouts", "Generate layout file", "Main window has layout", "Main window has OK/Cancel")
"Layout" lay = 2;
option "Imagelist file" iml;
@@<:PACKAGE:>.h
#ifndef _<:PACKAGE:>_<:PACKAGE:>_h
#define _<:PACKAGE:>_<:PACKAGE:>_h
#include <CtrlLib/CtrlLib.h>
using namespace Upp;<:?lay:>
#define LAYOUTFILE <<:PACKAGE:>/<:PACKAGE:>.lay>
#include <CtrlCore/lay.h><:.:><:?iml:>
#define IMAGEFILE <<:PACKAGE:>/<:PACKAGE:>.iml>
#include <Draw/iml_header.h><:.:>
class <:classname:> : public <:lay > 1 ? "With" + classname + "Layout<TopWindow>" : "TopWindow":> {
public:
<:classname:>();
};
#endif
@@main.cpp
#include "<:PACKAGE:>.h"<:?iml:>
#define IMAGEFILE <<:PACKAGE:>/<:PACKAGE:>.iml>
#include <Draw/iml_source.h><:.:>
<:classname:>::<:classname:>()
{<:?lay > 1:>
CtrlLayout<:(lay == 3 ? "OKCancel" : ""):>(*this, "Window title");<:.:>
}
GUI_APP_MAIN
{
<:classname:>().Run();
}
@@<:PACKAGE:>.lay
??lay
LAYOUT(<:classname:>Layout, 200, 100)<:?lay == 3:>
ITEM(Button, ok, SetLabel("OK").RightPosZ(90, 80).BottomPosZ(4, 22))
ITEM(Button, cancel, SetLabel("Cancel").RightPosZ(4, 80).BottomPosZ(4, 22))<:.:>
END_LAYOUT
@@<:PACKAGE:>.iml
??iml
@@<:PACKAGE:>.upp
uses
CtrlLib;
file
<:PACKAGE:>.h,
main.cpp<:?lay:>,
<:PACKAGE:>.lay<:.:><:?iml:>,
<:PACKAGE:>.iml<:.:>;
mainconfig
"" = "GUI";