Page 1 of 1
Image Gallery
Posted: Mon Aug 17, 2015 6:42 pm
by Polly
Hi everybody,
i have about 50 photos on my card (shirts in different colors), 10 red, 10 green,...for each color i have a radio button! i want to choose for example green and blue and want them to be in a scroll!
ifor each color i make a group and all gruops i also group with horicontal scrollbar! problem is when i select green and blue and make all other groups invisible the choosen groups dont rearrange, so there are white spaces between them!
Re: Image Gallery
Posted: Mon Aug 17, 2015 10:32 pm
by Klaus
Hi Polly,
1. welcome to the forum!
2. Not sure what you exspect, but you will need to adjust the visible groups locations by script.
Livecode will do this for you automatically. There is a little math involved, but hey, that's programming
Try to think it over a bit and come back if you get stuck.
Check these helpful terms in the dictionary: bottom, top, left, right
Best
Klaus
Re: Image Gallery
Posted: Tue Aug 18, 2015 11:43 am
by Polly
Hi Klaus,
thanx for answer!
yes i know terms left, bottom, usw...the problem is i can say green group should be left to blue one, red left to blue etc but if one of them is invisible the visible groups dont move up! they are always on their position! for example: if all checkboxes are checked i have
GREEN GROUP BLUE GROUP RED GROUP BLACK GROUP so now i uncheck blue i have
GREEN GROUP RED GROUP BLACK GROUP but it would be great that red and black group move up
GREEN GROUP RED GROUP BLACK GROUP because in scroll it looks stupid when there are always white spaces for the unchecked shirts!
=) hope there is a solution!
polly

Re: Image Gallery
Posted: Tue Aug 18, 2015 12:09 pm
by Klaus
Hi Polly,
I really understood your problem with your first posting and there is sure a solution,
but this is not something we can come up with quickly!
We can help with your problem, but will not solve it completely for you!
Did you try something already?
Remember, YOU are the programmer now and this is up to you!
Best
Klaus
Re: Image Gallery
Posted: Tue Aug 18, 2015 1:10 pm
by zaxos
Try this:
Code: Select all
-- put this in the green group checkbox
on mouseUp
if the hilite of me then
set the height of grp "greenGroup" to 100 -- or to the formattedHeight of grp "greenGroup" or to whatever you wish it to be
set the visible of grp "greenGroup" to true
else
set the height of group "greenGroup" to 1
set the visible of grp "greenGroup" to false
end if
resetPositions
end mouseUp
repeat this with the other checkboxes.
And this code in your stack or card script:
Code: Select all
-- assuming the positions are GREEN GROUP BLUE GROUP RED GROUP BLACK GROUP
on resetPositions
set the top of grp "greenGroup" to the top of the owner of grp "greenGroup"
set the top of grp "blueGroup" to the bottom of grp "greenGroup"
set the top of grp "redGroup" to the bottom of grp "blueGroup"
set the top of grp "blackGroup" to the bottom of grp "redGroup"
end resetPositions
Re: Image Gallery
Posted: Tue Aug 18, 2015 1:56 pm
by Polly
Yes sure =) i tried to group the groups by script when i check the box...positions are the same! i tried to make for all possible choices thescript but this was reeeally stupid!=)))
i searched for scrollbar commands!
honestly this is my first project and i am a newbie,
and i really didnt wanted to get the whole script but maybe a help how to solve the problem!
now i will try this with resetPositions!;)
Polly
Re: Image Gallery
Posted: Tue Aug 18, 2015 2:02 pm
by Klaus
HI Polly,
"grouping" objects does not change their position on a card
But you know now that you need to "manipulate" the positions of your objects.
It is most important to know WHAT to do, knowing HOW to do it comes next.
Please check these great stacks to learn more about the basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus
Re: Image Gallery
Posted: Tue Aug 18, 2015 3:05 pm
by Polly
Hi Klaus,
thanx for the link!=)
sure, i hoped if i group and make a scrollbar, the scrollbar would "rearrange" if an image is set invisible...!
and this script zaxos is what i needed! thanx a lot!
best
polly
Re: Image Gallery
Posted: Tue Aug 18, 2015 3:42 pm
by Klaus
Hi Polly,
Polly wrote:...
sure, i hoped if i group and make a scrollbar, the scrollbar would "rearrange" if an image is set invisible...!
just like a scrolling text field after you delete some lines but leave the blank spaces?
Don't take it personally, but you will need to be a bit more realistic when you want to work with Livecode!
So please ask questions here, whenever the arise, but only after thinking about them a bit first
Hint:
Do not try to think "computerish" immediately! Try to use a "real life" analogy, like how would you solve
your problem manually if the groups were LEGO bricks?
If you answer this to yourself, you will see that this can be translated to LC almost 1:1 most of the time,
especially since LC has this great english-like syntax!
Best
Klaus