ui/wpf/UIwrapper/UIwrapper/controls.cpp

changeset 101
1c943d43fa81
parent 88
04c81be1c5a0
child 104
3efe0210e27e
--- a/ui/wpf/UIwrapper/UIwrapper/controls.cpp	Sun Jan 17 19:19:28 2016 +0100
+++ b/ui/wpf/UIwrapper/UIwrapper/controls.cpp	Wed Jan 20 11:35:01 2016 +0100
@@ -7,6 +7,8 @@
 
 #using "UIcore.dll"
 
+/* ------------------------------ Buttons ------------------------------ */
+
 UI_EXPORT void* __stdcall UIbutton(gcroot<UI::Container^> *container, char *label, UIcallback f, void *eventdata) {
 	gcroot<Button^> *button = new gcroot<Button^>();
 
@@ -18,6 +20,29 @@
 }
 
 
+/* ------------------------------ Labels ------------------------------ */
+
+UI_EXPORT void* __stdcall UIlabel(gcroot<UI::Container^> *container, char *label, int alignment) {
+	gcroot<Label^> *control = new gcroot<Label^>();
+	*control = UI::Controls::Label(*container, gcnew String(label), alignment);
+	return control;
+}
+
+UI_EXPORT void* __stdcall UIspace(gcroot<UI::Container^> *container) {
+	gcroot<Label^> *control = new gcroot<Label^>();
+
+	*control = UI::Controls::Space(*container);
+	return control;
+}
+
+UI_EXPORT void* __stdcall UIseparator(gcroot<UI::Container^> *container) {
+	return NULL;
+}
+
+
+
+/* ------------------------------ Textarea ------------------------------ */
+
 UI_EXPORT void* __stdcall UItextarea(gcroot<UI::Container^> *container, char *text) {
 	String ^str = nullptr;
 	if (text) {
@@ -67,3 +92,18 @@
 UI_EXPORT void __stdcall UIfreestr(char *str) {
 	Marshal::FreeHGlobal((IntPtr)(void*)str);
 }
+
+
+/* ------------------------------ Textfield ------------------------------ */
+
+UI_EXPORT void* __stdcall UItextfield(gcroot<UI::Container^> *container, char *text) {
+	String ^str = nullptr;
+	if (text) {
+		str = gcnew String(text);
+	}
+
+	gcroot<UI::TextArea^> *textfield = new gcroot<UI::TextArea^>();
+	*textfield = UI::TextArea::CreateTextField(*container, str);
+
+	return textfield;
+}
\ No newline at end of file

mercurial