Thanks guys.
I was sure that some long time ago I had done this before through an
option on the dialog - I've already put the code in to tell the user
he'd got it wrong. Seemed like there should be a better way, but I'll
not waste any more time on it.

FWIW: I'm migrating from storing a lot of definition data in a far too
clumsy INI file (which my App used to read behind the scenes), to using
an XML format (GPX), which is sent by this new program to the app by UDP
(I'm emulating an airborne system where the app would be briefed by
another system). I convert the INI file date to XML as well, so I only
need to support one briefing method in the target app.

For now the briefing app needs to allow the user to send the old or new
formats, but knowing users they'll try to send somthing else. I suppose
I SHOULD open the file anyway and see if it looks like either of the
formats, but that seemed like overkill.

Ken

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Ross Levis
Sent: 06 August 2006 10:37
To: Borland's Delphi Discussion List
Subject: Re: How to limit user to "filter" file extensions


Writing your own is a bit excessive.  The most logical suggestion I 
think is to simply check the file after the dialog returns, and if it is

a file extension you do not support, then inform the user of his low IQ 
and to try again.  A user will only try it once, so it's not worth lots 
of additional programming time.

Ross.

----- Original Message ----- 
From: "Eddie Shipman" <[EMAIL PROTECTED]>
To: "Borland's Delphi Discussion List" <[email protected]>
Sent: Sunday, August 06, 2006 2:30 AM
Subject: RE: How to limit user to "filter" file extensions


Best bet is to write your own FileOpenDialog and filter the files when 
the
FileName of *.* is selected. The standard Opendialog is a wrapper for 
the
Windows Common Control and cannot be extended to do this because there 
are
no notifcation messages sent when the user enters anything in the 
FileName
edit area.

> Wayne,
> If they type (e.g.) *.* in the file name box, they get to see all
> files
> and can then select anything.
> I need to support a few (completely different) file types which are
> processed in different ways, but I do not want to allow the user to 
> pick
> some rubbish instead.
> Ken 

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to