forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Dialog(2) and timer

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Thu Jan 13, 2005 10:02 am    Post subject: Dialog(2) and timer Reply with quote

TITLE By Mac
DIALOG CREATE,Main,-1,0,200,100
DIALOG ADD,BUTTON,Child,5,5,150,20,"Open Child Window"
dialog add,text,text1,30,0
DIALOG SHOW

:EVLOOP
WAIT EVENT, 1
rem -- %e is event, %d is dialog number that issued it (0,1,2,etc.) --
PARSE "%e;%d", @event(d)
if @equal(%e, "TIMER")
goto TIMER
end
DIALOG SELECT, %d
goto %e

:ChildBUTTON
rem -- Allow only one --
if @not(@winexists("Child"))
DIALOG CREATE,"Child",-1,0,100,50,NOMIN
DIALOG ADD,BUTTON,Test,5,5,50,20
DIALOG SHOW
end
goto EVLOOP

:TestBUTTON
INFO Dialog = %d@cr()@cr()Event = %e@tab()
goto EVLOOP

:CLOSE
if @greater(%d, 0)
DIALOG CLOSE
rem -- Kill extra CLOSE event -
%e = @event()
goto EVLOOP
end
EXIT

:Timer
%t = @datetime(hh:nn:ss)
dialog set,text1,%T
goto evloop

This dont work...
Back to top
View user's profile Send private message Send e-mail
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Thu Jan 13, 2005 3:40 pm    Post subject: Reply with quote

Try this:
Code:

TITLE By Mac
DIALOG CREATE,Main,-1,0,200,100
DIALOG ADD,BUTTON,Child,5,5,150,20,"Open Child Window"
dialog add,text,text1,30,0
DIALOG SHOW

:EVLOOP
WAIT EVENT, 1
rem -- %e is event, %d is dialog number that issued it (0,1,2,etc.) --
PARSE "%e;%d", @event(d)
rem if @equal(%e, "TIMER")
rem   gosub TIMER
rem end
DIALOG SELECT, %d
goto %e

:ChildBUTTON
rem -- Allow only one --
if @not(@winexists("Child"))
DIALOG CREATE,"Child",-1,0,100,50,NOMIN
DIALOG ADD,BUTTON,Test,5,5,50,20
DIALOG SHOW
end
goto EVLOOP

:TestBUTTON
INFO Dialog = %d@cr()@cr()Event = %e@tab()
goto EVLOOP

:CLOSE
if @greater(%d, 0)
DIALOG CLOSE
  rem -- Kill extra CLOSE event -
  %e = @event()
  goto EVLOOP
end
EXIT

:Timer
  %t = @datetime(hh:nn:ss)
  dialog set,text1,%T
  goto evloop


Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Jan 16, 2005 5:42 pm    Post subject: Reply with quote

filip,

I just posted a working timer example for a main and child window
in the VDS3 source code forum:

http://www.vdsworld.com/forum/viewtopic.php?p=24662#24662

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group