View previous topic :: View next topic |
Author |
Message |
filip Valued Contributor
Joined: 07 Aug 2004 Posts: 340
|
Posted: Thu Nov 10, 2005 12:22 pm Post subject: Tip of the day |
|
|
>>Did anyone came up with how to replace text2 with new one if i press next or last button more than one time?
Code: | Title Tip of the day
DIALOG CREATE,Tip of the day,-1,0,323,222,NOSYS,COLOR white
DIALOG ADD,STYLE,STYLE1,Arial,12,B,,
DIALOG ADD,LINE,LINE1,15,14,296,155
DIALOG ADD,GRADIENT,GRADIENT1,16,15,293,152,WHITE,91C8FF,,TOPTOBOTTOM
DIALOG ADD,BUTTON,BUTTON1,190,94,64,24,Next ->,,DEFAULT
DIALOG ADD,BUTTON,BUTTON2,190,15,64,24,<- Last,,DEFAULT
DIALOG ADD,BUTTON,BUTTON3,190,246,64,24,Ok,,DEFAULT
DIALOG ADD,TEXT,TEXT1,40,90,,,Tip of the Day...,,STYLE1
DIALOG ADD,TEXT,TEXT2,80,30,,,
DIALOG ADD,CHECK,CHECK1,171,15,,,Show at start-up
DIALOG ADD,BITMAP,BITMAP1,35,29,32,38,tip.ico
DIALOG SHOW
dialog set,text2,Don't forget to bring 2 towels...
:Evloop
wait event
goto @event()
:BUTTON1BUTTON
dialog set,text2,Don't forget to bring a towel...
goto evloop
:BUTTON2BUTTON
dialog set,text2,Don't forget to bring 2 towels...
goto evloop
:BUTTON3BUTTON
:Close
exit |
|
|
Back to top |
|
|
DavidR Contributor
Joined: 05 Aug 2003 Posts: 83 Location: Bethel Pennsylvania U.S.A.
|
Posted: Thu Nov 10, 2005 1:58 pm Post subject: Tip Of The Day |
|
|
Try This!
You can add as many Tips as you want and it should continue to work.
There's probably a dozen other ways to do this but this was what came to mind first!
.........David
Code: | Title Tip of the day
DIALOG CREATE,Tip of the day,-1,0,323,222,NOSYS,COLOR white
DIALOG ADD,STYLE,STYLE1,Arial,12,B,,
DIALOG ADD,LINE,LINE1,15,14,296,155
DIALOG ADD,GRADIENT,GRADIENT1,16,15,293,152,WHITE,91C8FF,,TOPTOBOTTOM
DIALOG ADD,BUTTON,BUTTON1,190,94,64,24,Next ->,,DEFAULT
DIALOG ADD,BUTTON,BUTTON2,190,15,64,24,<- Last,,DEFAULT
DIALOG ADD,BUTTON,BUTTON3,190,246,64,24,Ok,,DEFAULT
DIALOG ADD,TEXT,TEXT1,40,90,,,Tip of the Day...,,STYLE1
DIALOG ADD,TEXT,TEXT2,80,30,,,
DIALOG ADD,CHECK,CHECK1,171,15,,,Show at start-up
DIALOG ADD,BITMAP,BITMAP1,35,29,32,38,tip.ico
DIALOG SHOW
# Put Tips in a List,
LIST CREATE,1,
LIST ADD,1, Don't forget to bring a towel...
LIST ADD,1, Don't forget to bring 2 towels...
LIST ADD,1, Don't forget to bring a blanket...
LIST ADD,1, Don't forget to bring 2 blankets...
LIST ADD,1, Don't forget to bring a ball...
LIST ADD,1, Don't forget to bring 2 balls...
# Determine the total number of list itemms
%%COUNT = @COUNT(1)
# Initial Tip is a random pick
%%START = @RANDOM(%%COUNT)
LIST SEEK,1,%%START
dialog set,text2,@ITEM(1)
:Evloop
wait event
goto @event()
:BUTTON1BUTTON
# Increment the list number whenever the user clicks Next button
%%START = @SUM(%%START,1)
# Make sure we don't try to display nonexistant item
# wrap back to beginning of list if total count is reached
IF @EQUAL(%%START,%%COUNT)
%%START = 0
END
LIST SEEK,1,%%START
dialog set,text2,@ITEM(1)
goto evloop
:BUTTON2BUTTON
# Decrement the list number if user clicks Previous button
%%START = @DIFF(%%START,1)
# If we just displayed the first item on the list
# wrap back to the last item
IF @EQUAL(%%START,-1)
%%START = @DIFF(%%COUNT,1)
END
LIST SEEK,1,%%START
dialog set,text2,@ITEM(1)
goto evloop
:BUTTON3BUTTON
:Close
exit
|
|
|
Back to top |
|
|
filip Valued Contributor
Joined: 07 Aug 2004 Posts: 340
|
Posted: Thu Nov 10, 2005 2:08 pm Post subject: |
|
|
You deserve more star points than i... |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|