Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site











SourceForge.net Logo

DerivedLayout

 

Test deriving layouts

 

 

DerivedLayout.h

 

#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 WithDerivedLayout<Base> {

    Derived();

};

 

#endif

 

 

 

main.cpp

 

#include "DerivedLayout.h"

 

Base::Base()

{

    CtrlLayout(*this);

}

 

Derived::Derived()

{

    SetLayout_DerivedLayout(*this, true);

}

 

GUI_APP_MAIN

{

    Derived().Run();

}

 

 

 

DerivedLayout.lay

 

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

 

 

 

 

 

Do you want to contribute?