scrolling a group with the mouse wheel

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
babas66
Posts: 19
Joined: Wed May 15, 2019 11:13 am
Location: France

scrolling a group with the mouse wheel

Post by babas66 » Mon Oct 21, 2019 10:06 am

Hello,

i am looking for a method to scroll a group with the mouse wheel. I have find some ideas in this forum using the handler rawKeyDown but the result is not really useful : it's working but is not a smooth scrolling.
Considering that the scrolling work well in dataGrid, I suppose that is possible to make a smooth scrolling in a group... but I've no idea how :oops:

Someone know if it's possible or the best way is using datagrid ?

Regards,

Seb

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

Re: scrolling a group with the mouse wheel

Post by jmburnod » Mon Oct 21, 2019 11:41 am

HI seb,
Magic word is rawkeydown
Something like that:

Code: Select all

local sCurScroll
on rawkeydown pRawKey
   put "65309,65308" into tLesK
   if pRawKey is in tLesK then
      put 24 into tEmpan
      if sCurScroll <> empty then
         if the mouseloc is within the rect of group sCurScrollGr then
            if pRawKey = 65308 then
               put tEmpan into tSec
            end if
            if pRawKey = 65309 then
               put (0-tEmpan) into tSec
            end if
            set the vscroll of group sCurScrollGr to (the vscroll of group sCurScrollGr)+tSec
         end if
      end if
   else
      pass rawkeydown
   end if
end rawkeydown
Best regards
Jean-Marc
https://alternatic.ch

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9461
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: scrolling a group with the mouse wheel

Post by richmond62 » Mon Oct 21, 2019 1:34 pm


babas66
Posts: 19
Joined: Wed May 15, 2019 11:13 am
Location: France

Re: scrolling a group with the mouse wheel

Post by babas66 » Mon Oct 21, 2019 1:38 pm

Hi Jean-Marc,

thanks you very much for your answer.
This handler work very well ! I have to make some changes to work with scrolling fields in group but the result is very fine !

Best regards,
Seb

babas66
Posts: 19
Joined: Wed May 15, 2019 11:13 am
Location: France

Re: scrolling a group with the mouse wheel

Post by babas66 » Mon Oct 21, 2019 1:42 pm

Interessing method, I haven't seen this post before but I thought something like this, if I can't find a good way to use the mouse wheel.

Seb

Post Reply

Return to “Talking LiveCode”