Ejemplo n.º 1
0
void writeEditor( WFile &ifile, char *edtext, char *isdlltext,
                        WFileName &editor, bool isdll, bool thisos ) {
    // the WFileName class has no != operator
    if( ( !thisos && !( editor == "" ) )
        || ( thisos && !( editor == _config->editor() ) )
        || ( thisos && isdll != _config->editorIsDLL() ) ) {
        ifile.printf( "%s=%s\n", edtext, editor.gets() );
        ifile.printf( "%s=%d\n", isdlltext, isdll );
    }
}
Ejemplo n.º 2
0
bool Browse::makeFileName( char *buff )
//-------------------------------------
{
    WFileName   file;
    WFileName   nfile;
    char        *p;
    char        *q;

    file = buff;
    if( file.attribs() ) {
        // file exists
        return( true );
    }

    if( _searchPath.length() == 0 ) {
        return( false );
    }

    p = new char [_searchPath.length() + 1];
    if( p == NULL )
        return( false );
    strcpy( p, _searchPath );

    q = strtok( p, ";" );
    while( q != NULL ) {
        nfile = "";
        nfile.setDir( q );
        nfile.setFName( file.fName() );
        nfile.setExt( file.ext() );
        if( nfile.attribs() ) {
            strcpy( buff, nfile.gets() );
            delete[] p;
            return( true );
        }
        q = strtok( NULL, ";" );
    }
    delete[] p;
    return( false );
}
Ejemplo n.º 3
0
static void addFileToList( HWND hwnd, char *fname )
{
    HWND        ctl;
    int         item;
    int         match;
    WFileName   fullname;
    bool        isLong = false;

    size_t len = strlen( fname ) - 1;
    if( fname[0] == '"' && fname[len] == '"' ) {
        fname++;
        fname[len - 1] = '\0';
        isLong = true;
    } else {
        WFileName filename( fname );
        isLong = filename.needQuotes();
    }

    match = findMatchingFile( hwnd, fname );
    ctl = GetDlgItem( hwnd, FOD_FILELIST );
    if( match == LB_ERR ) {
        if( IsDlgButtonChecked( hwnd, FOD_STORE_ABSOLUTE ) ) {
            getFullFname( hwnd, fname, &fullname );
        } else {
            getRelFname( hwnd, fname, &fullname );
        }
//        fullname.toLower();
        if( isLong ) {
            fullname.addQuotes();
        }
        item = (int)SendMessage( ctl, LB_ADDSTRING, 0, (LPARAM)(LPSTR)fullname.gets() );
    } else {
        item = match;
    }
    SendMessage( ctl, LB_SETCURSEL, item, 0 );
    checkRemoveButton( hwnd );
}