mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 12:19:21 +02:00
win32 interface: enable new style select directory dialog, which has a button for creating new directories from YHernan (#9860)
git-svn-id: trunk@12383 -
This commit is contained in:
parent
93c9981240
commit
a9f96510dc
@ -174,6 +174,13 @@ const
|
||||
|
||||
{ BrowseForFolder dialog}
|
||||
BIF_RETURNONLYFSDIRS = 1;
|
||||
BIF_NEWDIALOGSTYLE = $40;
|
||||
//Version 5.0. Use the new user interface. Setting this flag provides the
|
||||
//user with a larger dialog box that can be resized. The dialog box has
|
||||
//several new capabilities, including: drag-and-drop capability within the
|
||||
//dialog box, reordering, shortcut menus, new folders, delete, and other
|
||||
//shortcut menu commands. To use this flag, you must call OleInitialize or
|
||||
//CoInitialize before calling SHBrowseForFolder.
|
||||
|
||||
BFFM_INITIALIZED = 1;
|
||||
BFFM_SELCHANGED = 2;
|
||||
|
@ -639,16 +639,19 @@ begin
|
||||
end;
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
class function TWin32WSSelectDirectoryDialog.CreateHandle(const ACommonDialog: TCommonDialog): THandle;
|
||||
var
|
||||
bi : TBrowseInfo;
|
||||
Options: TOpenOptions;
|
||||
Buffer : PChar;
|
||||
iidl : PItemIDList;
|
||||
InitialDir: string;
|
||||
begin
|
||||
Buffer := CoTaskMemAlloc(MAX_PATH);
|
||||
InitialDir := TSelectDirectoryDialog(ACommonDialog).FileName;
|
||||
|
||||
Options := TSelectDirectoryDialog(ACommonDialog).Options;
|
||||
|
||||
if length(InitialDir)=0 then
|
||||
InitialDir := TSelectDirectoryDialog(ACommonDialog).InitialDir;
|
||||
if length(InitialDir)>0 then begin
|
||||
@ -666,6 +669,8 @@ begin
|
||||
pszDisplayName := Buffer;
|
||||
lpszTitle := PChar(ACommonDialog.Title);
|
||||
ulFlags := BIF_RETURNONLYFSDIRS;
|
||||
if not (ofOldStyleDialog in Options) then
|
||||
ulFlags := ulFlags + BIF_NEWDIALOGSTYLE;
|
||||
lpfn := @BrowseForFolderCallback;
|
||||
// this value will be passed to callback proc as lpData
|
||||
lParam := LclType.LParam(PChar(InitialDir));
|
||||
|
Loading…
Reference in New Issue
Block a user