void uiWindowSetChild(uiWindow *w, uiControl *child) { if (w->child != NULL) { uiControlSetParent(w->child, NULL); uiWindowsControlSetParentHWND(uiWindowsControl(w->child), NULL); } w->child = child; if (w->child != NULL) { uiControlSetParent(w->child, uiControl(w)); uiWindowsControlSetParentHWND(uiWindowsControl(w->child), w->hwnd); uiWindowsControlAssignSoleControlIDZOrder(uiWindowsControl(w->child)); windowRelayout(w); } }
void uiGroupSetChild(uiGroup *g, uiControl *child) { if (g->child != NULL) { uiControlSetParent(g->child, NULL); uiWindowsControlSetParentHWND(uiWindowsControl(g->child), NULL); } g->child = child; if (g->child != NULL) { uiControlSetParent(g->child, uiControl(g)); uiWindowsControlSetParentHWND(uiWindowsControl(g->child), g->hwnd); uiWindowsControlAssignSoleControlIDZOrder(uiWindowsControl(g->child)); uiWindowsControlMinimumSizeChanged(uiWindowsControl(g)); } }
void uiFormDelete(uiForm *f, int index) { struct formChild fc; fc = (*(f->controls))[index]; uiControlSetParent(fc.c, NULL); uiWindowsControlSetParentHWND(uiWindowsControl(fc.c), NULL); uiWindowsEnsureDestroyWindow(fc.label); f->controls->erase(f->controls->begin() + index); formArrangeChildren(f); uiWindowsControlMinimumSizeChanged(uiWindowsControl(f)); }
void uiFormAppend(uiForm *f, const char *label, uiControl *c, int stretchy) { struct formChild fc; WCHAR *wlabel; fc.c = c; wlabel = toUTF16(label); fc.label = uiWindowsEnsureCreateControlHWND(0, L"STATIC", wlabel, SS_LEFT | SS_NOPREFIX, hInstance, NULL, TRUE); uiFree(wlabel); uiWindowsEnsureSetParentHWND(fc.label, f->hwnd); fc.stretchy = stretchy; uiControlSetParent(fc.c, uiControl(f)); uiWindowsControlSetParentHWND(uiWindowsControl(fc.c), f->hwnd); f->controls->push_back(fc); formArrangeChildren(f); uiWindowsControlMinimumSizeChanged(uiWindowsControl(f)); }