Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any VFP 7 like version of GETDIR() for VFP 6?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00724840
Message ID:
00725227
Views:
15
>Hi James (nad Nadya :-)) ),
>
> .Download file getdirex.exe. This file is tester for function GetDirEx() from PDM.fll. This package contained VFP project with source code and PDM.fll library.
>
> Function work on W95 without button "Create New Folder"..., but depend on Shell version.
>
Thanks a lot for jumping in! I'll test it again.

I made minor modifications in the above sample to make it more like a function:
********************************************************************
*  Description.......: GetDirEx - enhanced GetDir for VFP6
*  Calling Samples...: 
*  Parameter List....: tcStartDir, tcTitle, tcBtnOkCaption, tcBtnNewFolderCaption, tcBtnCancelCaption
*  Created by........: Martin Jindra 
*  Modified by.......: 
********************************************************************
lparameters tcStartDir, tcTitle, tcBtnOkCaption, tcBtnNewFolderCaption, tcBtnCancelCaption
if not 'pdm.fll' $ lower(set('library'))
   SET LIBRARY TO pdm.fll additive
endif   

LOCAL loDir, lcDir, lcRetFolder

loDir=CREATEOBJECT("_GetDirEx")
if vartype(m.tcStartDir)<>"C"
   lcDir = "c:\"
else
   lcDir = m.tcStartDir
endif      
loDir.DefaultDir= m.lcDir
if vartype(m.tcBtnOkCaption)="C"
   loDir.btnOK=m.tcBtnOkCaption && New caption of button "OK"
endif

if vartype(m.tcBtnNewFolderCaption)="C"
   loDir.btnND=m.tcBtnNewFolderCaption && New caption of New Folder
endif

if vartype(m.tcTitle)="C"
   loDir.title = m.tcTitle
endif
   
if vartype(m.tcBtnCancelCaption)="C"
   loDir.btnCancel=m.tcBtnCancelCaption && New caption of button "OK"
endif
   
IF GetDirEx(m.loDir)
   lcRetFolder = loDir.OutPutDir
ENDIF

RETURN m.lcRetFolder

DEFINE CLASS _GetDirEx AS custom

   * If property btnND,btnOK or btnCancel empty, then default caption of buttons are not change.
   WTitle="" && Window Title
   Title="" && dialog Title

   NewFolderAllowed=.T. && For Shell version 5.0

   Flag=0 && Member ulFlags in struc. BROWSEINFO (FLL function always insert BIF_USENEWUI if NewFolderAllowed=.T.)

   btnND="" && New caption of button "Make New Folder"
   _btnND_ID=0x3746 && Control ID of button "Make New Folder". Don't change !!!

   btnOK="" && New caption of button "OK"
   _btnOK_ID=0x1 && Control ID of button "OK". Don't change !!!

   btnCancel="" && New caption of button "Cancel"
   _btnCancel_ID=0x2 && Control ID of button "Cancel". Don't change !!!

   DefaultDir="" && Default directory

   OutPutDir="" && Output directory

   IsRoot=.F. && If Default directory is root, same as parametr lReadOnly in function GetDir() in VFP 7.0
ENDDEFINE
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform