コード例 #1
0
ファイル: selection.c プロジェクト: barak/ivtools-cvs
void Selection::Sort (GraphicView* views) {
/*
 * Note: this doesn't work if there are views in the selection from more than
 * one GraphicViews.
 */
    Iterator i;
    UList* cur;
    UList* newList = new UList;

    views->First(i);

    while (!views->Done(i) && !_ulist->IsEmpty()) {
        cur = _ulist->First();

        while (cur != _ulist->End()) {
            if (views->GetView(i) == View(cur)) {
                _ulist->Remove(cur);
                newList->Append(cur);
                break;
            } else {
                cur = cur->Next();
            }
        }
        views->Next(i);
    }
    if (!_ulist->IsEmpty()) {
        cerr << "warning: selection contained spurious element(s)\n";
    }
    delete _ulist;
    _ulist = newList;
}
コード例 #2
0
ファイル: ibeditor.c プロジェクト: LambdaCalculus379/SLS-1.02
void EditorComp::GetExtraConflict(GetConflictCmd* gcmd) {
    const char* cname = gcmd->GetCName();
    UList* conflictlist = gcmd->GetConflict();

    const char* curCtrl = _curCtrlVar->GetName();
    const char* key = _keymap->GetName();
    const char* select = _selection->GetName();
    
    const char* ctrl_sub = _curCtrlVar->GetSubclassName();
    const char* key_sub = _keymap->GetSubclass()->GetName();
    const char* sel_sub = _selection->GetSubclass()->GetName();
    
    if (strcmp(curCtrl, cname) == 0) {
        conflictlist->Append(new UList(_curCtrlVar->GetButtonSharedName()));
    }
    if (strcmp(key, cname) == 0) {
        conflictlist->Append(new UList(_keymap->GetMemberSharedName()));
    }
    if (strcmp(select, cname) == 0) {
        conflictlist->Append(new UList(_selection->GetMemberSharedName()));
    }
    if (strcmp(ctrl_sub, cname) == 0) {
        conflictlist->Append(
            new UList(_curCtrlVar->GetButtonSharedName()->GetSubclass())
        );
    }
    if (strcmp(key_sub, cname) == 0) {
        conflictlist->Append(new UList(_keymap->GetSubclass()));
    }
    if (strcmp(sel_sub, cname) == 0) {
        conflictlist->Append(new UList(_selection->GetSubclass()));
    }
    _igrcomps->Interpret(gcmd);
}
コード例 #3
0
ファイル: ibdialog.c プロジェクト: LambdaCalculus379/SLS-1.02
void DialogClass::Interpret(Command* cmd) {
    if (cmd->IsA(GETCONFLICT_CMD)) {
        GetConflictCmd* gcmd = (GetConflictCmd*) cmd;
        const char* cname = gcmd->GetCName();
        MonoSceneClass::Interpret(cmd);
        UList* conflictlist = gcmd->GetConflict();
        ButtonSharedName* bsnamer = _bsVar->GetButtonSharedName();
        const char* buttonname = bsnamer->GetName();
        const char* funcname = bsnamer->GetFuncName();
        if (strcmp(buttonname, cname) == 0 || strcmp(funcname, cname) == 0) {
            conflictlist->Append(new UList(bsnamer));
        }

    } else {
        MonoSceneClass::Interpret(cmd);
    }
}