Información general
Ejemplos
Pantallas
Comparaciones
Aplicaciones
Descargar
Documentation
"El Mercado"
Estado y Plan de trabajo
Preguntas más frecuentes
Autores y Licencia
Foros
Financiación de U++
Busca en esta página
Idioma
español











SourceForge.net Logo



SetLayout

 

Demonstrates usage of SetLayout function to change the layout of dialog

 

 

SetLayout.cpp

 

#include <CtrlLib/CtrlLib.h>

 

using namespace Upp;

 

#define LAYOUTFILE <SetLayout/SetLayout.lay>

#include <CtrlCore/lay.h>

 

class MyApp : public WithLayout1<TopWindow> {

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();

}

 

 

 

 

SetLayout.lay

 

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

 

 

 

 

 

Esta página está también en english, català, čeština, deutsch, euskara, français, română, русский, 中文(简体) y 中文(繁體). ¿Quieres ayudar?