Esempio n. 1
0
/*
 * SetDefMemConfig
 */
void SetDefMemConfig( void )
{
    GetMemWndDefault( &MemConfigInfo );

} /* SetDefMemConfig */
Esempio n. 2
0
/*
 * ConfigDlgProc - handle messages from the configure dialog
 */
BOOL FAR PASCAL ConfigDlgProc( HWND hwnd, WORD msg, WORD wparam, DWORD lparam )
{
    MemWndConfig        info;
    HeapConfigInfo      heapdef;
    char                buf[_MAX_PATH];

    lparam = lparam;
    switch( msg ) {
    case WM_INITDIALOG:
        GetMemWndConfig( &info );
        SetupConfigDlg( &Config, &info, hwnd );
        break;
    case WM_SYSCOLORCHANGE:
        CvrCtl3dColorChange();
        break;
    case WM_COMMAND:
        switch( wparam ) {
        case CONFIG_GLOB_BROWSE:
            doFileBrowse( hwnd, CONFIG_GNAME );
            break;
        case CONFIG_LOCAL_BROWSE:
            doFileBrowse( hwnd, CONFIG_LNAME );
            break;
        case CONFIG_MEM_BROWSE:
            doFileBrowse( hwnd, CONFIG_MNAME );
            break;
        case CONFIG_DEFAULT:
            GetMemWndDefault( &info );
            GetDefaults( &heapdef );
            SetupConfigDlg( &heapdef, &info, hwnd );
            break;
        case CONFIG_OK:
            GetDlgItemText( hwnd, CONFIG_GNAME, buf, _MAX_PATH );
            if( !ValidateFName( buf ) ) {
                GetWindowText( hwnd, buf, sizeof( buf ) );
                RCMessageBox( hwnd, STR_INVALID_GLOB_FNAME,
                              buf, MB_OK | MB_ICONEXCLAMATION );
                break;
            }
            GetDlgItemText( hwnd, CONFIG_LNAME, buf, _MAX_PATH );
            if( !ValidateFName( buf ) ) {
                GetWindowText( hwnd, buf, sizeof( buf ) );
                RCMessageBox( hwnd, STR_INVALID_LCL_FNAME, buf,
                            MB_OK | MB_ICONEXCLAMATION );
                break;
            }
            GetDlgItemText( hwnd, CONFIG_MNAME, buf, _MAX_PATH );
            if( !ValidateFName( buf ) ) {
                GetWindowText( hwnd, buf, sizeof( buf ) );
                RCMessageBox( hwnd, STR_INVALID_MEM_FNAME, buf,
                            MB_OK | MB_ICONEXCLAMATION );
                break;
            }
            GetMemWndConfig( &info );
            info.autopos_info = IsDlgButtonChecked( hwnd, CONFIG_AUTOPOS );
            info.disp_info = IsDlgButtonChecked( hwnd, CONFIG_DISP_MEM_INFO );
            if( IsDlgButtonChecked( hwnd, CONFIG_MULT_MEM_WND ) ) {
                info.allowmult = WND_MULTI;
            } else {
                info.allowmult = WND_REPLACE;
            }
            Config.disp_res = IsDlgButtonChecked( hwnd, CONFIG_DISP_RES );
            Config.save_glob_pos = IsDlgButtonChecked( hwnd,
                                                       CONFIG_SAVE_MAIN_POS );
            Config.save_mem_pos = IsDlgButtonChecked( hwnd,
                                                       CONFIG_SAVE_MEM_POS );
            GetDlgItemText( hwnd, CONFIG_GNAME, Config.gfname, _MAX_PATH );
            GetDlgItemText( hwnd, CONFIG_LNAME, Config.lfname, _MAX_PATH );
            GetDlgItemText( hwnd, CONFIG_MNAME, info.fname, _MAX_PATH );
            SetMemWndConfig( &info );
            /* fall through */
        case CONFIG_CANCEL:
            EndDialog( hwnd, FALSE );
            break;
        default:
            return( FALSE );
        }
        break;
    case WM_CLOSE:
        EndDialog( hwnd, 0 );
        break;
    default:
        return( FALSE );
    }
    return( TRUE );
} /* ConfigDlgProc */