Hallo,
habe eine Frage habe folgende Listviewitems
Host|IP|MAC|Datum
pc1|192.168.01.13|00-13-E8-B8-57-E5|12.04.2010
pc2|192.168.02.14|00-13-E8-B8-57-E6|13.04.2010
pc3|192.168.03.15|00-13-E8-B8-57-E7|14.04.2010
pc4|192.168.04.16|00-13-E8-B8-57-E8|15.04.2010
pc5|192.168.05.17|00-13-E8-B8-57-E9|16.04.2010
pc6|192.168.06.18|00-13-E8-B8-57-E10|17.04.2010
pc7|192.168.07.19|00-13-E8-B8-57-E11|18.04.2010
pc8|192.168.08.20|00-13-E8-B8-57-E12|19.04.2010
pc9|192.168.10.21|00-13-E8-B8-57-E13|20.04.2010
Ich möchte mit der combobox filtern und jeweils die segmente anzeigen lassen die in der Listview enthalten sind.
01
02
03
04
05
06
07
08
09
10
autoit.de/wcf/attachment/9248/
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <GuiIPAddress.au3>
#include <Array.au3>
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
$Form1 = GUICreate("Get", 999, 628, 226, 231)
;$Input1 = GUICtrlCreateInput("P0XXXX", 24, 72, 73, 21)
$Combo1 = GUICtrlCreateCombo("Segmente", 104, 72, 161, 25)
;$IPAddress1 = _GUICtrlIpAddress_Create($Form1, 104, 8, 162, 21)
;_GUICtrlIpAddress_Set($IPAddress1, "10.11.0.0")
;$IPAddress2 = _GUICtrlIpAddress_Create($Form1, 104, 40, 162, 21)
;_GUICtrlIpAddress_Set($IPAddress2, "10.11.255.255")
$hListView1 = GUICtrlCreateListView("Host|IP|MAC|Last Seen", 24, 104, 930, 478)
;$Date1 = GUICtrlCreateDate("2010/04/27 20:50:50", 768, 8, 186, 21)
;$ListView2 = GUICtrlCreateListView("", 768, 32, 186, 54)
$Button1 = GUICtrlCreateButton("Import", 24, 590, 155, 25, 0)
;$Button2 = GUICtrlCreateButton("Stop", 424, 48, 155, 25, 0)
;$Button3 = GUICtrlCreateButton("Makierte wecken", 414, 72, 93, 25, 0)
;$Button4 = GUICtrlCreateButton("Alle wecken", 504, 72, 75, 25, 0)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_ditoimport()
EndSwitch
WEnd
func _ditoimport()
$sText= FileRead(FileOpenDialog("Datei wählen","","All (*.*)"))
If @error Then $sText = ClipGet()
$aData = StringRegExp($sText,"(\S+)\s+(\S+)\s+(\S+)\s+(\S+\s+\S+)(?>.+)?",3)
If @error Then Exit MsgBox(0,"","No Match!")
_ArraySplit($aData,4)
_ArrayDisplay($aData)
;For $i = 0 to Ubound($aData) - 1
;GUICtrlCreateListViewItem($aData[$i], $hListView1)
;Next
_GUICtrlListView_AddArray($hListView1, $aData)
EndFunc
Func _ArraySplit(ByRef $aArray, $iCol)
Local $iUB = Ceiling(UBound($aArray) / $iCol)
If $iUB < 1 Then Return
Local $aRet[$iUB][$iCol], $iC, $iUB2 = UBound($aArray)
For $i = 0 To UBound($aArray) - 1 Step $iCol
For $j = 0 To $iCol - 1
If $i + $j >= $iUB2 Then ExitLoop
$aRet[$iC][$j] = $aArray[$i + $j]
Next
$iC += 1
Next
;GUICtrlCreateListViewItem($aArray[0], $hListView1)
$aArray = $aRet
EndFunc ;==>_ArraySplit