go forward/backward in cards
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
go forward/backward in cards
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
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
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)..I made a scrolling list field: now how do I program that an other card is selected when a bar is touched/doubleclicked?
mouseDoubleUp message -- handles the double clicking
go command -- handles the moving to another card
visual effect command -- handles the pushing left/right visual effectI would prefer that the cards would be pushed to the left/right.
with the built-in listbox, either very hard or not at all.. might be better off looking in to using the DataGrid featureAnd how can I make specific headers (like 'algemeen') grey & bigger?
http://lessons.runrev.com/m/datagrid
Re: go forward/backward in cards
Maybe look at MobGUI and use native-looking iOS listboxes
Re: go forward/backward in cards
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
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
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
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
Hi.
In a list field, trap the "mouseUp" message, perhaps like this:
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
Maybe you have card names in that list? in that case:
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
In a list field, trap the "mouseUp" message, perhaps like this:
Code: Select all
on mouseUp
put word 2 of the clickline
end mouseUp
you would go to the card number that corresponds to the line number in the list field.on mouseUp
go card word 2 of the clickline
end mouseUp
Maybe you have card names in that list? in that case:
Code: Select all
on mouseUp
go card the clickText
end mouseUp
Craig Newman
Re: go forward/backward in cards
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:
but I didn't succeed.
Waiting for your kin help,
regards, Herman
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
Waiting for your kin help,
regards, Herman
- Attachments
-
- Schermafbeelding 2012-04-09 om 19.43.29.png (28.79 KiB) Viewed 7605 times
Re: go forward/backward in cards
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'
Code: Select all
go card (word 1 of the clickline)
Re: go forward/backward in cards
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
*smacks self on forehead* clicktext. Shoulda caught that.
Re: go forward/backward in cards
@mwieder, I tried your advice and attached the answer
@sturgis, I do not understand what you mean.
H
@sturgis, I do not understand what you mean.
H
Re: go forward/backward in cards
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.
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
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
As an alternative you can match the entire line
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.
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
Code: Select all
if the clicktext is "waarom deze App?" then
Code: Select all
if the clicktext is "inleiding >" then
Re: go forward/backward in cards
Yes, this works! Thanx all, docH