コード例 #1
0
ファイル: wmain.c プロジェクト: Ukusbobra/open-watcom-v2
WMenuHandle WRESEAPI WRMenuStartEdit( WMenuInfo *info )
{
    int             ok;
    WMenuEditInfo   *einfo;

    einfo = NULL;

    ok = (info != NULL && info->parent != NULL && info->inst != NULL);

    if( ok ) {
        if( appWidth == -1 ) {
            WInitEditDlg( WGetEditInstance(), info->parent );
        }
        ok = ((einfo = WAllocMenuEInfo()) != NULL);
    }

    if( ok ) {
        einfo->info = info;
        einfo->menu = WMakeMenuFromInfo( info );
        ok = (einfo->menu != NULL);
    }

    if( ok ) {
        if( einfo->info->file_name != NULL ) {
            einfo->file_name = WStrDup( einfo->info->file_name );
            ok = (einfo->file_name != NULL);
            if( ok ) {
                einfo->file_type = WRIdentifyFile( einfo->file_name );
                ok = (einfo->file_type != WR_DONT_KNOW);
            }
        }
    }

    if( ok ) {
        ok = WResolveMenuEntries( einfo );
    }

    if( ok ) {
        ok = WCreateEditWindow( WGetEditInstance(), einfo );
    }

    if ( ok ) {
        einfo->hndl = WRegisterEditSession( einfo );
        ok = (einfo->hndl != 0);
    }

    if( !ok ) {
        if( einfo != NULL ) {
            WFreeMenuEInfo( einfo );
        }
        return( 0 );
    }

    return( einfo->hndl );
}
コード例 #2
0
ファイル: wmain.c プロジェクト: NoSuchProcess/open-watcom-v2
WAccelHandle WRESEAPI WAccelStartEdit( WAccelInfo *info )
{
    bool            ok;
    WAccelEditInfo  *einfo;

    einfo = NULL;

    ok = (info != NULL && info->parent != NULL && info->inst != NULL);

    if( ok ) {
        if( appWidth == -1 ) {
            WInitEditDlg( WGetEditInstance(), info->parent );
        }
        ok = ((einfo = WAllocAccelEInfo()) != NULL);
    }

    if( ok ) {
        einfo->info = info;
        einfo->tbl = WMakeAccelTableFromInfo( info );
        ok = (einfo->tbl != NULL);
    }

    if( ok ) {
        if( einfo->info->file_name != NULL ) {
            einfo->file_name = WStrDup( einfo->info->file_name );
            ok = (einfo->file_name != NULL);
            if( ok ) {
                einfo->file_type = WRIdentifyFile( einfo->file_name );
                ok = (einfo->file_type != WR_DONT_KNOW);
            }
        }
    }

    if( ok ) {
        ok = WResolveAllEntrySymbols( einfo );
    }

    if( ok ) {
        ok = WCreateEditWindow( WGetEditInstance(), einfo );
    }

    if( ok ) {
        einfo->hndl = WRegisterEditSession( einfo );
        ok = (einfo->hndl != 0);
    }

    if( !ok ) {
        if( einfo != NULL ) {
            WFreeAccelEInfo( einfo );
        }
        return( 0 );
    }

    return( einfo->hndl );
}