187 |
187 |
188 // add control |
188 // add control |
189 control.HorizontalAlignment(HorizontalAlignment::Stretch); |
189 control.HorizontalAlignment(HorizontalAlignment::Stretch); |
190 control.VerticalAlignment(VerticalAlignment::Stretch); |
190 control.VerticalAlignment(VerticalAlignment::Stretch); |
191 |
191 |
192 if (layout.gridwidth > 0) { |
192 if (layout.colspan > 0) { |
193 grid.SetColumnSpan(control, layout.gridwidth); |
193 grid.SetColumnSpan(control, layout.colspan); |
|
194 } |
|
195 if (layout.rowspan > 0) { |
|
196 grid.SetRowSpan(control, layout.rowspan); |
194 } |
197 } |
195 |
198 |
196 grid.SetRow(control, y); |
199 grid.SetRow(control, y); |
197 grid.SetColumn(control, x); |
200 grid.SetColumn(control, x); |
198 grid.Children().Append(control); |
201 grid.Children().Append(control); |
227 void ui_layout_width(UiObject* obj, int width) { |
230 void ui_layout_width(UiObject* obj, int width) { |
228 UiContainer* ct = uic_get_current_container(obj); |
231 UiContainer* ct = uic_get_current_container(obj); |
229 ct->layout.width = width; |
232 ct->layout.width = width; |
230 } |
233 } |
231 |
234 |
232 void ui_layout_gridwidth(UiObject* obj, int width) { |
235 void ui_layout_height(UiObject* obj, int height) { |
233 UiContainer* ct = uic_get_current_container(obj); |
236 UiContainer* ct = uic_get_current_container(obj); |
234 ct->layout.gridwidth = width; |
237 ct->layout.height = height; |
|
238 } |
|
239 |
|
240 void ui_layout_colspan(UiObject* obj, int cols) { |
|
241 UiContainer* ct = uic_get_current_container(obj); |
|
242 ct->layout.colspan = cols; |
|
243 } |
|
244 |
|
245 void ui_layout_rowspan(UiObject* obj, int rows) { |
|
246 UiContainer* ct = uic_get_current_container(obj); |
|
247 ct->layout.rowspan = rows; |
235 } |
248 } |
236 |
249 |
237 void ui_newline(UiObject* obj) { |
250 void ui_newline(UiObject* obj) { |
238 UiContainer* ct = uic_get_current_container(obj); |
251 UiContainer* ct = uic_get_current_container(obj); |
239 ct->layout.newline = TRUE; |
252 ct->layout.newline = TRUE; |