ui/winui/container.cpp

branch
newapi
changeset 194
e2281ace0769
parent 193
74c688cc1839
child 195
0f2e69873875
equal deleted inserted replaced
193:74c688cc1839 194:e2281ace0769
236 x++; 236 x++;
237 237
238 ui_reset_layout(layout); 238 ui_reset_layout(layout);
239 } 239 }
240 240
241 // --------------------- UiFrameContainer --------------------- 241 // --------------------- UI Frame ---------------------
242 242
243 UIWIDGET ui_frame_create(UiObject* obj, UiFrameArgs args) { 243 UIWIDGET ui_frame_create(UiObject* obj, UiFrameArgs args) {
244 // create a grid for the frame, that contains the label and a sub-frame 244 // create a grid for the frame, that contains the label and a sub-frame
245 Grid frame = Grid(); 245 Grid frame = Grid();
246 246
307 uic_obj_add(obj, newobj); 307 uic_obj_add(obj, newobj);
308 308
309 return widget; 309 return widget;
310 } 310 }
311 311
312 // --------------------- UI ScrolledWindow ---------------------
313
314 UIWIDGET ui_scrolledwindow_create(UiObject* obj, UiContainerArgs args) {
315 ScrollViewer scrollW = ScrollViewer();
316
317 // add frame to the parent container
318 UiObject* current = uic_current_obj(obj);
319 UI_APPLY_LAYOUT1(current, args);
320 current->container->Add(scrollW, true);
321
322 UIElement elm = scrollW;
323 UiWidget* widget = new UiWidget(elm);
324
325 // create a vbox as child container
326 Grid vbox = Grid();
327 scrollW.Content(vbox);
328
329 UiObject* newobj = uic_object_new(obj, widget);
330 newobj->container = new UiBoxContainer(vbox, UI_CONTAINER_VBOX, args.margin, args.spacing);
331 uic_obj_add(obj, newobj);
332
333 return widget;
334 }
335
312 336
313 /* 337 /*
314 * -------------------- Layout Functions -------------------- 338 * -------------------- Layout Functions --------------------
315 * 339 *
316 * functions for setting layout attributes for the current container 340 * functions for setting layout attributes for the current container

mercurial