The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Extension Group

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000