Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » LineEdit, EditFields, DocEdit » About the beahaviour of FileSel fs.Type
About the beahaviour of FileSel fs.Type [message #3801] Tue, 27 June 2006 15:55 Go to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I have the following piece of code
 FileSel fs; // for Linux and windows
 String fn;
 fs.Type( t_("archive FIDE (txt)"), "*.txt") //type 1
   .Type( t_("archive VEG (csv)"), "*.csv;*.veg") //type 2
   .Type( t_("national archive with Fixed Length (txt)"), "*.txt")   //type 3   
 .Type( t_("archive FSI Italy (csv)"), "*.csv")  //type 4
	  .DefaultExt("txt");

As you can see type 1 and type 3 are both "*.txt" but are processed differently by the program. The problem is that if I select in the drop list type 3, at the end is shown always type 1. I wonder if this is normal and related to the fact that there are two type with the same extension. In fact if I set the extension "*.pxp" for type 3 I can select it.

Luigi
Re: About the beahaviour of FileSel fs.Type [message #3807 is a reply to message #3801] Tue, 27 June 2006 21:49 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
forlano wrote on Tue, 27 June 2006 09:55

Hello,

I have the following piece of code
 FileSel fs; // for Linux and windows
 String fn;
 fs.Type( t_("archive FIDE (txt)"), "*.txt") //type 1
   .Type( t_("archive VEG (csv)"), "*.csv;*.veg") //type 2
   .Type( t_("national archive with Fixed Length (txt)"), "*.txt")   //type 3   
 .Type( t_("archive FSI Italy (csv)"), "*.csv")  //type 4
	  .DefaultExt("txt");

As you can see type 1 and type 3 are both "*.txt" but are processed differently by the program. The problem is that if I select in the drop list type 3, at the end is shown always type 1. I wonder if this is normal and related to the fact that there are two type with the same extension. In fact if I set the extension "*.pxp" for type 3 I can select it.

Luigi



Yes, very likely. Something to change?

Mirek
Re: About the beahaviour of FileSel fs.Type [message #3809 is a reply to message #3807] Tue, 27 June 2006 22:12 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
luzr wrote on Tue, 27 June 2006 21:49

forlano wrote on Tue, 27 June 2006 09:55

Hello,

I have the following piece of code
 FileSel fs; // for Linux and windows
 String fn;
 fs.Type( t_("archive FIDE (txt)"), "*.txt") //type 1
   .Type( t_("archive VEG (csv)"), "*.csv;*.veg") //type 2
   .Type( t_("national archive with Fixed Length (txt)"), "*.txt")   //type 3   
 .Type( t_("archive FSI Italy (csv)"), "*.csv")  //type 4
	  .DefaultExt("txt");

As you can see type 1 and type 3 are both "*.txt" but are processed differently by the program. The problem is that if I select in the drop list type 3, at the end is shown always type 1. I wonder if this is normal and related to the fact that there are two type with the same extension. In fact if I set the extension "*.pxp" for type 3 I can select it.

Luigi



Yes, very likely. Something to change?

Mirek


In my case the possibility to select always the wanted type is fundamental to process properly the file. In fact I recognise the file not for the extension but for the index it has in the type drop list. I this way I can understand easily wich kind of txt the user ha selected. As workaround I set now:
...
.Type( t_("national archive with Fixed Length (txt)"), "*.txt;*.csv")   //type 3
...

that removed the ambiguity between type 1 and 3 being both txt.

Anyway I think should be better in future to let choose the user what file type he wants. Maybe there are many txt files each of them need to be processed in different way. By getting the index of the type selected everything it is easy. Now this case can be handled with some difficulty.

Luigi
Re: About the beahaviour of FileSel fs.Type [message #3815 is a reply to message #3809] Wed, 28 June 2006 12:15 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, changed to proposed behaviour.

Expect in next dev release.

Mirek
Previous Topic: How to print the selected text in a LineEdit
Next Topic: Right aligned EditField?
Goto Forum:
  


Current Time: Fri Mar 29 16:19:05 CET 2024

Total time taken to generate the page: 0.02640 seconds