Page 1 of 1

OnCurTextStyleChange??

Posted: Tue Aug 21, 2007 5:20 pm
by Shane Stump
Why does this event get called sometimes 3 to 4 times when the user clicks in a different part of the document (especially tables)? I would figure it would only get called ONCE.

Best Regards,

Shane

Posted: Wed Aug 22, 2007 3:51 pm
by Sergey Tkachenko
This behavior is inherited from TRichViewEdit. Yes, in some cases, OnCurTextStyleChange can be called several times.
I do not think that this is a serious problem.

Posted: Thu Aug 23, 2007 9:23 pm
by Shane Stump
Well, it killed a feature I was trying to add because of the # of times it was called. I was just going to check if the FontName / Size was the same and eat "repetitive" calls but many times clicking in a different section of the document gets multiple font/size combinations when really there shoud only be one.

Shane

Posted: Fri Aug 24, 2007 5:48 pm
by Sergey Tkachenko
Several calls of this event make no problem in all demos and real applications that use TRichViewEdit/ScaleRichView. And none of them implement special processing for this.
This event is never called with incorrect parameters, so they are called several times with the same value of CurTextStyleNo.

Posted: Fri Aug 24, 2007 8:14 pm
by Shane Stump
Well, it was causing me all kinds of problems trying to load a devexpress lookup control. As I said, I would simply filter the repetitive calls but several times an Arial, Font 10 got stuck in between when it shouldn't.

Any how, I just gave up because I have already spent more time on this than I have for it. I just want to get a basic WYSIWUG document editor going and I will put it to bed for now.

I have everything working except my users are telling me printing isn't correct. I cut / paste / translated the pascal code (which wasn't much) to c++. I will have to wait and test later this evening.

Best Regards,

Shane

Posted: Sun Aug 26, 2007 3:08 pm
by Sergey Tkachenko
"Arial 10" glitch is confirmed, will be fixed in the next update of TRichView