![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

That works perfectly, Anil. Thanks! This helps me focus the GUI to a
specific folder.
- Roger
-----Original Message-----
From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com] On Behalf Of
Anil Rodrigues
Sent: Friday, October 14, 2005 3:43 PM
To: sftalk_at_forth.com
Subject: [sftalk] Re: starting condition for browsing to a folder
Here's an example for getfilename "getfn" ,
default dir. is c:\shape - change this to c:\ in CUSTOM
My app. shows *.shp files, alt. all files
Is this too simplistic?
( edit out any =20's etc, I dont know where they come from)
-------------------------------------------------
CREATE MY-FILES
,Z" Shape files (*.shp)" ,Z" *.shp"
,Z" All files (*.*)" ,Z" *.*"
0 ,
PACKAGE OFN-DIALOGS ( Re-open Package )
FILENAME-DIALOG SUBCLASS MY-OFN-DIALOG
: ACTION ( addr -- bool ) :: GetOpenFileName ;
END-CLASS
PUBLIC
MY-OFN-DIALOG SUBCLASS MY-FILE-DIALOG
: CUSTOM ( -- title filter flags )
Z" C:\SHAPE " zInitialDir !
Z" Get File" MY-FILES
DEFAULT-OPEN-FLAGS OFN_FILEMUSTEXIST OR ;
END-CLASS
END-PACKAGE
: getfn ( -- ) \ leave name at pad
[OBJECTS MY-FILE-DIALOG MAKES MFD OBJECTS]
MFD CHOOSE
IF MFD FILENAME ( zStr ) zcount pad zplace
THEN ;
\\ : f2m ( -- ) \ read to fibuffer
pad zcount r/o
open-file throw
dup fid ! \ needs variable fid
fib 2000 rot \ create fib 4000 \allot
read-file 2drop ;
------------------------------------------------------
-----Original Message-----
From: Dr. Roger Dube [mailto:rogerdube_at_dathq.com]
Sent: Friday, October 14, 2005 2:45 PM
To: sftalk_at_forth.com
Subject: [sftalk] Re: starting condition for browsing to a folder
Anil, can you show me an example of using ofn.f and setting the default
directory to the root (C:\)? I can't seem to get this to work. I must be
dense today.
- Roger
This email message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message. Any views expressed in this message are those of
the individual sender, except where the sender specifically states them to
be the views of Digital Authentication Technologies, Inc.
-- ---------------------------------------------------------------------- sftalk_at_forth.com The SwiftForth programming discussion email list To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com For list command help, send subject "help" to sftalk-request_at_forth.com Message archives are located at http://www.forth.com/archive/sftalk ---------------------------------------------------------------------- This list is a forum for SwiftForth users. For product support and bug reports, please send email to support_at_forth.com ---------------------------------------------------------------------- -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.12.0/132 - Release Date: 10/13/2005 ---------------------------------------------------------------------- sftalk_at_forth.com The SwiftForth programming discussion email list To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com For list command help, send subject "help" to sftalk-request_at_forth.com Message archives are located at http://www.forth.com/archive/sftalk ---------------------------------------------------------------------- This list is a forum for SwiftForth users. For product support and bug reports, please send email to support_at_forth.com ----------------------------------------------------------------------Received on Fri Oct 14 2005 - 12:50:50 PDT
This archive was generated by hypermail 2.2.0 : Thu Dec 04 2008 - 03:04:20 PST