View Issue Details

IDProjectCategoryView StatusLast Update
0013040LazarusLCLpublic2013-09-03 12:07
ReporterMaxim Ganetsky Assigned ToPaul Ishenin  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWin32OSWindows 
Product Version0.9.27 (SVN) 
Target Version0.9.28Fixed in Version0.9.27 (SVN) 
Summary0013040: TOpenDialog and TSaveDialog never set ofExtensionDifferent option
DescriptionTOpenDialog 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
TagsNo tags attached.
Fixed in Revision18507,18511
LazTarget1.4
WidgetsetWin32/Win64
Attached Files

Relationships

related to 0012660 closedPaul Ishenin TSaveDialog with ofOverwritePrompt and DefaultExt does not show OverwritePrompt if filename is typed without extension 

Activities

2009-01-24 22:00

 

OpenSaveDialogs.zip (2,242 bytes)

Paul Ishenin

2009-01-30 19:03

manager   ~0024899

Please test and close if ok.

Maxim Ganetsky

2009-01-31 00:23

developer   ~0024913

Now MessageDlg seems to be always called no matter what I enter (e.g. "test", "test.avi", "test.txt", "test.TXT" were tested).

Paul Ishenin

2009-01-31 07:35

manager   ~0024917

Seems fixed now. Though in your example you had not used '.' in the defaultExt. But somehow it works now after that cosmetic changes. Please test and close if ok.

Maxim Ganetsky

2009-01-31 15:44

developer   ~0024935

Thanks. Note that MessageDlg will be called only if different extension is registered in Windows. This is compatible with Delphi.

Issue History

Date Modified Username Field Change
2009-01-24 22:00 Maxim Ganetsky New Issue
2009-01-24 22:00 Maxim Ganetsky File Added: OpenSaveDialogs.zip
2009-01-24 22:00 Maxim Ganetsky Widgetset => Win32
2009-01-30 09:57 Vincent Snijders LazTarget => post 1.2
2009-01-30 09:57 Vincent Snijders Status new => acknowledged
2009-01-30 19:03 Paul Ishenin Fixed in Revision => 18507
2009-01-30 19:03 Paul Ishenin Status acknowledged => resolved
2009-01-30 19:03 Paul Ishenin Fixed in Version => 0.9.27 (SVN)
2009-01-30 19:03 Paul Ishenin Resolution open => fixed
2009-01-30 19:03 Paul Ishenin Assigned To => Paul Ishenin
2009-01-30 19:03 Paul Ishenin Note Added: 0024899
2009-01-30 19:03 Paul Ishenin Target Version => 0.9.28
2009-01-31 00:23 Maxim Ganetsky Status resolved => assigned
2009-01-31 00:23 Maxim Ganetsky Resolution fixed => reopened
2009-01-31 00:23 Maxim Ganetsky Note Added: 0024913
2009-01-31 07:35 Paul Ishenin Fixed in Revision 18507 => 18507,18511
2009-01-31 07:35 Paul Ishenin Status assigned => resolved
2009-01-31 07:35 Paul Ishenin Resolution reopened => fixed
2009-01-31 07:35 Paul Ishenin Note Added: 0024917
2009-01-31 11:03 Paul Ishenin Relationship added related to 0012660
2009-01-31 15:44 Maxim Ganetsky Status resolved => closed
2009-01-31 15:44 Maxim Ganetsky Note Added: 0024935
2013-09-03 12:07 Martin Friebe LazTarget post 1.2 => 1.4