Forum > Win32/64
Issue with Win32 TSaveDialog.DefaultExt
AlexTP:
Issue not exists on gtk2 on Linux. Make the simple program with Button.OnClick
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.Button1Click(Sender: TObject);begin SaveDialog1.InitialDir:= ExtractFileDir(Application.ExeName); SaveDialog1.Options:= [ofOverwritePrompt,ofPathMustExist,ofEnableSizing,ofDontAddToRecent,ofViewDetail]; SaveDialog1.Filter:= 'YAML|*.yml;*.yaml|All files|*'; //bug exists only if '*' is after 'All files|' SaveDialog1.DefaultExt:= 'yml'; SaveDialog1.FileName:= ''; if SaveDialog1.Execute then caption:= 'chosen: '+ExtractFileName(SaveDialog1.FileName) else caption:= 'cancel';end;
- run the demo, press the btn
- choose 2nd filter - ie 'All files'
- enter filename 'n.lua', OK
--> resulting filename is 'n.lua.yml' with bad tail.
If i replace '*' mask with '*.*', no bug.
Bart:
I cannot reproduce: Lazarus 3.99 (rev main_3_99-437-g5fbeef0e07) FPC 3.2.2 i386-win32-win32/win64
Used "Pascal|*.pas;*.pp;*.p|All files|*" as filter.
Executed the dialog.
Selected the All files filter.
Typed: abacadabra -> abacadabra.pp
Typed: abacadabra.txt -> abacadabra.txt
Bart
ASerge:
--- Quote from: Bart on August 18, 2023, 05:12:55 pm ---I cannot reproduce: Lazarus 3.99 (rev main_3_99-437-g5fbeef0e07) FPC 3.2.2 i386-win32-win32/win64
Used "Pascal|*.pas;*.pp;*.p|All files|*" as filter.
Executed the dialog.
Selected the All files filter.
Typed: abacadabra -> abacadabra.pp
Typed: abacadabra.txt -> abacadabra.txt
Bart
--- End quote ---
Also not reproduced. lazarus 3.0RC1. Windows 7.
AlexTP:
Sample project in zip.
- run, press button, enter "n.lua", press Enter.
- caption shows 'n.lua.yml'
wp:
--- Quote from: AlexTP on August 18, 2023, 03:46:16 pm ---- run the demo, press the btn
- choose 2nd filter - ie 'All files'
- enter filename 'n.lua', OK
--> resulting filename is 'n.lua.yml' with bad tail.
--- End quote ---
Running your test application on Manjaro Linux/gtk2 --> Resulting filename is 'n.lua' after these steps. (Laz/main + fpc 3.2.2)
Navigation
[0] Message Index
[#] Next page