mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 09:39:13 +02:00
cocoa: making file related dialogs modal (blocking menu)
git-svn-id: trunk@62216 -
This commit is contained in:
parent
3930aa1772
commit
0e6259598f
@ -39,7 +39,7 @@ uses
|
||||
// LCL
|
||||
LCLStrConsts, LMessages, LCLMessageGlue, LCLProc, LCLIntf, LCLType,
|
||||
Controls, Forms, Themes, Menus,
|
||||
IntfGraphics, Graphics, CocoaWSFactory;
|
||||
IntfGraphics, Graphics, CocoaWSFactory, Interfaces, CocoaWSDialogs;
|
||||
|
||||
type
|
||||
|
||||
|
@ -33,7 +33,7 @@ uses
|
||||
WSForms, WSLCLClasses, WSProc, WSDialogs, LCLMessageGlue,
|
||||
// LCL Cocoa
|
||||
CocoaPrivate, CocoaUtils, CocoaWSCommon, CocoaWSStdCtrls, CocoaGDIObjects
|
||||
,Cocoa_Extra;
|
||||
,Cocoa_Extra, CocoaWSMenus;
|
||||
|
||||
type
|
||||
|
||||
@ -423,25 +423,30 @@ begin
|
||||
saveDlg.setDirectoryURL(NSURL.fileURLWithPath(NSStringUtf8(InitDir)));
|
||||
UpdateOptions(FileDialog, saveDlg);
|
||||
|
||||
if saveDlg.runModal = NSOKButton then
|
||||
begin
|
||||
FileDialog.FileName := NSStringToString(saveDlg.URL.path);
|
||||
FileDialog.Files.Clear;
|
||||
ToggleAppMenu(false);
|
||||
try
|
||||
if saveDlg.runModal = NSOKButton then
|
||||
begin
|
||||
FileDialog.FileName := NSStringToString(saveDlg.URL.path);
|
||||
FileDialog.Files.Clear;
|
||||
|
||||
if Assigned(openDlg) then
|
||||
for i := 0 to openDlg.filenames.Count - 1 do
|
||||
FileDialog.Files.Add(NSStringToString(
|
||||
NSURL(openDlg.URLs.objectAtIndex(i)).path));
|
||||
if Assigned(openDlg) then
|
||||
for i := 0 to openDlg.filenames.Count - 1 do
|
||||
FileDialog.Files.Add(NSStringToString(
|
||||
NSURL(openDlg.URLs.objectAtIndex(i)).path));
|
||||
|
||||
FileDialog.UserChoice := mrOk;
|
||||
if lFilter <> nil then
|
||||
FileDialog.FilterIndex := lFilter.lastSelectedItemIndex+1;
|
||||
FileDialog.UserChoice := mrOk;
|
||||
if lFilter <> nil then
|
||||
FileDialog.FilterIndex := lFilter.lastSelectedItemIndex+1;
|
||||
end;
|
||||
FileDialog.DoClose;
|
||||
|
||||
|
||||
// release everything
|
||||
LocalPool.Release;
|
||||
finally
|
||||
ToggleAppMenu(true);
|
||||
end;
|
||||
FileDialog.DoClose;
|
||||
|
||||
|
||||
// release everything
|
||||
LocalPool.Release;
|
||||
|
||||
end; {TCocoaWSFileDialog.ShowModal}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user