How to get nearly the same result as a RichEdit

General TRichView support forum. Please post your questions here
Post Reply
gotoxy
Posts: 29
Joined: Tue Jun 16, 2009 6:44 pm

How to get nearly the same result as a RichEdit

Post by gotoxy »

Hi,
I have already read a lot of stuff on the forum, and it seems that i cant find what im looking for. I worked a lot with TRichEdit from D2k7 and i was able to paint the richedit from a char to an other define by a Rect. From what i read on the forum, it should be the RVReportHelper that do nearly or really the same thing, but i dont really understand, from what ive seen in the demos, how it could. There is no starting char and only a MaxHeight in the DrawPage function parameters.

To make sure you understand what i mean, ill try my best to describe what im doing.

I'm developping a "Publisher / Illustrator" kind application. I want to be able to add TextAre anywhere in my document. (those text area was with RichEdit before, but i would like to use RichView) If the text is too long to find in the textArea, you can link it to an other TextArea. So, i need to know from what char (index) to what other char the first TextArea is, to tell the linked TextArea to start from and ect... All those thing works fine with RichEdit, but as a lot of ppl know, RichEdit WYSISYG is not working because of bad character width count from RichEdit so its RichView time to show its power :P hehehhe

Thanks a lot.
Sergey Tkachenko
Site Admin
Posts: 17571
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

TRVReportHelper can display document in several rectangular areas ("pages"). You do not need to specify starting character, you need to specify a page index instead.
All "pages" have the same width, specify it in the call of helper.Init.
Then call FormatNextPage until it returns False. In each call, you specify a height for the specific page.
When you need to draw a page, use DrawPage or DrawPageAt with the proper page index (the first page - 1, next page - 2 and so on)
Post Reply