14 RoutedEventHandler ^handler = gcnew RoutedEventHandler(evt, &EventWrapper::Callback); |
14 RoutedEventHandler ^handler = gcnew RoutedEventHandler(evt, &EventWrapper::Callback); |
15 |
15 |
16 *button = UI::Controls::Button(*container, gcnew String(label), handler); |
16 *button = UI::Controls::Button(*container, gcnew String(label), handler); |
17 return button; |
17 return button; |
18 } |
18 } |
|
19 |
|
20 |
|
21 UI_EXPORT void* __stdcall UItextarea(gcroot<UI::Container^> *container, char *text) { |
|
22 String ^str = nullptr; |
|
23 if (text) { |
|
24 str = gcnew String(text); |
|
25 } |
|
26 |
|
27 gcroot<UI::TextArea^> *textarea = new gcroot<UI::TextArea^>(); |
|
28 *textarea = UI::TextArea::CreateTextArea(*container, str); |
|
29 |
|
30 return textarea; |
|
31 } |
|
32 |
|
33 UI_EXPORT void __stdcall UItextarea_set(gcroot<UI::TextArea^> *textarea, char *str) { |
|
34 (*textarea)->SetText(gcnew String(str)); |
|
35 } |
|
36 |
|
37 UI_EXPORT char* __stdcall UItextarea_get(gcroot<UI::TextArea^> *textarea) { |
|
38 String ^str = (*textarea)->GetText(); |
|
39 return (char*)(void*)Marshal::StringToHGlobalAnsi(str); |
|
40 } |
|
41 |
|
42 UI_EXPORT char* __stdcall UItextarea_getsubstr(gcroot<UI::TextArea^> *textarea, int begin, int end) { |
|
43 String ^str = (*textarea)->GetSubString(begin, end); |
|
44 return (char*)(void*)Marshal::StringToHGlobalAnsi(str); |
|
45 } |
|
46 |
|
47 UI_EXPORT void __stdcall UItextarea_insert(gcroot<UI::TextArea^> *textarea, int position, char *str) { |
|
48 // TODO |
|
49 } |
|
50 |
|
51 UI_EXPORT int __stdcall UItextarea_position(gcroot<UI::TextArea^> *textarea) { |
|
52 return (*textarea)->Position(); |
|
53 } |
|
54 |
|
55 UI_EXPORT void __stdcall UItextarea_selection(gcroot<UI::TextArea^> *textarea, int *begin, int *end) { |
|
56 // TODO |
|
57 } |
|
58 |
|
59 UI_EXPORT int __stdcall UItextarea_length(gcroot<UI::TextArea^> *textarea) { |
|
60 return (*textarea)->Length(); |
|
61 } |
|
62 |
|
63 UI_EXPORT void __stdcall UItextarea_remove(gcroot<UI::TextArea^> *textarea, int begin, int end) { |
|
64 // TODO |
|
65 } |
|
66 |
|
67 UI_EXPORT void __stdcall UIfreestr(char *str) { |
|
68 Marshal::FreeHGlobal((IntPtr)(void*)str); |
|
69 } |