;=============
;=釬氪:崦赽梨=
;=============
#include <String.au3>
#include <Date.au3>
#include <GuiConstants.au3>
$dataname = "data.ini"
$softname = IniRead($dataname, "main", "softname", "嗣啋數奀")
$count = IniRead($dataname, "main", "count",1)
$NameVersion = $softname & "v1.0"
If WinExists($NameVersion) Then
MsgBox(16, $NameVersion, "眒冪衄珨跺最唗婓堍俴賸!")
Exit ; 森褐掛眒冪堍俴賸
EndIf
AutoItWinSetTitle($NameVersion)
Global $Paused
;HotKeySet("{f11}", "TogglePause")
HotKeySet("{f10}", "Terminate")
Opt("WinTitleMatchMode", 2);梓枙黍耀宒岆 砩饜
AutoItSetOption("PixelCoordMode", 0);眈勤敦諳黍釴梓晇伎
AutoItSetOption("MouseCoordMode", 0);眈勤敦諳黍扷梓釴梓晇伎
AutoItSetOption("TrayIconHide", 1);笐紲炵苀戲芞梓
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$mygui=GuiCreate($NameVersion,600,500,-1, -1); BitOR($GUI_SS_DEFAULT_GUI,$WS_SYSMENU,$WS_MINIMIZEBOX,$WS_VSCROLL))
;GUISetIcon ("time.ico") ; 載蜊芞梓
Dim $Group[$count+1],$Label1[$count+1],$Label2[$count+1],$Label3[$count+1],$Button0[$count+1],$Button1[$count+1]
$rows=4
row();數呾衄撓俴
$i=0
$y=0
Do
$x=0
$y=$y+1
Do
$i=$i+1
$x=$x+1
getdata($i,$x,$y)
Until $x=4 Or $i=$count
Until $i=$count
$Buttonup = GuiCtrlCreateButton("∥",575,445, 20, 20)
$Buttondown = GuiCtrlCreateButton("∣",575,470, 20, 20)
GUICtrlSetState(-1,$GUI_FOCUS)
GuiSetState()
While 1
$msg = GuiGetMsg()
For $i = 1 to $count Step 1
Select
Case $msg = $Button0[$i] ;羲宎數奀
start($i)
Case $msg = $Button1[$i] ;礿砦數奀
stop($i)
Case $msg = $Buttonup
pageup($i)
Case $msg = $Buttondown
pagedown($i)
Case $msg = $GUI_EVENT_CLOSE
Exit 0
Case Else
;;;
EndSelect
Next
WEnd
Exit
#endregion --- GuiBuilder generated code End ---
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
func pageup($i)
$if = controlgetpos($NameVersion,"",$Group[$count])
If $if[1] < $rows Then
$Group_xy = controlgetpos($NameVersion,"",$Group[$i])
$Label1_xy = controlgetpos($NameVersion,"",$Label1[$i])
$Label2_xy = controlgetpos($NameVersion,"",$Label2[$i])
$Label3_xy = controlgetpos($NameVersion,"",$Label3[$i])
$Button0_xy = controlgetpos($NameVersion,"",$Button0[$i])
$Button1_xy = controlgetpos($NameVersion,"",$Button1[$i])
GUICtrlSetPos($Group[$i],$Group_xy[0],$Group_xy[1]+100)
GUICtrlSetPos($Label1[$i],$Label1_xy[0],$Label1_xy[1]+100)
GUICtrlSetPos($Label2[$i],$Label2_xy[0],$Label2_xy[1]+100)
GUICtrlSetPos($Label3[$i],$Label3_xy[0],$Label3_xy[1]+100)
GUICtrlSetPos($Button0[$i],$Button0_xy[0],$Button0_xy[1]+100)
GUICtrlSetPos($Button1[$i],$Button1_xy[0],$Button1_xy[1]+100)
EndIf
EndFunc
Func pagedown($i)
$if = controlgetpos($NameVersion,"",$Group[$count])
If $if[1] > 400 Then
$Group_xy = controlgetpos($NameVersion,"",$Group[$i])
$Label1_xy = controlgetpos($NameVersion,"",$Label1[$i])
$Label2_xy = controlgetpos($NameVersion,"",$Label2[$i])
$Label3_xy = controlgetpos($NameVersion,"",$Label3[$i])
$Button0_xy = controlgetpos($NameVersion,"",$Button0[$i])
$Button1_xy = controlgetpos($NameVersion,"",$Button1[$i])
GUICtrlSetPos($Group[$i],$Group_xy[0],$Group_xy[1]-100)
GUICtrlSetPos($Label1[$i],$Label1_xy[0],$Label1_xy[1]-100)
GUICtrlSetPos($Label2[$i],$Label2_xy[0],$Label2_xy[1]-100)
GUICtrlSetPos($Label3[$i],$Label3_xy[0],$Label3_xy[1]-100)
GUICtrlSetPos($Button0[$i],$Button0_xy[0],$Button0_xy[1]-100)
GUICtrlSetPos($Button1[$i],$Button1_xy[0],$Button1_xy[1]-100)
EndIf
EndFunc
Func getdata($i,$x,$y)
$state = IniRead($dataname,"group"&$i,"state","stop")
$starttime = IniRead($dataname,"group"&$i,"starttime","諾玿!")
$stoptime = IniRead($dataname,"group"&$i,"stoptime","")
$Group_x=15+($x-1)*140
$Label_x=25+($x-1)*140
$Button0_x=20+($x-1)*140
$Button1_x=85+($x-1)*140
$Group_y=10+($y-1)*120
$Label1_y=30+($y-1)*120
$Label2_y=50+($y-1)*120
$Label3_y=70+($y-1)*120
$Button_y=90+($y-1)*120
$Group[$i] = GuiCtrlCreateGroup($i&"瘍", $Group_x, $Group_y, 135, 110)
$Label1[$i] = GuiCtrlCreateLabel("諾玿!", $Label_x, $Label1_y, 120, 20)
$Label2[$i] = GuiCtrlCreateLabel("", $Label_x, $Label2_y, 120, 20)
$Label3[$i] = GuiCtrlCreateLabel("", $Label_x, $Label3_y, 120, 20)
$Button0[$i] = GuiCtrlCreateButton("羲宎數奀", $Button0_x, $Button_y, 60, 25)
$Button1[$i] = GuiCtrlCreateButton("礿砦數奀", $Button1_x, $Button_y, 60, 25)
If $state = "start" Then
GUICtrlSetData($Label1[$i],$starttime)
GUICtrlSetData($Label2[$i],"淏婓數奀!")
GUICtrlSetData($Label3[$i],"")
GUICtrlSetBkColor($Group[$i],0x00ff00) ; 蟯伎
GUICtrlSetColor($Label2[$i],0xff0000) ; 綻伎
GUICtrlSetState($Button0[$i],$GUI_DISABLE)
GUICtrlSetState($Button1[$i],$GUI_ENABLE)
Else
GUICtrlSetState($Button1[$i],$GUI_DISABLE)
GUICtrlSetState($Button0[$i],$GUI_ENABLE)
EndIf
EndFunc
Func start($i)
$starttime = _NowCalc ();
GUICtrlSetData($Label1[$i],$starttime)
GUICtrlSetData($Label2[$i],"淏婓數奀!")
GUICtrlSetData($Label3[$i],"")
GUICtrlSetBkColor($Group[$i],0x00ff00) ; 蟯伎
GUICtrlSetColor($Label2[$i],0xff0000) ; 綻伎
GUICtrlSetState($Button0[$i],$GUI_DISABLE)
GUICtrlSetState($Button1[$i],$GUI_ENABLE)
IniWrite($dataname,"group"&$i,"state","start")
IniWrite($dataname,"group"&$i,"starttime",$starttime)
EndFunc
Func stop($i)
$starttime = IniRead($dataname,"group"&$i,"starttime",_NowCalc ())
$stoptime = _NowCalc ()
$time = _DateDiff('n',$starttime,$stoptime)
GUICtrlSetData($Label2[$i],$stoptime)
GUICtrlSetData($Label3[$i],"數奀賦彆:"&$time&"煦笘")
GUICtrlSetBkColor($Group[$i],0xe9e5da)
GUICtrlSetColor($Label2[$i],0x000000)
GUICtrlSetColor($Label3[$i],0xff0000)
GUICtrlSetState($Button1[$i],$GUI_DISABLE)
GUICtrlSetState($Button0[$i],$GUI_ENABLE)
IniWrite($dataname,"group"&$i,"state","stop")
IniWrite($dataname,"group"&$i,"stoptime",$stoptime)
IniWrite($dataname,"group"&$i,"time",$time)
EndFunc
Func row()
$rows=$count/4
If $rows > Round($rows) Then
$rows=Round($rows)
Else
$rows=Round($rows)-1
EndIf
$rows=$rows*120+10
EndFunc
;婃礿/閥葩滲杅
Func TogglePause()
$Paused = Not $Paused
While $Paused
Sleep(100)
ToolTip("Paused")
WEnd
ToolTip("")
EndFunc ;==>TogglePause
;豖堤滲杅
Func Terminate()
Exit 0
EndFunc ;==>Terminate
如下為配置文件