.tutorial

git-svn-id: svn://ultimatepp.org/upp/trunk@15247 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2020-10-14 14:36:29 +00:00
parent 453a60c97a
commit c9c77ab237
4 changed files with 7 additions and 7 deletions

View file

@ -1,4 +1,4 @@
description "Context menu alternative and using CallbackArgTarget\377";
description "Context menu alternative\377";
uses
CtrlLib;

View file

@ -12,7 +12,7 @@ struct MyAppWindow : TopWindow {
int result = Null;
MenuBar menu;
for(int i = 0; i < 10; i++)
menu.Add(AsString(i), [=, &result] { result = i; });
menu.Add(AsString(i), [&] { result = i; });
menu.Separator();
menu.Add("Exit", [=] { Exit(); });
menu.Execute();

View file

@ -5,15 +5,15 @@ using namespace Upp;
struct MyAppWindow : TopWindow {
Button button;
void Click() { PromptOK("You have clicked the button!"); }
typedef MyAppWindow CLASSNAME;
MyAppWindow() {
Title("My application with button");
Add(button.LeftPos(10, 100).TopPos(10, 30));
button.SetLabel("Click me!");
button <<= THISBACK(Click);
button << [=] {
PromptOK("You have clicked the button!");
};
}
};

View file

@ -12,8 +12,8 @@ struct MyApp : TopWindow {
Add(ok.SetLabel("OK").LeftPosZ(10, 64).TopPosZ(40, 24));
Add(cancel.SetLabel("Cancel").LeftPosZ(100, 64).TopPosZ(40, 24));
ok.Ok() <<= Acceptor(IDOK);
cancel.Cancel() <<= Rejector(IDCANCEL);
ok.Ok() << Acceptor(IDOK);
cancel.Cancel() << Rejector(IDCANCEL);
}
};