PromptForFileName implementation for LCL
This utility function - albeit with some truly weird details (like placing the crucial save-or-read switch AFTER default variables, forcing you to tediously provide default values for them all) and limitations (filename should have no path on enter, but does have path on exit, file filters are not selected properly - so WHY even pass them in?) is actually really handy and is lacked in LCL.
Here is source-compatible implementation - against the fixes_2_2
branch.
https://docwiki.embarcadero.com/Libraries/Sydney/en/Vcl.Dialogs.PromptForFileName
Personally i'd prefer to call it via class function TOpenDialog.PromptForFileName
and TSaveDialog.PromptForFileName
which would work around the first quirk mentioned above. Test project also.
project1.lpi unit1.lfm unit1.pas
0001-implementing-Delphi-like-PromptForFileName-functions.patch