mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
reference: Cpp11 features
git-svn-id: svn://ultimatepp.org/upp/trunk@8880 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
322f86dbac
commit
89a0bf4270
6 changed files with 51 additions and 1 deletions
4
reference/Callback/init
Normal file
4
reference/Callback/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _Callback_icpp_init_stub
|
||||
#define _Callback_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#endif
|
||||
6
reference/Cpp11/Cpp11.lay
Normal file
6
reference/Cpp11/Cpp11.lay
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
LAYOUT(MyAppLayout, 212, 196)
|
||||
ITEM(ArrayCtrl, list, LeftPosZ(4, 96).TopPosZ(4, 188))
|
||||
ITEM(EditInt, number, LeftPosZ(108, 96).TopPosZ(4, 19))
|
||||
ITEM(Button, add, SetLabel(t_("Add")).LeftPosZ(148, 56).TopPosZ(28, 20))
|
||||
END_LAYOUT
|
||||
|
||||
12
reference/Cpp11/Cpp11.upp
Normal file
12
reference/Cpp11/Cpp11.upp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
description "Demostrates C++11 features\377";
|
||||
|
||||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp,
|
||||
Cpp11.lay;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
4
reference/Cpp11/init
Normal file
4
reference/Cpp11/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _Cpp11_icpp_init_stub
|
||||
#define _Cpp11_icpp_init_stub
|
||||
#include "CtrlLib/init"
|
||||
#endif
|
||||
24
reference/Cpp11/main.cpp
Normal file
24
reference/Cpp11/main.cpp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#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();
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ CONSOLE_APP_MAIN
|
|||
#ifdef bmSVN_REVISION
|
||||
LOG("Svn revision " << bmSVN_REVISION);
|
||||
#endif
|
||||
#ifdef bmSVN_REVISION
|
||||
#ifdef bmSVN_URL
|
||||
LOG("Svn url " << bmSVN_URL);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue