[Lazarus] DefaultExt and Filter priority.

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Jun 16 18:13:06 CEST 2012


On Sat, 16 Jun 2012 12:20:48 +0300
Zaher Dirkey <parmaja at gmail.com> wrote:

> On Sat, Jun 16, 2012 at 11:37 AM, Mattias Gaertner <
> nc-gaertnma at netcologne.de> wrote:
> 
> > On Sat, 16 Jun 2012 11:29:34 +0300
> > Zaher Dirkey <parmaja at gmail.com> 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.

Mattias




More information about the Lazarus mailing list