Jump to content


Photo

StopWatch


  • Please log in to reply
9 replies to this topic

Poll: Do yo like the GUI? (9 member(s) have cast votes)

Do yo like the GUI?

  1. Yes (6 votes [50.00%])

    Percentage of vote: 50.00%

  2. No (6 votes [50.00%])

    Percentage of vote: 50.00%

Vote Guests cannot vote

#1 emmanuel d

emmanuel d
  • Members
  • 494 posts

Posted 28 May 2011 - 12:05 PM

here is my version of a Stopwatch.
not to much text controls, but there is no need for it.
the sfx 7Zip file
press space to start or split, or leftclick on the gui
press enter or backspace to reset, or rightclick on the gui
press F4 to view the log file
Some Pictures:
Posted Image

Posted Image

Posted Image
The source:[code=auto:0]
; Gui, 1: +LastFound -Caption +Border ;+Alwaysontop +Owner
; SplitPath, A_ScriptFullPath, exeNameExt, exeDir, exeExt, ExeName, ExeDrive
#SingleInstance force
MainIcon=%A_ScriptDir%\Stopwatch.ico
if !A_IsCompiled ; Autocompiling
{
SplitPath, A_ScriptFullPath, , OutDir, , OutName
Icon:= MainIcon ? "/icon """ MainIcon """ " : ""
Process,Close, %OutName%.exe
Process,WaitClose, %OutName%.exe
RunWait, "%A_AhkPath%\..\Compiler\Ahk2Exe.exe" /in "%A_ScriptFullPath%" %Icon%/out "%OutDir%\%OutName%.exe"
Run, %OutDir%\%OutName%.exe
ExitApp
}
WinTitle:="StopWatch"
FileInstall, StopWatchb.ico, %A_ScriptDir%\StopWatchb.ico, 0 ;
FileInstall, StopWatchr.ico, %A_ScriptDir%\StopWatchR.ico, 0
; FileInstall, Stopwatch.ahk, %A_ScriptDir%\Stopwatch.ahk, 0 ; Sourcecode
FileInstall, Stopwatch.ico, %A_ScriptDir%\Stopwatch.ico, 0 ; MainIcon
_1_=666666
_2_=777777
_3_=888888
_4_=999999
_5_=AAAAAA
_6_=BBBBBB
_7_=CCCCCC
_8_=DDDDDD
_9_=EEEEEE
_10_=FFFFFF
menu,tray,nostandard
menu,tray,icon,%A_ScriptDir%\StopWatchb.ico
menu,tray,add,toggle GUI,GuiToggle
menu,tray,add,exit,exit
Menu,Tray,Default,toggle GUI ; Changes the menu's default item
Menu,Tray,Click,1 ; Single-click to activate the tray menu's default menu item.

Gui,Destroy
Gui,+LastFound -Caption +Border +ToolWindow +Alwaysontop +Owner ;+resize
GUI_ID:=WinExist() ; Get the Handle of the Window
Gui,Color,Black
Gui,font, S9 , webdings ; Set the font for the text
Gui,Add, Button, x0 yp w20 h20 Center hwndhStartSplit vStartSplit gPlay,= ;`;
Gui,Add, Button, x+0 yp wp hp Center hwndhStopReset vStopReset gTimerReset,<
Gui,Add, Button, x+0 yp wp hp Center hwndhViewLog vViewLog gViewLog,

#2 emmanuel d

emmanuel d
  • Members
  • 494 posts

Posted 03 June 2011 - 09:22 AM

Updated the script to show real tooltips(no onmessage)
Added some pictures

Please feel free to comment

#3 j--hn

j--hn
  • Members
  • 176 posts

Posted 03 June 2011 - 10:16 AM

First of all, it doesn't work on AHK_L (its working fine on regular AHK)

Personally i don't like the button position i prefer it to be on bottom, moreover the button is too small. The button icon looks different from original screenshot, this is how it looks on my laptop:

Posted Image

The font looks smoothed because i use gdi++ (a font smoothing apps)

I think it would be easier to control the stopwatch by clicking the GUI (as an alternative to button). Start the stopwatch by clicking & stop it by double clicking/right clicking.

#4 emmanuel d

emmanuel d
  • Members
  • 494 posts

Posted 03 June 2011 - 10:25 AM

thx j[]hn for the reply
Updated to work with autohotkey_l
variables can only contain _ as a special character

working on lbutton rbutton now.

#5 emmanuel d

emmanuel d
  • Members
  • 494 posts

Posted 03 June 2011 - 10:53 AM

Personally i don't like the button position i prefer it to be on bottom, moreover the button is too small. The button icon looks different from original screenshot, this is how it looks on my laptop:

The font looks smoothed because i use gdi++ (a font smoothing apps)


Maybe your OS doesn't have the font "webdings"
can you check that?

#6 emmanuel d

emmanuel d
  • Members
  • 494 posts

Posted 03 June 2011 - 11:08 AM

Updated:
Added leftclick on GUI to start-split the timer
Rightclick to stop-reset the timer

#7 j--hn

j--hn
  • Members
  • 176 posts

Posted 03 June 2011 - 12:06 PM

Yes it's installed. Script works on AHK_L now.
I set my visual style to windows XP (default) and here's the result(GDI++ OFF, no smoothing):

Posted Image

It seems my previous visualstyle & most of my other vs (from deviantart) interfere with gui font settings. Did you use windows classic visualstyle on original screenshots?

#8 emmanuel d

emmanuel d
  • Members
  • 494 posts

Posted 03 June 2011 - 12:14 PM

Did you use windows classic theme on original screenshots?

Yes i did
i am on xp sp3
classic theme

#9 sjkeegs

sjkeegs
  • Members
  • 21 posts

Posted 03 June 2011 - 02:07 PM

Which is the current version of the source?

The file extracted from the 7zip file does not match the code box in the first post.

#10 emmanuel d

emmanuel d
  • Members
  • 494 posts

Posted 03 June 2011 - 02:17 PM

i have no idea what it was i removed

edit they should match now