Scrolling Group
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 77
- Joined: Thu May 21, 2015 2:41 am
Scrolling Group
Not exactly sure what is causing this issue, but I'm trying to use the standard method of creating a scrolling group by using the mousedown and mouseup handlers on a group. I tried setting this on a stack level command worked for the horizontal, but it isn't actually scrolling, its just moving an object. Regardless, I moved it down to the group level to see if I could get a better response. No dice. I tested the commands and it seems that my mousedown handler is received by the group ( showing up a true value in a test field for that handler ). However, the mouseUP handler only is received when it is on a few specific objects within that group (none of which actually have scripts) and it is only returned whenever the mouseDown and mouseUp handlers are received by the same object. I'm not exactly sure what might be causing this issue. I'm sure it's just something that I am overlooking, but I can't seem to figure it out.
What I am creating:
Essentially I have a group of objects displaying information about a given object but it displays a larger array of data than can fit on the screen so I need the group to be able to scroll down and up to access the information.
Code (wherever there is a put something into field "test1" that is just a validation that the command is being run) The breakdown starts at the On MouseUp:
global sStartH, sStartV
on mouseDown
put the mouseV into sStartV
put "mousedown" into field "test1"
end mouseDown
on mouseUp
put "mouseUp" into field "test1"
if abs(the mouseV - sStartV) > 100 then
if the mouseV - sStartV >0 then
put "true" into field "test1"
else if the mouseV - sStartV <0 then
put "truedown" into field "test1"
end if
end if
put "mouseUp4" into field "test1"
end mouseUp
on swipedown
put the mouseV - sStartV into SwipeDownDist
set the vScroll of grp "Scroll_group id 5263" to SwipeDownDist
put "true" into field "test1"
end swipedown
on swipeUp
put the mouseV - sStartV into SwipeUpDist
set the vScroll of grp "Scroll_group id 5263" to SwipeUpDist
put "true" into field "test1"
end swipeUp
What I am creating:
Essentially I have a group of objects displaying information about a given object but it displays a larger array of data than can fit on the screen so I need the group to be able to scroll down and up to access the information.
Code (wherever there is a put something into field "test1" that is just a validation that the command is being run) The breakdown starts at the On MouseUp:
global sStartH, sStartV
on mouseDown
put the mouseV into sStartV
put "mousedown" into field "test1"
end mouseDown
on mouseUp
put "mouseUp" into field "test1"
if abs(the mouseV - sStartV) > 100 then
if the mouseV - sStartV >0 then
put "true" into field "test1"
else if the mouseV - sStartV <0 then
put "truedown" into field "test1"
end if
end if
put "mouseUp4" into field "test1"
end mouseUp
on swipedown
put the mouseV - sStartV into SwipeDownDist
set the vScroll of grp "Scroll_group id 5263" to SwipeDownDist
put "true" into field "test1"
end swipedown
on swipeUp
put the mouseV - sStartV into SwipeUpDist
set the vScroll of grp "Scroll_group id 5263" to SwipeUpDist
put "true" into field "test1"
end swipeUp
Re: Scrolling Group
Oh, come on!
Even with a username like yours, the name of this forum can not be misunderstood this much!
Moving this to the beginners section...
Even with a username like yours, the name of this forum can not be misunderstood this much!
Moving this to the beginners section...
-
- Posts: 77
- Joined: Thu May 21, 2015 2:41 am
Re: Scrolling Group
Yeah. I didn't see the User...thought it said Groups and Gatherings. I just logged on to move it.
Re: Scrolling Group
Not sure what you where trying to do there with the mouseUp handler, anyway this will do what you want i tested it and its working:
Code: Select all
local sStartV
on mouseMove
if sStartV <> empty then
if sStartV < the mouseV then
swipeUp
else
swipeDown
end if
end if
end mouseMove
on mouseUp
put empty into sStartV
end mouseUp
on mouseDown
put the mouseV into sStartV
end mouseDown
on swipedown
put the mouseV - sStartV into SwipeDownDist
set the vScroll of grp 1 to SwipeDownDist
end swipedown
on swipeUp
put the mouseV - sStartV into SwipeUpDist
set the vScroll of grp 1 to SwipeUpDist
end swipeUp
Knowledge is meant to be shared.
Re: Scrolling Group
Hi guys,
no need to poll the mouse several times inside of the handlers!
"mousemove X,Y" goes with 2 parameters, so we can pass this
to the swipeXXX handlers a a parameter:
Best
Klaus
no need to poll the mouse several times inside of the handlers!
"mousemove X,Y" goes with 2 parameters, so we can pass this
to the swipeXXX handlers a a parameter:
Code: Select all
local sStartV
on mouseMove X,Y
if sStartV <> empty then
if sStartV < Y then
swipeUp Y
else
swipeDown Y
end if
end if
end mouseMove
on mouseUp
put empty into sStartV
end mouseUp
on mouseDown
put the mouseV into sStartV
end mouseDown
on swipedown Y
put Y - sStartV into SwipeDownDist
set the vScroll of grp 1 to SwipeDownDist
end swipedown
on swipeUp Y
put Y - sStartV into SwipeUpDist
set the vScroll of grp 1 to SwipeUpDist
end swipeUp
Best
Klaus
-
- Posts: 77
- Joined: Thu May 21, 2015 2:41 am
Re: Scrolling Group
Klaus:
That worked, but it doesn't scroll the whole distance down the group. It only goes approximately a quarter of the way. When you try to move it further by going to the top of the group again (moving the cursor outside of the range of the group going to the top) and swipe down more it pops back up to the top of the group?!
That worked, but it doesn't scroll the whole distance down the group. It only goes approximately a quarter of the way. When you try to move it further by going to the top of the group again (moving the cursor outside of the range of the group going to the top) and swipe down more it pops back up to the top of the group?!