ui/wpf/UIwrapper/UIwrapper/toolkit.h

Sat, 31 Jan 2015 11:51:54 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 31 Jan 2015 11:51:54 +0100
changeset 83
a38aec91bd66
parent 82
0cdb8089a29f
child 135
b9dc9cdfa23a
permissions
-rw-r--r--

added box layout and button (WPF)

// UIwrapper.h

#pragma once

#include <vcclr.h>

using namespace System;
using namespace System::Runtime::InteropServices;
using namespace System::Threading;
using namespace System::Windows;
using namespace System::Windows::Controls;

#define UI_EXPORT extern "C" __declspec(dllexport)

extern "C" typedef void(*UIcallback)(void*, void*);

void* ObjectToPtr(Object ^obj);
Object^ PtrToObject(void *ptr);

public ref class ObjEventWrapper {
	UIcallback callback = NULL;
	void *eventdata = NULL;
	Action<IntPtr> ^action;

public:
	ObjEventWrapper(UIcallback callback, void *eventdata);

	Action<IntPtr>^ GetAction();

	void Callback(IntPtr uiobj);
};

public ref class EventWrapper {
	UIcallback callback = NULL;
	void *eventdata = NULL;
	

public:
	EventWrapper(UIcallback callback, void *eventdata);
	void Callback(Object ^sender, RoutedEventArgs ^e);
};

mercurial