Print Page | Close Window

Redraw Issue with CXTPTabClientWnd

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=2426
Printed Date: 08 November 2025 at 1:40pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Redraw Issue with CXTPTabClientWnd
Posted By: Graham
Subject: Redraw Issue with CXTPTabClientWnd
Date Posted: 21 June 2005 at 11:23am

When using CXTTabClientWnd for tabbed windows the redraw is messy when switching between windows when they are maximised. It looks as though when you press the tab to change active window, the window is first drawn restored, then drawn maximised which makes it look messy. It is easily reproducable using the toolkit example program MDIPanes.

In MDIPanes ManFrm.h add the following member variable to add tabbed windows

CXTPTabClientWnd m_MTIClientWnd

Then in CMainFrame::OnCreate, add the following line before LoadCommandBars

m_MTIClientWnd.Attach (this, FALSE);

Then when you run the application, add a couple of new documents, maximize the documents, and then switch between them using the tabs.

Thanks,

Graham




Replies:
Posted By: proe
Date Posted: 03 July 2005 at 3:37am

BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
 // Make sure view is maximum size to eliminate
 // flicker when switching tabs.
 cs.x = cs.y = 0; 
 cs.cx = cs.cy = 32767;

 if( !CMDIChildWnd::PreCreateWindow(cs) )
  return FALSE;

 return TRUE;
}



Posted By: pascal
Date Posted: 07 July 2005 at 3:24pm

Hello,

the best way to avoid fleeking is to inherit from CXTPTabClientWnd and to catch the WM_MDIACTIVATE message. You should then lock the redraw before calling the base class and unlock it after execution.  See code below.

best regards from Göttingen, germany

BEGIN_MESSAGE_MAP(CMainTabClientWnd, CXTPTabClientWnd)ON_WM_MDIACTIVATE()
END_MESSAGE_MAP()

void CMainTabClientWnd::OnMDIActivate(BOOL bActivate,CWnd* pActivateWnd, CWnd* pDeactivateWnd)
{
SetRedraw(FALSE);
CWnd::OnMDIActivate(bActivate, pActivateWnd, pDeactivateWnd);
SetRedraw(TRUE);

RedrawWindow( NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_ALLCHILDREN);
}



-------------
Pascal Verdier
Software Engineer Manager



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