hallo leute
ich hab in meiner gui ne liste und würde jetzt gerne die meine auswahl in der liste öffnen geht das per doppelklick oder irgendwie?
wenn ja wie kann ich das machen
hallo leute
ich hab in meiner gui ne liste und würde jetzt gerne die meine auswahl in der liste öffnen geht das per doppelklick oder irgendwie?
wenn ja wie kann ich das machen
Ja, das geht. Zeig mal dein Skript oder einen testbaren Ausschnitt.
bis jetzt habe ich nur ein array
welches in meine liste geschrieben wird und zwar so:
For $i = 1 To UBound($bugListe) - 1
FileWrite($reportfile, "[" & $i & "] " & $bugListe[$i][0] & " Fehler: " & $bugListe[$i][1] & @CRLF)
Sleep(100)
GuiCtrlSetData($list, $bugListe[$i][0])
Next
das klappt soweit auch
nur kein plan wie ich die noch anklickbar mache
#Region ;************ Includes ************
#Include <WindowsConstants.au3>
#Include <File.au3>
#Include <Debug.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#EndRegion ;************ Includes ************
GUIRegisterMsg($WM_NOTIFY, 'WM_NOTIFY')
[/autoit] [autoit][/autoit] [autoit]$hGUI = GUICreate("Test", 500, 500)
[/autoit] [autoit][/autoit] [autoit]Global $hListView = GUICtrlCreateListView("Items", 10, 10, 480, 380)
_GUICtrlListView_SetColumnWidth($hListView, 0, 450)
Global $startfolder = @ScriptDir
Global $FileList = _FileListToArray($startfolder, '*.xls?', 1)
For $i = 1 To UBound($FileList) -1
GUICtrlCreateListViewItem($FileList[$i], $hListView)
Next
$hButton = GUICtrlCreateButton("Search", 10, 460, 100, 30)
$input = GUICtrlCreateInput("", 200, 460, 100, 30)
GUISetState()
[/autoit] [autoit][/autoit] [autoit]; Scroll down to hide top item
_GUICtrlListView_Scroll($hListView, 0, 500)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $hButton
$iIndex = _GUICtrlListView_FindInText($hListView, GUICtrlRead($input))
_GUICtrlListView_ClickItem($hListView, $iIndex)
EndSwitch
WEnd
Func WM_NOTIFY($hWnd, $iMsg, $iWparam, $iLparam)
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndTab
Local $cpMin, $cpMax, $tMsgFilter, $iTab
$tNMHDR = DllStructCreate($tagNMHDR, $iLparam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, 'hWndFrom'))
$iIDFrom = DllStructGetData($tNMHDR, 'IDFrom')
$iCode = DllStructGetData($tNMHDR, 'Code')
Switch $hWndFrom
; Listivew
Case GUICtrlGetHandle($hListView)
;~ ConsoleWrite("Listview" & @CRLF)
Switch $iCode
Case $NM_DBLCLK
Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $iLparam)
_DebugPrint('$NM_DBLCLK' & @LF & '--> hWndFrom:' & @TAB & $hWndFrom & @LF & _
'-->IDFrom:' & @TAB & $iIDFrom & @LF & _
'-->Code:' & @TAB & $iCode & @LF & _
'-->Index:' & @TAB & DllStructGetData($tInfo, 'Index') & @LF & _
'-->SubItem:' & @TAB & DllStructGetData($tInfo, 'SubItem') & @LF & _
'-->NewState:' & @TAB & DllStructGetData($tInfo, 'NewState') & @LF & _
'-->OldState:' & @TAB & DllStructGetData($tInfo, 'OldState') & @LF & _
'-->Changed:' & @TAB & DllStructGetData($tInfo, 'Changed') & @LF & _
'-->ActionX:' & @TAB & DllStructGetData($tInfo, 'ActionX') & @LF & _
'-->ActionY:' & @TAB & DllStructGetData($tInfo, 'ActionY') & @LF & _
'-->lParam:' & @TAB & DllStructGetData($tInfo, 'lParam') & @LF & _
'-->KeyFlags:' & @TAB & DllStructGetData($tInfo, 'KeyFlags'))
$file = _GUICtrlListView_GetItemText($hListView, DllStructGetData($tInfo, 'Index'), 0)
ConsoleWrite($file & @LF)
ShellExecute(@ScriptDir & '\' & $file)
;~ $cpPassword = _GUICtrlListView_GetItemText($logins_LV, DllStructGetData($tInfo, 'Index'), 2)
EndSwitch
EndSwitch
EndFunc ;==>WM_NOTIFY
Func _DebugPrint($s_text, $line = @ScriptLineNumber)
ConsoleWrite( _
'!===========================================================' & @LF & _
'+======================================================' & @LF & _
'-->Line(' & StringFormat('%04d', $line) & '):' & @TAB & $s_text & @LF & _
'+======================================================' & @LF)
EndFunc ;==>_DebugPrint
und welchen teil brauch ich denn dafür nun?
Versuch das Skript zu verstehen.
Es nimmt alle Exceldokumente aus dem SkriptDir in eine Listview.
Mit Doppelklick startet die Datei in Excel oder was auch immer bei dir mit der Endung verknüpft ist.
wie kann ich eine zweite spalte in die liste einfügen?
So, aber guck dir dazu die Hilfe an. Die ist super.
#Region ;************ Includes ************
#Include <WindowsConstants.au3>
#Include <File.au3>
#Include <Debug.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#EndRegion ;************ Includes ************
GUIRegisterMsg($WM_NOTIFY, 'WM_NOTIFY')
[/autoit] [autoit][/autoit] [autoit]$hGUI = GUICreate("Test", 500, 500)
[/autoit] [autoit][/autoit] [autoit]Global $hListView = GUICtrlCreateListView("Dateiname|Größe", 10, 10, 480, 380)
Global $startfolder = @ScriptDir
Global $FileList = _FileListToArray($startfolder, '*.xls?', 1)
For $i = 1 To UBound($FileList) -1
GUICtrlCreateListViewItem($FileList[$i] & '|' & FileGetSize($FileList[$i]), $hListView)
Next
$hButton = GUICtrlCreateButton("Search", 10, 460, 100, 30)
$input = GUICtrlCreateInput("", 200, 460, 100, 30)
GUISetState()
[/autoit] [autoit][/autoit] [autoit]While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $hButton
$iIndex = _GUICtrlListView_FindInText($hListView, GUICtrlRead($input))
_GUICtrlListView_ClickItem($hListView, $iIndex)
EndSwitch
WEnd
Func WM_NOTIFY($hWnd, $iMsg, $iWparam, $iLparam)
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndTab
Local $cpMin, $cpMax, $tMsgFilter, $iTab
$tNMHDR = DllStructCreate($tagNMHDR, $iLparam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, 'hWndFrom'))
$iIDFrom = DllStructGetData($tNMHDR, 'IDFrom')
$iCode = DllStructGetData($tNMHDR, 'Code')
Switch $hWndFrom
; Listivew
Case GUICtrlGetHandle($hListView)
;~ ConsoleWrite("Listview" & @CRLF)
Switch $iCode
Case $NM_DBLCLK
Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $iLparam)
_DebugPrint('$NM_DBLCLK' & @LF & '--> hWndFrom:' & @TAB & $hWndFrom & @LF & _
'-->IDFrom:' & @TAB & $iIDFrom & @LF & _
'-->Code:' & @TAB & $iCode & @LF & _
'-->Index:' & @TAB & DllStructGetData($tInfo, 'Index') & @LF & _
'-->SubItem:' & @TAB & DllStructGetData($tInfo, 'SubItem') & @LF & _
'-->NewState:' & @TAB & DllStructGetData($tInfo, 'NewState') & @LF & _
'-->OldState:' & @TAB & DllStructGetData($tInfo, 'OldState') & @LF & _
'-->Changed:' & @TAB & DllStructGetData($tInfo, 'Changed') & @LF & _
'-->ActionX:' & @TAB & DllStructGetData($tInfo, 'ActionX') & @LF & _
'-->ActionY:' & @TAB & DllStructGetData($tInfo, 'ActionY') & @LF & _
'-->lParam:' & @TAB & DllStructGetData($tInfo, 'lParam') & @LF & _
'-->KeyFlags:' & @TAB & DllStructGetData($tInfo, 'KeyFlags'))
$file = _GUICtrlListView_GetItemText($hListView, DllStructGetData($tInfo, 'Index'), 0)
ConsoleWrite($file & @LF)
ShellExecute(@ScriptDir & '\' & $file)
;~ $cpPassword = _GUICtrlListView_GetItemText($logins_LV, DllStructGetData($tInfo, 'Index'), 2)
EndSwitch
EndSwitch
EndFunc ;==>WM_NOTIFY
Func _DebugPrint($s_text, $line = @ScriptLineNumber)
ConsoleWrite( _
'!===========================================================' & @LF & _
'+======================================================' & @LF & _
'-->Line(' & StringFormat('%04d', $line) & '):' & @TAB & $s_text & @LF & _
'+======================================================' & @LF)
EndFunc ;==>_DebugPrint
das mit dem öffnen hab ich noch nicht geblickt wie das geht
könntest du mir das vielleicht erklären?
habs gelöst
danke