************************************************** *-- Class: cntgetdir *-- ParentClass: container *-- wrapper for vfp GetDir() function * DEFINE CLASS cntgetdir AS CONTAINER WIDTH = 403 HEIGHT = 35 BACKSTYLE = 0 BORDERWIDTH = 0 *-- Specifies the directory that is initially displayed in the dialog box. When cDirectory is not specified, the dialog box opens with the Visual FoxPro default directory displayed. cdirectory = "" *-- Specifies the text for the directory list in the Open dialog box. In Windows 95, the text appears below the list of files and long text strings may be truncated. ctext = "" *-- Holds the value returned by the GetDir function cpath = "" NAME = "cntgetdir" ADD OBJECT label1 AS lblbase WITH ; AUTOSIZE = .T., ; BACKSTYLE = 0, ; CAPTION = "Directory:", ; HEIGHT = 17, ; LEFT = 8, ; TOP = 8, ; WIDTH = 53, ; NAME = "Label1" ADD OBJECT txtdirectory AS txtbase WITH ; HEIGHT = 22, ; LEFT = 72, ; TOP = 4, ; WIDTH = 288, ; NAME = "txtDirectory" ADD OBJECT cmdgetdir AS cmdbase WITH ; TOP = 4, ; LEFT = 370, ; HEIGHT = 22, ; WIDTH = 22, ; FONTBOLD = .T., ; CAPTION = ". . .", ; NAME = "cmdGetDir" *-- Issue a GetDir() and populate the textbox with its results PROCEDURE GETDIR *** Invoke the VFP native GetDir function with the container's properties *** These properties correspond to all of the paramters accepted by the GetFile function WITH THIS .cpath = GETDIR( .cdirectory, .ctext ) .txtdirectory.VALUE = .cpath ENDWITH ENDPROC PROCEDURE INIT WITH THIS .txtdirectory.VALUE = .cpath ENDWITH ENDPROC PROCEDURE cmdgetdir.onclick THIS.PARENT.GETDIR() ENDPROC ENDDEFINE