Page 1 of 1
go forward/backward in cards
Posted: Mon Apr 09, 2012 10:12 am
by docHerman
Dear all
I try to improve my App, hopefully one day the App store accepts it. In the meanwhile I have some questions.
I made a scrolling list field: now how do I program that an other card is selected when a bar is touched/doubleclicked? And how can I make specific headers (like 'algemeen') grey & bigger?
I would prefer that the cards would be pushed to the left/right.
Thank you so much,
I like this product & forum a lot,
herman
Re: go forward/backward in cards
Posted: Mon Apr 09, 2012 11:17 am
by shaosean
I made a scrolling list field: now how do I program that an other card is selected when a bar is touched/doubleclicked?
easiest way is to name the card the same as the line of text, but if you are using non-ascii characters you will run in to an issue (personally i take the text and make a hash and use the hash in the same manner)..
mouseDoubleUp message -- handles the double clicking
go command -- handles the moving to another card
I would prefer that the cards would be pushed to the left/right.
visual effect command -- handles the pushing left/right visual effect
And how can I make specific headers (like 'algemeen') grey & bigger?
with the built-in listbox, either very hard or not at all.. might be better off looking in to using the DataGrid feature
http://lessons.runrev.com/m/datagrid
Re: go forward/backward in cards
Posted: Mon Apr 09, 2012 11:21 am
by shaosean
Maybe look at
MobGUI and use native-looking iOS listboxes
Re: go forward/backward in cards
Posted: Mon Apr 09, 2012 12:30 pm
by Klaus
Dag Herman,
welcome to the forum!
Please take a look at these stacks:
http://www.runrev.com/developers/lesson ... nferences/
They are not iOS related, but will give you a good insight about all the cool aspects of LiveCode,
which you can of course also use on iOS!
Best & Groetjes
Klaus
Re: go forward/backward in cards
Posted: Mon Apr 09, 2012 4:17 pm
by docHerman
Thank you all for your kind words.
Maybe my question was not cleaar enough, I am sorry for that.
I try to say it more clear now:
Can someone please help me with the Code?
I just want to select a line in the
Scrolling List Field and want to go to an other card.
I hope I do not sound unkind, that is not my intention. I apologize for that in advance
Once again, thanx for your help
Herman
Re: go forward/backward in cards
Posted: Mon Apr 09, 2012 4:31 pm
by dunbarx
Hi.
In a list field, trap the "mouseUp" message, perhaps like this:
Code: Select all
on mouseUp
put word 2 of the clickline
end mouseUp
So you see that the line number appears in the message box. I don't know how you want to navigate, but if you wrote
on mouseUp
go card word 2 of the clickline
end mouseUp
you would go to the card number that corresponds to the line number in the list field.
Maybe you have card names in that list? in that case:
Code: Select all
on mouseUp
go card the clickText
end mouseUp
I hope these examples help. We do not know how your list is composed, or how you want to map the lines in that list to the cards you want to go to. Write back if I missed something. Also read in the dictionary about the terms I used above, like "clickLine" and "clickText"
Craig Newman
Re: go forward/backward in cards
Posted: Mon Apr 09, 2012 6:49 pm
by docHerman
Hi Craig
I didn't manage, unfortnately.
I put a new attachement, maybe this makes it more clear.
My first attachement is the
scrolling field of the
S03_iphonesubstackNL-card: when I select 'inleiding', I hope the card 'inleiding' will be openend.
I tried:
Code: Select all
on mouseUp
go card word 1 of the clickline
end mouseUp
but I didn't succeed.
Waiting for your kin help,
regards, Herman
Re: go forward/backward in cards
Posted: Mon Apr 09, 2012 7:00 pm
by sturgis
Does it work if you change it to
With the parens it will do the evaluation of "word 1 of the clickline" first so that go card isn't trying to go card 'word'
Re: go forward/backward in cards
Posted: Mon Apr 09, 2012 7:15 pm
by mwieder
This should make it a bit clearer what's going on:
Code: Select all
on mouseUp
put the clickline into tCard
-- display what's in "the clickline"
put "the clickline" && the clickline into msg
-- display what's in "the clicktext"
put "the clicktext=" && the clicktext after msg
end mouseUp
Re: go forward/backward in cards
Posted: Mon Apr 09, 2012 7:18 pm
by sturgis
*smacks self on forehead* clicktext. Shoulda caught that.
Re: go forward/backward in cards
Posted: Mon Apr 09, 2012 7:49 pm
by docHerman
@mwieder, I tried your advice and attached the answer
@sturgis, I do not understand what you mean.
H
Re: go forward/backward in cards
Posted: Mon Apr 09, 2012 8:04 pm
by sturgis
Ignore my first answer, apparently my brain was in left field.
As marks code indicates "the clickline" is a description of the chunk of text that has been clicked. IE line 3 of field 2 So using "word 1 of the clickline" will always try to go to a card named line which doesn't exist. (if you try to go card "whateverCardDoesntExist" and then see whats in "the result" it will say "no such card")
The clicktext on the other hand actually contains the text that was clicked.
Re: go forward/backward in cards
Posted: Mon Apr 09, 2012 8:36 pm
by mwieder
OK, several things here.
First of all, my code example was just so you could see the difference between "the clickline" and "the clicktext", and as sturgis points out, "the clickline" is just an indication of the line number, not the actual text. So go ahead and delete the lines of text I had you add.
(and I should have added "& cr " before the "after msg" to separate the lines)
Second, you're trying to match *some* of the text in the line rather than the whole text. "waarom" doesn't match "waarom deze App? >", for example. There are a few ways to deal with that. If you're sure that the text you're searching for is unique (isn't in more than one line) then you can say
Code: Select all
if "waarom" is in the clicktext then
As an alternative you can match the entire line
Code: Select all
if the clicktext is "waarom deze App?" then
Third, notice that the ">" indicator is part of the clicktext. If you're going to match the line exactly then you need to include that as well as all the space before it, or the second approach above will fail.
Code: Select all
if the clicktext is "inleiding >" then
Re: go forward/backward in cards
Posted: Tue Apr 10, 2012 10:37 am
by docHerman
Yes, this works! Thanx all, docH