retain mouseScroll in field when hiding scrollbar

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Sjatplat
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 75
Joined: Wed Jun 22, 2011 1:53 pm
Location: Norway

retain mouseScroll in field when hiding scrollbar

Post by Sjatplat » Sat Oct 24, 2015 1:18 pm

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

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: retain mouseScroll in field when hiding scrollbar

Post by jmburnod » Sat Oct 24, 2015 1:40 pm

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
https://alternatic.ch

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9664
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: retain mouseScroll in field when hiding scrollbar

Post by dunbarx » Sat Oct 24, 2015 3:05 pm

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

Sjatplat
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 75
Joined: Wed Jun 22, 2011 1:53 pm
Location: Norway

Re: retain mouseScroll in field when hiding scrollbar

Post by Sjatplat » Sat Oct 24, 2015 6:35 pm

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
Last edited by Sjatplat on Sat Oct 24, 2015 7:33 pm, edited 5 times in total.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4002
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: retain mouseScroll in field when hiding scrollbar

Post by bn » Sat Oct 24, 2015 7:19 pm

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

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: retain mouseScroll in field when hiding scrollbar

Post by jmburnod » Sat Oct 24, 2015 8:58 pm

Hi Sjat,

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

Sjatplat
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 75
Joined: Wed Jun 22, 2011 1:53 pm
Location: Norway

Re: retain mouseScroll in field when hiding scrollbar

Post by Sjatplat » Sat Oct 24, 2015 9:13 pm

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

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”