John, 

On Mon, 2002-10-21 at 02:09, John Levon wrote: 
> On Sun, Oct 20, 2002 at 09:58:21PM +0930, Darren Freeman wrote:
> 
> > 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.
> 
> That's what wheel_jump (should) does.

OK a grep through the source for wheel_jump told me what you meant, it's
an RC variable. 

I assume for the moment it is measured in lines. 

> > 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.
> 
> scrolling up has a negative displacement.

Yeah I worked out from grepping that the "time" call value to scroll()
is abused, it really means "offset", straight out of the RC file. Plus
or minus sign depending on the direction. 

I get this from the lines in text3.C: 
text3.C:                        bv->scroll(-lyxrc.wheel_jump); 
text3.C:                        bv->scroll(lyxrc.wheel_jump); 

Only other call to scroll(time) is from a wrapper in BufferView which
passes it through from the above to the implementation in
BufferView_pimpl.C 

So I will hack scroll() do do the right thing in this case. I hope it
doesn't get called anywhere else =) I grepped for it and I don't think
so. 

<time passes as I hack around> 

Ok since it's only called in three places I'm confident about this
working. 

<run LyX>

Shit, this is the second time LyX locked up my machine, requiring a hard
reset.

While scrolling down with the wheel, after mucking about with the wheel.
Strange.

Anyway, some observations. scrollDocView() handles scrolling ofthe
bottom of the document fine, drawing a border and grey below. But off
the top and it displays repetitions of the first few lines of the
document. Personally I would like to be able to scroll the document
until the last line is just visible. This is handy when you can't see
part of the window due to covering up the window for some reason. You
want to be able to move the last line all the way to the wrong edge.

I now have working mouse wheel support, but the scroll rate varies
depending upon the content I'm viewing. Please check the patch and tell
me why...

> > 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?).
> 
> Yes, it should do that.

Implementing now... please wait =)

<time passes>

OK, that's done too. Currently hard-coded limits, 0 and 4 lines from the bottom.

> > 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.
> 
> which comment ?

Fixed it anyway.

> I can't sort it out because I can't test it...

Done. Briefly tested. Works OK.

> thanks
> john

Since I'm new at this, please tell me how to generate a patch for you from CVS.

I've modified my anonymously checked-out version of 3 files. I'd like to create
one of those diff-patch thingies that everyone seems to like =)

I'm going to bed now, but rest assured that this time tomorrow you will have a
patch for mousewheel support..

Have fun,
Darren

Reply via email to