Demo: scroller with A-Z index

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:

Demo: scroller with A-Z index

Post by splash21 » Sun Jul 31, 2011 12:10 pm

I've been asked a few times of it's possible to have a scroller with the vertical A-Z index like the iPhone contacts app. This demo shows a similar set up using the following;

1/ The contact list: a native scroller with a text field.
2/ The index: a graphic with rounded ends and a text field.

The code is in the card script so that once the index has been touched, your finger doesn't have to stay on top of the index as you move up and down the screen. It works in the simulator and the device.
ScrollerAZIndexDemo.zip
(128.59 KiB) Downloaded 517 times
Depending on your needs, you could improve on this idea or re-engineer it using alternative controls. Hope it's useful as a starting point :D


John



Here it is running on the iPhone4
A-Z.jpg
A-Z.jpg (28.3 KiB) Viewed 7255 times
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: Demo: scroller with A-Z index

Post by splash21 » Mon Aug 01, 2011 10:12 am

You could also add the following code to the script of the 'Contacts' field;

Code: Select all

on touchEnd pId
   answer the value of the clickLine
end touchEnd
An easy way to take an action when an entry is touched.
LiveCode Development & Training : http://splash21.com

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Demo: scroller with A-Z index

Post by BarrySumpter » Mon Aug 01, 2011 11:34 pm

mobGUI keeps gettin better and better.

But this scroller looks like its only for i$hone.

Soooo jealous!
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

cenglish
Posts: 34
Joined: Wed May 11, 2011 6:44 pm
Location: LA, USA

Re: Demo: scroller with A-Z index

Post by cenglish » Thu Sep 01, 2011 6:42 pm

This helped a lot. However, I do have one question remaining.

How can I get this same effect if I have a list of data filling the scrolling field in the preopenstack event? For instance, I have data that is preloaded and could change. Any way I can add in the alphabet letters on the fly into my scrolling field in order to get this same effect?

cenglish
Posts: 34
Joined: Wed May 11, 2011 6:44 pm
Location: LA, USA

Re: Demo: scroller with A-Z index

Post by cenglish » Thu Sep 15, 2011 12:31 am

Does anyone know how to make this work if you're preloading data in the preopenstack? I have a database that I'm pulling from that I can't go in and put A, B, C, and so on into. Anyone got any ideas for a shortcut to make this work so that I can have that "quickjump" capability in the scolling field? Any feedback would be greatly appreciated. Thanks

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

Re: Demo: scroller with A-Z index

Post by Jellicle » Thu Sep 15, 2011 1:34 am

cenglish wrote:Does anyone know how to make this work if you're preloading data in the preopenstack? I have a database that I'm pulling from that I can't go in and put A, B, C, and so on into. Anyone got any ideas for a shortcut to make this work so that I can have that "quickjump" capability in the scolling field? Any feedback would be greatly appreciated. Thanks
Just grab your database text and parse it to insert the A,B, C etc before you put it into the field? How much data is there?

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

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Demo: scroller with A-Z index

Post by BarrySumpter » Thu Sep 15, 2011 1:50 am

Might be out of context but
yesterday I was trying to populate a DataGrid on a card where the card wasn't open or loaded yet.
Once I loaded the card first then the script that populated the DataGrid worked.
Too many fumblings about on my part to be more specific.

hth
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Post Reply

Return to “MobGUI”