im trying to make a progress bar for the time and was wondering how i would start this project... i have the progress bar setup and ready but i cant figure out how to do anything else
[edit]
im also thinking about having it so people can select what time measure they want the progress bar to be for....like xxseconds or xxminutes xxhours xxdays
What do you meen; 'for the time'? I use progressbars to from mdx... If u spessify, I might be able to help u
ok disregard everything i said, im am using it to measure one day, say its 12 noon
the progress bar would be here
{||||||||||||------------}
ok, I see....
I`m sure u have the aliases for the mdx.dll... and the init event...
so what u have to do is make an alias and execute it with a timer... Say every minute...
.timermdxupdate 0 60 mdxtime
alias mdxtime {
did -a dname did <current time> 1 <max time>
}
this should make the progress bar move as you wanted.
If not, play around with it, and/or msg me...
ok i got this far
how can i get the current seconds into the day that it is right now?
.timersitime 0 60 sitime
alias sitime { did -a si 18 xxx 1 3600 }
Im not really good with time identifiers.. But i`ll guess u have to use $ctime or something to do that...
im not sure if this is right, the number is still very huge
$ctime($asctime(mmmm d yyyy 00:00:00))
it seems like $ctime is right if i can get it to return the seconds since the begin of that day
UNTESTED
alias test {
did -a name id $iif($left($time,2) isnum,$left($time,2) 0 23,$left($time,1) 0 23)
.timer -o 0 $calc(60 * 60) did -a name id $iif($left($time,2) isnum,$left($time,2) 0 23,$left($time,1) 0 23)
}
never used a progress bar but seen other peoples, try that.
nothing happened but i think //did -a si 18 $left($time,2) works,,, ill check back with ya in a few hours to see
how do you move an mdx progress bar?
did -a name id <Place To Move> <Total Length>??
did -a name id <Place To Move> 0 <Total Length> i belive
i belive my litle piece of code works fine
thats the problem,if it does work: it may work now, when its: 20:48, but what about when its, 2:32 it will try to move to 2: in that progress bar.
because 2: is not a number in your progress bar, however 20 is.
The way I'd go about it is by setting the current time in a variable, %ctime, set the range of the progress bar from 1 - 86,400 (1 day in seconds), then just /did the %ctime variable to the progress bar. That way if the time was at 43,200 (12:00pm), the progress bar will be at 50%.
how do i get the time in seconds?
Sorry, I've made a couple of miscalculations... It's too early in the morning. I realized it after I tried making an example code and ended up with 1,000,000 seconds...
Firstly, calculate the hour with: $calc($time(H) * 60 * 60)
Then calculate the minutes with: $calc($time(nn) * 60)
Then finally add it all together: $calc(%hrs + %mins + $time(ss))
This should return the right time now.
my progress bar is full...its 6:25pm...
text "1 0 86400", 18, 388 64 85 20
alias sitime {
if (%si.time == 1) {
if ($dialog(si)) {
set %si.time.now $calc(($time(Hnn) * 60) * 60)
//did -ra si 18 %si.time.now
}
}
else { .timersitime off }
}
Yeah, I thought that would happen, my mistake.
what about if i use minutes?
Seconds would be more accurate, but, it's your choice.
ok i think if i went by hours it would be easyer...so i set my dialog for 1 - 24 how can i get the hour that it is now?
$calc(($time(H) * 60 ) + $time(n))
Yeah, hours would be a lot easier because you'd only have to return $time(H), although, how would you display the time when it's 13:52? Even though it is almost 2pm, it would still display it as 1pm because that's what the hours read.
thanks