diff --git a/lcl/interfaces/cocoa/alllclintfunits.pas b/lcl/interfaces/cocoa/alllclintfunits.pas
index ca33c68b16..2dabba411e 100644
--- a/lcl/interfaces/cocoa/alllclintfunits.pas
+++ b/lcl/interfaces/cocoa/alllclintfunits.pas
@@ -5,7 +5,7 @@ uses
agl{%H-},
cocoa_extra{%H-},
cocoacaret{%H-},
- cocoaconfig{%H-},
+ cocoaconst{%H-},
cocoacursor{%H-},
cocoagdiobjects{%H-},
cocoaint{%H-},
diff --git a/lcl/interfaces/cocoa/cocoa_extra.pas b/lcl/interfaces/cocoa/cocoa_extra.pas
index 7688dea9c6..1d0376c5d2 100644
--- a/lcl/interfaces/cocoa/cocoa_extra.pas
+++ b/lcl/interfaces/cocoa/cocoa_extra.pas
@@ -48,6 +48,20 @@ const // NSImageScaling values
NSImageScaleNone = 2;
NSImageScaleProportionallyUpOrDown = 3;
+type
+ NSPasteboardType = NSString;
+var
+ NSPasteboardTypeString: NSPasteboardType; cvar; external;
+ NSPasteboardTypePNG: NSPasteboardType; cvar; external;
+ NSPasteboardTypeTIFF: NSPasteboardType; cvar; external;
+ NSPasteboardTypePDF: NSPasteboardType; cvar; external;
+ NSPasteboardTypeHTML: NSPasteboardType; cvar; external;
+ NSPasteboardTypeRTF: NSPasteboardType; cvar; external;
+ NSPasteboardTypeColor: NSPasteboardType; cvar; external;
+ NSPasteboardTypeFont: NSPasteboardType; cvar; external;
+ NSPasteboardTypeRuler: NSPasteboardType; cvar; external;
+ NSPasteboardTypeSound: NSPasteboardType; cvar; external;
+
type
NSMenuFix = objccategory external (NSMenu)
function itemAtIndex(index: NSInteger): NSMenuItem; message 'itemAtIndex:';
diff --git a/lcl/interfaces/cocoa/cocoaconfig.pas b/lcl/interfaces/cocoa/cocoaconfig.pas
deleted file mode 100644
index 0527088644..0000000000
--- a/lcl/interfaces/cocoa/cocoaconfig.pas
+++ /dev/null
@@ -1,33 +0,0 @@
-unit CocoaConfig;
-
-{$mode ObjFPC}{$H+}
-{$modeswitch objectivec1}
-
-interface
-
-uses
- CocoaAll;
-
-const
- CocoaBasePPI : Integer = 96; // for compatiblity with LCL 1.8 release. The macOS base is 72ppi
-
- // if set to true, then WS would not assign icons via TCocoaWSForm SetIcon
- // The icon would have to be changed manually. By default LCL behaviour is used
- CocoaIconUse: Boolean = false;
- CocoaToggleBezel : NSBezelStyle = NSRoundedBezelStyle;
- CocoaToggleType : NSButtonType = NSPushOnPushOffButton;
-
- CocoaHideFocusNoBorder : Boolean = true;
-
- CocoaUseLocalizedFontName : Boolean = false; // some localized named might be too long to be returned properly by APIs
-
- {$ifdef COCOALOOPHIJACK}
- // The flag is set to true once hi-jacked loop is finished (at the end of app)
- // The flag is checked in Menus to avoid "double" Cmd+Q menu
- LoopHiJackEnded : Boolean = false;
- {$endif}
-
-implementation
-
-end.
-
diff --git a/lcl/interfaces/cocoa/cocoaconst.pas b/lcl/interfaces/cocoa/cocoaconst.pas
new file mode 100644
index 0000000000..f74dedab33
--- /dev/null
+++ b/lcl/interfaces/cocoa/cocoaconst.pas
@@ -0,0 +1,169 @@
+unit CocoaConst;
+
+{$mode ObjFPC}{$H+}
+{$modeswitch objectivec1}
+
+interface
+
+uses
+ CocoaAll;
+
+const
+ CocoaBasePPI : Integer = 96; // for compatiblity with LCL 1.8 release. The macOS base is 72ppi
+
+ // if set to true, then WS would not assign icons via TCocoaWSForm SetIcon
+ // The icon would have to be changed manually. By default LCL behaviour is used
+ CocoaIconUse: Boolean = false;
+ CocoaToggleBezel : NSBezelStyle = NSRoundedBezelStyle;
+ CocoaToggleType : NSButtonType = NSPushOnPushOffButton;
+
+ CocoaHideFocusNoBorder : Boolean = true;
+
+ CocoaUseLocalizedFontName : Boolean = false; // some localized named might be too long to be returned properly by APIs
+
+ {$ifdef COCOALOOPHIJACK}
+ // The flag is set to true once hi-jacked loop is finished (at the end of app)
+ // The flag is checked in Menus to avoid "double" Cmd+Q menu
+ LoopHiJackEnded : Boolean = false;
+ {$endif}
+
+function NSSTR_EMPTY: NSString;
+
+function NSSTR_DARK_NAME: NSString;
+function NSSTR_DARK_NAME_VIBRANT: NSString;
+
+function NSSTR_LINE_FEED: NSString;
+function NSSTR_CARRIAGE_RETURN: NSString;
+function NSSTR_LINE_SEPARATOR: NSString;
+function NSSTR_PARAGRAPH_SEPARATOR: NSString;
+
+function NSSTR_KEY_ENTER: NSString;
+function NSSTR_KEY_ESC: NSString;
+function NSSTR_KEY_EQUALS: NSString;
+function NSSTR_KEY_PLUS: NSString;
+
+function NSSTR_TABCONTROL_PREV_ARROW: NSSTRING;
+function NSSTR_TABCONTROL_NEXT_ARROW: NSSTRING;
+
+implementation
+
+const
+ DarkName = 'NSAppearanceNameDarkAqua'; // used in 10.14
+ DarkNameVibrant = 'NSAppearanceNameVibrantDark'; // used in 10.13
+
+var
+ _NSSTR_EMPTY: NSString;
+
+ _NSSTR_DARK_NAME: NSString;
+ _NSSTR_DARK_NAME_VIBRANT: NSString;
+
+ _NSSTR_LINE_FEED: NSString;
+ _NSSTR_CARRIAGE_RETURN: NSString;
+ _NSSTR_LINE_SEPARATOR: NSString;
+ _NSSTR_PARAGRAPH_SEPARATOR: NSString;
+
+ _NSSTR_KEY_ENTER: NSString;
+ _NSSTR_KEY_ESC: NSString;
+ _NSSTR_KEY_EQUALS: NSString;
+ _NSSTR_KEY_PLUS: NSString;
+
+ _NSSTR_TABCONTROL_PREV_ARROW: NSSTRING;
+ _NSSTR_TABCONTROL_NEXT_ARROW: NSSTRING;
+
+function NSSTR_EMPTY: NSString;
+begin
+ Result:= _NSSTR_EMPTY;
+end;
+
+function NSSTR_DARK_NAME: NSString;
+begin
+ Result:= _NSSTR_DARK_NAME;
+end;
+
+function NSSTR_DARK_NAME_VIBRANT: NSString;
+begin
+ Result:= _NSSTR_DARK_NAME_VIBRANT;
+end;
+
+
+function NSSTR_LINE_FEED: NSString;
+begin
+ Result:= _NSSTR_LINE_FEED;
+end;
+
+function NSSTR_CARRIAGE_RETURN: NSString;
+begin
+ Result:= _NSSTR_CARRIAGE_RETURN;
+end;
+
+function NSSTR_LINE_SEPARATOR: NSString;
+begin
+ Result:= _NSSTR_LINE_SEPARATOR;
+end;
+
+function NSSTR_PARAGRAPH_SEPARATOR: NSString;
+begin
+ Result:= _NSSTR_PARAGRAPH_SEPARATOR;
+end;
+
+
+function NSSTR_KEY_ENTER: NSString;
+begin
+ Result:= _NSSTR_KEY_ENTER;
+end;
+
+function NSSTR_KEY_ESC: NSString;
+begin
+ Result:= _NSSTR_KEY_ESC;
+end;
+
+function NSSTR_KEY_EQUALS: NSString;
+begin
+ Result:= _NSSTR_KEY_EQUALS;
+end;
+
+function NSSTR_KEY_PLUS: NSString;
+begin
+ Result:= _NSSTR_KEY_PLUS;
+end;
+
+
+function NSSTR_TABCONTROL_PREV_ARROW: NSSTRING;
+begin
+ Result:= _NSSTR_TABCONTROL_PREV_ARROW;
+end;
+
+function NSSTR_TABCONTROL_NEXT_ARROW: NSSTRING;
+begin
+ Result:= _NSSTR_TABCONTROL_NEXT_ARROW;
+end;
+
+
+initialization
+ _NSSTR_EMPTY:= NSString.string_;
+
+ _NSSTR_DARK_NAME:= NSSTR(DarkName);
+ _NSSTR_DARK_NAME_VIBRANT:= NSSTR(DarkNameVibrant);
+
+ _NSSTR_LINE_FEED:= NSSTR(#10);
+ _NSSTR_CARRIAGE_RETURN:= NSSTR(#13);
+ _NSSTR_LINE_SEPARATOR:= NSString.alloc.initWithUTF8String(#$E2#$80#$A8);
+ _NSSTR_PARAGRAPH_SEPARATOR:= NSString.alloc.initWithUTF8String(#$E2#$80#$A9);
+
+ _NSSTR_KEY_ENTER:= NSSTR(#13);
+ _NSSTR_KEY_ESC:= NSSTR(#27);
+ _NSSTR_KEY_EQUALS:= NSSTR('=');
+ _NSSTR_KEY_PLUS:= NSSTR('+');
+
+ _NSSTR_TABCONTROL_PREV_ARROW:= NSString.alloc.initWithUTF8String('◀');
+ _NSSTR_TABCONTROL_NEXT_ARROW:= NSString.alloc.initWithUTF8String('▶');
+
+finalization;
+ _NSSTR_LINE_SEPARATOR.release;
+ _NSSTR_PARAGRAPH_SEPARATOR.release;
+
+ _NSSTR_TABCONTROL_PREV_ARROW.release;
+ _NSSTR_TABCONTROL_NEXT_ARROW.release;
+
+end.
+
diff --git a/lcl/interfaces/cocoa/cocoaint.pas b/lcl/interfaces/cocoa/cocoaint.pas
index 581292f00e..52ad424049 100644
--- a/lcl/interfaces/cocoa/cocoaint.pas
+++ b/lcl/interfaces/cocoa/cocoaint.pas
@@ -33,7 +33,7 @@ uses
// darwin bindings
MacOSAll,
// private
- CocoaAll, CocoaConfig, CocoaPrivate, CocoaUtils, CocoaGDIObjects, CocoaCursor,
+ CocoaAll, CocoaConst, CocoaPrivate, CocoaUtils, CocoaGDIObjects, CocoaCursor,
cocoa_extra, CocoaMenus, CocoaWindows, CocoaScrollers,
CocoaWSClipboard, CocoaTextEdits,
// LCL
diff --git a/lcl/interfaces/cocoa/cocoalclintf.inc b/lcl/interfaces/cocoa/cocoalclintf.inc
index eb770c636e..d01a0894a0 100644
--- a/lcl/interfaces/cocoa/cocoalclintf.inc
+++ b/lcl/interfaces/cocoa/cocoalclintf.inc
@@ -290,16 +290,16 @@ begin
aButton.setKeyEquivalentModifierMask(0);
if I = DefaultIndex then
- aButton.setKeyEquivalent(NSSTR(#13))
+ aButton.setKeyEquivalent(NSSTR_KEY_ENTER)
else if I = 0 then
// By default, the first button is the default button. If in our
// case this should not be the case, remove the default status
// from the first button.
- aButton.setKeyEquivalent(NSSTR(''));
+ aButton.setKeyEquivalent(NSSTR_EMPTY);
if Buttons[I]=mrCancel then begin
needsCancel := False;
- aButton.setKeyEquivalent(NSSTR(#27));
+ aButton.setKeyEquivalent(NSSTR_KEY_ESC);
end;
aButton.setTag(Buttons[I]);
diff --git a/lcl/interfaces/cocoa/cocoamenus.pas b/lcl/interfaces/cocoa/cocoamenus.pas
index 7141ca6942..25f4d7e5b0 100644
--- a/lcl/interfaces/cocoa/cocoamenus.pas
+++ b/lcl/interfaces/cocoa/cocoamenus.pas
@@ -12,7 +12,7 @@ uses
// LCL
Forms, Menus, LCLType, Classes, LCLStrConsts,
// LCL Cocoa
- CocoaAll, CocoaPrivate, CocoaUtils;
+ CocoaAll, CocoaPrivate, CocoaUtils, CocoaConst;
type
IMenuItemCallback = interface(ICommonCallBack)
@@ -144,9 +144,9 @@ begin
// as a key , +/= is a rare case, both + and = are used as primary keys.
// ‘Shift+=’ for ‘+’
// ‘=’ for ‘='
- if key.isEqualToString(NSSTR('+')) then begin
+ if key.isEqualToString(NSSTR_KEY_PLUS) then begin
if (ShiftKeyMask and NSShiftKeyMask)=0 then
- key := NSStr('=')
+ key := NSSTR_KEY_EQUALS
else
ShiftKeyMask := ShiftKeyMask - NSShiftKeyMask;
end;
diff --git a/lcl/interfaces/cocoa/cocoatabcontrols.pas b/lcl/interfaces/cocoa/cocoatabcontrols.pas
index 2bd25ab60b..1880e87d3a 100644
--- a/lcl/interfaces/cocoa/cocoatabcontrols.pas
+++ b/lcl/interfaces/cocoa/cocoatabcontrols.pas
@@ -26,7 +26,7 @@ uses
// rtl+ftl
Types, Classes, SysUtils,
// Libs
- MacOSAll, CocoaAll, CocoaUtils, CocoaPrivate;
+ MacOSAll, CocoaAll, CocoaUtils, CocoaPrivate, CocoaConst;
type
@@ -189,9 +189,9 @@ begin
btn.setButtonType(NSMomentaryLightButton);
if isPrev then
- btn.setTitle( StrToNSString('◀') )
+ btn.setTitle( NSSTR_TABCONTROL_PREV_ARROW )
else
- btn.setTitle( StrToNSString('▶') );
+ btn.setTitle( NSSTR_TABCONTROL_NEXT_ARROW );
{$ifdef BOOLFIX}
btn.setBordered_(Ord(false));
diff --git a/lcl/interfaces/cocoa/cocoatables.pas b/lcl/interfaces/cocoa/cocoatables.pas
index 5bad73b124..5e88841879 100644
--- a/lcl/interfaces/cocoa/cocoatables.pas
+++ b/lcl/interfaces/cocoa/cocoatables.pas
@@ -29,7 +29,7 @@ uses
Types, Classes, SysUtils,
// Libs
MacOSAll, CocoaAll, CocoaUtils, CocoaGDIObjects,
- cocoa_extra, CocoaPrivate,
+ cocoa_extra, CocoaPrivate, CocoaConst,
// LCL
LCLType;
@@ -924,7 +924,7 @@ begin
if not isFirstColumnCheckboxes and isImagesInCell then begin
img := lclGetItemImageAt(row, col);
- Result := NSImageAndTextCell(NSImageAndTextCell.alloc).initTextCell(NSSTR(''));
+ Result := NSImageAndTextCell(NSImageAndTextCell.alloc).initTextCell(NSSTR_EMPTY);
NSImageAndTextCell(Result).drawImage := img; // if "image" is assigned, text won't be drawn :(
Exit;
end;
diff --git a/lcl/interfaces/cocoa/cocoathemes.pas b/lcl/interfaces/cocoa/cocoathemes.pas
index 3d90198af8..312a2bd2f1 100644
--- a/lcl/interfaces/cocoa/cocoathemes.pas
+++ b/lcl/interfaces/cocoa/cocoathemes.pas
@@ -22,7 +22,7 @@ uses
LCLType, LCLProc, LCLIntf, Graphics, Themes, TmSchema,
customdrawndrawers,
// widgetset
- CocoaUtils, CocoaGDIObjects;
+ CocoaUtils, CocoaGDIObjects, CocoaConst;
type
{ TCocoaThemeServices }
@@ -266,7 +266,7 @@ var
begin
if (HdrCell=nil) then
begin
- hdrCell := NSTableHeaderCell.alloc.initTextCell(NSSTR(''));
+ hdrCell := NSTableHeaderCell.alloc.initTextCell(NSSTR_EMPTY);
end;
CellDrawStart(DC, R, cur, nsr);
@@ -530,7 +530,7 @@ begin
end;
if cocoaBtn < 0 then Exit; // unsupported button type
- btn := NSButtonCell(NSButtonCell.alloc).initTextCell(NSSTR(''));
+ btn := NSButtonCell(NSButtonCell.alloc).initTextCell(NSSTR_EMPTY);
btn.setButtonType(NSButtonType(cocoaBtn));
SetButtonCellToDetails(btn, Details);
@@ -542,7 +542,7 @@ end;
constructor TCocoaThemeServices.Create;
begin
inherited Create;
- BtnCell := NSButtonCell.alloc.initTextCell(NSSTR(''));
+ BtnCell := NSButtonCell.alloc.initTextCell(NSSTR_EMPTY);
BezelToolBar := NSSmallSquareBezelStyle; // can be resized at any size
BezelButton := NSSmallSquareBezelStyle;
diff --git a/lcl/interfaces/cocoa/cocoautils.pas b/lcl/interfaces/cocoa/cocoautils.pas
index 91073fa51b..cd745aa6fe 100644
--- a/lcl/interfaces/cocoa/cocoautils.pas
+++ b/lcl/interfaces/cocoa/cocoautils.pas
@@ -7,7 +7,7 @@ interface
uses
classes,
- MacOSAll, CocoaAll, Cocoa_Extra,
+ MacOSAll, CocoaAll, Cocoa_Extra, CocoaConst,
SysUtils, Types, LCLType, LCLProc,
Graphics, GraphType;
@@ -154,20 +154,8 @@ function NSEventRawKeyChar(ev: NSEvent): System.WideChar;
function AllocImageRotatedByDegrees(src: NSImage; degrees: double): NSImage;
function AllocCursorFromCursorByDegrees(src: NSCursor; degrees: double): NSCursor;
-var
- NSSTR_DARK_NAME: NSString;
- NSSTR_DARK_NAME_VIBRANT: NSString;
- NSSTR_LINE_FEED: NSString;
- NSSTR_CARRIAGE_RETURN: NSString;
- NSSTR_LINE_SEPARATOR: NSString;
- NSSTR_PARAGRAPH_SEPARATOR: NSString;
-
implementation
-const
- DarkName = 'NSAppearanceNameDarkAqua'; // used in 10.14
- DarkNameVibrant = 'NSAppearanceNameVibrantDark'; // used in 10.13
-
procedure ApplicationWillShowModal;
begin
// Any place that would attempt to use Cocoa-native modality.
@@ -1361,18 +1349,5 @@ begin
img.release;
end;
-initialization
- NSSTR_DARK_NAME:= NSSTR(DarkName);
- NSSTR_DARK_NAME_VIBRANT:= NSSTR(DarkNameVibrant);
- NSSTR_LINE_FEED:= NSStr(#10);
- NSSTR_CARRIAGE_RETURN:= NSStr(#13);
- NSSTR_LINE_SEPARATOR:= StrToNSString(#$E2#$80#$A8, false);
- NSSTR_PARAGRAPH_SEPARATOR:= StrToNSString(#$E2#$80#$A9, false);
-
-finalization;
- NSSTR_LINE_SEPARATOR.release;
- NSSTR_PARAGRAPH_SEPARATOR.release;
-
end.
-
diff --git a/lcl/interfaces/cocoa/cocoawsclipboard.pas b/lcl/interfaces/cocoa/cocoawsclipboard.pas
index b47813d698..f131c48244 100644
--- a/lcl/interfaces/cocoa/cocoawsclipboard.pas
+++ b/lcl/interfaces/cocoa/cocoawsclipboard.pas
@@ -24,7 +24,7 @@ uses
// fcl-image
,fpreadpng, fpwritepng, fpimage, fpreadbmp, fpwritebmp
,LCLType
- ,CocoaUtils;
+ ,CocoaUtils, Cocoa_Extra;
type
TCocoaClipboardDataType = (ccdtText,
@@ -81,22 +81,8 @@ type
end;
-const
- // these constants are available starting MacOSX 10.6
- // thus for earlier systems must be redeclared
- _NSPasteboardTypeString : NSString = nil;
- _NSPasteboardTypePNG : NSString = nil;
- _NSPasteboardTypeTiff : NSString = nil;
-
implementation
-procedure InitConst;
-begin
- _NSPasteboardTypeString := NSSTR('public.utf8-plain-text');
- _NSPasteboardTypePNG := NSSTR('public.png');
- _NSPasteboardTypeTiff := NSSTR('public.tiff');
-end;
-
{ TCocoaWSClipboard }
constructor TCocoaWSClipboard.Create;
@@ -433,20 +419,17 @@ begin
case AMimeType of
'text/plain':
begin
- //hack: the name of constants is a hack
- // should be replaced with either weaklinking
- // or dynamic loading (dlsym)
- lNSStr := NSSTR('public.utf8-plain-text'); // NSPasteboardTypeString; // commented out for OSX < 10.6 see #33672
+ lNSStr := NSPasteboardTypeString;
lDataType := ccdtText;
end;
'image/png':
begin
- lNSStr := NSSTR('public.png'); // NSPasteboardTypePNG
+ lNSStr := NSPasteboardTypePNG;
lDataType := ccdtCocoaStandard;
end;
'image/bmp':
begin
- lNSStr := NSSTR('public.png'); // NSPasteboardTypePNG
+ lNSStr := NSPasteboardTypePNG;
lDataType := ccdtBitmap;
end;
else
@@ -470,7 +453,7 @@ end;
function TCocoaWSClipboard.CocoaTypeToMimeType(AType: NSString): string;
begin
// "default" types must be mapped to a default LCL mime-type
- if AType.isEqualToString(_NSPasteboardTypeString) then
+ if AType.isEqualToString(NSPasteboardTypeString) then
Result := 'text/plain'
else
Result := NSStringToString(AType);
@@ -490,8 +473,4 @@ begin
CocoaFormat.release;
end;
-
-initialization
- InitConst;
-
end.
diff --git a/lcl/interfaces/cocoa/cocoawscommon.pas b/lcl/interfaces/cocoa/cocoawscommon.pas
index b5454f49d4..421ca6db04 100644
--- a/lcl/interfaces/cocoa/cocoawscommon.pas
+++ b/lcl/interfaces/cocoa/cocoawscommon.pas
@@ -10,7 +10,7 @@ interface
uses
Types, Classes, Controls, SysUtils,
WSControls, LCLType, LCLMessageGlue, LMessages, LCLProc, LCLIntf, Graphics, Forms,
- CocoaAll, CocoaInt, CocoaConfig, CocoaPrivate, CocoaUtils,
+ CocoaAll, CocoaInt, CocoaConst, CocoaPrivate, CocoaUtils,
CocoaGDIObjects, CocoaCursor, CocoaCaret, CocoaScrollers, cocoa_extra;
type
diff --git a/lcl/interfaces/cocoa/cocoawsforms.pas b/lcl/interfaces/cocoa/cocoawsforms.pas
index 47aee7ac89..f1636f1921 100644
--- a/lcl/interfaces/cocoa/cocoawsforms.pas
+++ b/lcl/interfaces/cocoa/cocoawsforms.pas
@@ -30,7 +30,7 @@ uses
// Widgetset
WSForms, WSLCLClasses, LCLMessageGlue,
// LCL Cocoa
- CocoaInt, CocoaConfig, CocoaPrivate, CocoaUtils, CocoaWSCommon, CocoaMenus,
+ CocoaInt, CocoaConst, CocoaPrivate, CocoaUtils, CocoaWSCommon, CocoaMenus,
CocoaGDIObjects,
CocoaWindows, CocoaScrollers, cocoa_extra;
@@ -642,7 +642,7 @@ begin
SetWindowButtonState(NSWindowZoomButton, (biMaximize in ABorderIcons) and (ABorderStyle in [bsSizeable, bsSizeToolWin]), (ABorderStyle in [bsSingle, bsSizeable]) and (biSystemMenu in ABorderIcons));
SetWindowButtonState(NSWindowCloseButton, True, (ABorderStyle <> bsNone) and (biSystemMenu in ABorderIcons));
- if not CocoaConfig.CocoaIconUse then
+ if not CocoaConst.CocoaIconUse then
begin
btn := AWindow.standardWindowButton(NSWindowDocumentIconButton);
url := nil;
@@ -1048,7 +1048,7 @@ var
trg : NSImage;
btn : NSButton;
begin
- if CocoaConfig.CocoaIconUse then Exit;
+ if CocoaConst.CocoaIconUse then Exit;
if not AForm.HandleAllocated then Exit;
win := TCocoaWindowContent(AForm.Handle).lclOwnWindow;
diff --git a/lcl/interfaces/cocoa/cocoawsstdctrls.pas b/lcl/interfaces/cocoa/cocoawsstdctrls.pas
index 52dda2c8d0..6096bddc99 100644
--- a/lcl/interfaces/cocoa/cocoawsstdctrls.pas
+++ b/lcl/interfaces/cocoa/cocoawsstdctrls.pas
@@ -33,7 +33,7 @@ uses
// Widgetset
WSStdCtrls, WSLCLClasses,
// LCL Cocoa
- CocoaConfig, CocoaWSCommon, CocoaPrivate, CocoaUtils, CocoaGDIObjects, CocoaButtons,
+ CocoaConst, CocoaWSCommon, CocoaPrivate, CocoaUtils, CocoaGDIObjects, CocoaButtons,
CocoaTables, CocoaTextEdits, CocoaScrollers, Cocoa_Extra;
type
@@ -1432,8 +1432,6 @@ var
ns : NSString;
idx : integer;
ro : Boolean;
-const
- LFSTR = #10;
begin
ns:=FTextView.string_;
idx:=0;
@@ -1455,7 +1453,7 @@ begin
FTextView.setSelectedRange(rng);
if (rng.location>=ns.length) and (st=ced) and (ns.length>0) then
- FTextView.insertText( NSString.stringWithUTF8String( LFSTR ));
+ FTextView.insertText( NSSTR_LINE_FEED );
if S<>'' then
begin
@@ -1463,7 +1461,7 @@ begin
end;
dec(FTextView.supressTextChangeEvent);
- FTextView.insertText( NSString.stringWithUTF8String( LFSTR ));
+ FTextView.insertText( NSSTR_LINE_FEED );
if not ro then FTextView.setEditable(ro);
diff --git a/lcl/interfaces/lcl.lpk b/lcl/interfaces/lcl.lpk
index 7bfe276a35..b4e67d469d 100644
--- a/lcl/interfaces/lcl.lpk
+++ b/lcl/interfaces/lcl.lpk
@@ -2614,9 +2614,9 @@ end;"/>
-
+
-
+