Page 1 of 1

Progress bars on multiple cards of same stack

Posted: Tue May 15, 2007 5:23 pm
by jon
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

Posted: Tue May 15, 2007 8:43 pm
by Mark
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:

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
You can include these scripts in the stack script.

Best,

Mark

Posted: Tue May 15, 2007 9:05 pm
by jon
Hi Mark,
What is a template? Do you mean a group?
Sorry, yes I did, Im really new to this

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

Posted: Thu May 17, 2007 10:23 pm
by jon
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

Posted: Thu May 17, 2007 10:34 pm
by Mark
Hello Jon,

Change

Code: Select all

set the thumbPos of scrollbar "Progress" to the cProgress of this card 
into

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
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

Posted: Thu May 17, 2007 10:51 pm
by jon
:D Mark....Thank you for the very quick and accurate reply....two minutes after reading you reply I am up and running again.......

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