| View previous topic :: View next topic |
| Author |
Message |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Feb 25, 2003 2:53 pm Post subject: Rotating text in status bar? |
|
|
Could anyone help to make a rotating statusbar?
I want the text on the statusbar to change every 5 seconds or so. _________________
 |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Tue Feb 25, 2003 3:15 pm Post subject: |
|
|
Be glad to help. Just tell me what exactly ya need.  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1754 Location: Space and Time
|
Posted: Tue Feb 25, 2003 3:16 pm Post subject: |
|
|
You can use a timer event to rotate the text in the status bar. Put your text in a list, then every 5 sec move to the next item in the list. Something like this.
| Code: |
DIALOG CREATE,New Dialog,-1,0,240,160
DIALOG ADD,STATUS,STATUS1,item 1
DIALOG SHOW
%x = 1
list create,1
list add,1,item 1
list add,1,item 2
list add,1,item 3
list add,1,item 4
:evloop
wait event,5
%e = @event()
goto %e
:timer
if @equal(%x,4)
%x = 0
end
dialog set,status1,@item(1,%x)
%x = @succ(%x)
goto evloop
:close
stop
|
hope this helps! _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Feb 25, 2003 3:18 pm Post subject: |
|
|
Here is my evloop
| Code: | :Evloop
wait event
parse "%%Event;%D",@event(D)
goto %%Event |
Can I add that without messing up my program?
Remember I'm still a newbie and in early learning stages  _________________
 |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Tue Feb 25, 2003 3:20 pm Post subject: |
|
|
There is nothing wrong with your :Evloop label. You can use it even if there
aren't multiple dialogs. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Feb 25, 2003 3:23 pm Post subject: |
|
|
But won't the wait 5 command slow down my application?
Sorry for the possibly dumb question but I gotta ask  _________________
 |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1567
|
Posted: Tue Feb 25, 2003 3:35 pm Post subject: |
|
|
| Sorry a little off topic, but wow! I really like your logo LiquidCode, I'll definately be hiring you for a logo once I get my new website design up! Great job with that logo. |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Feb 25, 2003 3:40 pm Post subject: |
|
|
He he he yes, it does look really nice  _________________
 |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Tue Feb 25, 2003 3:40 pm Post subject: |
|
|
Yes the WAIT command will slow your app. If you are using VDS 4+ you
could use the TIMER command in your :Timer label.
| Code: |
REM ** PLACE THIS LINE AFTER YOUR MAIN DIALOG IS CREATED **
timer start,1,chrono,@datetime(dd-hh:nn:ss)
:Evloop
wait event,".5"
parse "%%Event;%D",@event(D)
goto %E
:Timer
if @not(@greater(@timer(1,V),5))
goto Evloop
else
timer stop,1
REM ** SET STATUS TEXT HERE **
timer start,1,chrono,@datetime(dd-hh:nn:ss)
end
goto Evloop
|
The above code is off the top of my head so I'm not sure if it exactly
works. But it should give you a general idea. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Tue Feb 25, 2003 3:43 pm Post subject: |
|
|
If you'd like, give me a few and I can have a working example from the
code we have here in this thread.
Just say the word. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Feb 25, 2003 3:50 pm Post subject: |
|
|
Yeah that would be great.
Thanks alot  _________________
 |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Tue Feb 25, 2003 4:05 pm Post subject: |
|
|
Here's what I've come up with, without the TIMER command.
| Code: |
TITLE Status Scroller
dialog create,Status Scroller,-1,0,300,200
dialog add,Status,Stat
dialog show
%%item = 0
%%time = 0
list create,1
list loadtext,1
"Testing 1...
"Testing 2...
"Testing 3...
"Testing 4...
"Testing 5...
:Evloop
wait event,1
parse "%%Event;%D",@event(D)
goto %%Event
:Timer
%%time = @succ(%%time)
if @not(@equal(%%time,5))
goto Evloop
else
%%time = 0
dialog set,Stat,@item(1,%%item)
%%item = @succ(%%item)
if @equal(%%item,5)
%%item = 0
end
end
goto Evloop
:CLOSE
exit
|
_________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Feb 25, 2003 4:24 pm Post subject: |
|
|
I get an error code 23 at line 88 which is
Timer code | Code: | :Timer
%%time = @succ(%%time)
if @not(@equal(%%time,5))
goto Evloop
else
%%time = 0
dialog set,Stat,@item(1,%%item)
%%item = @succ(%%item)
if @equal(%%item,5)
%%item = 0
end
end
goto Evloop |
_________________
 |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Tue Feb 25, 2003 4:27 pm Post subject: |
|
|
I'm not sure how ERROR 23 applies here since this is a variable and not
a control. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Tue Feb 25, 2003 4:36 pm Post subject: |
|
|
Try initializing the the %%time variable at the very beginning of your
script. Though this may not fix the problem. The sample works by itself,
but without knowing where you placed thed code and all of the other things
that your script might do, I'm unable to offer a fix at this time. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
|