The ChooseDir class implements the pre-defined directory-selection dialog. This is a top-level object (i.e. it should not be opened as the child of a window).
To use the dialog, you must first create it using ŚNEW. (Alternatively, you can create it as a top-level object using the New or Create method of ŚWI). It will remain hidden at this stage. You can optionally set the initial directory as the directory property. You can also set the title of the dialog as the caption property.
When you are ready to show the dialog, call the Show method. This displays the modal dialog. The user can then select a directory; if the Cancel button is pressed, the Show method returns 0. If the OK button is pressed, the Show method returns 1. You can then read the directory property to retrieve the directory selected by the user.
’DEMO_ChooseDir;DLG [1] © Sample function demonstrating use of the ChooseDir object [2] DLG„'Ś' ŚNEW 'ChooseDir' [3] © Show the dialog. If user presses Cancel, quit [4] :If 1=DLG.Show [5] © He pressed OK. [6] 'Directory selected: ',DLG.directory [7] :EndIf ’
caption children class data directory events methods name opened properties self tie
Close Create Delete New Open Send Set Show Trigger
onClose onDestroy onOpen onSend