Search

Using the mouse wheel to scroll in a scrollable CMFCPopupMenu does not work correctly by TOnofre

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 638564
Opened: 1/26/2011 11:50:09 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
It looks like the mouse wheel does not work correctly with a CMFCPopupMenu. You need to have a menu that is long enough to activate the scroll controls (I have reproduced using the VisualStudioDemo sample so my description will be in regards to this sample).

When you use the scroll control to scroll down in the menu - a mouse wheel movement in either direction will automatically jump the menu back to the top.

A larger related issue is when you scroll all the way to the bottom of the menu and move the mouse slightly up from the bottom (out of the coordinates of where the bottom scroll control will appear) and trigger the mouse wheel the menu appears to have jumped to the top but it is not repainted so as you move your mouse up the menu item by item it will repaint...
Details (expand)

Visual Studio/Silverlight/Tooling version

Visual Studio 2010

What category (if any) best represents this feedback?

Performance

Steps to reproduce

1. Download and run the VisualStudioDemo sample
2. Use ctrl + N to create new c++ example files (tabbed across the top) - you need to create a lot of them to get the scrolling going - I created 104.
3. Click the Active Files icon to drop down a list of all the open files - there will be a scroll control at the bottom of this list.
4. A. scroll to around 60 and use the mouse wheel to see it jump back to the beginning of the list - i would expect it to move slightly (probably one item at a time) in either direction depending on the mouse wheel movement.
4. B. For the larger issue, scroll to the bottom of this list so that the scroll down control disappears. Then move your mouse so that it is over the second item from the bottom and use the mouse wheel. The item the mouse is over is repainted but no one else is (scroll down control is back but don't use it!)
Now if you move your mouse up the list each item will be repainted individually.

Product Language

English

Operating System

Windows Vista

Operating System Language

English

Actual results

Using the mouse wheel while scrolling in a menu will jump back to the beginning item in the menu.

Possible paint issues when using the mouse wheel when scrolling has reached the bottom of the list (the scroll down control disappears).

Expected results

I would expect that the mouse wheel work by moving the current position by one in EITHER direction. I think having this working correctly would fix the painting problem.
File Attachments
File Name Submitted By Submitted On File Size  
AfterUsingMouseWheel.jpg 1/27/2011 46 KB
ApplicationLookDialogSettings.jpg 1/27/2011 35 KB
ctrl_N_ForLotsOfWindows.jpg 1/27/2011 10 KB
MenuAfterScrollingToBottom.jpg 1/27/2011 42 KB
MenuGeneratedWhenArrowClicked.jpg 1/27/2011 44 KB
Sign in to post a comment.
Posted by Microsoft on 2/22/2011 at 3:20 PM
Hello,

Thanks for the detailed report. This issue has been fixed in MFC for the next major release of Visual Studio.

Pat Brenner
Visual C++ Libraries Development
Posted by TOnofre on 1/27/2011 at 5:03 AM
I went ahead and attached some screen shots just in case... The ApplicationLookDialogSettings shot displays the initial settings on the dialog that pops up when you run the Visual Studio Demo.

The ctrl_N_ForLotsOfWindows just shows what I mean in step 2 of my steps to reproduce - this time I went with 80 "open files". This also shows a red square around the Acive Files icon that I reference in step 3.

The MenuGeneratedWhenArrowClicked shot shows the menu displayed when the Active Files arrow is clicked.

The MenuAfterScrollingToBottom shot shows what type of order the files are in at the bottom of the menu. In this example (with the screen shots) if you now move the mouse to highlight C++ example 9 and then use the mouse wheel in either direction this menu item will become C++ example 47 or 48. Move your mouse up the menu to highlight other items and they will repaint into the 40s as well (This is where the AfterUsingMouseWheel shot comes in). The red outlined areas show where there is a painting problem.

I think the big problem is I would expect the mouse wheel to move the menu scroll position by 1, not jump to the beginning of the menu.... Having this function properly will probably solve the painting issue....

And just taking a stab at this one - in afxpopupmenu.cpp in CMFCPopupMenu::OnVScroll there is a call to get the scroll info (m_wndScrollBarVert.GetScrollInfo(&scrollInfo);) but the m_wndScrollBarVert is never initialized so when the offset is calculated below the nMaxOffset is 0. I think it should probably be == the number of items in the menu... just a guess though.

I hope this all helps!
Thanks!
Posted by TOnofre on 1/27/2011 at 4:41 AM
I just went and re-downloaded the VisualStudioDemo sample project again from here:
http://code.msdn.microsoft.com/vcsamplesmfc - it is located towards the bottom of the list with the heading MFC Samples - Visual C++ 2008 Feature Pack.
Here is a link to the License agreement page before you can download this project:
http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=vcsamplesmfc&DownloadId=9828

I can still reproduce this problem with this sample project and can provide screen shots of what I am seeing if needed. When I run the Visual Studio Demo I am selecting the Microsoft Visual Studio 2008 Visual Manager - I don't think any of the other settings on this Application Look dialog matter.
Posted by Microsoft on 1/26/2011 at 6:37 PM
Thanks for reporting this issue. In order to fix the issue, we must first reproduce the issue in our labs. We are unable to reproduce the issue with the steps you provided.

Could you please upload the project agian because we could not find the demo you provided?

It would be greatly appreciated if you could provide us with that information as quickly as possible. If we do not hear back from you within 5 days, we will close this issue.

Thanks again for your efforts and we look forward to hearing from you.

Microsoft Visual Studio Connect Support Team
Posted by Microsoft on 1/26/2011 at 11:59 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.