Implemented OFN_OVERWRITEPROMPT and OFN_EXTENSIONDIFFERENT flags.

Changed IDL_OVERWRITEFILE string resource ID to IDS_OVERWRITEFILE.
Use the extended UI for the "Look In" combo.
Select the text in the "File name" field after filling it.
This commit is contained in:
Phil Krylov 2004-01-02 01:47:52 +00:00 committed by Alexandre Julliard
parent f41e047020
commit 930b7da626
12 changed files with 55 additions and 18 deletions

View file

@ -368,7 +368,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "找不到文件"
IDS_VERIFYFILE "请检验是否给予正确的文件名称。"
IDS_CREATEFILE "找不到文件\n是否创建新文件?"
IDL_OVERWRITEFILE "文件已经存在。\n要替换吗?"
IDS_OVERWRITEFILE "文件已经存在。\n要替换吗?"
IDS_INVALID_FILENAME_TITLE "文件名中存在无效的字符"
IDS_INVALID_FILENAME "文件名中不能包含任何一下字符:: \n / : < > |"
IDS_PATHNOTEXISTING "文件夹不存在"

View file

@ -366,7 +366,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "Datei nicht gefunden"
IDS_VERIFYFILE "Bitte überprüfen sie, ob der korrekte Dateiname angegeben wurde"
IDS_CREATEFILE "Die Datei existiert nicht.\nWollen Sie sie neu anlegen?"
IDL_OVERWRITEFILE "Die Datei existiert bereits.\nWollen Sie sie überschreiben?"
IDS_OVERWRITEFILE "Die Datei existiert bereits.\nWollen Sie sie überschreiben?"
IDS_INVALID_FILENAME_TITLE "Unzulässige Zeichen im Pfad"
IDS_INVALID_FILENAME "Ein Dateiname darf folgende Zeichen nicht enthalten:\n / : < > |"
IDS_PATHNOTEXISTING "Der Pfad existiert nicht"

View file

@ -368,7 +368,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "File not found"
IDS_VERIFYFILE "Please verify that the correct file name was given"
IDS_CREATEFILE "File does not exist\nDo you want to create file"
IDL_OVERWRITEFILE "File does already exist.\nDo you want to replace it?"
IDS_OVERWRITEFILE "File does already exist.\nDo you want to replace it?"
IDS_INVALID_FILENAME_TITLE "Invalid character(s) in path"
IDS_INVALID_FILENAME "A filename cannot contain any of the following characters: \n / : < > |"
IDS_PATHNOTEXISTING "Path does not exist"

View file

@ -371,7 +371,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "Fichier non trouvé"
IDS_VERIFYFILE "Prière de vérifier que le nom de fichier indiqué est correct"
IDS_CREATEFILE "Ce fichier n'existe pas.\nSouhaitez-vous le créer ?"
IDL_OVERWRITEFILE "Ce fichier existe déjà.\nVoulez-vous le remplacer ?"
IDS_OVERWRITEFILE "Ce fichier existe déjà.\nVoulez-vous le remplacer ?"
IDS_INVALID_FILENAME_TITLE "Le chemin d'accès contient des caractères invalides"
IDS_INVALID_FILENAME "Un nom de fichier ne peut contenir un des caractères suivants : \n / : < > |"
IDS_PATHNOTEXISTING "Le chemin d'accès n'existe pas"

View file

@ -369,7 +369,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "Arquivo não encontrado"
IDS_VERIFYFILE "Por favor verifique se foi fornecido o nome correto do arquivo"
IDS_CREATEFILE "Arquivo não existe\nVocê gostaria de cria-lo"
IDL_OVERWRITEFILE "Arquivo já existe.\nGostaria de substituí-lo?"
IDS_OVERWRITEFILE "Arquivo já existe.\nGostaria de substituí-lo?"
IDS_INVALID_FILENAME_TITLE "Caracter(es) inválidos no caminho"
IDS_INVALID_FILENAME "Um nome de arquivo não pode conter quaisquer dos seguintes caracteres: \n / : < > |"
IDS_PATHNOTEXISTING "Caminho não existe"

View file

