Page 1 of 1

retain mouseScroll in field when hiding scrollbar

Posted: Sat Oct 24, 2015 1:18 pm
by Sjatplat
Hi

Is there a way to keep the mouse scroll functionality in a field when you hide the scrollbar?
As soon as you untick the vertical scrollbar scrolling does not work anymore.


Sjat

Re: retain mouseScroll in field when hiding scrollbar

Posted: Sat Oct 24, 2015 1:40 pm
by jmburnod
Hi Sjat,

Do you mean mouse wheel ?
If yes, I tested it with rawkeydown message and it works for me "LC 7.0.5).
Best regards
Jean-Marc

Re: retain mouseScroll in field when hiding scrollbar

Posted: Sat Oct 24, 2015 3:05 pm
by dunbarx
Hmmm.

If you click and hold the mouse in a field, and drag above the top or below the bottom, the field will scroll its contents. Of course, you are selecting that block of text as you do so.

I am sure that a kluge using the "mouseMove" message can be worked out. Can you say why you need this, or how you really need it to work?

Craig Newman

Re: retain mouseScroll in field when hiding scrollbar

Posted: Sat Oct 24, 2015 6:35 pm
by Sjatplat
Hi
Thanks Jean-Marc.
Yes, rawkey 65308 and 65309 is the mouse wheel. Easy to to just add or subtract 1 to/from scroll.
Put this handler in the field that needs to be scrolled. Adjust the 10 to whatever value to change the speed.

Code: Select all

on rawkeydown theKey
   if theKey=65308 then set the vScroll of me to the vScroll of me-10
   if theKey=65309 then set the vScroll of me to the vScroll of me+10
   pass rawkeyDown
end rawkeydown
Craig
I just need the mouse wheel to be able to scroll the text without showing the scrollbar. It´s a text-centric game and I don´t want the scrollbar for aesthetic reasons.

But I understand by the answers that I have to kluge this. It´s just irritating that when you try to customize the look of a field you loose the built-in functions.

thanks

Re: retain mouseScroll in field when hiding scrollbar

Posted: Sat Oct 24, 2015 7:19 pm
by bn
Hi Sjat,

try to set the scrollbarWidth to 0

That way the field behaves as if it had a scrollbar but does not show it.

Kind regards

Bernd

Re: retain mouseScroll in field when hiding scrollbar

Posted: Sat Oct 24, 2015 8:58 pm
by jmburnod
Hi Sjat,

I see that the vScroll works fine without scrollbar (LC 7.0.5).
Which version do you use ?
Jean-Marc

Re: retain mouseScroll in field when hiding scrollbar

Posted: Sat Oct 24, 2015 9:13 pm
by Sjatplat
Thanks Bernd. Very nice.

Jean-Marc:
I´m using 8 dp 7.
I tried 7.1.0. Same problem there. Also in 5.5.

Sjat