diff --git a/reference/SetLayout/SetLayout.cpp b/reference/SetLayout/SetLayout.cpp new file mode 100644 index 000000000..b1ed56b63 --- /dev/null +++ b/reference/SetLayout/SetLayout.cpp @@ -0,0 +1,28 @@ +#include + +using namespace Upp; + +#define LAYOUTFILE +#include + +class MyApp : public WithLayout1 { +public: + void Layout1() { SetLayout_Layout1(*this); } + void Layout2() { SetLayout_Layout2(*this); } + + typedef MyApp CLASSNAME; + + MyApp() + { + CtrlLayout(*this, "Window title"); + layout1 <<= THISBACK(Layout1); + layout2 <<= THISBACK(Layout2); + } +}; + + +GUI_APP_MAIN +{ + MyApp().Run(); +} + diff --git a/reference/SetLayout/SetLayout.lay b/reference/SetLayout/SetLayout.lay new file mode 100644 index 000000000..d993f1ade --- /dev/null +++ b/reference/SetLayout/SetLayout.lay @@ -0,0 +1,14 @@ +LAYOUT(Layout1, 228, 64) + ITEM(Label, lbl1, SetLabel(t_("Label")).LeftPosZ(8, 40).TopPosZ(4, 21)) + ITEM(EditString, edit, LeftPosZ(48, 172).TopPosZ(4, 19)) + ITEM(Button, layout1, SetLabel(t_("Layout1")).LeftPosZ(8, 96).TopPosZ(32, 24)) + ITEM(Button, layout2, SetLabel(t_("Layout2")).LeftPosZ(124, 96).TopPosZ(32, 24)) +END_LAYOUT + +LAYOUT(Layout2, 228, 64) + ITEM(Label, lbl1, SetLabel(t_("Label")).LeftPosZ(8, 36).TopPosZ(12, 21)) + ITEM(EditString, edit, LeftPosZ(8, 112).TopPosZ(37, 19)) + ITEM(Button, layout1, SetLabel(t_("Layout1")).LeftPosZ(124, 96).TopPosZ(8, 24)) + ITEM(Button, layout2, SetLabel(t_("Layout2")).LeftPosZ(124, 96).TopPosZ(36, 24)) +END_LAYOUT + diff --git a/reference/SetLayout/SetLayout.upp b/reference/SetLayout/SetLayout.upp new file mode 100644 index 000000000..35aa85dca --- /dev/null +++ b/reference/SetLayout/SetLayout.upp @@ -0,0 +1,12 @@ +description "Demonstrates usage of SetLayout function to change the layout of dialog\377"; + +uses + CtrlLib; + +file + SetLayout.cpp, + SetLayout.lay; + +mainconfig + "" = "GUI SSE2"; + diff --git a/reference/SetLayout/init b/reference/SetLayout/init new file mode 100644 index 000000000..c86bb5c88 --- /dev/null +++ b/reference/SetLayout/init @@ -0,0 +1,4 @@ +#ifndef _SetLayout_icpp_init_stub +#define _SetLayout_icpp_init_stub +#include "CtrlLib/init" +#endif