D-Fly / alsing

Automatically exported from code.google.com/p/alsing
0 stars 0 forks source link

Mouse Wheel Scrolling #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create an empty project.
2. Add Syntaxbox control
3. Create enough sample text to force the control to require vertical
scrolling to view all content.
4. Scroll the window with the mouse wheel.

What is the expected output? What do you see instead?
I have to flick the mouse wheel very hard 3-4 times in a row to get the
control to scroll 2 or 3 lines.  Then 3 or 4 more hard flicks and it
scrolls a little more.  Very frustrating

What version of the product are you using? On what operating system?

- Windows Vista SP1.
- VS2008.
- Microsoft Wireless Mouse 5000.
- Latest version of intellipoint drivers (as of this date stamp on this post)
- The version of Syntaxbox contained in the zip file for download (dated
June 2008 I think).  And also the latest version in SVN.  Both versions
won't scroll. 

Please provide any additional information below.
I have done everything I can think of.  I have
uninstalled/reinstalled/updated all mouse drivers.  Tried two version of
the control as indicated above.  I have played with various mouse settings,
as well as scrolling settings of the Syntaxbox control.  All to no avail.  

I also happen to have a VMWare virtual machine on my system running Windows
Server 2003.  This issue does not exist while running it in the VM.

I'm beginning to think it has more to do with Vista than with your control.
 I guess I'm hoping there is a work around.  

Thanks!

Original issue reported on code.google.com by james...@gmail.com on 3 Aug 2009 at 7:18

GoogleCodeExporter commented 8 years ago
Ok, I've done quite a lot of research and tinkering, and I've finally figured 
out why
this is happening.  I've even created an SVN patch for my solution.  It's ugly 
but it
works

With respect to the OnMouseWheel event on line 3377 of EditViewControl.cs (r508)

The MSDN documentation states that the normal mouse delta is 120.  On my Server 
2003
VM, e.delta was either 120 or a factor of: (120, 240, etc).  With a value of 
120 or
greater, the expression e.delta/120*l evaluated to a non zero integer.  

This is all well and good.  However, on my Vista machine, e.delta was 30, 60, 
90, or
120.  With a value of less than 120, the expression mentioned above evaluated to
zero.  In other words, zero lines scrolled.  

I have no idea why this is.  I don't know if it's my mouse driver, mouse 
hardware,
Vista OS, etc.  Who knows.  

My patch essentially prevents the expression from evaluating to zero, ensuring 
it's
always at least 1, or -1 depending on the direction the mouse wheel was 
flicked.  

I could have taken my mouse's delta and multiplied by 4.  However, what happens 
if
someone else has funky deltas like 50, 100, 150, etc?  Perhaps there is a delta
multiplier somewhere in the .NET classes.  *shrug*

Anyway... patch is attached.  

Thanks!

Original comment by james...@gmail.com on 4 Aug 2009 at 8:42

Attachments: