On Sat, Jun 16, 2012 at 7:13 PM, Mattias Gaertner <
Show quoted text 53 lines
wrote:
On Sat, 16 Jun 2012 12:20:48 +0300
Zaher Dirkey wrote:
> On Sat, Jun 16, 2012 at 11:37 AM, Mattias Gaertner <
> > wrote:
>
> > On Sat, 16 Jun 2012 11:29:34 +0300
> > Zaher Dirkey wrote:
> >
> > > Hi Lazarus team,
> > >
> > > I know it is not Delphi compatibility.
> > >
> > > In OpenDialogs or SaveDialog if i set DefaultExt value and execute,
and
> > > type file name without an extension, the file name return with the
> > > extension from the first extension in the filter.
> > >
> > > 1 - DefaultExt not work until filter is empty
> > > 2 - DefaultExt is nonsense if the Filter is set
> > >
> > > Most programmers set the filter except the newbie ones, then mostly
> > > DefaultExt is nonsense.
> > >
> > > My problem is my project collect the filter from the plugins, i can't
> > sort
> > > it manually to put the default extension to the first, DefaultExt
come
> > not
> > > useful for me.
> >
> > How does the user of your application know the default
> > extension?
> >
> > Mattias
> >
> >
> For example, my project is an editor for multitype files, PAS, LFM, SQL
> now the default is PAS and it is the first extension, not problem
> the user open SQL file, now he make SaveAs and type new name without
> extension, here the dialog return it as PAS extension.
On "save as" of a SQL file I would expect that the selected filter
is the filter for SQL files.
In that case TFileDialog adds ".sql".
If the user selects a different filter, say .txt, then TFileDialog
adds ".txt".
AFAIK MS Office and Open Office do it the same.
Thanks, I understand now, i fixed it by change the order of filter.
The real problem happened when we have same filter like in Lazarus (*.pas, *.pp, *.inc) and if we set the DefaultExt to .pp it will return .pas as the first filter extension, but i think Lazarus fix it manual, for me i changed the order depend on the current file opened, i moved the extension to the first.
Best Regards
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120616/154b8b32/attachment.html>