Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetBatchLines, -1
Critical
PfadDaten := A_ScriptDir "\00_Daten"
PfadAnfragen := "\01_Anfragen"
Gui, 5:new, hwndhwndparent
Gui, 5:Color, Silver
Gui, 5:Font, s11 norm cBlack cBlack, Verdana
Gui, 5:+Resize
Gui, 5:Font, bold s12
Gui, 5:add, Text, x5 y5 w100 Section, Verzeichnisliste
Gui, 5:Font, norm, 10
Gui, 5:add, ListView, x5 y80 w350 h250 Section grid NoSortHdr vLVAnfrage gLVClickAnfrage HWNDhwnd_LV1, Kunde|Datum
Loop, Files, %PfadDaten%%PfadAnfragen%\*.*, D
{
AnfrageArray := StrSplit(A_LoopFileFullPath, "\")
AnfrageKunde := AnfrageArray[AnfrageArray.MaxIndex()]
formattime, AnfrageKundeDatum, %A_LoopFileTimeModified%, dd.MM.yyyy
rowNum := LV_Add(, AnfrageKunde, AnfrageKundeDatum)
}
LV_ModifyCol()
Gui, 5:add, TreeView, x+15 w350 h250 vProjektListe gTVAnfrClick HWNDhwnd_TVProj AltSubmit
Gui, 5:add, ListBox, x+15 w350 h250 vProjektDateiListe HWNDhwnd_ListboxDateiProj gTVAnfrClickDatei
Gui, 5:add, Button, gNeuLaden, Neu Laden
Gui, 5:show, ,Übersicht
return
5GuiClose:
ExitApp
return
NeuLaden:
reload
return
LVClickAnfrage:
Gui, 5:Submit, nohide
if A_GuiEvent = Normal
{
LV_GetText(KundeGeklickt, A_EventInfo, 1)
If KundeGeklickt =
return
geklickt = %A_guiEvent%
ZeileNum = %A_EventInfo%
msgbox A_GuiEvent: %A_GuiEvent% / %KundeGeklickt%
Gui, TreeView, ProjektListe
GuiControl, -redraw, ProjektListe
TV_Delete(ProjektListe)
anzVerz := 0
Loop, Files, %PfadDaten%%PfadAnfragen%\%KundeGeklickt%\*.*, D
{
;msgbox, %A_LoopFileFullPath%
anzVerz := anzVerz+1
ToolTip, Lade Daten...Bitte kurz warten`nVerzeichnis %anzVerz%
P1 := TV_Add(A_LoopFileName, ProjektListe, "Icon4")
loop, Files, %A_LoopFileFullPath%\*.*, D
{
P2 := TV_Add(A_LoopFileName, P1, "Icon4")
loop, Files, %A_LoopFileFullPath%\*.*, D
{
P3 := TV_Add(A_LoopFileName, P2)
}
}
}
GuiControl, +redraw, ProjektListe
ToolTip
}
if A_GuiEvent = DoubleClick
{
LV_GetText(KundeGeklickt, A_EventInfo, 1)
If KundeGeklickt =
return
geklickt = %A_guiEvent%
ZeileNum = %A_EventInfo%
msgbox A_GuiEvent: %A_GuiEvent% / %KundeGeklickt%
Gui, TreeView, ProjektListe
GuiControl, -redraw, ProjektListe
TV_Delete(ProjektListe)
anzVerz := 0
Loop, Files, %PfadDaten%%PfadAnfragen%\%KundeGeklickt%\*.*, D
{
anzVerz := anzVerz+1
ToolTip, Lade Daten...Bitte kurz warten`nVerzeichnis %anzVerz%
P1 := TV_Add(A_LoopFileName, ProjektListe, "Icon4")
loop, Files, %A_LoopFileFullPath%\*.*, D
{
P2 := TV_Add(A_LoopFileName, P1, "Icon4")
loop, Files, %A_LoopFileFullPath%\*.*, D
{
P3 := TV_Add(A_LoopFileName, P2)
}
}
}
GuiControl, +redraw, ProjektListe
ToolTip
}
TVAnfrClick:
Gui, 5:submit, nohide
if (A_GuiEvent = "S")
{
if A_EventInfo =
return
VerzName2 =
VerzName3 =
PfadAnfrageKlick := ""
ItemText := ""
Gui, TreeView, ProjektListe
IdVorher := 0
Loop
{
If A_Index = 1
{
TV_GetText(ItemText, A_EventInfo)
PfadAnfrageKlick := "\" ItemText PfadAnfrageKlick
IdVorher := TV_GetParent(A_EventInfo)
TV_GetText(ItemText, IdVorher)
PfadAnfrageKlick := "\" ItemText PfadAnfrageKlick
}
If A_Index > 1
{
IdVorher := TV_GetParent(IdVorher)
TV_GetText(ItemText, IdVorher)
PfadAnfrageKlick := "\" ItemText PfadAnfrageKlick
}
if not IdVorher
break
stringreplace, PfadAnfrageKlick, PfadAnfrageKlick, \\, \
}
stringreplace, PfadAnfrageKlick, PfadAnfrageKlick, \\, \
TV_GetText(VerzName3, A_EventInfo)
ProjektDateiListeT := ""
Loop, Files, %PfadDaten%%PfadAnfragen%\%KundeGeklickt%\%PfadAnfrageKlick%\*.*
{
ProjektDateiListeT := ProjektDateiListeT "|" A_LoopFileName
}
GuiControl, -Redraw, ProjektDateiListe
GuiControl, ,ProjektDateiListe, |
GuiControl, ,ProjektDateiListe, %ProjektDateiListeT%
GuiControl, +Redraw, ProjektDateiListe
}
return
TVAnfrClickDatei:
Gui, 5:submit, nohide
if (A_GuiEvent = "DoubleClick")
{
run, %PfadDaten%%PfadAnfragen%\%KundeGeklickt%\%PfadAnfrageKlick%\%ProjektDateiListe%
}
return