Page 1 of 1

Bounds checking for TRichViewEdit.

Posted: Wed Jan 09, 2008 3:52 pm
by fure
I am looking for a way to bounds check the a TRichViewEdit object. What I am doing is filling in a TRichViewEdit object at run time with data read from a file. Then I am painting this information to a bitmap, and then sending it to a printer. The issue that I am running into is that since this is all done at runtime and is not visible, I have no way of knowing if some of the data would run past the dimensions of the TRichViewEdit control, which would be bad.

So, is there a way to check if any of the data (text or images) exceeds the specified dimensions of the TRichViewEdit control?

Posted: Wed Jan 09, 2008 5:04 pm
by Sergey Tkachenko
When document in RV is formatted, it has width:
rv.RVData.DocumentWidth+rv.LeftMargin+rv.RightMargin;
height:
rv.DocumentHeight.

Posted: Thu Jan 10, 2008 5:17 pm
by fure
Thank you for the quick reply. I tried this out and it does exactly what I wanted it to.