Draw only after all changes?

General TRichView support forum. Please post your questions here
Post Reply
RichEnjoyer
Posts: 14
Joined: Fri Jan 20, 2006 11:05 am
Location: Germany

Draw only after all changes?

Post by RichEnjoyer »

Hello,

if it posible that i can made any changes in a RichViewEdit component without drawing?

I want no see any changes by the programm on the screen befor i say "draw".

best wishes, Frank
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

In TRichViewEdit, there are two types of methods for document modifications.

1) "Viewer-style" methods, introduced in TRichView. They do not update document view until you call Format. They provide the fastest way to modify document, but these changes cannot be undone and redone by user.
After calling such method, document becomes unformatted and cannot be displayed until you call Format.

2) Editing methods, introduced in TRichViewEdit. They always reformat and redraw document. You can suppress redrawing using WM_SETREDRAW message:

Code: Select all

SendMessage(rve.Handle, WM_SETREDRAW, 0, 0);
<modifications here>
SendMessage(rve.Handle, WM_SETREDRAW, 1, 0);
rve.Invalidate;
RichEnjoyer
Posts: 14
Joined: Fri Jan 20, 2006 11:05 am
Location: Germany

Post by RichEnjoyer »

That's is! :D
Absolutly great, thanks Sergey.

When i use RichView, it this component "more faster" for output only as RichViewEdit?

Best wishes, Frank
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

No, TRichView is not faster than TRichViewEdit (if you will use the same methods for them).
RichEnjoyer
Posts: 14
Joined: Fri Jan 20, 2006 11:05 am
Location: Germany

Post by RichEnjoyer »

Ok thanks for answer! :D
Post Reply