Page 1 of 1

Picture-Scroller with a group?

Posted: Fri Oct 24, 2014 9:25 am
by DevBoyLars
Hi there,
I want to build a horizontal scroller for some pictures inside an App.

I need to fill the scroller with pictures at runtime.

Has anyone experiences with something like this and can give me an examples?

Maybe it is possible to build a group, which is bigger than the screen and hide the scoller-bars? But if this could work, how to add/remove pictures at runtime in this group?

Thank you!! :)

Re: Picture-Scroller with a group?

Posted: Fri Oct 24, 2014 10:07 am
by jmburnod
Hi,
Maybe it is possible to build a group, which is bigger than the screen and hide the scoller-bars?
Yes, and you can scroll your group with Horizontal or vertical move :D
You can see one example called "StResizeAndMoveGroupH" from revOnline
But if this could work, how to add/remove pictures at runtime in this group?
You can copy one control in your group

Code: Select all

copy control "ImageMaster" to group pGroup
and set the properties of all controls of group in a loop
Best regards
Jean-Marc

Re: Picture-Scroller with a group?

Posted: Sat Oct 25, 2014 9:01 am
by DevBoyLars
Thank you :)

What does the last thing means?

"set the properties of all controls of group in a loop"

Re: Picture-Scroller with a group?

Posted: Sat Oct 25, 2014 9:28 am
by jmburnod
Welcome,

Once you have created all controls of your group you can set the properties of all controls of group.
As properties I mean "location,rect, filename etc...
This script place all images of a group verticaly

Code: Select all

on doImgGroupVertical
   put the num of images of group "grMyGroup" into nbImg
   put the bottomleft of image 1 of group "grMyGroup" into tDepBL 
   repeat with i = 2 to nbImg
      set the topleft of image i of group "grMyGroup" to tDepBL
      put the bottomleft of image i of group "grMyGroup" into tDepBL 
      add 2 to item 2 of tDepBL --marginV 2 px
      wait 1 milliseconds
   end repeat
end doImgGroupVertical
Best regards
Jean-Marc