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 Go to next message](theme/default/images/down.png) |
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 #5977 is a reply to message #5950] |
Thu, 26 October 2006 05:34 ![Go to previous message Go to previous message](theme/default/images/up.png) |
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
|
|
|
Goto Forum:
Current Time: Sun Sep 01 07:23:20 CEST 2024
Total time taken to generate the page: 0.00475 seconds
|