| 49 } |
49 } |
| 50 return 1; |
50 return 1; |
| 51 } |
51 } |
| 52 |
52 |
| 53 |
53 |
| |
54 UIEXPORT UIWIDGET ui_customwidget_create(UiObject *obj, ui_createwidget_func create_widget, void *userdata, UiWidgetArgs args) { |
| |
55 UiObject* current = uic_current_obj(obj); |
| |
56 |
| |
57 UIWIDGET widget = create_widget(obj, args, userdata); |
| |
58 FrameworkElement w = widget->uielement.as<FrameworkElement>(); |
| |
59 |
| |
60 UI_APPLY_LAYOUT1(current, args); |
| |
61 |
| |
62 current->container->Add(w, false); |
| |
63 |
| |
64 return widget; |
| |
65 } |
| |
66 |
| 54 // --------------------- UiBoxContainer --------------------- |
67 // --------------------- UiBoxContainer --------------------- |
| 55 |
68 |
| 56 static UIWIDGET ui_box(UiObject* obj, UiContainerArgs args, UiBoxContainerType type) { |
69 static UIWIDGET ui_box(UiObject* obj, UiContainerArgs args, UiBoxContainerType type) { |
| 57 UiObject* current = uic_current_obj(obj); |
70 UiObject* current = uic_current_obj(obj); |
| 58 UI_APPLY_LAYOUT1(current, args); |
71 UI_APPLY_LAYOUT1(current, args); |
| 903 void ui_layout_vfill(UiObject* obj, UiBool fill) { |
917 void ui_layout_vfill(UiObject* obj, UiBool fill) { |
| 904 UiContainer* ct = uic_get_current_container(obj); |
918 UiContainer* ct = uic_get_current_container(obj); |
| 905 ct->layout.vfill = fill; |
919 ct->layout.vfill = fill; |
| 906 } |
920 } |
| 907 |
921 |
| |
922 void ui_layout_override_defaults(UiObject* obj, UiBool def) { |
| |
923 UiContainer* ct = uic_get_current_container(obj); |
| |
924 ct->layout.override_defaults = def; |
| |
925 } |
| |
926 |
| 908 void ui_layout_width(UiObject* obj, int width) { |
927 void ui_layout_width(UiObject* obj, int width) { |
| 909 UiContainer* ct = uic_get_current_container(obj); |
928 UiContainer* ct = uic_get_current_container(obj); |
| 910 ct->layout.width = width; |
929 ct->layout.width = width; |
| 911 } |
930 } |
| 912 |
931 |