T O P I C R E V I E W |
illysam |
Posted - 12/15/2003 : 11:01:13 AM Hi,
for an add-on that I'm writing (Origin7, SR4), I need an open box that displays a group of file types (e.g. '*.dat' and '*.txt') at the same time.
How can I do this in OriginC?
Thanks, Rolf
|
2 L A T E S T R E P L I E S (Newest First) |
illysam |
Posted - 12/15/2003 : 2:59:25 PM Thanks Mike,
works like a charm! |
Mike Buess |
Posted - 12/15/2003 : 2:41:44 PM Hi Rolf,
The Origin C GetOpenBox() function will show either DAT or TXT files, but not both at the same time. (At least I haven't figured out how to do that.)
string sFile; StringArray saFiletypes; saFiletypes.SetSize( 2 ); saFiletypes[0]="[DAT files (*.dat)] *.dat"; saFiletypes[1]="[TXT files (*.txt)] *.txt"; sFile = GetOpenBox(saFiletypes,GetAppPath(),"","Open"); out_str(sFile); // full path of selected file
However, LabTalk's fdlog.open() will show DAT and TXT files at the same time...
char sFile[100]; using fdlog = LabTalk.fdlog; fdlog.numTypes = 1; fdlog.type1$ = "[Data files (*.dat;*.txt)] *.dat;*.txt"; fdlog.path$ = GetAppPath(); fdlog.open("A"); string sPath = fdlog.path$; LT_get_str("%A",sFile,100); out_str(sPath+sFile);
...Just figured out how to do it with GetOpenBox(). It requires an extra pair of quotes.
string sFile; StringArray saFiletypes; saFiletypes.SetSize( 1 ); saFiletypes[0]="\"[DAT files (*.dat;*.txt)] *.dat;*.txt\""; sFile = GetOpenBox(saFiletypes,GetAppPath(),"","Open"); out_str(sFile); // full path of selected file
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 12/15/2003 2:42:57 PM
Edited by - Mike Buess on 12/15/2003 2:48:38 PM |
|
|