Print Page | Close Window

Bad flicker with mouse move in CXTPSkinObjectTab

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=7607
Printed Date: 06 May 2024 at 9:41am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Bad flicker with mouse move in CXTPSkinObjectTab
Posted By: adrien
Subject: Bad flicker with mouse move in CXTPSkinObjectTab
Date Posted: 16 July 2007 at 12:14pm
Hi
 
I'm trying to track down a flicker problem with tab controls using skins.  the problem is this code in XTPSkinObjectTab.cpp
 
void CXTPSkinObjectTab::OnMouseMove(UINT /*nFlags*/, CPoint point)
{
 int nHotItem = -1;
 CTabCtrl* pTabCtrl = (CTabCtrl*)this;
 for (int iItem = 0; iItem < pTabCtrl->GetItemCount(); ++iItem)
 {
  CRect rcItem;
  pTabCtrl->GetItemRect(iItem, &rcItem);
  if (rcItem.PtInRect(point))
  {
   nHotItem = iItem;
   break;
  }
 }
 if (nHotItem != m_nHotItem)
 {
  m_nHotItem = nHotItem;
  Invalidate(FALSE);
  if (m_nHotItem != -1)
  {
   TRACKMOUSEEVENT tme = {sizeof(TRACKMOUSEEVENT), TME_LEAVE, m_hWnd, HOVER_DEFAULT};
   _TrackMouseEvent(&tme);
  }
 }
}
the call to Invalidate redraws the whole tab, so when you mouse over the tab items at the top, the whole tab redraws twice whenever you move from hovering over one tab item to another even though you didn't click the mouse.
 
the call to Invalidate should be a call to InvalidateRect, and should include a rect specifying the update region of the tab items affected (the 2 changing state), not the entire control.
 
Adrien
 
 



Replies:
Posted By: Oleg
Date Posted: 16 July 2007 at 1:44pm
Hello,
 
You're right, please change this line to   
InvalidateRect(GetHeaderRect(), FALSE);
and build library.
Please, let me know if it fixed some flickers for you.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: adrien
Date Posted: 16 July 2007 at 6:59pm
Hi
 
thanks, that fixed it!
 
Regards
 
Adrien



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