ultimatepp/reference/EventArgTarget/main.cpp
cxl b4126f6147 .reference
git-svn-id: svn://ultimatepp.org/upp/trunk@9802 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2016-05-05 05:20:18 +00:00

22 lines
445 B
C++

#include <CtrlLib/CtrlLib.h>
using namespace Upp;
struct MyApp : TopWindow {
virtual void RightDown(Point p, dword keyflags) {
EventArgTarget<int> result;
MenuBar menu;
for(int i = 0; i < 10; i++)
menu.Add(AsString(i), result[i]);
menu.Execute();
if(IsNull(result))
PromptOK("Menu was cancelled");
else
PromptOK("You have selected " + AsString((int)result));
}
};
GUI_APP_MAIN
{
MyApp().Run();
}