Esempio n. 1
0
void MenuBar::removeMenu(const UInt32& Index)
{
    if(Index < getMFChildren()->size())
    {
        MenuRefPtr Item(dynamic_cast<Menu*>(getChildren(Index)));
        removeFromChildren(Index);

        Item->setTopLevelMenu(false);
        if(_PopupMenuCanceledConnections.find(Item) != _PopupMenuCanceledConnections.end())
        {
            _PopupMenuCanceledConnections[Item].disconnect();
            _PopupMenuCanceledConnections.erase(_PopupMenuCanceledConnections.find(Item));
        }
    }
}
Esempio n. 2
0
void Toolbar::removeSeparator(const UInt32&  Index)
{
    if(Index < getNumSeparators())
    {
        UInt32 SeparatorCount(0);
        for(UInt32 i(0) ; i<getMFChildren()->size() ; ++i)
        {
            if(getChildren(i)->getType() == Separator::getClassType())
            {
                ++SeparatorCount;
            }
            if(SeparatorCount == Index)
            {
                break;
            }
        }

        removeFromChildren(SeparatorCount);
    }
}