mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-20 11:59:26 +02:00
cocoa: Basic support for select directory dialog
git-svn-id: trunk@49586 -
This commit is contained in:
parent
b7c800ae6d
commit
38e7f694c0
@ -1943,7 +1943,7 @@ procedure TCocoaContext.ClearClipping;
|
||||
var
|
||||
Trans: CGAffineTransform;
|
||||
begin
|
||||
if FClipped then
|
||||
if FClipped then
|
||||
begin
|
||||
Trans := CGContextGetCTM(CGContext);
|
||||
CGContextRestoreGState(CGContext());
|
||||
|
@ -173,14 +173,24 @@ begin
|
||||
|
||||
//todo: Options
|
||||
|
||||
if FileDialog.FCompStyle = csOpenFileDialog then
|
||||
if (FileDialog.FCompStyle = csOpenFileDialog) or
|
||||
(FileDialog is TSelectDirectoryDialog) then
|
||||
begin
|
||||
openDlg := NSOpenPanel.openPanel;
|
||||
openDlg.setAllowsMultipleSelection(ofAllowMultiSelect in
|
||||
TOpenDialog(FileDialog).Options);
|
||||
openDlg.setCanChooseFiles(True);
|
||||
if (FileDialog is TSelectDirectoryDialog) then
|
||||
begin
|
||||
openDlg.setCanChooseDirectories(True);
|
||||
openDlg.setCanChooseFiles(False);
|
||||
end
|
||||
else
|
||||
begin
|
||||
openDlg.setCanChooseFiles(True);
|
||||
openDlg.setCanChooseDirectories(False);
|
||||
openDlg.setAllowedFileTypes(nsfilter);
|
||||
end;
|
||||
openDlg.setTitle(NSStringUtf8(FileDialog.Title));
|
||||
openDlg.setAllowedFileTypes(nsfilter);
|
||||
openDlg.setDirectoryURL(NSURL.fileURLWithPath(NSStringUtf8(FileDialog.InitialDir)));
|
||||
|
||||
if openDlg.runModal = NSOKButton then
|
||||
@ -192,10 +202,8 @@ begin
|
||||
NSURL(openDlg.URLs.objectAtIndex(i)).path));
|
||||
FileDialog.UserChoice := mrOk;
|
||||
end;
|
||||
|
||||
end
|
||||
else
|
||||
if FileDialog.FCompStyle = csSaveFileDialog then
|
||||
else if FileDialog.FCompStyle = csSaveFileDialog then
|
||||
begin
|
||||
saveDlg := NSSavePanel.savePanel;
|
||||
saveDlg.setCanCreateDirectories(True);
|
||||
|
Loading…
Reference in New Issue
Block a user