Monday, November 26, 2012

Adding a Make New Folder button


The mentioned WinAPI class has one more method named browseForFolderDialog().
Besides folder browsing, it also allows creating a new one. The method accepts three
optional arguments:
1. The lookup description.
2. The folder path selected initially.
3. The boolean value, where true shows and false hides the Make New Folder
button. The button is shown by default if this argument is omitted.


Let's replace the lookup() method of the DocumentPath field in the LedgerParameters
form data source with the following code:
public void lookup(FormControl _formControl, str _filterStr)
{
    FilePath path;
    path = WinAPI::browseForFolderDialog(
    "Select document folder extended", LedgerParameters.DocumentPath, true);
    LedgerParameters.DocumentPath = path;
    LedgerParameters_ds.refresh();
}

Now, the folder browsing lookup has a new Make New Folder button, which allows the user to
create a new folder straight away without leaving the lookup:



No comments: