Print Page | Close Window

MDI ChildFrame Repaint/Resize issue

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=7216
Printed Date: 12 November 2025 at 11:55pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MDI ChildFrame Repaint/Resize issue
Posted By: steve_murch
Subject: MDI ChildFrame Repaint/Resize issue
Date Posted: 23 May 2007 at 2:55pm

Hi Oleg and team,

I love the framework you've built.  Samples are generally quite clear, and I really appreciate the extra time you've put into making this accessible.

I've got a flicker-problem I'm trying to figure out with an MDI application that I'm building using both your RibbonBar and pane framework.  This problem doesn't exist in your sample application, so I know its somewhere in my code.  But I've gone over, and over and over what might be different between my app and your samples, and can't find anything.  I'm hoping you can point me to some specific things to look for on the off chance you (or others) have seen this before.  (Looked on the forums here too and didn't see anything related to this.)

 
The problem is that my app paints just fine the upon initial load, but every time I try to resize the MainFrm, in a split second, the ChildFrm window gets painted at 0,0 (where 0,0 is the upper leftmost and topmost pixel of the MainFrm window).  Indeed, when I trap the OnSize event of the ChildFrm, even before it gets to the OnSize of that ChildFrm, somehow the active view gets repainted at 0,0.  It is then erased and (properly) repainted when I continue.
This split-second repaint causes a very annoying flicker in the application when the mainfrm is resized.

I've tried stripping my app down to its bare minimum, making the activeview a simple RichEditView just like the sample, and it has the same problem.  I've also tried removing the PaneManager from the code, as well as the skinning of the underlying panes and active view, and the same thing happens.    I'm not doing anything in the OnSize event of the MainFrm or the ChildFrm. 

Why do you think my active View might be being repainted at 0,0 before its re-painted again in its expected position?  (It doesn't happen like this in your samples, particularly RibbonMDISample.)
 
I am using the very latest code -- 11.1.2 
 
------
In main application .cpp:
 

CMultiDocTemplate* pDocTemplate;pDocTemplate = new CMultiDocTemplate(IDR_BigOven_2TYPE, RUNTIME_CLASS(CBigOven_2Doc), RUNTIME_CLASS(CChildFrame), RUNTIME_CLASS(CTestView));

CTestView is simply a subclassed CRichEditView
 
 
MainFrm::OnSize DOES NOT exist, nor am I trapping the message
CChildFrm::OnSize DOES NOT exist
 
 



Replies:
Posted By: steve_murch
Date Posted: 23 May 2007 at 3:03pm

DISREGARD

[Once again, I just knew that the moment I posted a question here, I'd find the mistake and it'd be a stupid one.
 
If anyone else runs into this, the problem was that in MainFrm.cpp, I had this:
 
// wrong
IMPLEMENT_DYNAMIC(CMainFrame, CXTPFrameWnd)BEGIN_MESSAGE_MAP(CMainFrame, CXTPFrameWnd)
instead of this:
 
//right
IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net