#include<GUIConstants.au3>
#Include <GuiListView.au3>
#include <DateTimeConstants.au3>
Dim $HangHao
$ShuJu = @ScriptDir & "\beiwanglu.ini"
$bei = GUICreate("备忘录",400,240)
$GListView= GUICtrlCreateListView (" 事件 | 日期 |指定的时间| 备注 ",5,5,310,156) ;创建Listview控件,
_GUICtrlListView_SetExtendedListViewStyle($GListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES))
GUICtrlCreateLabel("现在时刻:",5,180,75,30)
$time = GUICtrlCreateLabel("",70,180,230,30)
$add = GUICtrlCreateButton("添加事件",320,10,70,30)
$del = GUICtrlCreateButton("删除事件",320,130,70,30)
GUISetState(@SW_SHOW)
;添加窗口
$tianjia = GUICreate("添加事件提醒",235,280)
GUICtrlCreateLabel("事件名称:",10,20,70,30)
$Rinput = GUICtrlCreateInput("",70,15,155,20)
GUICtrlCreateLabel("指定日期:",10,50,70,30)
$Rdate = GUICtrlCreateDate(@YEAR&"/"&@MON&"/"&@MDAY,70,45,155,20)
GUICtrlCreateLabel("指定时间:",10,84,70,30)
$Rtime1 = GUICtrlCreateCombo("00",70,80,35,20)
GUICtrlSetData(-1,"01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24")
GUICtrlCreateLabel("时",106,84,15,20)
$Rtime2 = GUICtrlCreateCombo("00",122,80,35,20)
GUICtrlSetData(-1,"01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60")
GUICtrlCreateLabel("分",158,84,15,20)
$Rtime3 = GUICtrlCreateCombo("00",174,80,35,20)
GUICtrlSetData(-1,"01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60")
GUICtrlCreateLabel("秒",210,84,15,20)
GUICtrlCreateLabel("备 注:",10,114,70,30)
$Redit = GUICtrlCreateEdit("",10,135,215,110)
$Rok = GUICtrlCreateButton("确定",50,250,60,25)
$Rcancle = GUICtrlCreateButton("取消",120,250,60,25)
_duqu()
While 1
$Rinput0 = GUICtrlRead($Rinput)
$Rdate0 = GUICtrlRead($Rdate)
$Rtime10 = GUICtrlRead($Rtime1)
$Rtime20 = GUICtrlRead($Rtime2)
$Rtime30 = GUICtrlRead($Rtime3)
$Redit0 = GUICtrlRead($Redit)
$a = '<' & ' '& @YEAR & '年' & @MON & '月' & @MDAY & '日' &' '&'>'& ' ' & @HOUR & ':' & @MIN & ':' & @SEC ;时间
If GUICtrlRead($time) <> $a Then GUICtrlSetData($time,$a)
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
Case $add
_tianjia()
Case $del
_del()
Case $Rok
_Rok()
Case $Rcancle
_cancle()
EndSwitch
WEnd
Func _tianjia()
GUISetState(@SW_SHOW,$tianjia)
GUISetState(@SW_DISABLE,$bei)
WinSetTrans($bei,"",150)
EndFunc
Func _del()
$aa = GUICtrlRead(GUICtrlRead($GListView))
$bb = StringSplit($aa, '|', 1)
$cc = _GUICtrlListView_GetSelectedIndices($GListView)
$d = MsgBox(1+64,"提示","是否删除"&$bb[1]&"项目?")
If StringLen($d) Then
_GUICtrlListView_DeleteItemsSelected ($GListView)
IniDelete($shuju,"Section",$bb[1])
ElseIf $d = 2 Then
MsgBox(64,"","你放弃删除选中项!")
EndIf
EndFunc
Func _cancle()
GUICtrlSetData($Rinput,"")
GUICtrlSetData($Rdate,@YEAR&"/"&@MON&"/"&@MDAY)
GUICtrlSetData($Rtime1,"00")
GUICtrlSetData($Rtime2,"00")
GUICtrlSetData($Rtime3,"00")
GUICtrlSetData($Redit,"")
GUISetState(@SW_HIDE,$tianjia)
GUISetState(@SW_ENABLE,$bei)
WinSetTrans($bei,"",250)
EndFunc
Func _Rok()
$hanghao = _GUICtrlListView_GetItemCount($GListView)
;~ $hanghao +=1
If $Rinput0 <> "" And $Rdate0 <> "" And $Rtime10 <> "" And $Rtime20 <> "" And $Rtime30 <> "" And $Redit0 <> "" Then
GUICtrlCreateListViewItem($Rinput0 & "|" & $Rdate0 & "|" & $Rtime10 &":"& $Rtime20 &":"& $Rtime30 & "|" & $Redit0,$GListView)
IniWrite($ShuJu,"Section",$rinput0,$Rinput0 & "|" & $Rdate0 & "|" & $Rtime10 &":"& $Rtime20 &":"& $Rtime30 & "|" & $Redit0)
GUISetState(@SW_HIDE,$tianjia)
GUICtrlSetData($Rinput,"")
GUICtrlSetData($Rdate,@YEAR&"/"&@MON&"/"&@MDAY)
GUICtrlSetData($Rtime1,"00")
GUICtrlSetData($Rtime2,"00")
GUICtrlSetData($Rtime3,"00")
GUICtrlSetData($Redit,"")
GUISetState(@SW_ENABLE,$bei)
WinSetTrans($bei,"",250)
EndIf
EndFunc
Func _duqu()
_GUICtrlListView_DeleteAllItems($GListView)
$var = IniReadSection($ShuJu,"Section")
If Not @error Then
For $i = 1 To $var[0][0]
GUICtrlCreateListViewItem($var[$i][1], $GListView)
Next
EndIf
EndFunc
是QQ上的你吗``我上次不是给你改好了吗?