Oleg, I take it back, OnRecalclayout is being called when I mouse down. It took the correct breakpoint to find this out. I set a "break on count" in CXTPPopupBar::AdjustScrolling in the "!bDown" if statement where btnUp.m_rc.SetRect is called with a break count of two.
That allowed me to get the scroll to the point where I do a mouse down on a control AFTER scrolling to the last control. This break point trips during idle processing. That is, the mouse is being held down and we send the WM_IDLEUPDATECMDUI message thru the system. The stack looks like this:
ToolkitPro1341vc100UD.dll!CXTPPopupBar::AdjustScrolling(tagSIZE * lpSize, int bDown, int bInvalidate) Line 766 C++ ToolkitPro1341vc100UD.dll!CXTPPopupBar::CalculatePopupRect(CPoint ptPopup, CSize sz) Line 669 C++ ToolkitPro1341vc100UD.dll!CXTPPopupBar::OnRecalcLayout() Line 322 + 0x52 bytes C++ ToolkitPro1341vc100UD.dll!CXTPCommandBar::OnIdleUpdateCmdUI(unsigned int __formal, unsigned int __formal) Line 608 + 0x12 bytes C++ mfc100ud.dll!CWnd::OnWndMsg(unsigned int message, unsigned int wParam, long lParam, long * pResult) Line 2330 + 0x11 bytes C++
So I wonder if the update UI call is causing the scrolling as I have found the "btnUp" structure is given a rect (which triggers the paint manager to draw the arrow (I found that code after the last post).
We have an "IsIdleMessage" function. Perhaps I should add mouse down to the list of events that should NOT trigger idle processing? That sounds dangerous to me (the MFC version doesn't filter that message).
I have found one other bit of interesting info. If I use the keyboard to navigate to the popup, I have never been able to repro the issue. That is, when I mouse down, the popup never scrolls. I don't know what the connection, if any, is to idle processing. One thing for sure, my breakpoint based on the count is not tripped when I use the keyboard to get the popup to pop. Our IsIdleMessage function doesn't tag key events.
I am assuming the breakpoint I tripped duing the idle processing is an indication that the window has scrolled even if the display has yet to occur. Nor do I understand why the mouse down (plus idle processing while the mouse is held down) would cause the popup to think it should be scrolling.
Any ideals what to look for next?
|