mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 08:59:13 +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
|
if not GridIsUpdating and IsCurrentEditorAvailable then begin
|
||||||
CurRow:=Rows[FItemIndex];
|
CurRow:=Rows[FItemIndex];
|
||||||
NewValue:=CurRow.Editor.GetVisualValue;
|
NewValue:=CurRow.Editor.GetVisualValue;
|
||||||
|
{$IFDEF LCLCarbon}
|
||||||
|
NewValue:=StringReplace(NewValue,LineEnding,LineFeedSymbolUTF8,[rfReplaceAll]);
|
||||||
|
{$ENDIF}
|
||||||
SetCurrentEditValue(NewValue);
|
SetCurrentEditValue(NewValue);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -3116,7 +3119,11 @@ end;
|
|||||||
function TOICustomPropertyGrid.GetCurrentEditValue: string;
|
function TOICustomPropertyGrid.GetCurrentEditValue: string;
|
||||||
begin
|
begin
|
||||||
if FCurrentEdit=ValueEdit then
|
if FCurrentEdit=ValueEdit then
|
||||||
|
{$IFDEF LCLCarbon}
|
||||||
|
Result:=StringReplace(ValueEdit.Text,LineFeedSymbolUTF8,LineEnding,[rfReplaceAll])
|
||||||
|
{$ELSE}
|
||||||
Result:=ValueEdit.Text
|
Result:=ValueEdit.Text
|
||||||
|
{$ENDIF}
|
||||||
else if FCurrentEdit=ValueComboBox then
|
else if FCurrentEdit=ValueComboBox then
|
||||||
Result:=ValueComboBox.Text
|
Result:=ValueComboBox.Text
|
||||||
else if FCurrentEdit=ValueCheckBox then
|
else if FCurrentEdit=ValueCheckBox then
|
||||||
@ -3146,7 +3153,11 @@ end;
|
|||||||
procedure TOICustomPropertyGrid.SetCurrentEditValue(const NewValue: string);
|
procedure TOICustomPropertyGrid.SetCurrentEditValue(const NewValue: string);
|
||||||
begin
|
begin
|
||||||
if FCurrentEdit=ValueEdit then
|
if FCurrentEdit=ValueEdit then
|
||||||
|
{$IFDEF LCLCarbon}
|
||||||
|
ValueEdit.Text:=StringReplace(StringReplace(NewValue,#13,LineEnding,[rfReplaceAll]),LineEnding,LineFeedSymbolUTF8,[rfReplaceAll])
|
||||||
|
{$ELSE}
|
||||||
ValueEdit.Text:=NewValue
|
ValueEdit.Text:=NewValue
|
||||||
|
{$ENDIF}
|
||||||
else if FCurrentEdit=ValueComboBox then
|
else if FCurrentEdit=ValueComboBox then
|
||||||
begin
|
begin
|
||||||
ValueComboBox.Text:=NewValue;
|
ValueComboBox.Text:=NewValue;
|
||||||
|
@ -41,6 +41,13 @@ uses
|
|||||||
const
|
const
|
||||||
MaxIdentLength: Byte = 63;
|
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
|
type
|
||||||
|
|
||||||
TPersistentSelectionList = PropEditUtils.TPersistentSelectionList;
|
TPersistentSelectionList = PropEditUtils.TPersistentSelectionList;
|
||||||
@ -2721,7 +2728,11 @@ end;
|
|||||||
function TPropertyEditor.GetVisualValue: ansistring;
|
function TPropertyEditor.GetVisualValue: ansistring;
|
||||||
begin
|
begin
|
||||||
if AllEqual then
|
if AllEqual then
|
||||||
|
{$IFDEF LCLCarbon}
|
||||||
|
Result:=StringReplace(GetValue,LineEnding,LineFeedSymbolUTF8,[rfReplaceAll])
|
||||||
|
{$ELSE}
|
||||||
Result:=GetValue
|
Result:=GetValue
|
||||||
|
{$ENDIF}
|
||||||
else
|
else
|
||||||
Result:='';
|
Result:='';
|
||||||
end;
|
end;
|
||||||
|
@ -83,6 +83,7 @@ GongYu
|
|||||||
Graeme Geldenhuys
|
Graeme Geldenhuys
|
||||||
Grzegorz Zakrzewski
|
Grzegorz Zakrzewski
|
||||||
Hakan Kizilhan
|
Hakan Kizilhan
|
||||||
|
Hans Luijten
|
||||||
Hans-Joachim Ott
|
Hans-Joachim Ott
|
||||||
Hans-Peter Diettrich
|
Hans-Peter Diettrich
|
||||||
Haruyuki Fujimaki
|
Haruyuki Fujimaki
|
||||||
|
Loading…
Reference in New Issue
Block a user