PDA

View Full Version : My progress bar is not updated



sonata31
November 16th, 2007, 09:08 AM
In my lua file I have the code :

function AnimeWaitProgressBar (waitTimer)
local waitProgress = NetRemote.GetVariable('NR.waitProgressBar');
if (waitProgress == "10") then
NetRemote.SetVariable('NR.waitProgressBar', 0);
waitTimer:KillTimer();
else
NetRemote.SetVariable('NR.waitProgressBar', waitProgress + 1);
end;
end;

I have a button Component
NRBasic:Image Progress Bar Compnent
- DIRECTION : Right
- VAR : NR.waitProgressBar
- MIN : 0
- MAX : 10

I have a button 'wait' with action :
NRBasic:Set variable to value (NR.waitProgressBar, 0)
NRBasic:Execute lua code (OnRelease) (waitTimer = NetRemote.SetTimer(500, AnimeWaitProgressBar);

I have a frame with {NR.waitProgressBar} in Element Name

When I clic on button 'wait' in the frame 0,1,2, ..., 10 is displayed, but the progress bar no

Help

Rob H
November 17th, 2007, 06:47 AM
Hmm... that looks okay - can you post the CCF and .lua so we can check it out.

Thanks

sonata31
November 17th, 2007, 08:42 AM
Clic on button Home (top left)
Clic on Options
Clic on button wait

Page group GLOBAl
Page P.Options

sonata31
November 17th, 2007, 09:06 AM
In my ccf I have the button B.avecVP, with action :

NRBasic:Execute lua code (OnRelease) (ToggleMenu());
NRBasic:Execute lua code (OnRelease) (waitTimer = NetRemote.SetTimer(500, AnimeProgressBar); NetRemote.GoDevice(PCHC, P.Main));

Why NetRemote.GoDevice(PCHC, P.Main) is not executed ?
I tried NetRemote.GoDevice('PCHC', 'P.Main') also

Rob H
November 17th, 2007, 09:06 AM
You need to add a button pressed image to it (and probably make the background colour transparent while you're at it). Should work properly then.

sonata31
November 17th, 2007, 09:42 AM
You need to add a button pressed image to it (and probably make the background colour transparent while you're at it). Should work properly then.

It's ok, Thank You

And for my pb on the previous post ?

sonata31
November 17th, 2007, 10:10 AM
In my ccf I have the button B.avecVP, with action :

NRBasic:Execute lua code (OnRelease) (ToggleMenu());
NRBasic:Execute lua code (OnRelease) (waitTimer = NetRemote.SetTimer(500, AnimeProgressBar); NetRemote.GoDevice(PCHC, P.Main));

Why NetRemote.GoDevice(PCHC, P.Main) is not executed ?
I tried NetRemote.GoDevice('PCHC', 'P.Main') also

For this pb ?

Rob H
November 17th, 2007, 10:24 AM
Oops, I missed that one. I don't see the button you're referring to - have you just added it?

It should definitely be NetRemote.GoDevice('PCHC', 'P.Main') - but that won't work the way you want it to. You need it to do that when the progress bar reaches 10 presumably?

sonata31
November 17th, 2007, 10:52 AM
Oops, I missed that one. I don't see the button you're referring to - have you just added it?

It should definitely be NetRemote.GoDevice('PCHC', 'P.Main') - but that won't work the way you want it to. You need it to do that when the progress bar reaches 10 presumably?

Yes, I found : in Properties of PCHC, Page Template must be 'device Template'

Thank You