home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / shareware / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlListViewSetHoverTime.au3 < prev    next >
Encoding:
Text File  |  2006-06-20  |  1.9 KB  |  42 lines

  1. #include <GuiConstants.au3>
  2. #include <GuiListView.au3>
  3.  
  4. Opt ('MustDeclareVars', 1)
  5. Dim $listview, $Btn_SetHoverTime, $Btn_Exit, $msg, $Input, $Status, $ret, $current
  6. GUICreate("ListView Sets Hover Time", 392, 322)
  7.  
  8. $listview = GUICtrlCreateListView("col1|col2|col3", 40, 30, 310, 149, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER))
  9. GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
  10. GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
  11. GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_TRACKSELECT, $LVS_EX_TRACKSELECT)
  12. GUICtrlCreateListViewItem("line1|data1|more1", $listview)
  13. GUICtrlCreateListViewItem("line2|data2|more2", $listview)
  14. GUICtrlCreateListViewItem("line3|data3|more3", $listview)
  15. GUICtrlCreateListViewItem("line4|data4|more4", $listview)
  16. GUICtrlCreateListViewItem("line5|data5|more5", $listview)
  17. GUICtrlCreateLabel("Enter Hover Time:", 90, 190, 130, 20)
  18. $Input = GUICtrlCreateInput("", 220, 190, 80, 20, $ES_NUMBER)
  19. GUICtrlSetLimit($Input, 3)
  20. $Btn_SetHoverTime = GUICtrlCreateButton("Set Hover Time", 75, 230, 90, 40)
  21. $Btn_Exit = GUICtrlCreateButton("Exit", 300, 260, 70, 30)
  22. $current = _GUICtrlListViewGetHoverTime ($listview)
  23. $Status = GUICtrlCreateLabel("Hover Time:" & $current, 0, 302, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER))
  24.  
  25. GUISetState()
  26. While 1
  27.     $msg = GUIGetMsg()
  28.     If ($current <> _GUICtrlListViewGetHoverTime ($listview)) Then
  29.         GUICtrlSetData($Status, "Hover Time:" & _GUICtrlListViewGetHoverTime ($listview))
  30.         $current = _GUICtrlListViewGetHoverTime ($listview)
  31.     EndIf
  32.     Select
  33.         Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
  34.             ExitLoop
  35.         Case $msg = $Btn_SetHoverTime
  36.             If (StringLen(GUICtrlRead($Input)) > 0) Then
  37.                 $ret = _GUICtrlListViewSetHoverTime ($listview, Int(GUICtrlRead($Input)))
  38.             EndIf
  39.     EndSelect
  40. WEnd
  41. Exit
  42.