Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Redraw Issue with CXTPTabClientWnd
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Redraw Issue with CXTPTabClientWnd

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


Joined: 12 May 2003
Location: United Kingdom
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote Graham Quote  Post ReplyReply Direct Link To This Post Topic: Redraw Issue with CXTPTabClientWnd
    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

Back to Top
proe View Drop Down
Newbie
Newbie


Joined: 17 June 2005
Location: China
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote proe Quote  Post ReplyReply Direct Link To This Post 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;
}

Back to Top
pascal View Drop Down
Groupie
Groupie


Joined: 07 February 2005
Location: Germany
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote pascal Quote  Post ReplyReply Direct Link To This Post 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
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.031 seconds.