第一印象
範例程式
截圖
與其它函式庫比較
相關應用
下載
Documentation
作品展示(Bazaar)
現狀及發展藍圖
常見問題(FAQ)
作者與授權
論壇
資助Ultimate++
搜尋本網站
語言
中文(繁體)











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

 

 

 

 

 

本頁也正在english, català, čeština, deutsch, español, euskara, français, română, русский中文(简体)中. 你想幫忙嗎?