EControl Ltd. Forum Index EControl Ltd.
VCL libraries and software support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Delete selection

 
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor
View previous topic :: View next topic  
Author Message
itsatomic



Joined: 12 Jun 2006
Posts: 38

PostPosted: Fri Jul 21, 2006 11:37 am    Post subject: Delete selection Reply with quote

Hi Michael

I cannot find a command constant (for ExecCommand) or a method to delete the current selection. Should there be one?

Aaron
Back to top
View user's profile Send private message
itsatomic



Joined: 12 Jun 2006
Posts: 38

PostPosted: Fri Jul 21, 2006 11:49 am    Post subject: Reply with quote

Ok I worked out something:

Code:
FMemo.DeleteText(-FMemo.SelLength);


makes sense to me Smile
Back to top
View user's profile Send private message
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Fri Jul 21, 2006 8:12 pm    Post subject: Reply with quote

Ways to delete selection:

Code:
1. TSyntaxMemo.ClearSelection;
2. TSyntaxMemo.ExecCommand(smClearSelection);


DeleteText(Count: integer) deletes abs(Count) characters right from caret if Count > 0 or left from caret if Count < 0.
Do not use DeleteText to delete selection because there will be error for columnar selection. Also caret may be at the start of the selection, at the end of the selection and even outside selection (for option "Persistent blocks").

Michael.
Back to top
View user's profile Send private message Send e-mail
itsatomic



Joined: 12 Jun 2006
Posts: 38

PostPosted: Sat Jul 22, 2006 3:18 am    Post subject: Reply with quote

oops, thanks. That'll teach me for developing when tired. I even looked through the helpfile, was looking for "Delete*".

Thanks Michael
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group