Progress bars on multiple cards of same stack
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Progress bars on multiple cards of same stack
Hi,
I am trying to get my progress bar to update according to the state of highlighted buttons on individual cards, I can make it update okay but ---
My problem is I don't know of a way to save the present state of progress bar on card 1 and make changes to the progress bar on card 2 without affecting card 1's progress bar state
The progress bar is part of the main Template
Any advice appreciated, thanks
I am trying to get my progress bar to update according to the state of highlighted buttons on individual cards, I can make it update okay but ---
My problem is I don't know of a way to save the present state of progress bar on card 1 and make changes to the progress bar on card 2 without affecting card 1's progress bar state
The progress bar is part of the main Template
Any advice appreciated, thanks
Hi Jon,
What is a template? Do you mean a group?
You could save the thumbPos of a scrollbar (progress bar) to a custom property of the card and reset the thumbPos when you come back to the card. Script should look something like this:
You can include these scripts in the stack script.
Best,
Mark
What is a template? Do you mean a group?
You could save the thumbPos of a scrollbar (progress bar) to a custom property of the card and reset the thumbPos when you come back to the card. Script should look something like this:
Code: Select all
on closeCard
set the cProgress of this card to the thumbPos of scrollbar "Progress"
end closeCard
on preOpenCard
set the thumbPos of scrollbar "Progress" to the cProgress of this card
end preOpenCard
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi Mark,
Also I found a way to do it by creating new progress bars as each card is created, but oh boy am I glad I read your post before I got much further
I think it could have taken me ages and lots of repetative code to do it my way...... you just showed me how to acheive the similar result with hardly any code at all....and my mind has now gone off on another fact finding tour of the help files
Thanks
Really appreciated Mark
Sorry, yes I did, Im really new to thisWhat is a template? Do you mean a group?
Also I found a way to do it by creating new progress bars as each card is created, but oh boy am I glad I read your post before I got much further
I think it could have taken me ages and lots of repetative code to do it my way...... you just showed me how to acheive the similar result with hardly any code at all....and my mind has now gone off on another fact finding tour of the help files
Thanks
Really appreciated Mark
Further probs with create card
Hi,
Your code works very nicely Mark....
I have been hours now on trying to find out how to get a the same thing happenning when i click my new record button to create a newcard, i get the error message "property not an integer" ... the error points to the "preOpenCard" and when i cancel the error message it creates a card and runs ok again, any advice welcome
Your code works very nicely Mark....
I have been hours now on trying to find out how to get a the same thing happenning when i click my new record button to create a newcard, i get the error message "property not an integer" ... the error points to the "preOpenCard" and when i cancel the error message it creates a card and runs ok again, any advice welcome
I dare not shake the dew drop from a rose lest I disturb the stars.
Hello Jon,
Change
into
This may be not exactly what you are looking for, but I just don't know the exact situation. Perhaps, you don't want a new progress bar to start at 0 all the time?
Best,
Mark
Change
Code: Select all
set the thumbPos of scrollbar "Progress" to the cProgress of this card
Code: Select all
if the cProgress of this cd is an integer then
set the thumbPos of scrollbar "Progress" to the cProgress of this cd
else
set the thumbPos of scrollbar "Progress" to 0
end if
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

I have really been trying for hours ( about 9 ) because i wanted to learn more...
I found lots of other interesting facts while searching......
maybe one day i will just look at a problem and solve it as quickly as you do.......yeah right...in my next life i think
just gluing my hair back on....
Thanks again Mark
I dare not shake the dew drop from a rose lest I disturb the stars.