Ejemplo n.º 1
0
Fixture::Fixture(QuasiDeclarativeItem *parent)
    : QuasiDeclarativeItem(parent)
    , m_fixture(0)
    , m_material(0)
    , m_shapeItem(0)
    , m_body(0)
    , m_bodyItem(0)
{
    connect(this, SIGNAL(parentChanged()),
            this, SLOT(onParentChanged()));
}
Ejemplo n.º 2
0
void Window::setParent(Window* parent)
{
	if (!mHWND) {
		mParent = parent; // parent will be used in realize() later on
		mParent->mChildren.push_back(this);
		onParentChanged();
		return;
	}
	// Otherwise, reparent
	LONG currStyle = GetWindowLong(handle(), GWL_STYLE);
	if (parent) {
		SetParent(handle(), parent->handle());
		SETWINDOWLONGPTR(handle(), GWL_STYLE, currStyle | WS_CHILD);
	} else {
		SetParent(handle(), 0);
		SETWINDOWLONGPTR(handle(), GWL_STYLE, currStyle & ~WS_CHILD);
	}
	if (mParent)
		mParent->rebuildChildrenList();
	mParent = parent;
	if (mParent)
		mParent->rebuildChildrenList();
	onParentChanged();
}
Ejemplo n.º 3
0
void GuiElement::setParent(ParentElement *new_parent, bool was_floating, bool now_floating, bool handle)
{
	if(parent == new_parent)
		return;

	if(handle)
	{
		if(parent)
			parent->removeChild(this, was_floating);

		if(new_parent)
			new_parent->addChild(this, now_floating);	//TODO: Keep track of whether this element is floating!!
	}

	parent = new_parent;

	onParentChanged();
}