Class TFolderDialog (unit FoldrDlg) |
Inherits from
TCommonDialog
TFolderDialog is a shell supplied task modal dialog with
active events and customizable buttoncontrol
constructor Create(AOwner: TComponent);
- compensate for Mapping Mode of dialog's canvas
destructor Destroy;
set default prop.
procedure EnableOK(const Value: Boolean);
procedure Refresh; // SHChangeNotify--------------------------------------------------------------------------------------------------------// {Use this function to enable/disable the OK button of the browse dialog from within one of the TFolderDialog event handlers
function Execute: Boolean;
If we should, disable/enable the custom button in sync with the OK button
function Perform(Msg: Cardinal; WParam, LParam: Longint): Longint;
Pass on to original dialog procedure
procedure BFFMInitialized(Param: integer);
clear statustext
procedure BFFMSelChanged(Param: integer);
do not free PIDLS here
procedure CreateCustomButton;
inherited TCommonDialog's FHandle is not same as ours, so:
procedure DefaultHandler(var Message);
Free the ID lists with the system task allocator
procedure Notification(AComponent: TComponent; Operation: TOperation);
make sure we get a notification when the CustomButton is destroyed
procedure PositionWindow;
function BffScaledX(dlgpixX: integer): integer;
next values are from Shell32.
function BffScaledY(dlgpixY: integer): integer;
compensate for Mapping Mode of dialog's canvas
procedure CenterOnParent;
Center the given window on the Foreground window - Added by Manuel Duarte} {Modifed by Todd Fast to place the top of the dialog at visual center of main window} {Changed CenterWindow to method CenterOnParent: fdj
procedure DefineProperties(Filer: TFiler);
dlg result; relative to FRootIDList { GPV* = GetPropertyValue, SPV* = SetPropertyValue pass on to our Owner if any
procedure DoChange;
class function GetDlgCtlPixelRect(duX, duY, duCX, duCY: word): TRect;
e.
function GPVCaption: string;
include implicit combinations
function GPVCustomButton: TButtonControl;
Fire the user event (WM_InitDialog is not sent by shell dlgs
function GPVDesignedLeft: integer;
function GPVDesignedTop: integer;
function GPVDirectory: string;
function GPVHandle: HWND;
function GPVParent: TWinControl;
function GPVParentHandle: HWND;
class procedure InitializeClass;
pixelX = (dialogunitX * baseunitX) / 4
pixelY = (dialogunitY * baseunitY) / 8
procedure ReplaceSelection(PIDL: PItemIDList);
unscaled, canvas Mapping Mode is used
procedure SPVCaption(const Value: string);
procedure SPVCustomButton(Value: TButtonControl);
procedure TFolderDialog.
procedure SPVDesignedLeft(Value: integer);
procedure SPVDesignedTop(Value: integer);
procedure SPVDirectory(const Value: string);
desktop
procedure SPVOptions(const Value: TFolderDialogOptions);
procedure SPVParent(const Value: TWinControl);
procedure SPVRootFolder(Value: TShellFolder);
TFolderDialog
procedure SPVSelectionPath(const Value: String);
procedure SPVSelectionPIDL(const Value: PItemIDList);
designed position
procedure SPVStatusText(const Value: string);
TFolderDialog.
procedure WMCommand(var Message: TWMCommand);
procedure WMDestroy(var Message: TWMDestroy);
Otherwise, execute the user's code
procedure WMNCDestroy(var Message: TWMNCDestroy);
D3: triggers OnClose
procedure WMShowWindow(var Message: TWMShowWindow);
triggers OnChange does Dispatch(Message)
property CustomButton : TButtonControl
property Directory : String
property Left : integer
property Options : TFolderDialogOptions
property RootFolder : TShellFolder
property Text : String
property Title : string
property Top : integer
property ClientHeight : integer
property ClientWidth : integer
property DisplayName : String
DisplayName is dlg result when browsing non-filesystemfolders
(e.
property Handle : HWND
next are valid while Executing
property ImageIndex : Integer
property Parent : TWinControl
a defined Parent makes Top, Left position relative to it's client
property RootPIDL : PItemIDList
property SelectionPath : string
property SelectionPIDL : PItemIDList
property StatusText : string
property ParentHandle : HWnd
event OnChange : TNotifyEvent
event OnClose :
event OnShow :
FBrowseInfo : TBrowseInfo;
FCaption : String;
FClientHeight : integer;
FClientWidth : integer;
FCustomButton : TButtonControl;
FDirectory : String;
FDisplayName : string;
FFirstShowDone : boolean;
FHandle : HWnd;
FImageIndex : Integer;
FOkBtnHandle : HWND;
FOnChange : TNotifyEvent;
FOptions : TFolderDialogOptions;
FParent : TWinControl;
FRootFolder : TShellFolder;
FRootIDList : PItemIDList;
pointers to Shell ID list (PIDL
FSelectionIDList : PItemIDList;
corresponds with RootFolder
FSelectionPath : String;
FStatusText : String;
FTemplateButton : TButtonControl;
FTitleText : String;
FXDefWndProc : Pointer;
FXObjectInstance : Pointer;
constructor Create(AOwner: TComponent);
compensate for Mapping Mode of dialog's canvas
destructor Destroy;
set default prop. values Ctl3d:= true; // inherited Ctl3d should be hidden (does nothing for TFolderDialog
procedure EnableOK(const Value: Boolean);
procedure Refresh; // SHChangeNotify
--------------------------------------------------------------------------------------------------------// {Use this function to enable/disable the OK button of the browse dialog from within one of the TFolderDialog event handlers
function Execute: Boolean;
If we should, disable/enable the custom button in sync with the OK button
function Perform(Msg: Cardinal; WParam, LParam: Longint): Longint;
Pass on to original dialog procedure
procedure BFFMInitialized(Param: integer);
clear statustext
procedure BFFMSelChanged(Param: integer);
do not free PIDLS here
procedure CreateCustomButton;
inherited TCommonDialog's FHandle is not same as ours, so:
procedure DefaultHandler(var Message);
Free the ID lists with the system task allocator
procedure Notification(AComponent: TComponent; Operation: TOperation);
make sure we get a notification when the CustomButton is destroyed
procedure PositionWindow;
function BffScaledX(dlgpixX: integer): integer;
next values are from Shell32.dll DIALOG resource #1079
function BffScaledY(dlgpixY: integer): integer;
compensate for Mapping Mode of dialog's canvas
procedure CenterOnParent;
Center the given window on the Foreground window - Added by Manuel Duarte} {Modifed by Todd Fast to place the top of the dialog at visual center of main window} {Changed CenterWindow to method CenterOnParent: fdj
procedure DefineProperties(Filer: TFiler);
dlg result; relative to FRootIDList { GPV* = GetPropertyValue, SPV* = SetPropertyValue
pass on to our Owner if any
procedure DoChange;
class function GetDlgCtlPixelRect(duX, duY, duCX, duCY: word): TRect;
e.g.: small fonts = (8,16), large fonts = (10,20)
function GPVCaption: string;
include implicit combinations
function GPVCustomButton: TButtonControl;
Fire the user event (WM_InitDialog is not sent by shell dlgs
function GPVDesignedLeft: integer;
function GPVDesignedTop: integer;
function GPVDirectory: string;
function GPVHandle: HWND;
function GPVParent: TWinControl;
function GPVParentHandle: HWND;
class procedure InitializeClass;
pixelX = (dialogunitX * baseunitX) / 4
pixelY = (dialogunitY * baseunitY) / 8
procedure ReplaceSelection(PIDL: PItemIDList);
unscaled, canvas Mapping Mode is used
procedure SPVCaption(const Value: string);
procedure SPVCustomButton(Value: TButtonControl);
procedure TFolderDialog.Refresh;
{ This has no effect:
Looks like the dlg's TreeView is not sensitive to
shell's systemwide change notifications (also no F5-key):
the dlg doesn't have a or can't refresh his
IShellBrowser explorer interface ? }
const
SHCNE_FOLDEREVENTS =
SHCNE_MKDIR or SHCNE_RMDIR or
SHCNE_MEDIAINSERTED or SHCNE_MEDIAREMOVED or
SHCNE_DRIVEREMOVED or SHCNE_DRIVEADD or
SHCNE_UPDATEDIR or SHCNE_DRIVEADDGUI or SHCNE_RENAMEFOLDER;
var
P1, p2: pointer; dw1, dw2: dword;
begin
dw1:= 0; dw2:= 0; p1:= @dw1; p2:= @dw2;
if Assigned(FRootIDList) then p1:= FRootIDList;
if Assigned(FSelectionIDList) then p2:= FSelectionIDList;
SHChangeNotify(SHCNE_FOLDEREVENTS{SHCNE_RENAMEFOLDER},
SHCNF_IDLIST or SHCNF_FLUSH{NOWAIT}, p1, p2);
end;
procedure SPVDesignedLeft(Value: integer);
procedure SPVDesignedTop(Value: integer);
procedure SPVDirectory(const Value: string);
desktop
procedure SPVOptions(const Value: TFolderDialogOptions);
procedure SPVParent(const Value: TWinControl);
procedure SPVRootFolder(Value: TShellFolder);
TFolderDialog
procedure SPVSelectionPath(const Value: String);
procedure SPVSelectionPIDL(const Value: PItemIDList);
designed position
procedure SPVStatusText(const Value: string);
TFolderDialog.CreateCustomButton
procedure WMCommand(var Message: TWMCommand);
procedure WMDestroy(var Message: TWMDestroy);
Otherwise, execute the user's code
procedure WMNCDestroy(var Message: TWMNCDestroy);
D3: triggers OnClose
procedure WMShowWindow(var Message: TWMShowWindow);
triggers OnChange
does Dispatch(Message)
property CustomButton : TButtonControl
property Directory : String
property Left : integer
property Options : TFolderDialogOptions
property RootFolder : TShellFolder
property Text : String
property Title : string
property Top : integer
property ClientHeight : integer
property ClientWidth : integer
property DisplayName : String
DisplayName is dlg result when browsing non-filesystemfolders
(e.g. bfBrowseForComputer)
property Handle : HWND
next are valid while Executing
property ImageIndex : Integer
property Parent : TWinControl
a defined Parent makes Top, Left position relative to it's client
property RootPIDL : PItemIDList
property SelectionPath : string
property SelectionPIDL : PItemIDList
property StatusText : string
property ParentHandle : HWnd
event OnChange : TNotifyEvent
event OnClose :
event OnShow :
FBrowseInfo : TBrowseInfo;
FCaption : String;
FClientHeight : integer;
FClientWidth : integer;
FCustomButton : TButtonControl;
FDirectory : String;
FDisplayName : string;
FFirstShowDone : boolean;
FHandle : HWnd;
FImageIndex : Integer;
FOkBtnHandle : HWND;
FOnChange : TNotifyEvent;
FOptions : TFolderDialogOptions;
FParent : TWinControl;
FRootFolder : TShellFolder;
FRootIDList : PItemIDList;
pointers to Shell ID list (PIDL
FSelectionIDList : PItemIDList;
corresponds with RootFolder
FSelectionPath : String;
FStatusText : String;
FTemplateButton : TButtonControl;
FTitleText : String;
FXDefWndProc : Pointer;
FXObjectInstance : Pointer;