TApFolderDialog component

Inherited from : TCommonDialog

unit : ApFolderDlg

Custom version : TApCustomFolderDialog

This component is simply wrapper for SHBrowseForFolder Win32 function.

Types

Properties

Methods

Events



Types


TApBrowseForFolderFlag

= (ffBrowseForComputer,
ffBrowseForPrinter,
ffDontGoBelowDomain,
ffReturnFSAncestors,
ffReturnOnlyFSDirs,
ffStatusText);

TApBrowseForFolderFlags

= set of TApBrowseForFolderFlag;

Is used in Options property.


TApSpecShellFolder = (ftNone,
    ftRecycleBin,
    ftCommonDesktopDir,
    ftCommonPrograms,
    ftCommonStartMenu,
    ftCommonStartup,
    ftControls,
    ftDesktop,
    ftDesktopDir,
    ftDrives,
    ftFonts,
    ftNethood,
    ftNetwork,
    ftPersonal,
    ftPrinters,
    ftPrograms,
    ftRecent,
    ftSendTo,
    ftStartMenu,
    ftStartup,
    ftTemplates);

Predefined system folders.

This type is used in SpecialIniFolder property to specify initial folder wich will be selected on dialog showing.



Properties


CustDlgParams : TApCustDlgParams; RW

Published, protected in custom version

This variable contains all information about side panels of the standard dialog. See TApCustDlgPatams type for details.

useCustDlgParams.CustomForm is not used in this component. (Later - as replacement on std shell selection control similar to TApOpen/SaveDialog).


SelectionType: TApDlgSelectionType; RW

Published; protected in custom version

If you set this property to stCustom then CustDlgParams.CustomForm will be displayed instead of the standard shell tree view.


Initial Folder : string; RW

Published; protected in custom version

You can specify initial folder wich is selected when you launch the dialog. If you change this property then SpecIniFolder property value is changed to ftNone.


SpecialIniFolder : TApSpecShellFolder; RW

Published; protected in custom version

You can specify one of the predefined system folders as initial folder. If you set this property to some value not equal to ftNone then InitialFolder property value is assigned to empty string.


StatusText : string; RW

Published; protected in custom version

Instead of sending BFFM_SETSTATUSTEXT message via callback dialog fuction use this property to specify status text. This text will be displayed in the dialog box.


Options : TApBrowseForFolderFlags; RW

Published; protected in custom version

Simply wrapper for BROWSEINFO.ulFlags struct member. See Win32 Reference for details.


SelectedFolder : string; R; valid when dialog is visible

Public; protected in custom version

Read-only and "dialog-time". You can read this property to get currently selected folder.


SelectedPidl : PItemIDList; R; valid when dialog is visible

Public; protected in custom version

The same as SelectedFolder property. But returns PItemIDList insead of string value. See Win32 Reference for infomation about ITEMIDLIST.


OkEnabled : boolean; RW

Public; protected in custom version

"Dialog-time" property. Determines whether OK button of the dialog is enabled. Set to False to prevent the dialog box closing.


FolderName : string; R

Public; protected in custom version

After dialog box is closed, you can read this property to get folder name (with disk name and path) you selected.


FolderPidl; R

Public; protected in custom version

The same as FolderName, but returns PItemIDList. See Win32 Reference for information about ITEMIDLIST structure.


DisplayName : string; R

Published; protected in custom version

Short user-friendly name of the folder you selected (without disk and path).


Text : string; RW

Published; protected in custom version

Wrapper for Win32 BROWSEINFO.plszTitle struct member.


DlgItemsCaptions : TApDlgCaptions

Published; protected in custom version

You can set items in this property to replace labels for standard controls inside dialog. For example you can replace OK button caption using DlgItemsCaptions.OK property and so on. If there is no value in any subitem then original text is displayed.



Methods

No items in this section.



Events

All the new properties below are "dialog-time".


OnSelectionChange: TNotifyEvent

Published; protected in custom version

Occurs if user changes the folder.


OnCanClose: TCloseQueryEvent

Published; protected in custom version

Occurs when user tries to close dialog box by pressing OK button. You can prevent dialog box closing by setting CanClose value to false (see VCL Reference for help about TCloseQueryEvent).


OnEventHook : TWndMethod

General hook procedure. You can hook any message you want directry in this handler. This handler occurs after dialog procedure has processed current message.

Note that you can not process any of the BrowseCallbackProc messages (for example, BFFM_SELCHANGED) in this handler.Use OnSelectionChange or OnCanClose instead.


OnEventHooking : TApMsgQueryEvent

You can determine here whether dialog box procedure should process current message (m parameter).  Set AllowDispatch to false to prevent this message's processing by dialog box procedure.

Note that you can not process any of the BrowseCallbackProc messages (for example, BFFM_SELCHANGED) in this handler.