@ -337,7 +337,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "Файл не найден"
IDS_VERIFYFILE "Проверьте, правильно ли указано имя файла"
IDS_CREATEFILE "Файла не существует\nХотите ли Вы его создать?"
IDL_OVERWRITEFILE "Файл уже существует.\nЗаменить его?"
IDS_OVERWRITEFILE "Файл уже существует.\nЗаменить его?"
IDS_INVALID_FILENAME_TITLE "Некорректный символ в записи пути"
IDS_INVALID_FILENAME "Имя файла не может содержать следующие символы: \n / : < > |"
IDS_PATHNOTEXISTING "Путь не существует"

View file

@ -368,7 +368,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "Datoteke ni mogoèe najti"
IDS_VERIFYFILE "Preverite, ali ste vnesli pravilno ime datoteke"
IDS_CREATEFILE "Datoteka ne obstaja\nAli jo želite ustvariti?"
IDL_OVERWRITEFILE "Datoteka že obstaja.\nAli jo želite zamenjati?"
IDS_OVERWRITEFILE "Datoteka že obstaja.\nAli jo želite zamenjati?"
IDS_INVALID_FILENAME_TITLE "Neustrezni znaki v imenu"
IDS_INVALID_FILENAME "Ime datoteke ne sme vsebovati naslednjih znakov: \n / : < > |"
IDS_PATHNOTEXISTING "Pot ne obstaja"

View file

@ -339,7 +339,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "Súbor nenájdený"
IDS_VERIFYFILE "Please verify if the correct file name was given"
IDS_CREATEFILE "File does not exist\nDo you want to create file"
IDL_OVERWRITEFILE "File does already exist.\nDo you want to replace it?"
IDS_OVERWRITEFILE "File does already exist.\nDo you want to replace it?"
IDS_INVALID_FILENAME_TITLE "Invalid character(s) in path"
IDS_INVALID_FILENAME "A filename cannot contain any of the following characters: \n / : < > |"
IDS_PATHNOTEXISTING "Cesta neexistuje"

View file

@ -361,7 +361,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "Kunde inte hitta filen"
IDS_VERIFYFILE "Vad god verifiera så korrekt filnamn är angivet"
IDS_CREATEFILE "Filen finns inte\nVill du skapa fil"
IDL_OVERWRITEFILE "Filen finns redan.\nVill du ersätta den?"
IDS_OVERWRITEFILE "Filen finns redan.\nVill du ersätta den?"
IDS_INVALID_FILENAME_TITLE "Illegalt tecken i sökväg"
IDS_INVALID_FILENAME "Ett filnamn kan inte innehålla någon av följande tecken: \n / : < > |"
IDS_PATHNOTEXISTING "Sökvägen finns inte"

View file

@ -213,7 +213,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "File not found"
IDS_VERIFYFILE "Please verify if the correct file name was given"
IDS_CREATEFILE "File does not exist\nDo you want to create file"
IDL_OVERWRITEFILE "File does already exist.\nDo you want to replace it?"
IDS_OVERWRITEFILE "File does already exist.\nDo you want to replace it?"
IDS_INVALID_FILENAME_TITLE "Invalid character(s) in path"
IDS_INVALID_FILENAME "A filename cannot contain any of the following characters: \n / : < > |"
IDS_PATHNOTEXISTING "Path does not exist"

View file

