reference: DerivedLayout example

git-svn-id: svn://ultimatepp.org/upp/trunk@4615 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2012-02-24 17:43:33 +00:00
parent adf5544e00
commit fcdccf4f81
5 changed files with 62 additions and 0 deletions

View file

@ -0,0 +1,19 @@
#ifndef _DerivedLayout_DerivedLayout_h
#define _DerivedLayout_DerivedLayout_h
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
#define LAYOUTFILE <DerivedLayout/DerivedLayout.lay>
#include <CtrlCore/lay.h>
struct Base : public WithBaseLayout<TopWindow> {
Base();
};
struct Derived : public Base, public WithDerivedLayout<EmptyClass> {
Derived();
};
#endif

View file

@ -0,0 +1,10 @@
LAYOUT(BaseLayout, 184, 68)
ITEM(Label, bl, SetLabel(t_("Base class control:")).LeftPosZ(8, 108).TopPosZ(8, 20))
ITEM(EditString, baseEdit, LeftPosZ(116, 64).TopPosZ(8, 19))
END_LAYOUT
LAYOUT(DerivedLayout, 184, 68)
ITEM(Label, dl, SetLabel(t_("Derived class control:")).LeftPosZ(8, 112).TopPosZ(36, 20))
ITEM(EditString, derivedEdit, LeftPosZ(116, 64).TopPosZ(36, 19))
END_LAYOUT

View file

@ -0,0 +1,13 @@
description "Combining Layouts in class inheritance\377";
uses
CtrlLib;
file
DerivedLayout.h,
main.cpp,
DerivedLayout.lay;
mainconfig
"" = "GUI";

View file

@ -0,0 +1,4 @@
#ifndef _DerivedLayout_icpp_init_stub
#define _DerivedLayout_icpp_init_stub
#include "CtrlLib/init"
#endif

View file

@ -0,0 +1,16 @@
#include "DerivedLayout.h"
Base::Base()
{
CtrlLayout(*this);
}
Derived::Derived()
{
SetLayout_DerivedLayout(*this, true);
}
GUI_APP_MAIN
{
Derived().Run();
}