Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
FireMonkey
Additional
Animations
Colors
Components
Dialogs
Effects
Form Designer
Layers
Menu Designer
Runtime
Shapes
Standard
Style Designer
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/FireMonkey/Dialogs
[ Add a report in this area ]
Report #:
99840
Status:
Open
TOpenDialog implementation always allows the user to choose a directory and not just a file on OS X
Project:
Delphi
Build #:
16.0.4276.44006
Version:
16.1
Submitted By:
Chris Rolliston
Report Type:
Basic functionality failure
Date Reported:
10/9/2011 6:28:14 PM
Severity:
Serious / Highly visible problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All Mac platforms
Internal Tracking #:
288083
Resolution:
None
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
22
Description
In line 2630 of FMX.Platform.Mac.pas, the setCanChooseDirectories method is called, passing True as its parameter. This causes the resulting dialog to allow choosing a directory instead of only a file. This is inconsistent with the behaviour on Windows.
Steps to Reproduce:
1. Drop a TOpenDialog and TButton on a form.
2. Enable the foFileMustExist option in the dialog.
3. Set the button to show the dialog on being clicked
4. Target for the Mac, run the application, and click the button.
5. Select a directory and click Open.
6. The dialog closes, returning the path to the selected directory in its FileName property. This is unexpected.
Really, I think it was a mistake to promote the VCL TOpenOptions set to be a FireMonkey set too - instead, the TFileDialogOptions type (used by the VCL TFileOpenDialog component) is a better fit. Aside from TOpenOptions including legacy elements irrelevant in a FireMonkey context, TFileDialogOption includes a fdoPickFolders bit which would directly map to setCanChooseDirectories(True)/setCanChooseFiles(False) if set, and setCanChooseDirectories(False)/setCanChooseFiles(True) if not.
Workarounds
None
Attachment
None
Comments
Graham Neden-Watts at 11/3/2011 3:28:41 PM
-
As an extension to this issue - In general we need a way in FMX to select folders as well as file open/save. Many apps require users to select a folder for data storage. In FMX, developers will need to implement a per-platform solution for this which seems a shame as Delphi clearly has the code in place to allow folder selection as well as file open/save
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us