@ -42,9 +42,9 @@
* FIXME: add to recent docs
*
* FIXME: flags not implemented: OFN_CREATEPROMPT, OFN_DONTADDTORECENT,
* OFN_ENABLEINCLUDENOTIFY, OFN_ENABLESIZING, OFN_EXTENSIONDIFFERENT,
* OFN_ENABLEINCLUDENOTIFY, OFN_ENABLESIZING,
* OFN_NODEREFERENCELINKS, OFN_NOREADONLYRETURN,
* OFN_NOTESTFILECREATE, OFN_OVERWRITEPROMPT, OFN_USEMONIKERS
* OFN_NOTESTFILECREATE, OFN_USEMONIKERS
*
* FIXME: lCustData for lpfnHook (WM_INITDIALOG)
*
@ -85,9 +85,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
#define UNIMPLEMENTED_FLAGS \
(OFN_CREATEPROMPT | OFN_DONTADDTORECENT |\
OFN_ENABLEINCLUDENOTIFY | OFN_ENABLESIZING | OFN_EXTENSIONDIFFERENT |\
OFN_ENABLEINCLUDENOTIFY | OFN_ENABLESIZING |\
OFN_NODEREFERENCELINKS | OFN_NOREADONLYRETURN |\
OFN_NOTESTFILECREATE | OFN_OVERWRITEPROMPT /*| OFN_USEMONIKERS*/)
OFN_NOTESTFILECREATE /*| OFN_USEMONIKERS*/)
#define IsHooked(fodInfos) \
((fodInfos->ofnInfos->Flags & OFN_ENABLEHOOK) && fodInfos->ofnInfos->lpfnHook)
@ -168,6 +168,8 @@ typedef struct tagLookInInfo
#define CBSetItemHeight(hwnd,index,height) \
SendMessageA(hwnd,CB_SETITEMHEIGHT,(WPARAM)index,(LPARAM)height);
#define CBSetExtendedUI(hwnd,flag) \
SendMessageA(hwnd,CB_SETEXTENDEDUI,(WPARAM)(flag),0)
const char *FileOpenDlgInfosStr = "FileOpenDlgInfos"; /* windows property description string */
const char *LookInInfosStr = "LookInInfos"; /* LOOKIN combo box property */
@ -1875,7 +1877,9 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
/* add default extension */
if (fodInfos->defext)
{
if (! *PathFindExtensionW(lpstrPathAndFile))
WCHAR *ext = PathFindExtensionW(lpstrPathAndFile);
if (! *ext)
{
/* only add "." in case a default extension does exist */
if (*fodInfos->defext != '\0')
@ -1886,11 +1890,38 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
strcatW(lpstrPathAndFile, szwDot);
strcatW(lpstrPathAndFile, fodInfos->defext);
/* if file does not exist try without extension */
if (!PathFileExistsW(lpstrPathAndFile))
/* In Open dialog: if file does not exist try without extension */
if (!(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
&& !PathFileExistsW(lpstrPathAndFile))
lpstrPathAndFile[PathLength] = '\0';
}
}
/* Set/clear the output OFN_EXTENSIONDIFFERENT flag */
if (*ext)
ext++;
if (!lstrcmpiW(fodInfos->defext, ext))
fodInfos->ofnInfos->Flags &= ~OFN_EXTENSIONDIFFERENT;
else
fodInfos->ofnInfos->Flags |= OFN_EXTENSIONDIFFERENT;
}
/* In Save dialog: check if the file already exists */
if (fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG
&& fodInfos->ofnInfos->Flags & OFN_OVERWRITEPROMPT
&& PathFileExistsW(lpstrPathAndFile))
{
WCHAR lpstrOverwrite[100];
int answer;
LoadStringW(COMDLG32_hInstance, IDS_OVERWRITEFILE, lpstrOverwrite, 100);
answer = MessageBoxW(hwnd, lpstrOverwrite, fodInfos->title,
MB_YESNO | MB_ICONEXCLAMATION);
if (answer == IDNO)
{
ret = FALSE;
goto ret;
}
}
/* Check that the size of the file does not exceed buffer size.
@ -2291,6 +2322,9 @@ static HRESULT FILEDLG95_LOOKIN_Init(HWND hwndCombo)
/* set item height for both text field and listbox */
CBSetItemHeight(hwndCombo,-1,GetSystemMetrics(SM_CYSMICON));
CBSetItemHeight(hwndCombo,0,GetSystemMetrics(SM_CYSMICON));
/* Turn on the extended UI for the combo box like Windows does */
CBSetExtendedUI(hwndCombo, TRUE);
/* Initialise data of Desktop folder */
SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidlTmp);
@ -2807,6 +2841,9 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd)
}
}
SetWindowTextA( fodInfos->DlgInfos.hwndFileName, lpstrAllFile );
/* Select the file name like Windows does */
SendMessageA(fodInfos->DlgInfos.hwndFileName, EM_SETSEL, (WPARAM)0, (LPARAM)-1);
}
HeapFree(GetProcessHeap(),0, lpstrAllFile );
}

View file

@ -116,7 +116,7 @@ typedef struct
#define IDS_CREATEFILE 116
#define IDS_CREATEFOLDER_DENIED 117
#define IDS_FILEOPEN_CAPTION 118
#define IDL_OVERWRITEFILE 119
#define IDS_OVERWRITEFILE 119
#define IDS_INVALID_FILENAME_TITLE 120
#define IDS_INVALID_FILENAME 121
#define IDS_PATHNOTEXISTING 122