[Lazarus] how to set two memos for parallel text editing ?

Martin Frb lazarus at mfriebe.de
Wed May 28 02:40:14 CEST 2014


Sorry, that mail was sent a bit quicker than I intended.

On 28/05/2014 01:37, Martin Frb wrote:
> On 28/05/2014 00:46, Etienne Leblois wrote:
>> Dear list,
>>
>> I want to edit two textfiles in a parallel way, so that visible 
>> portion of text one in memo1 has always same lines extent as the 
>> visible portion of text two in memo2, say lines n1 to n2.
>>
>> Of course WordWrap must be false, so that one_text_line=one_visible_line
>>
>> Then, how to manage that scrolling or arrowing up in one memo will 
>> also scroll up the other one ? Intercept event yes, but how to 
>> issue/code a scrolling order for memo that does not have focus ?
>
> I dont know about TMemo. But with TSynEdit, you can use OnStatusChange

I dont know about TMemo. But with TSynEdit, you can use
OnStatusChange

SynEdit2.TopLine := SynEdit1.TopLine;

Also
SynEdit2.CaretY := SynEdit1.CaretY;

That is cool if you enable current line highlight, so the line with the 
caret has a special background color.




More information about the Lazarus mailing list