mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 23:59:27 +02:00
IdeIntf: Support multi-line text in property editors also in Carbon. Issue #27867, patch from Hans Luijten.
git-svn-id: trunk@52234 -
This commit is contained in:
parent
c8432ee164
commit
618bfe6da9
@ -1566,6 +1566,9 @@ begin
|
||||
if not GridIsUpdating and IsCurrentEditorAvailable then begin
|
||||
CurRow:=Rows[FItemIndex];
|
||||
NewValue:=CurRow.Editor.GetVisualValue;
|
||||
{$IFDEF LCLCarbon}
|
||||
NewValue:=StringReplace(NewValue,LineEnding,LineFeedSymbolUTF8,[rfReplaceAll]);
|
||||
{$ENDIF}
|
||||
SetCurrentEditValue(NewValue);
|
||||
end;
|
||||
end;
|
||||
@ -3116,7 +3119,11 @@ end;
|
||||
function TOICustomPropertyGrid.GetCurrentEditValue: string;
|
||||
begin
|
||||
if FCurrentEdit=ValueEdit then
|
||||
{$IFDEF LCLCarbon}
|
||||
Result:=StringReplace(ValueEdit.Text,LineFeedSymbolUTF8,LineEnding,[rfReplaceAll])
|
||||
{$ELSE}
|
||||
Result:=ValueEdit.Text
|
||||
{$ENDIF}
|
||||
else if FCurrentEdit=ValueComboBox then
|
||||
Result:=ValueComboBox.Text
|
||||
else if FCurrentEdit=ValueCheckBox then
|
||||
@ -3146,7 +3153,11 @@ end;
|
||||
procedure TOICustomPropertyGrid.SetCurrentEditValue(const NewValue: string);
|
||||
begin
|
||||
if FCurrentEdit=ValueEdit then
|
||||
{$IFDEF LCLCarbon}
|
||||
ValueEdit.Text:=StringReplace(StringReplace(NewValue,#13,LineEnding,[rfReplaceAll]),LineEnding,LineFeedSymbolUTF8,[rfReplaceAll])
|
||||
{$ELSE}
|
||||
ValueEdit.Text:=NewValue
|
||||
{$ENDIF}
|
||||
else if FCurrentEdit=ValueComboBox then
|
||||
begin
|
||||
ValueComboBox.Text:=NewValue;
|
||||
|
@ -41,6 +41,13 @@ uses
|
||||
const
|
||||
MaxIdentLength: Byte = 63;
|
||||
|
||||
{$IFDEF LCLCarbon}
|
||||
// LineFeed symbol (UTF8) to maintain linefeeds in multiline text for Carbon TEdit.
|
||||
// In Carbon, linefeeds get stripped from TEdit text, so we replace it temporary with
|
||||
// this symbol which displays correctly a LF symbol in the Object Inspector as well.
|
||||
LineFeedSymbolUTF8 = #226#144#138;
|
||||
{$ENDIF}
|
||||
|
||||
type
|
||||
|
||||
TPersistentSelectionList = PropEditUtils.TPersistentSelectionList;
|
||||
@ -2721,7 +2728,11 @@ end;
|
||||
function TPropertyEditor.GetVisualValue: ansistring;
|
||||
begin
|
||||
if AllEqual then
|
||||
{$IFDEF LCLCarbon}
|
||||
Result:=StringReplace(GetValue,LineEnding,LineFeedSymbolUTF8,[rfReplaceAll])
|
||||
{$ELSE}
|
||||
Result:=GetValue
|
||||
{$ENDIF}
|
||||
else
|
||||
Result:='';
|
||||
end;
|
||||
|
@ -83,6 +83,7 @@ GongYu
|
||||
Graeme Geldenhuys
|
||||
Grzegorz Zakrzewski
|
||||
Hakan Kizilhan
|
||||
Hans Luijten
|
||||
Hans-Joachim Ott
|
||||
Hans-Peter Diettrich
|
||||
Haruyuki Fujimaki
|
||||
|
Loading…
Reference in New Issue
Block a user