Home » U++ Library support » FileSel&FileList, Path » How to open a FileSelect widget and select a file?
How to open a FileSelect widget and select a file? [message #2697] |
Fri, 21 April 2006 22:59 |
|
forlano
Messages: 1185 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
Now it is time to read the data from a file (and later save them). So the first step is to select one.
Spying in the available code I've found in UWord package some useful code. I copied, without understand, in VegaMain.h
FileSel& UWordFs()
{
static FileSel fs;
return fs;
}
and then created the following method:
void VegaMain::OpenTournament()
{
FileSel& fs = UWordFs();
fs.ExecuteOpen();
}
that with my great satisfaction open a fileselect widget. Now I've 2 questions:
1. What have I done? (I do not understand the logic of the first operation... FileSel& UWordFs()...
2. How can I get the selected file, the directory in which it resides, and set a filter? (For example I want to show in the dialog only the file *.txt and *.qtf)
I think when I need to save a file the operations to select a filename are the same.
Thank you,
Luigi
[Updated on: Fri, 21 April 2006 23:01] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat May 04 15:19:25 CEST 2024
Total time taken to generate the page: 0.02837 seconds
|