[WIN] RE: Win32lib: setting cursor in RichEdit

new topic     » goto parent     » topic index » view thread      » older message » newer message

Matt,

I don't think I quite understand.

Do you mean load a file into the editor (RTF formatted, like I'm doing now)
and onKeyPress, pull all the data out as getRichText, use the cursor
position  from getIndex( RE ) with that position in the getRichText data,
colorize the data bounded by spaces left and right and reload as RTF? That's
a mighty big bunch of data to be moving around. Won't it take time? But it
sounds like it will work. For the IDE there is not that much data in the
editor at a time but for projecting the method into a general purpose
editor, one never knows how much there will be.

I appreciate your ideas.

Judith



On Fri, 13 Oct 2000 10:28:06 -0700, Matthew Lewis <MatthewL at KAPCOUSA.COM>
wrote:

>Judith Evans wrote:
>
>> I've played a lot with the RTF codes you have to place in
>> front of your data and in front of each group of words that need a
>different
>> font or color. I got that nicely going, only to discover that getIndex(
>RE) is
>> not helping me know where in the stream the user is - just where he in on
>> control. In other words he might be in position 10 screenwise but
>positiong 528
>> streamwise. So I haven't found a good method to colorize the data while
>the
>> user works on it. URGH! Have you had any luck with this? I sure hope I'm
>> doing something incorrectly and there is a solution. The first method I
>used
>> was to color with setIndex/setFont but I didn't like that at all.
>
>What you might try is mixing your streaming methods.  the get/setIndex()
>routines are looking at the content of the control as normal text, whereas
>you're streaming in rich text.  For in process colorization, I'd select the
>text as normal text, then replace it with a stream of rich text with the
>appropriate formatting.  I think the difference between the plain text and
>rich text is what's complicating matters.
>
>Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu