ui/wpf/UIwrapper/UIwrapper/controls.cpp

changeset 83
a38aec91bd66
child 88
04c81be1c5a0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/wpf/UIwrapper/UIwrapper/controls.cpp	Sat Jan 31 11:51:54 2015 +0100
@@ -0,0 +1,18 @@
+
+
+#include "stdafx.h"
+#include <stdio.h>
+
+#include "controls.h"
+
+#using "UIcore.dll"
+
+UI_EXPORT void* __stdcall UIbutton(gcroot<UI::Container^> *container, char *label, UIcallback f, void *eventdata) {
+	gcroot<Button^> *button = new gcroot<Button^>();
+
+	EventWrapper ^evt = gcnew EventWrapper(f, eventdata);
+	RoutedEventHandler ^handler = gcnew RoutedEventHandler(evt, &EventWrapper::Callback);
+
+	*button = UI::Controls::Button(*container, gcnew String(label), handler);
+	return button;
+}
\ No newline at end of file

mercurial