Re: [WIN] RE: Win32lib: setting cursor in RichEdit

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

Judith Evans wrote:

> 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?

Actually, I was thinking more like just pulling out just the text that's
been edited (last word or line).  You could keep track of what line is being
edited (EM_LINEINDEX, EM_CHARFROMPOS, EM_LINEFROMCHAR should all be useful),
and wait for it to be changed.  At that point, use EM_GETLINE to get the
text of the line, color code it, and stream it back in as rich text.

It's not quite as simple as all that, of course, but that's my take on how
it might be done.  I'm no expert on writing editor stuff, though.

Matt Lewis

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

Search



Quick Links

User menu

Not signed in.

Misc Menu