Please enable JavaScript to view this site.

KOL/MCK - User Guide

dirselect

 

The directory selection dialog is one of the cases when in KOL it was decided to create an object type, while on the VCL it is proposed to directly call an API function, entering many parameters each time. I decided to "wrap" the call of this function into an object also because, just like for the file selection dialog, there are a number of properties that can "inherit" their state from one call of the dialog to another (namely: start the directory that is made current when the dialog is called on the screen). It is completely incomprehensible why the user should always start choosing a directory from the "My Computer" or "Desktop" folder. It can be especially offensive if very often you have to select the same directory while interacting with the application. However, if you like,

 

Constructor:

NewOpenDirDialog(s, options) - creates a dialog for choosing a directory with the header s (if the line is empty, then the standard system header is used), and with a set of options:

 

odBrowseForComputer - dialog for choosing a computer, not a directory;

odBrowseForPrinter - the dialog is used to select a printer;

odDontGoBelowDomain - do not include network folders below the domain level (if someone does not know what exactly this phrase means, then most likely you simply do not need this option);

odOnlyFileSystemAncestors - the dialog allows you to select only system file objects. / Similar to the previous one, if this phrase tells you little, there is nothing terrible about it. At the moment, I myself do not know exactly what this means. Whenever I need to find out, I'll check the Help. /

odOnlySystemDirs - the dialog allows you to select only system folders;

odStatusText - the presence of the status bar in the dialog is ensured;

odBrowseIncludeFiles - the dialog also displays the contents of folders (list of files);

odEditBox - the presence of a field for entering the name of the folder or the entire path is provided;

odNewDialogStyle - a new style of dialogue. Compared to the old style, the new one, for example, provides the ability to resize the dialog.

 

Properties, method and event of the dialog:

 

Execute - a method for invoking a dialog. Similar to the TOpenSaveDialog dialog, returns true if the dialog succeeded by selecting a directory;

Title - the title of the dialog box. If the string is empty, the system uses the default header;

Options - dialogue options;

Path - path to the directory selected by the user at the exit from the dialog;

InitialPath - the initial path from which the directory selection starts when showing the dialog;

CenterOnScreen - center the dialog box on the screen when displaying;

OnSelChanged - an event that is triggered when the user selects a different directory while the dialog is running. The handler can prohibit the selection of some directories, making the selection button unavailable;

DialogWnd - the window of the dialog itself (available during the execution of the dialog itself, can be used to enumerate its children in the custom event handler OnSelChanged);

WndOwner - the window responsible for the transmission of messages. The same window is used as the "parent" for the dialog, i.e. is automatically activated upon completion.

 

In the package of mirror components MCK, the TKOLOpenDirDialog component takes on the role of the image of this object.

But, in addition, it has a design-time property AltDialog, setting which to true means that the form will use the alternative TOpenDirDialogEx dialog (see below).

 

KOL / MCK User Guide - Created by Carl Peeraer - Diamant Soft, based on the work of Vladimir Kladov - Artwerp.be

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Nav Header: ALT+n
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Exit Menu/Up: ESC