Carousel first draft (+ hints and tips)

This is the place to discuss anything relating to MobGUI

Moderators: heatherlaine, kevinmiller, robinmiller, malte, splash21

Post Reply
splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Carousel first draft (+ hints and tips)

Post by splash21 » Thu Feb 13, 2014 2:31 pm

The carousel custom control is a first attempt as far as MobGUI goes and I'm sure there are improvements that could be made. I was thinking that if images are dragged into the control, the fileName property could be set automatically - relative to the stack's path - allowing resolution independence to kick in and use appropriate images if they are present.
LiveCode Development & Training : http://splash21.com

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Carousel first draft

Post by bangkok » Thu Feb 13, 2014 2:50 pm

It's brillant. Bravo.

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: Carousel first draft

Post by splash21 » Thu Feb 13, 2014 4:31 pm

Thanks - I really wasn't sure how to start creating a palette to set the thing up, but I think it's worked out OK.

Here are a couple of hints that can help; (I've caught myself out a few times when testing and thought something had gone wrong, but I had just forgot to check a couple of things)
  • If you have trouble moving the carousel when the mouse is not directly on an image : click the 'Reset' button in the palette.
  • If the images suddenly jump to another position when you spin the control after editing the group, check the position of the carousel oval ("Show carousel oval" check box). It may just have been moved out of position.
There's an autospin feature that's not in the palette yet - try creating a carousel and then putting the following into a button;

Code: Select all

on mouseUp
   set the mgProps["autospin"] of group "Carousel" to 25
   send "mgCarouselSpin" to group "Carousel" in 0 millisecs
end mouseUp
(The control will ignore touches/mouse in this mode)
LiveCode Development & Training : http://splash21.com

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: Carousel first draft (+ hints and tips)

Post by Jellicle » Sat Feb 15, 2014 12:11 am

Great control! However I feel t's not quite useable. I have 7 images in a test carousel and I want the user to be able to swipe to bring them to the front in sequence. At the moment if the user swipes the control at all fast it spins rather than just bringing the next image to the front. I have to swipe quite slowly to achieve good control (pun intended).

Secondly, when I do:

on carouselFront pControlId
put pControlId
end carouselFront

...in the IDE I don't get a control ID in the message box. I get e.g. "0.064103" or "0.016393". It returns an ID only on iOS. Of course that isn't a problem, but it seemed worth noting.

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: Carousel first draft (+ hints and tips)

Post by splash21 » Sun Feb 16, 2014 5:31 pm

Hi, Gerry. I posted a message to the use-list, but forgot to drop a post here : there are a couple of puts that will hog the message box;
Just noticed two stray puts in the carousel behavior script: lines 255 & 309. I'll make sure those are removed for the next update.
Jellicle wrote:I want the user to be able to swipe to bring them to the front in sequence
A mode where the control sticks as soon as it hits the next in sequence sounds like a good idea - it's now on the list ;)
LiveCode Development & Training : http://splash21.com

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: Carousel first draft (+ hints and tips)

Post by splash21 » Sun Feb 16, 2014 9:47 pm

I've snuck in a quick carousel update with a 'sticky' option that should hopefully allow much easier selection of items as discussed. V1.23 is ready for download.
LiveCode Development & Training : http://splash21.com

Post Reply

Return to “MobGUI”