ultimatepp/reference/Cpp11/main.cpp
cxl 401d9129b7 reference: Cpp11 features
git-svn-id: svn://ultimatepp.org/upp/trunk@8880 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2015-08-31 10:13:04 +00:00

24 lines
507 B
C++

#include "CtrlLib/CtrlLib.h"
using namespace Upp;
#define LAYOUTFILE <Cpp11/Cpp11.lay>
#include <CtrlCore/lay.h>
GUI_APP_MAIN
{
WithMyAppLayout<TopWindow> dlg;
CtrlLayout(dlg, "C++11 demo");
dlg.list.NoHeader().AddColumn();
Vector<int> x = { 1, 2, 12, 34, 15, 11 };
for(auto i : x)
dlg.list.Add(i);
dlg.add << [&] {
if(dlg.list.Find(~dlg.number) < 0)
dlg.list.Add(~dlg.number);
};
dlg.list.WhenSel << [&] {
dlg.number <<= dlg.list.GetKey();
};
dlg.Execute();
}