ui/wpf/UIwrapper/UIwrapper/menu.cpp

Sun, 15 Jan 2017 15:08:07 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 15 Jan 2017 15:08:07 +0100
changeset 132
a24465cc7262
parent 89
9a7e4a335b2b
permissions
-rw-r--r--

fixes VS settings

81
5eb765a7a793 added menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1
5eb765a7a793 added menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 #include "stdafx.h"
5eb765a7a793 added menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 #include <stdio.h>
5eb765a7a793 added menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4
5eb765a7a793 added menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 #include "menu.h"
5eb765a7a793 added menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6
5eb765a7a793 added menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 #using "UIcore.dll"
5eb765a7a793 added menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8
5eb765a7a793 added menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 UI_EXPORT void __stdcall UImenu(char *label) {
89
9a7e4a335b2b added toolbar (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 83
diff changeset
10 UI::Application::GetInstance()->Menu->AddMenu(gcnew String(label));
81
5eb765a7a793 added menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 }
5eb765a7a793 added menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12
82
0cdb8089a29f added event handler for menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 81
diff changeset
13 UI_EXPORT void __stdcall UIsubmenu(char *label) {
89
9a7e4a335b2b added toolbar (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 83
diff changeset
14 UI::Application::GetInstance()->Menu->AddSubMenu(gcnew String(label));
82
0cdb8089a29f added event handler for menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 81
diff changeset
15 }
81
5eb765a7a793 added menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16
82
0cdb8089a29f added event handler for menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 81
diff changeset
17 UI_EXPORT void __stdcall UIsubmenu_end() {
89
9a7e4a335b2b added toolbar (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 83
diff changeset
18 UI::Application::GetInstance()->Menu->EndSubMenu();
82
0cdb8089a29f added event handler for menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 81
diff changeset
19 }
0cdb8089a29f added event handler for menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 81
diff changeset
20
0cdb8089a29f added event handler for menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 81
diff changeset
21
0cdb8089a29f added event handler for menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 81
diff changeset
22 UI_EXPORT void __stdcall UImenuitem(char *label, UIcallback f, void *eventdata) {
83
a38aec91bd66 added box layout and button (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 82
diff changeset
23 ObjEventWrapper ^e = gcnew ObjEventWrapper(f, eventdata);
89
9a7e4a335b2b added toolbar (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 83
diff changeset
24 UI::Application::GetInstance()->Menu->AddMenuItem(gcnew String(label), e->GetAction());
81
5eb765a7a793 added menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 }
82
0cdb8089a29f added event handler for menus (WPF)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 81
diff changeset
26

mercurial