Esempio n. 1
0
//----------------------------------------------------------------------------//
void Element::addChild(Element* element)
{
    if (!element)
        CEGUI_THROW(
                InvalidRequestException("Can't add NULL to Element as a child!"));

    if (element == this)
        CEGUI_THROW(
                InvalidRequestException("Can't make element its own child - "
                                        "this->addChild(this); is forbidden."));

    addChild_impl(element);
    ElementEventArgs args(element);
    onChildAdded(args);
}
Esempio n. 2
0
void PNode::addChild(PNode *child)
{
    if (this->child(child->m_name.toString().c_str()) != P_NULL)
    {
        PLOG_ERROR("Cannot add another %s to the parent node %s ",
            m_name.toString().c_str(), child->m_name.toString().c_str());
    }
    else
    {
        pchar *name = const_cast<pchar*>(child->name().c_str());
        m_children.insert(name, child);
        
        onChildAdded(child);
    }
}