******************************************************************** * 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