scrollbar and scaling
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
scrollbar and scaling
Hi Guys,
I have a scrollbar attached to a grouped object.Within the scroll bar, there is an graphic called rectangle. When I use the vertical scrollbar to to scroll down, the rectangle moves up which it should as the rectangle isn't as tall as some of the other components on the page. What I would like to do is ensure the rectangle is flush at the top and flush at the bottom of the card when a user scrolls up and down.
Anyone know how i can achieve this?
tanks as always
Jalz
I have a scrollbar attached to a grouped object.Within the scroll bar, there is an graphic called rectangle. When I use the vertical scrollbar to to scroll down, the rectangle moves up which it should as the rectangle isn't as tall as some of the other components on the page. What I would like to do is ensure the rectangle is flush at the top and flush at the bottom of the card when a user scrolls up and down.
Anyone know how i can achieve this?
tanks as always
Jalz
Re: scrollbar and scaling
Ah I think I can do this by finding the bottom of the object that is the furthest down on a page.
Does anyone know the relevant command I can use to find the furthest object on a card or am I going to have to loop through all the objects to find the one thats the furthest down?
Thanks
Jalz
Does anyone know the relevant command I can use to find the furthest object on a card or am I going to have to loop through all the objects to find the one thats the furthest down?
Thanks
Jalz
Re: scrollbar and scaling
I confess I'm not absolutely sure what you are doing in your measurements, but maybe the formatteHeight of group "myGroup" is what you need.
Re: scrollbar and scaling
Hi SparkOut,
I've managed to solve my problem by just hardcoding the position of the last object. Its just easier, especially as I figure the object shouldn't move on the card and I already know whats the last object.
I do have another question relating to scrollbar and this title fits this problem as well. I've got the code below which applies a scrollbar to the group depending on the size of the card and formatted content (using resizeStack handler). It works quite well, apart from if I have some content which I have scrolled down and I call the script via button, the content jumps/resets back to the top. Hope that makes sense? Is there a way where I can keep the content position the same if I run that script via a button?
I've managed to solve my problem by just hardcoding the position of the last object. Its just easier, especially as I figure the object shouldn't move on the card and I already know whats the last object.
I do have another question relating to scrollbar and this title fits this problem as well. I've got the code below which applies a scrollbar to the group depending on the size of the card and formatted content (using resizeStack handler). It works quite well, apart from if I have some content which I have scrolled down and I call the script via button, the content jumps/resets back to the top. Hope that makes sense? Is there a way where I can keep the content position the same if I run that script via a button?
Code: Select all
command applyScrollBars
if the formattedHeight of group "grp_scrollbar" > the height of group "grp_scrollbar" then
set the vScrollbar of group "grp_scrollbar" to true
else
set the vScrollbar of group "grp_scrollbar" to false
end if
if the formattedWidth of group "grp_scrollbar" > the width of group "grp_scrollbar" then
set the hScrollbar of group "grp_scrollbar" to true
else
set the hScrollbar of group "grp_scrollbar" to false
end if
end applyScrollBars
Re: scrollbar and scaling
Hi jalz,
if you want to save some typing:
Best
Klaus
if you want to save some typing:
Code: Select all
command applyScrollBars
set the vScrollbar of group "grp_scrollbar" to (the formattedHeight of group "grp_scrollbar" > the height of group "grp_scrollbar")
set the hScrollbar of group "grp_scrollbar" to (the formattedWidth of group "grp_scrollbar" > the width of group "grp_scrollbar")
end applyScrollBarsBest
Klaus
Re: scrollbar and scaling
Store the original scroll in a variable, lock the screen, apply the scrollbar, reset the scroll to the original, and unlock the screen.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: scrollbar and scaling
just wanted to say thank you to both of you. Got it working now on my page "fairly" reliably. Some more testing

