mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
.tutorial
git-svn-id: svn://ultimatepp.org/upp/trunk@15247 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
453a60c97a
commit
c9c77ab237
4 changed files with 7 additions and 7 deletions
|
|
@ -1,4 +1,4 @@
|
|||
description "Context menu alternative and using CallbackArgTarget\377";
|
||||
description "Context menu alternative\377";
|
||||
|
||||
uses
|
||||
CtrlLib;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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!");
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue