mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 09:09:35 +02:00
cocoa: Makes the native modal mode selective via a define
git-svn-id: trunk@49779 -
This commit is contained in:
parent
50bc37338d
commit
0486824ce1
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -6965,6 +6965,7 @@ lcl/interfaces/cocoa/Makefile.fpc svneol=native#text/plain
|
||||
lcl/interfaces/cocoa/alllclintfunits.pas svneol=native#text/plain
|
||||
lcl/interfaces/cocoa/cocoa_extra.pas svneol=native#text/plain
|
||||
lcl/interfaces/cocoa/cocoacaret.pas svneol=native#text/pascal
|
||||
lcl/interfaces/cocoa/cocoadefines.inc svneol=native#text/plain
|
||||
lcl/interfaces/cocoa/cocoagdiobjects.pas svneol=native#text/plain
|
||||
lcl/interfaces/cocoa/cocoaint.pas svneol=native#text/plain
|
||||
lcl/interfaces/cocoa/cocoalclintf.inc svneol=native#text/pascal
|
||||
|
@ -27,6 +27,10 @@ uses
|
||||
MacOSAll, CocoaAll;
|
||||
|
||||
type
|
||||
NSMenuFix = objccategory external (NSMenu)
|
||||
function itemAtIndex(index: NSInteger): NSMenuItem; message 'itemAtIndex:';
|
||||
end;
|
||||
|
||||
NSViewFix = objccategory external (NSView)
|
||||
function fittingSize: NSSize; message 'fittingSize';
|
||||
end;
|
||||
|
4
lcl/interfaces/cocoa/cocoadefines.inc
Normal file
4
lcl/interfaces/cocoa/cocoadefines.inc
Normal file
@ -0,0 +1,4 @@
|
||||
{%MainUnit cocoaint.pas}
|
||||
|
||||
{.$define COCOA_USE_NATIVE_MODAL}
|
||||
|
@ -21,6 +21,7 @@ unit CocoaInt;
|
||||
{$mode objfpc}{$H+}
|
||||
{$modeswitch objectivec1}
|
||||
{$modeswitch objectivec2}
|
||||
{$include cocoadefines.inc}
|
||||
|
||||
interface
|
||||
|
||||
|
@ -229,9 +229,14 @@ begin
|
||||
lcNeedMininimizeAppWithMainForm,
|
||||
lcApplicationTitle,
|
||||
lcFormIcon,
|
||||
{$ifndef COCOA_USE_NATIVE_MODAL}
|
||||
lcModalWindow,
|
||||
{$endif}
|
||||
lcReceivesLMClearCutCopyPasteReliably:
|
||||
Result := LCL_CAPABILITY_NO;
|
||||
{$ifdef COCOA_USE_NATIVE_MODAL}
|
||||
lcModalWindow,
|
||||
{$endif}
|
||||
lcAntialiasingEnabledByDefault:
|
||||
Result := LCL_CAPABILITY_YES;
|
||||
else
|
||||
|
@ -18,6 +18,7 @@ unit CocoaWSForms;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
{$modeswitch objectivec1}
|
||||
{$include cocoadefines.inc}
|
||||
|
||||
interface
|
||||
|
||||
@ -567,7 +568,9 @@ begin
|
||||
{if CocoaWidgetSet.CurModalSession <> nil then
|
||||
NSApp.endModalSession(CocoaWidgetSet.CurModalSession);
|
||||
CocoaWidgetSet.CurModalSession := nil;}
|
||||
NSApp.stopModal();
|
||||
{$ifdef COCOA_USE_NATIVE_MODAL}
|
||||
NSApp.stopModal();
|
||||
{$endif}
|
||||
CocoaWidgetSet.CurModalForm := nil;
|
||||
end;
|
||||
|
||||
@ -586,7 +589,9 @@ begin
|
||||
NSApp.runModalSession(CocoaWidgetSet.CurModalSession);}
|
||||
|
||||
CocoaWidgetSet.CurModalForm := ACustomForm;
|
||||
{$ifdef COCOA_USE_NATIVE_MODAL}
|
||||
NSApp.runModalForWindow(win);
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
// If ShowModal will not be fully blocking in the future this can be removed
|
||||
|
Loading…
Reference in New Issue
Block a user