On Mon, Oct 21, 2002 at 03:44:37AM +0930, Darren Freeman wrote:

> I would like to help document the code. First I have to understand it
> for myself.

And we are happy to help you with that, as much as we can.

> At the minimum I would be happy to go through some of it and
> reformat it to the standards I learned while working for Motorola (which
> I now choose to use all the time!)

Hmm, what are these standards ? If they agree with LyX's putative
standards, sure. But I used to work with some Motorola code myself ...

> If I reverse-engineer correctly, the calling parameter "time" is the
> time that a button has been pressed until now.

No. (time is completely wrong name). See text3.C:1317-1322

> Each call to scroll() is then supposed to scroll down by one line plus
> (1/8) * time^2

Something like that.

> But from my test of the code, it only scrolls to the first line, hence
> my suspicion that scrollDocView accepts an _absolute_ value rather than
> the relative displacement given.

Yes, scrollDocView is absolute.

> To me the code was never meant to handle a mouse wheel, it looks

It was. Check out the 1.2 source for working code. Some changes meant I
broke it :(

> > That's what wheel_jump (should) does.
> 
> There's a wheel_jump()? =)

see text3.C/lyxrc

>       /// wheel mouse scroll
>       int scroll(long time);
> 
> One of the few comments that aren't FIX_ME =)

A patch to fix that the parameter name would be more than welcome.

> Well IMHO it's not testworthy, it needs a rewrite. Once again, that's if
> this was meant for wheel scrolling only, nothing else. But I haven't
> looked beyond those two files because I was pointed to them for simple
> tweaking. I don't think tweaking will help =)

Tweaking is what is needed. You need to get the current first_y, make
the correct modification to move it up or down, and pass the new value
to scrollDocView.

> Well, I hope we sort this out soon as I'm eager to use the 1.3.0CVS
> version.

Great.

john

-- 
"It's a cardboard universe ... and if you lean too hard against it, you fall
 through." 
        - Philip K. Dick 

Reply via email to