Hi,

 

There is a small error on your script:

 

               local i,j = string.match( caret, "(%d),(%d)")

should be:

               local i,j = string.match( caret, "(%d+),(%d+)")

 

Best,

Scuri

 

From: Benoit Germain [mailto:[email protected]] 
Sent: segunda-feira, 4 de junho de 2012 11:25
To: IUP discussion list.
Subject: Re: [Iup-users] [Iup 3.5, Windows 7] Questions about finding and
highlighting substrings in a multiline text

 

 

2012/5/28 Antonio Scuri <[email protected]>

> Is it possible to format parts of the text already present in the control?

 

 Yes. In fact, it shouldn't work the other way. From the documentation:

"The formatting depends on the existing text, so if VALUE attribute is set,
all formatting is lost. You must set it again for the new text."


What I try to do is the following:

Compute caretpos from mouse position, set text caretpos attribute, read back
caret attribute, deduce line number, compute selection to select entire
line, apply formatting on the selection.

As demonstrated by the attached script, although I read back a correct caret
attribute after setting the caretpos attribute, the highlighted line isn't
correct when I select any line starting with line 10 and below.



-- 
Benoit.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to