Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - redraw problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

redraw problem

 Post Reply Post Reply
Author
Message
douglashogan View Drop Down
Groupie
Groupie


Joined: 02 July 2003
Location: Switzerland
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote douglashogan Quote  Post ReplyReply Direct Link To This Post Topic: redraw problem
    Posted: 04 February 2006 at 6:40am

I change the text in one of the cells of the report control using SetValue, it doesn't redraw automatically. I currrently have to call redrawwindow for the entire control to update it. What am i doing wrong?

Also, I would like to embed a custom draw gauge control in a cell. Is this possible? If so, are there any examples of similar.

Regards
Douglas Hogan
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 04 February 2006 at 7:13am
Hi,

It's not incorrect behavior. Imagine that you'd like to change a number of report control cells values in a loop. If it would be automatically redrawn, you'll see a heavy flickering. So, to avoid that a user has a choice when to call Redraw method.

Yes, of course it is possible to make custom drawn items. You'll have to derive your class from CXTPReportRecordItem and write custom implementation for Draw() method and some others (like mouse events handlers, etc).

--
WBR,
Serge
Back to Top
douglashogan View Drop Down
Groupie
Groupie


Joined: 02 July 2003
Location: Switzerland
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote douglashogan Quote  Post ReplyReply Direct Link To This Post Posted: 04 February 2006 at 7:44am

Thanks for the reply,

But why do I have to redraw the ENTIRE control. I just want to invalidate the cell. I have a % indicator which grows as a download proceeds. There are tons of messages coming in and redrawing the entire control every time i get an update message is very inefficient. Is there no way to invalidate/redraw a single cell?

Regards
Douglas Hogan
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 04 February 2006 at 10:30am
Douglas,

There are no ways to redraw a single cell, but the entire operation is optimized internally.

However, if redrawing a control on every your custom message looks inefficient for you, try using some kind of a workaround - for example redraw a control N times per second by timer, what definitely will be fast enough with reasonable N (5 for example).

--
WBR,
Serge
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.157 seconds.