|
1 |
|
2 |
|
3 #include "stdafx.h" |
|
4 #include <stdio.h> |
|
5 |
|
6 #include "container.h" |
|
7 |
|
8 #using "UIcore.dll" |
|
9 |
|
10 UI_EXPORT void* __stdcall UIvbox(gcroot<UI::Container^> *parent, int margin, int spacing) { |
|
11 UI::BoxContainer ^vbox = gcnew UI::BoxContainer(*parent, UI::BoxOrientation::VERTICAL, margin, spacing); |
|
12 gcroot<UI::BoxContainer^> *container = new gcroot<UI::BoxContainer^>(); |
|
13 *container = vbox; |
|
14 return container; |
|
15 } |
|
16 |
|
17 UI_EXPORT void* __stdcall UIhbox(gcroot<UI::Container^> *parent, int margin, int spacing) { |
|
18 UI::BoxContainer ^hbox = gcnew UI::BoxContainer(*parent, UI::BoxOrientation::HORIZONTAL, margin, spacing); |
|
19 gcroot<UI::BoxContainer^> *container = new gcroot<UI::BoxContainer^>(); |
|
20 *container = hbox; |
|
21 return container; |
|
22 } |
|
23 |
|
24 UI_EXPORT void* __stdcall UIgrid(gcroot<UI::Container^> *parent, int margin, int columnspacing, int rowspacing) { |
|
25 UI::GridContainer ^grid = gcnew UI::GridContainer(*parent, margin, columnspacing, rowspacing); |
|
26 gcroot<UI::GridContainer^> *container = new gcroot<UI::GridContainer^>(); |
|
27 *container = grid; |
|
28 return container; |
|
29 } |
|
30 |
|
31 UI_EXPORT void* __stdcall UIscrolledwindow(gcroot<UI::Container^> *parent) { |
|
32 UI::ScrollViewerContainer ^scrollviewer = gcnew UI::ScrollViewerContainer(*parent); |
|
33 gcroot<UI::ScrollViewerContainer^> *container = new gcroot<UI::ScrollViewerContainer^>(); |
|
34 *container = scrollviewer; |
|
35 return container; |
|
36 } |
|
37 |
|
38 UI_EXPORT void* __stdcall UItabview(gcroot<UI::Container^> *parent) { |
|
39 UI::TabViewContainer ^tabview = gcnew UI::TabViewContainer(*parent); |
|
40 gcroot<UI::TabViewContainer^> *container = new gcroot<UI::TabViewContainer^>(); |
|
41 *container = tabview; |
|
42 return container; |
|
43 } |
|
44 |
|
45 UI_EXPORT void __stdcall UItab(gcroot<UI::Container^> *container, char *label) { |
|
46 UI::Container ^ct = *container; |
|
47 ct->Layout->Label = gcnew String(label); |
|
48 } |
|
49 |
|
50 |
|
51 |
|
52 /* ------------------- layout functions ------------------- */ |
|
53 |
|
54 UI_EXPORT void __stdcall UIlayout_fill(gcroot<UI::Container^> *container, int fill) { |
|
55 UI::Container ^ct = *container; |
|
56 ct->Layout->Fill = fill != 0; |
|
57 } |
|
58 |
|
59 UI_EXPORT void __stdcall UIlayout_hexpand(gcroot<UI::Container^> *container, int expand) { |
|
60 UI::Container ^ct = *container; |
|
61 ct->Layout->Hexpand = expand != 0; |
|
62 } |
|
63 |
|
64 UI_EXPORT void __stdcall UIlayout_vexpand(gcroot<UI::Container^> *container, int expand) { |
|
65 UI::Container ^ct = *container; |
|
66 ct->Layout->Vexpand = expand != 0; |
|
67 } |
|
68 |
|
69 UI_EXPORT void __stdcall UIlayout_gridwidth(gcroot<UI::Container^> *container, int width) { |
|
70 UI::Container ^ct = *container; |
|
71 ct->Layout->GridWidth = width; |
|
72 } |
|
73 |
|
74 UI_EXPORT void __stdcall UIlayout_newline(gcroot<UI::Container^> *container) { |
|
75 UI::Container ^ct = *container; |
|
76 ct->Layout->NewLine = true; |
|
77 } |
|
78 |