Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Bad flicker with mouse move in CXTPSkinObjectTab
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Bad flicker with mouse move in CXTPSkinObjectTab

 Post Reply Post Reply
Author
Message
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Topic: Bad flicker with mouse move in CXTPSkinObjectTab
    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
 
 
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: 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
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 16 July 2007 at 6:59pm
Hi
 
thanks, that fixed it!
 
Regards
 
Adrien
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.156 seconds.