TOpenDialog and TSaveDialog never set ofExtensionDifferent option
Original Reporter info from Mantis: Maxim @ganmax
-
Reporter name: Maxim Ganetsky
Original Reporter info from Mantis: Maxim @ganmax
- Reporter name: Maxim Ganetsky
Description:
TOpenDialog and TSaveDialog never set ofExtensionDifferent option.
They should set it if entered file name has extension different from DefaultExt.
The following code should work, but in fact MessageDlg never gets called:
with SaveDialog1 do
begin
Filter := 'Text File (*.txt)|*.txt';
DefaultExt := 'txt';
Filename := '';
Options := [ofEnableSizing, ofOverwritePrompt, ofPathMustExist, ofViewDetail];
if Execute then
if ofExtensionDifferent in Options then
MessageDlg ('Not a file with the .TXT extension',
mtError, [mbOK], 0);
end;
Test project is attached.
This issue also present in Lazarus 0.9.26.1