Dialog for selecting both files and directories lazarus / 31-LCL ---------------------------------------------------------------------- simsee · 2025-01-05 12:36 With TOpenDialog I can select files, while with TSelectDirectoryDialog I can select directories. Is there a dialog that allows you to select both files and directories? If I remember correctly, in Delphi there is TFileOpenDialog with fdoPickFolders option, but I can't seem to find anything similar in Lazarus. Thanks. ---------------------------------------------------------------------- ASerge · 2025-01-05 14:39 Quote from: simsee on January 05, 2025, 01:36:13 pmIf I remember correctly, in Delphi there is TFileOpenDialog with fdoPickFolders option, but I can't seem to find anything similar in Lazarus. In Lazarus, this is "ofPickFolders". This is the same as in Delphi fdoPickFolders, and allows you to select folders ONLY. ---------------------------------------------------------------------- Bart · 2025-01-05 14:47 Quote from: ASerge on January 05, 2025, 03:39:39 pmQuote from: simsee on January 05, 2025, 01:36:13 pmIf I remember correctly, in Delphi there is TFileOpenDialog with fdoPickFolders option, but I can't seem to find anything similar in Lazarus. In Lazarus, this is "ofPickFolders". This is the same as in Delphi fdoPickFolders, and allows you to select folders ONLY. And that behaviour is the native behaviour of Windows, since we just tell Windows to apply that flag (FOS_PICKFOLDERS). Microsoft says: QuoteFOS_PICKFOLDERS: Present an Open dialog that offers a choice of folders rather than files. I'm also not sure how "pick a folder and pich a filename" is supposed to work. If I double click on a folder, wil it open the folder or pick it. Either behaviour may not be what the user expected. ---------------------------------------------------------------------- simsee · 2025-01-05 17:36 Quote from: ASerge on January 05, 2025, 03:39:39 pmQuote from: simsee on January 05, 2025, 01:36:13 pmIf I remember correctly, in Delphi there is TFileOpenDialog with fdoPickFolders option, but I can't seem to find anything similar in Lazarus. In Lazarus, this is "ofPickFolders". This is the same as in Delphi fdoPickFolders, and allows you to select folders ONLY. Thanks, but I can't find the ofPickFolders option listed here: https://lazarus-ccr.sourceforge.io/docs/lcl/dialogs/topenoptions.html ---------------------------------------------------------------------- Bart · 2025-01-05 17:52 Quote from: simsee on January 05, 2025, 06:36:03 pmThanks, but I can't find the ofPickFolders option listed here: https://lazarus-ccr.sourceforge.io/docs/lcl/dialogs/topenoptions.html It's in TOpenDialog.OptionsEx, but that's not documentend on that site (yet). I don't think it's in fixes 3 (3.6 etc). It will be in 4.0 (and should be in upcoming 4.0 RC2), it's a recent addition, exposing all Vista+ options for the dialog that were not in present in XP. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  TOpenOptionEx = (    ofHidePinnedPlaces,         //Windows Vista+ Hide items shown by default in the view's navigation pane.    ofForcePreviewPaneOn,       //Windows Vista+ Indicates to the Open dialog box that the preview pane should always be displayed (a NARG/NARL option IMHO)    ofStrictFileTypes,          //Windows Vista+ In the Save dialog, only allow the user to choose a file that has one of the file name extensions specified through Filter property    ofPickFolders,              //Windows Vista+ Turns the dialog into a TSelectDirectoryDialog    ofOkButtonNeedsInteraction, //Windows Vista+ The OK button will be disabled until the user navigates the view or edits the filename (if applicable).    ofForceFileSystem,          //Windows Vista+ Ensures that returned items are file system items  ofAllNonStorageItems        //Windows Vista+ Enables the user to choose any item in the Shell namespace, not just those with SFGAO_STREAM or SFAGO_FILESYSTEM attributes.                              //               This flag cannot be combined with FOS_FORCEFILESYSTEM.    // Intentionally not supported: ofDefaultNoMiniMode, ofHideMruPlaces: these values are not supported as of Windows 7.  );  TOpenOptionsEx = set of TOpenOptionEx; In Lazarus main, this has been extended with yet another flag. At current they are all Windows specific, but other widgetset dependant flags (GTK, QT, Cocoa) could be implented as well. Bart ---------------------------------------------------------------------- TRon · 2025-01-05 17:58 Quote from: Bart on January 05, 2025, 06:52:33 pmIt's in TOpenDialog.OptionsEx, but that's not documentend on that site (yet). I don't think it's in fixes 3 (3.6 etc). It will be in 4.0 (and should be in upcoming 4.0 RC2), it's a recent addition, exposing all Vista+ options for the dialog that were not in present in XP. For (more) up to date docs see dsiders nextdoc site, for the extended dialog options in particular see here. Do note that all information listed is a work in progress (as is trunk).