Bad flicker with mouse move in CXTPSkinObjectTab |
Post Reply |
Author | |
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
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
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
Hi
thanks, that fixed it!
Regards
Adrien
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |