AutoHotkey Community

It is currently May 27th, 2012, 10:00 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Stop-watch GUI
PostPosted: December 5th, 2006, 5:07 am 
Is it possible to create a lightwight GUI function which upon calling it will start a timer and stop it to report result? I have a program which has a reaction time to symbols, and this number can be calculated into performance values. I hope to overcome this and publish my work!:) Thank you! Have nice day and thank you! :D

[Moderator's note: Original title was "Hello, quick question I hope someone can help.", changed to something more useful in searches...]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2006, 5:54 am 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8667
Location: Salem, MA
I'm afraid your request doesn't make sense to me.

You want to make a GUI (that is possible)

That starts a timer when you hit a button?

What happens when the timer completes?

What other program is this interfacing with?

We're happy to help, but maybe need a little more info.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2006, 6:45 am 
Hi Engunneer. More like a internal timer that will generate a $string var result of the time in between starting and stopping it through calling it via GoSub :D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2006, 11:18 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Code:
bStart := true
Gui Font, s20, Verdana
Gui Add, Text, w500 cBlue Center vtimerResult
Gui Font, s15
Gui Add, Button, gGo vbutton, Start
Gui Show
Return

Go:
   bStart := !bStart
   If bStart
   {
      GuiControl, , timerResult
      GuiControl, , button, Stop
      tickStart := A_TickCount
   }
   Else
   {
      GuiControl, , button, Start
      tickStop := A_TickCount
      time := (tickStop - tickStart) / 1000
      StringTrimRight time, time, 3
      GuiControl, , timerResult, %time%
   }
Return

GuiClose:
GuiEscape:
ExitApp

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2006, 7:50 am 
[quote="PhiLho"][code]bStart := true

PhiLho, you are the best - thank you! Have great day! :)


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, tomoe_uehara, XstatyK and 62 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group