mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 14:56:00 +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/alllclintfunits.pas svneol=native#text/plain
|
||||||
lcl/interfaces/cocoa/cocoa_extra.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/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/cocoagdiobjects.pas svneol=native#text/plain
|
||||||
lcl/interfaces/cocoa/cocoaint.pas svneol=native#text/plain
|
lcl/interfaces/cocoa/cocoaint.pas svneol=native#text/plain
|
||||||
lcl/interfaces/cocoa/cocoalclintf.inc svneol=native#text/pascal
|
lcl/interfaces/cocoa/cocoalclintf.inc svneol=native#text/pascal
|
||||||
|
@ -27,6 +27,10 @@ uses
|
|||||||
MacOSAll, CocoaAll;
|
MacOSAll, CocoaAll;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
NSMenuFix = objccategory external (NSMenu)
|
||||||
|
function itemAtIndex(index: NSInteger): NSMenuItem; message 'itemAtIndex:';
|
||||||
|
end;
|
||||||
|
|
||||||
NSViewFix = objccategory external (NSView)
|
NSViewFix = objccategory external (NSView)
|
||||||
function fittingSize: NSSize; message 'fittingSize';
|
function fittingSize: NSSize; message 'fittingSize';
|
||||||
end;
|
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+}
|
{$mode objfpc}{$H+}
|
||||||
{$modeswitch objectivec1}
|
{$modeswitch objectivec1}
|
||||||
{$modeswitch objectivec2}
|
{$modeswitch objectivec2}
|
||||||
|
{$include cocoadefines.inc}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
@ -229,9 +229,14 @@ begin
|
|||||||
lcNeedMininimizeAppWithMainForm,
|
lcNeedMininimizeAppWithMainForm,
|
||||||
lcApplicationTitle,
|
lcApplicationTitle,
|
||||||
lcFormIcon,
|
lcFormIcon,
|
||||||
|
{$ifndef COCOA_USE_NATIVE_MODAL}
|
||||||
|
lcModalWindow,
|
||||||
|
{$endif}
|
||||||
lcReceivesLMClearCutCopyPasteReliably:
|
lcReceivesLMClearCutCopyPasteReliably:
|
||||||
Result := LCL_CAPABILITY_NO;
|
Result := LCL_CAPABILITY_NO;
|
||||||
|
{$ifdef COCOA_USE_NATIVE_MODAL}
|
||||||
lcModalWindow,
|
lcModalWindow,
|
||||||
|
{$endif}
|
||||||
lcAntialiasingEnabledByDefault:
|
lcAntialiasingEnabledByDefault:
|
||||||
Result := LCL_CAPABILITY_YES;
|
Result := LCL_CAPABILITY_YES;
|
||||||
else
|
else
|
||||||
|
@ -18,6 +18,7 @@ unit CocoaWSForms;
|
|||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
{$modeswitch objectivec1}
|
{$modeswitch objectivec1}
|
||||||
|
{$include cocoadefines.inc}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@ -567,7 +568,9 @@ begin
|
|||||||
{if CocoaWidgetSet.CurModalSession <> nil then
|
{if CocoaWidgetSet.CurModalSession <> nil then
|
||||||
NSApp.endModalSession(CocoaWidgetSet.CurModalSession);
|
NSApp.endModalSession(CocoaWidgetSet.CurModalSession);
|
||||||
CocoaWidgetSet.CurModalSession := nil;}
|
CocoaWidgetSet.CurModalSession := nil;}
|
||||||
|
{$ifdef COCOA_USE_NATIVE_MODAL}
|
||||||
NSApp.stopModal();
|
NSApp.stopModal();
|
||||||
|
{$endif}
|
||||||
CocoaWidgetSet.CurModalForm := nil;
|
CocoaWidgetSet.CurModalForm := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -586,7 +589,9 @@ begin
|
|||||||
NSApp.runModalSession(CocoaWidgetSet.CurModalSession);}
|
NSApp.runModalSession(CocoaWidgetSet.CurModalSession);}
|
||||||
|
|
||||||
CocoaWidgetSet.CurModalForm := ACustomForm;
|
CocoaWidgetSet.CurModalForm := ACustomForm;
|
||||||
|
{$ifdef COCOA_USE_NATIVE_MODAL}
|
||||||
NSApp.runModalForWindow(win);
|
NSApp.runModalForWindow(win);
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// If ShowModal will not be fully blocking in the future this can be removed
|
// If ShowModal will not be fully blocking in the future this can be removed
|
||||||
|
Loading…
Reference in New Issue
Block a user