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 


VDS Clock

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code
View previous topic :: View next topic  
Author Message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Sep 28, 2002 9:30 pm    Post subject: VDS Clock Reply with quote

I tried to make a analog clock, but I didn't know how to calculate the
positions of the hours, minutes and seconds, so I made a list with all the positions. If someone knows how to calculate it, please post a reply...

This is what I have till now...

Code:

option decimalsep,.
  DIALOG CREATE,VDS Clock,-1,0,190,190
  DIALOG SHOW
 
rem                 top|left   
%%clockproperties = 8  |8
gosub createclock

:evloop
wait event,1
goto @event()


:Timer
gosub Setclock
goto evloop

:Close
exit

rem ----------------------------------------------------------------

:Setclock
parse "%%left;%%top",@item(9,@datetime(ss))
dialog setpos,SECOND1,@fadd(%%top,%%clocktop),@fadd(%%left,%%clockleft)
parse "%%left;%%top",@item(9,@datetime(nn))
dialog setpos,MINUTE1,@fadd(%%top,%%clocktop),@fadd(%%left,%%clockleft)
if @greater(@datetime(hh),12)
parse "%%left;%%top",@item(9,@fmul(@diff(@datetime(hh),12),5)) 
else
parse "%%left;%%top",@item(9,@fmul(@datetime(hh),5))
end
dialog setpos,HOUR1,@fadd(%%top,%%clocktop),@fadd(%%left,%%clockleft)
exit

:Createclock
list create,9
list loadtext,9
"75|1
"79|1
"85|2
"92|3
"99|5
"107|8
"115|12
"122|18
"130|26
"136|33
"140|42
"144|50
"147|56
"148|63
"149|70
"150|75
"147|79
"147|85
"146|92
"143|99
"140|107
"136|115
"131|123
"123|130
"115|136
"107|141
"99|144
"93|146
"86|148
"79|148
"74|149
"69|148
"62|148
"55|146
"49|144
"41|140
"33|135
"26|129
"18|122
"12|114
"8|107
"5|99
"2|92
"1|85
"1|79
"2|74
"2|70
"2|63
"4|57
"6|50
"9|43
"13|34
"19|27
"27|20
"34|14
"41|10
"49|6
"56|3
"63|2
"75|1
parse "%%clocktop;%%clockleft",%%clockproperties
  DIALOG ADD,STYLE,CLOCKSTYLE1,Courier New,18,B,,
  DIALOG ADD,SHAPE,CLOCK1,%%clocktop,%%clockleft,175,175,WHITE,BLACK,,ELLIPSE
  DIALOG ADD,TEXT,HOUR1,9999,9999,,,O,,CLOCKSTYLE1,TRANSPARENT
  DIALOG ADD,TEXT,MINUTE1,9999,9999,,,O,,CLOCKSTYLE1,TRANSPARENT
  DIALOG ADD,TEXT,SECOND1,9999,9999,,,o,,CLOCKSTYLE1,TRANSPARENT
  DIALOG ADD,TEXT,CLOCKTEXT1,@fadd(%%clocktop,1),@fadd(%%clockleft,73),,,12,,TRANSPARENT,CLOCKSTYLE1
  DIALOG ADD,TEXT,CLOCKTEXT2,@fadd(%%clocktop,75),@fadd(%%clockleft,157),,,3,,CLOCKSTYLE1,TRANSPARENT
  DIALOG ADD,TEXT,CLOCKTEXT3,@fadd(%%clocktop,151),@fadd(%%clockleft,83),,,6,,CLOCKSTYLE1,TRANSPARENT
  DIALOG ADD,TEXT,CLOCKSTYLE4,@fadd(%%clocktop,77),@fadd(%%clockleft,3),,,9,,CLOCKSTYLE1,TRANSPARENT
exit
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code 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