Lazarus

Programming => Packages and Libraries => SynEdit => Topic started by: Edson on October 11, 2013, 08:42:20 pm

Title: BeginUndoBlock and EndUndoBlock of SynEdit
Post by: Edson on October 11, 2013, 08:42:20 pm
Are these methods:

BeginUndoBlock and EndUndoBlock

enabled in SynEdit?

If so, How do they work?
Title: Re: BeginUndoBlock and EndUndoBlock of SynEdit
Post by: Martin_fr on October 11, 2013, 09:32:58 pm
yes they are.
Code: [Select]
BeginUndoBlock;
//call edit
//call edit
//...
EndUndoBlock;

All edits will be undone in a single undo.
Without the undoblock, each edit requires one undo

Please read:
http://wiki.lazarus.freepascal.org/SynEdit#Change_text_from_code

access to SynEdit.Lines never works with undo
Title: Re: BeginUndoBlock and EndUndoBlock of SynEdit
Post by: Edson on October 11, 2013, 10:37:22 pm
Thanks Martin,

I haven't found information about these methods of SynEdit.

The wiki is a little poor about SynEdit.

In fact, I have started to complete the spanish version: http://wiki.freepascal.org/SynEdit/es
Title: Re: BeginUndoBlock and EndUndoBlock of SynEdit
Post by: Martin_fr on October 11, 2013, 10:59:04 pm
well yes, documenting synedit is still a big todo.

but the methods should be self explaining. Use code navigation, and you will see the declaration.

SynEdit.TextBetweenPoints[ Point(x,y), Point(x2,y2) ] := 'abc';

works like setting block-selection begin/end and then SelText := 'abc'

x,y are "logical". see same wiki page
TinyPortal © 2005-2018