Page 1 of 1

TBRichViewEdit sup and super

Posted: Tue Jan 03, 2012 4:09 pm
by Thr33D
Hi,

I use a TBRichViewEdit and RTF. With a Stream I changend Letters high and down with s := '{\sub\fs22 '+vm+'\plain}';. That's works.

If I go with the cursor through the text I want to know when there is the formatting sup and super. Is there an easy way to find that out in order to undo the formatting?

My first idea was the "OnCurTextStyleChanged" after asking CurTextStyleNo, but that does not work, because the values ​​are different.

Can you help me?

Thank you.

Posted: Tue Jan 03, 2012 4:46 pm
by Sergey Tkachenko
OnCurTextStyleChanged and CurTextStyleNo is the correct way.

For example, see Demos\*\Editors\Editor 2\
It does not work with sub/superscripts, but the idea is the same as for other text style properties.

RichViewActions use CurTextStyleNo as well (they do not use OnCurTextStyleChanged - they update themselves when the application is idle, but it makes sense only when using actions)