Пример #1
0
extern int DlgGetFileName( open_file_name *ofn )
{
    int         rc;
    a_window    *wnd;

    wnd = WndFindActive();
    rc = GUIGetFileName( DlgGetParent(), ofn );
    if( wnd != NULL )
        WndToFront( wnd );
    return( rc );
}
Пример #2
0
const char * WEXPORT WFileDialog::getSaveFileName( const char *fn,
                                                   const char *title,
                                                   unsigned style ) {
/*******************************************************************/

    _ofn.flags = style | OFN_ISSAVE;
    init( fn, title );
    if( GUIGetFileName( _parent->handle(), &_ofn ) == OFN_RC_FILE_SELECTED ) {
        return( _fileName );
    }
    return( NULL );
}
Пример #3
0
bool WEXPORT WFileDialog::getOpenFileName( WFileNameList &flist,
                                           const char *fn,
                                           const char *title,
                                           unsigned style ) {
/***********************************************************/

    init( fn, title );
    _ofn.flags = style | OFN_ALLOWMULTISELECT;
    if( GUIGetFileName( _parent->handle(), &_ofn ) == OFN_RC_FILE_SELECTED ) {
        flist.parseIn( _fileName );
#if defined( __WINDOWS__ ) || defined( __NT__ )
        if( flist.count() > 1 ) {
            WFileName path( flist.stringAt( 0 ) );
            path.concat( '\\' );
            for( int i = 1; i < flist.count(); ++i ) {
                flist.stringAt(i).absoluteTo( path );
            }
            flist.removeAt( 0 );
        }
#endif
        return( TRUE );
    }
    return( FALSE );
}
Пример #4
0
const char * WEXPORT WFileDialog::getOpenFileName( const char *fn,
                                                   const char *title,
                                                   unsigned style ) {
/*******************************************************************/

    init( fn, title );
    _ofn.flags = style;
#if defined( __NT__ )
    _ofn.flags |= OFN_WANT_LAST_PATH;
#endif
    if( GUIGetFileName( _parent->handle(), &_ofn ) == OFN_RC_FILE_SELECTED ) {
#if defined( __NT__ )
        WFileName f( _fileName );
        WFileName path( _ofn.last_path );
        path.concat( "\\" );
        f.absoluteTo( path );
        GUIMemFree( _ofn.last_path );
        _ofn.last_path = NULL;
        strcpy( _fileName, f );
#endif
        return( _fileName );
    }
    return( NULL );
}