Page 2 of 2

Re: Scrolling field or datagrid with Native scroller?

Posted: Thu Apr 19, 2012 2:15 pm
by Youks
Hi all,
A handler was missing in that version so not a neat code but works the same.
I forgot to mention that i am using MobGUI.!
Rgds.

Re: Scrolling field or datagrid with Native scroller?

Posted: Thu Apr 19, 2012 9:41 pm
by bn
Hi Youks,

thanks for posting your example.

Kind regards

Bernd

Re: Scrolling field or datagrid with Native scroller?

Posted: Fri Apr 20, 2012 6:15 am
by FireWorx
Couldn't get it to open in LC 5.02. =[

Re: Scrolling field or datagrid with Native scroller?

Posted: Fri Apr 20, 2012 9:48 am
by Youks
Hi Fireworx,
Try this one.

Rgds

Re: Scrolling field or datagrid with Native scroller?

Posted: Sat Apr 21, 2012 7:43 pm
by FireWorx
Strong work !!! Just so you know in v LC 5.02 the line of code shown below in the openstack handler Throws an error. However it seems to work fine with it commented out.
Here is the line:
set the compositorType of stack "ScrollerAZIndexDemo" to "opengl"

I looked over your code but was unable to find what happens on: scrollerUpdate "Scroller"

Also

Not exactly sure where all the contacts data is stored and how you pull it out based on the index alpha request to display a subset of the entire list.

Can you elaborate on this a little?

This would be some great stuff for me to use to cross reference an alpha indexed list of streets to their map pages in my mapping application. I do have MobgGui and sadly have not had much luck with it so I would be excited to put the cash outlay to work.

Dave

Re: Scrolling field or datagrid with Native scroller?

Posted: Sun Apr 22, 2012 12:02 am
by Youks
Hi Dave,
Basically don't pay attention to that error with set the compositorType of stack "ScrollerAZIndexDemo" to "opengl" it is normal and has no effect when you try it on the simulator because "openGl" is just for the IOS so it triggers that error msg on the IDE.

I have just adapted the original code from Splash21 to suit my need and the "scrollerupdate" is a MobGUI feature that allows you to update the scroller when its content has changed.

Regarding the different lists, they are just on the second card embedded in different field contents (from A to Z) that i refer to when needed.

The big issue with the original code was that if you apply a scroll on the screen and then select another letter, the content of the scroller will update its content but continue scrolling......which is not like the behavior of the native address book. So i tried somehow to get rid of that !

I am sure that my code is not perfect and i hope that it will be improved.

Kind Regards. :D

Re: Scrolling field or datagrid with Native scroller?

Posted: Sun Apr 22, 2012 9:05 am
by FireWorx
If you would like to combine your 26 Alpha indexed fields into just one field for easy maintenance just replace the one line of code.

put fld ("Contacts_"&tIndexChar) of cd "ItemsList" into fld"Contacts"

with

repeat with x = 1 to the number of lines of field "MyContacts" of card 2
if char 1 of line x of field "MyContacts" of card 2 is tIndexChar then
put line x of field "MyContacts" of card 2 & CR after tNewList
end if
end repeat
put tNewList into fld "contacts"
------------------------
Works pretty good here is the stack. PS had to sort the lines starting with "The" into the "T" group.
Dave

Re: Scrolling field or datagrid with Native scroller?

Posted: Sun Apr 22, 2012 12:02 pm
by Klaus
Hi Dave,

you could also "filter" instead of a repeat loop:
FireWorx wrote: ...
put fld ("Contacts_"& tIndexChar) of cd "ItemsList" into fld "Contacts"
put field "MyContacts" of card 2 int tNewList
filter tNewList with(tIndexChar & "*")
put tNewList into fld "contacts"
...
:-)

Best

Klaus

Re: Scrolling field or datagrid with Native scroller?

Posted: Sun Apr 22, 2012 4:43 pm
by FireWorx
Thanks Klaus,
Yes I like that better.
However so as not to confuse. The first line of your code is the one that is being replaced. So Just have one field rather than 26 and name it "MyContacts" and then the following script.

put field "MyContacts" of card 2 int tNewList
filter tNewList with(tIndexChar & "*")
put tNewList into fld "contacts"

Dave

Re: Scrolling field or datagrid with Native scroller?

Posted: Sun Apr 22, 2012 6:57 pm
by Youks
Hi,

Thx Dave & Klaus!

Rgds :D