示例#1
0
文件: window.cpp 项目: 08opt/libui
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);
	}
}
示例#2
0
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));
	}
}