mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 17:50:19 +02:00
fixed appending text to TMemo
git-svn-id: trunk@4062 -
This commit is contained in:
parent
94d356f9a1
commit
b1082798ec
@ -115,18 +115,24 @@ var
|
|||||||
TempStrings: TStringList;
|
TempStrings: TStringList;
|
||||||
Cnt: Integer;
|
Cnt: Integer;
|
||||||
LastLine: String;
|
LastLine: String;
|
||||||
|
CurText: String;
|
||||||
begin
|
begin
|
||||||
If Assigned(FMemo) and (Index >= 0)
|
If Assigned(FMemo) and (Index >= 0)
|
||||||
then begin
|
then begin
|
||||||
TempStrings := TStringList.Create;
|
TempStrings := TStringList.Create;
|
||||||
TempStrings.Text := FMemo.Text;
|
CurText := FMemo.Text;
|
||||||
|
TempStrings.Text := CurText;
|
||||||
Cnt:=TempStrings.Count;
|
Cnt:=TempStrings.Count;
|
||||||
if Index=Cnt then begin
|
if Index=Cnt then begin
|
||||||
LastLine:=S+LineEnding;
|
if FMemo.HandleAllocated then begin
|
||||||
if false and FMemo.HandleAllocated then
|
LastLine:=S+LineEnding;
|
||||||
|
if (CurText<>'') and (not (CurText[length(CurText)] in [#10,#13])) then
|
||||||
|
LastLine:=LineEnding+LastLine;
|
||||||
CNSendMessage(LM_APPENDTEXT, FMemo, PChar(LastLine))
|
CNSendMessage(LM_APPENDTEXT, FMemo, PChar(LastLine))
|
||||||
else
|
end else begin
|
||||||
FMemo.Text:=TempStrings.Text+LastLine;
|
TempStrings.Insert(Index, S);
|
||||||
|
FMemo.Text:=TempStrings.Text;
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else if Index < Cnt then
|
else if Index < Cnt then
|
||||||
begin
|
begin
|
||||||
@ -142,6 +148,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.7 2003/04/16 06:27:12 mattias
|
||||||
|
fixed appending text to TMemo
|
||||||
|
|
||||||
Revision 1.6 2003/04/15 08:54:27 mattias
|
Revision 1.6 2003/04/15 08:54:27 mattias
|
||||||
fixed TMemo.WordWrap
|
fixed TMemo.WordWrap
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user