mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
reference: DerivedLayout example
git-svn-id: svn://ultimatepp.org/upp/trunk@4615 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
adf5544e00
commit
fcdccf4f81
5 changed files with 62 additions and 0 deletions
19
reference/DerivedLayout/DerivedLayout.h
Normal file
19
reference/DerivedLayout/DerivedLayout.h
Normal 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
|
||||||
10
reference/DerivedLayout/DerivedLayout.lay
Normal file
10
reference/DerivedLayout/DerivedLayout.lay
Normal 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
|
||||||
|
|
||||||
13
reference/DerivedLayout/DerivedLayout.upp
Normal file
13
reference/DerivedLayout/DerivedLayout.upp
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
description "Combining Layouts in class inheritance\377";
|
||||||
|
|
||||||
|
uses
|
||||||
|
CtrlLib;
|
||||||
|
|
||||||
|
file
|
||||||
|
DerivedLayout.h,
|
||||||
|
main.cpp,
|
||||||
|
DerivedLayout.lay;
|
||||||
|
|
||||||
|
mainconfig
|
||||||
|
"" = "GUI";
|
||||||
|
|
||||||
4
reference/DerivedLayout/init
Normal file
4
reference/DerivedLayout/init
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#ifndef _DerivedLayout_icpp_init_stub
|
||||||
|
#define _DerivedLayout_icpp_init_stub
|
||||||
|
#include "CtrlLib/init"
|
||||||
|
#endif
|
||||||
16
reference/DerivedLayout/main.cpp
Normal file
16
reference/DerivedLayout/main.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
#include "DerivedLayout.h"
|
||||||
|
|
||||||
|
Base::Base()
|
||||||
|
{
|
||||||
|
CtrlLayout(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
Derived::Derived()
|
||||||
|
{
|
||||||
|
SetLayout_DerivedLayout(*this, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
GUI_APP_MAIN
|
||||||
|
{
|
||||||
|
Derived().Run();
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue