Beispiel #1
0
void UIListTreeType::FillLevelFromTree(UIListGenericTree *item,
                                       UIListBtnType *list)
{
    if (!item || !list)
        return;

    ClearLevel(list);

    vector<GenericTree*> itemlist = item->getAllChildren();

    vector<GenericTree*>::const_iterator it = itemlist.begin();

    for ( ; it != itemlist.end(); ++it)
    {
        UIListGenericTree *uichild =
            dynamic_cast<UIListGenericTree*>(*it);

        if (!uichild)
            continue;

        UIListBtnTypeItem *newitem;

        int check = uichild->getCheck();
        newitem = new UIListBtnTypeItem(list, uichild->getString(),
                                        uichild->getImage(), (check >= 0),
                                        (UIListBtnTypeItem::CheckState)check,
                                        (uichild->childCount() > 0));
        newitem->setData(uichild);

        uichild->setItem(newitem);

        if (!uichild->getActive())
            newitem->setOverrideInactive(true);
    }
}
Beispiel #2
0
void UIListTreeType::FillLevelFromTree(UIListGenericTree *item,
                                       UIListBtnType *list)
{
    if (!item || !list)
        return;

    ClearLevel(list);

    QPtrList<GenericTree> *itemlist = item->getAllChildren();

    QPtrListIterator<GenericTree> it(*itemlist);
    GenericTree *child;

    while ((child = it.current()) != 0)
    {
        UIListGenericTree *uichild = (UIListGenericTree *)child;

        UIListBtnTypeItem *newitem;

        int check = uichild->getCheck();
        newitem = new UIListBtnTypeItem(list, child->getString(),
                                        uichild->getImage(), (check >= 0),
                                        (UIListBtnTypeItem::CheckState)check,
                                        (child->childCount() > 0));
        newitem->setData(uichild);

        uichild->setItem(newitem);

        if (!uichild->getActive())
            newitem->setOverrideInactive(true);

        ++it;
    }
}
Beispiel #3
0
void UIListTreeType::RefreshCurrentLevel(void)
{
    if (currentlevel)
    {
        UIListBtnType::iterator it = currentlevel->begin();
        for (; it != currentlevel->end(); ++it)
        {
            UIListGenericTree *ui = (UIListGenericTree*)((*it)->getData());
            ui->setActive(ui->getActive());
        }
    }
}
Beispiel #4
0
void UIListTreeType::RefreshCurrentLevel(void)
{
    if (currentlevel)
    {
        QPtrListIterator<UIListBtnTypeItem> it = currentlevel->GetIterator();

        UIListBtnTypeItem *item;
        while ((item = it.current()))
        {
            UIListGenericTree *ui = (UIListGenericTree *)item->getData();
            ui->setActive(ui->getActive());
            ++it;
        }
    }
}