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











SourceForge.net Logo

Layout

 

Using layouts for dialogs

 

 

Layout.cpp

 

#include <CtrlLib/CtrlLib.h>

 

using namespace Upp;

 

#define LAYOUTFILE <Layout/Layout.lay>

#include <CtrlCore/lay.h>

 

GUI_APP_MAIN

{

    WithDialogLayout<TopWindow> dlg;

    CtrlLayoutOKCancel(dlg, "Enter a number");

    dlg.number <<= 10;

    for(;;)

        switch(dlg.Execute()) {

        case IDOK:

            PromptOK(AsString(~dlg.number));

            break;

        case IDCANCEL:

            return;

        }

}

 

 

 

Layout.lay

 

LAYOUT(DialogLayout, 148, 68)

    ITEM(Label, dv___0, SetLabel(t_("A number")).LeftPosZ(8, 56).TopPosZ(8, 19))

    ITEM(EditIntSpin, number, LeftPosZ(64, 76).TopPosZ(8, 19))

    ITEM(Button, cancel, SetLabel(t_("Cancel")).LeftPosZ(76, 64).TopPosZ(36, 24))

    ITEM(Button, ok, SetLabel(t_("OK")).LeftPosZ(8, 64).TopPosZ(36, 24))

END_LAYOUT

 

 

 

 

 

Do you want to contribute?