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 » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » Tip: Using FileSel
Tip: Using FileSel [message #5950] Wed, 25 October 2006 18:46 Go to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
Hi,

	FileSel f;                          // create a FileSel object
	f.ActiveDir(".");                   // set folder to look in               
	f.Type("Text file", "*.txt;*.log");  // set file types to filter
	f.ExecuteOpen("Select a text file");// display the File Selection dialog
	String fs = f.Get();                // get a file name
	String s;                           // create a String object 
	s = LoadFile(fs);                  // load the file into a string
	mydocedit1.Set(s);                 // display the file in a DocEdit control
	mylineedit1.Set(s);                // display the file in a LineEdit control

[Updated on: Wed, 25 October 2006 18:47]

Report message to a moderator

Re: Tip: Using FileSel [message #5963 is a reply to message #5950] Thu, 26 October 2006 01:28 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
f.ActiveDir(GetCurrentDirectory());

Mirek
Re: Tip: Using FileSel [message #5970 is a reply to message #5950] Thu, 26 October 2006 02:06 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
Thanks, Mirek. Smile U++ is amazing. Its class browser and code completion are superb.

Best Regards,
Yeoh
Re: Tip: Using FileSel [message #5972 is a reply to message #5970] Thu, 26 October 2006 03:02 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
yeohhs wrote on Wed, 25 October 2006 20:06

Thanks, Mirek. Smile U++ is amazing. Its class browser and code completion are superb.



..as long as they can parse the file... Sad We need to improve there as well.

Mirek
Re: Tip: Using FileSel [message #5977 is a reply to message #5950] Thu, 26 October 2006 05:34 Go to previous message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
Hi,

Thanks to Mirek, this revised code is better.

	FileSel f;                             // create a FileSel object
	String curdir = GetCurrentDirectory(); // get the current folder
	f.ActiveDir(curdir);                   // set folder to look in               
	f.Type("Text file", "*.txt;*.log");    // set file types to filter
	f.ExecuteOpen("Select a text file");   // display the File Selection dialog
	String fs = f.Get();                   // get a file name
	String s;                              // create a String object 
	s = LoadFile(fs);                      // load the file into a string
	mydocedit1.Set(s);                     // display the file in a DocEdit control
	mylineedit1.Set(s);                    // display the file in a LineEdit control


Previous Topic: enumCharSet() funtion
Next Topic: Vector of Vector
Goto Forum:
  


Current Time: Thu Mar 28 15:56:36 CET 2024

Total time taken to generate the page: 0.01667 seconds