Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Pane redraw doubt!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Pane redraw doubt!

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Pane redraw doubt!
    Posted: 29 September 2008 at 12:32pm
I have a pane P1 with heavy GDI-drawing (memory-device + bitmap used). A hidden pane H1 is then shown. When I move away the mouse pointer it closes, but the content of H1 is visible for some 2 seconds!
 
Try this sample:
 
You will see that only the obscured area of the right pane is invalidated, which is probably the best thing to do in most cases. However, why does this happen when CS_SAVEBITS is set for the window class?
 
I believe this is a flaw in the pane implementation!
 
 
From MSDN:
CS_SAVEBITS Saves, as a bitmap, the portion of the screen image obscured by a window of this class. When the window is removed, the system uses the saved bitmap to restore the screen image, including other windows that were obscured. Therefore, the system does not send WM_PAINT messages to windows that were obscured if the memory used by the bitmap has not been discarded and if other screen actions have not invalidated the stored image.
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 02 October 2008 at 5:39pm
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 03 October 2008 at 1:47am
Hi,
CS_SAVEBITS is style for Top Level windows only. Don't apply it for Child windows.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 03 October 2008 at 1:49am
btw... I very recommend use cashed bitmap if you need draw a lot of stuff.
 
See CXTPReportControl::OnPaint() method - if nothing was changed its just print saved m_bmpCache.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 03 October 2008 at 4:59am
I have a cached bitmap. The problem is I have to StretchBlt it...
 
Is there no other way to prevent the pane from being redrawn?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2008 at 2:34am
your Pane is standard Window. Each window receives WM_PAINT if its content was invalidated.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2008 at 12:04pm
CS_SAVEBITS is style for Top Level windows only.
 
Disagree. I think it should be possible to set this style of all panes, just like you do in MFC. Why not add this?
 
More info about this peculiar class style:
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 07 October 2008 at 2:34am
Should be, but not possible. CS_SAVEBITS can't be applied for Child windows.
Use cashed bitmap and it will save time to redraw whole window.
 
 
Closed.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.