diff --git a/reference/MenuBarCheck/MenuBarCheck.upp b/reference/MenuBarCheck/MenuBarCheck.upp new file mode 100644 index 000000000..974d150ea --- /dev/null +++ b/reference/MenuBarCheck/MenuBarCheck.upp @@ -0,0 +1,11 @@ +description "Demonstrates the use of local menu with checked item\377"; + +uses + CtrlLib; + +file + main.cpp; + +mainconfig + "" = "GUI SSE2"; + diff --git a/reference/MenuBarCheck/init b/reference/MenuBarCheck/init new file mode 100644 index 000000000..582a9ebcb --- /dev/null +++ b/reference/MenuBarCheck/init @@ -0,0 +1,4 @@ +#ifndef _MenuBarCheck_icpp_init_stub +#define _MenuBarCheck_icpp_init_stub +#include "CtrlLib/init" +#endif diff --git a/reference/MenuBarCheck/main.cpp b/reference/MenuBarCheck/main.cpp new file mode 100644 index 000000000..3ff635b79 --- /dev/null +++ b/reference/MenuBarCheck/main.cpp @@ -0,0 +1,26 @@ +#include + +using namespace Upp; + +struct MyApp : TopWindow { + typedef MyApp CLASSNAME; + + bool check; + + void Check() { check = !check; } + + void RightDown(Point p, dword) { + MenuBar bar; + bar.Add("Check", THISBACK(Check)).Check(check); + bar.Execute(); + } + + MyApp() { + check = false; + } +}; + +GUI_APP_MAIN +{ + MyApp().Run(); +}