I actually made a few more posts but due to a bug in Evolution they disappeared without being sent.
Basically my thoughts are that the code is really poorly documented and could do with some whitespace just about everywhere =) It took a comparatively long time to reverse-engineer the code, but I eventually worked out that scroll(time) was the culprit (due to comments in the header file actually). It seems to calculate the relative displacement from how long a button is held down, then call scrollDocView() to jump by that much. But the value it calls with is a relative displacement, the value it seems to expect is an absolute value. So I changed: scrollDocView(int(diff)); to: scrollDocView(t->first_y + int(diff)); // changed by DF 20021019 The result is that I could scroll down, although it was a bit slow for my liking. Would need something in the lyxrc file to control that as everybody has a different taste. I couldn't scroll up, there doesn't seem to be any code for that. Scrolling the wheel up scrolled down for obvious reasons. scroll(time) only ever scrolls down. Also, the code lets you scroll way past the bottom of the doc, would be more reasonable to limit it when the last line is about to leave the document (or is about to cross the middle of the window?). In addition, if this code really is specific to a mouse wheel as commented in the header, then it's not written for any mouse wheel I've ever seen. Mouse wheels generate button clicks as the wheel turns. You feel the notches in the wheel as it clicks. It's as if the user sits there clicking the button fairly quickly. The code seems to expect the button to be held down for a long time, and it accelerates the scroll the longer it is held down. This will never happen on the mice I have ever used, they can't hold down the pretend buttons that the wheel is attached to, they are impulsive clicks only. You just keep turning the wheel and the document should keep scrolling without acceleration, say 3 lines per click. Anyways, I'll let you sort it out, if scroll(value) is the function I'm meant to be changing then it's not finished and I don't know enough to do it (yet). Wouldn't you want something like wheelScrollUp() and wheelScrollDown() which look in the lyxrc and simply scroll by that many lines per press? Have fun, Darren On Sun, 2002-10-20 at 01:22, John Levon wrote: > On Sat, Oct 19, 2002 at 07:29:13PM +0930, Darren Freeman wrote: > > > I'll have a poke around in the source, someone mentioned the lines that > > are the problem and asked for a wheel user to fix it. > > Great. Here's some hints : > > defaultHeight() is the standard height of one text row > height() is the height of the entire document in pixels > setScrollbarParams() sets the scrollbar to the new value > scrollDocView actually moves up and down the document > > john > -- > "It's a cardboard universe ... and if you lean too hard against it, you fall > through." > - Philip K. Dick >