Hallo,
ich habe nach langer Zeit mal wieder angefangen etwas zu proggen. Dabei habe ich ein Problem.
Ich verwendet die Funktion GUICtrlCreateEdit () und fülle mit GUICtrlSetData() Text in das Feld ein.
Irgendwann paßt dort leider kein Text mehr rein ... nach ca. 100 Verzeichnissnamen und Dateinamen wird einfach nichts mehr angezeigt.
Eigentlich wollte ich nur einen Darstellungsbereich haben, in dem man sehen kann, was gerade abgearbeitet wird.
Ich habe gedacht, das Edit-Control arbeitet nach FiFo-Prinzip (First-In - First-Out), so das man immer Text an das Edit-Control übergeben kann.
Oder benutz ich das Falsche Control ? Wie kann ich das so realisieren, das unendlich viel Text angezeigt wird ?
Ich wollte das in $Edit1 und im $Edit2 - Contol verwenden.
Kann mir da jemand einen Tip geben ?
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
Global $i, $hDatei, $strQuellVerz, $strZielVerz
#Region ### START Koda GUI section ### Form=c:\program files (x86)\autoit3\scite\koda\forms\fileserver - form1.kxf
$Form1_1 = GUICreate("FileServer (ver 0.2)", 963, 661, 468, 228)
$Group1 = GUICtrlCreateGroup("Prpgramm zum kopieren von Zeichnungen in die Dokumentenverwaltung", 8, 8, 945, 641)
$Group2 = GUICtrlCreateGroup("Quellverzeichnis", 16, 32, 929, 49)
$Label1 = GUICtrlCreateLabel("Quelle :", 24, 56, 40, 17)
$Button5 = GUICtrlCreateButton("...", 896, 48, 35, 25)
$Input1 = GUICtrlCreateInput("", 72, 52, 801, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Info zu Quellverzeichnis", 16, 88, 929, 161)
$Edit1 = GUICtrlCreateEdit("", 24, 104, 913, 137, $ES_AUTOVSCROLL + $WS_VSCROLL)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group5 = GUICtrlCreateGroup("Info zu Zielverzeichnis", 16, 312, 929, 161)
$Edit2 = GUICtrlCreateEdit("", 24, 328, 913, 137)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group6 = GUICtrlCreateGroup("Status", 16, 480, 929, 129)
$Edit3 = GUICtrlCreateEdit("", 24, 496, 913, 97)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Dateiendungen editieren", 40, 616, 163, 25)
$Button2 = GUICtrlCreateButton("Kopiervorgang starten", 232, 616, 147, 25)
$Button3 = GUICtrlCreateButton("Hilfe", 416, 616, 75, 25)
$Button4 = GUICtrlCreateButton("Beenden", 864, 616, 75, 25)
$Group4 = GUICtrlCreateGroup("Zielverzeichnis", 16, 256, 929, 49)
$Label2 = GUICtrlCreateLabel("Ziel :", 24, 280, 27, 17)
$Button6 = GUICtrlCreateButton("...", 896, 272, 35, 25)
$Input2 = GUICtrlCreateInput("", 56, 276, 817, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
InitStart()
GUICtrlSetData($Input1, $strQuellVerz, $strQuellVerz)
GUICtrlSetData($Input2, $strZielVerz, $strZielVerz)
ViewInfosVerz($strQuellVerz, $Edit1, TRUE)
ViewInfosVerz($strZielVerz, $Edit2, FALSE)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ProgrammEnde()
Exit
Case $Button1 ; Dateiendungen editieren
MsgBox(0, "Meldung"," Die Funktion steht noch nicht zur Verfügung.")
Case $Button2 ; Kopiervorgang starten
Case $Button3 ; Hilfe
Case $Button4 ; Beenden
ProgrammEnde()
Case $Button5 ; QuellVerz auswählen
$strQuellVerz = _FileSelectFile("Quellverzeichnis auswählen", $strQuellVerz)
GUICtrlSetData($Input1, "")
GUICtrlSetData($Input1, $strQuellVerz, $strQuellVerz)
ViewInfosVerz($strQuellVerz, $Edit1, TRUE)
Case $Button6 ; ZielVerz auswählen
$strZielVerz = FileSelectFolder("Zielverzeichnis auswählen", $strZielVerz)
GUICtrlSetData($Input2, "")
GUICtrlSetData($Input2, $strZielVerz, $strZielVerz)
EndSwitch
WEnd
Func _FileSelectFile($strUeberschrift, $strPath)
Local $strPath_l, $array_l, $strSelectedFile_l, $strText, $i
$strSelectedFile_l = FileSaveDialog($strUeberschrift, $strPath, "Dateien (*.pdf;*.dwg;*.dxf)", 2)
; Option 2 = Dialog wird solange wiederholt, bis ein gültiger Pfad bzw. eine gültige Datei ausgewählt wurde.
If @error Then
MsgBox(4096, "", "Vorgang abgebrochen.", 1)
Else
$array_l = StringSplit($strSelectedFile_l, "\")
;$strPath_l = $strPath_l & "$array_l[0] : <" & $array_l[0] & ">" & @CRLF
;$strPath_l = $strPath_l & "$array_l[1] : <" & $array_l[1] & ">" & @CRLF
;$strPath_l = $strPath_l & "$array_l[2] : <" & $array_l[2] & ">" & @CRLF
;$strPath_l = $strPath_l & "$array_l[3] : <" & $array_l[3] & ">" & @CRLF
;$strPath_l = $strPath_l & "$array_l[4] : <" & $array_l[4] & ">" & @CRLF
;$strPath_l = $strPath_l & "$array_l[5] : <" & $array_l[5] & ">" & @CRLF
;$strPath_l = $strPath_l & "$array_l[6] : <" & $array_l[6] & ">" & @CRLF
;$strText = $strPath_l
;MsgBox(4096, "", $strText)
$strPath_l = ""
For $i = 1 To $array_l[0] - 1
$strPath_l = $strPath_l & $array_l[$i] & "\"
Next
$strPath_l = StringLeft($strPath_l, StringLen($strPath_l) - 1)
;MsgBox(4096, "", $strPath_l)
EndIf
Return $strPath_l
EndFunc
Func ViewInfosVerz($strPath, $hFenster, $boShow)
Local $strSuchen_l, $strFile_l, $strAttrib_l
Local $liAnzPDF_l, $liAnzDWG_l, $liAnzDXF_l
$liAnzPDF_l = 0
$liAnzDWG_l = 0
$liAnzDXF_l = 0
;MsgBox(0, "Meldung", "$strQuellVerz : " & $strQuellVerz & @CRLF & @CR & "$strZielVerz : " & $strZielVerz & @CRLF & @CR)
If NOT FileExists($strPath) Then
MsgBox(4096, "Fehler", "Verzeichnis " & $strPath & " nicht erreichbar !" & @CRLF & @CR & "Programm wird beendet !")
ProgrammEnde()
Exit
EndIf
GUICtrlSetData($Edit3, "Verzeichnis " & $strPath & " vorhanden." & @CRLF, 1)
GUICtrlSetData($Edit3, "lese Verzeichnisstruktur ein ... " & @CRLF, 1)
$strSuchen_l = FileFindFirstFile($strPath & "\*.*")
If $strSuchen_l = -1 Then
GUICtrlSetData($Edit3, "keine Unterverzeichnisse zu " & $strPath & " gefunden ... " & @CRLF, 1)
Else
While 1
$strFile_l = FileFindNextFile($strSuchen_l)
If @error Then
ExitLoop
EndIf
GUICtrlSetData($hFenster, $strPath & "\" & $strFile_l & @CRLF, 1)
If StringInStr($strFile_l, ".pdf") Then
$liAnzPDF_l = $liAnzPDF_l + 1
EndIf
If StringInStr($strFile_l, ".dwg") Then
$liAnzDWG_l = $liAnzDWG_l + 1
EndIf
If StringInStr($strFile_l, ".dxf") Then
$liAnzDXF_l = $liAnzDXF_l + 1
EndIf
MsgBox(4096, "", "<" & $strFile_l & ">")
WEnd
EndIf
If $boShow = TRUE Then
GUICtrlSetData($Edit3, "pdf-Datein : " & $liAnzPDF_l & @CRLF, 1)
GUICtrlSetData($Edit3, "dwg-Datein : " & $liAnzDWG_l & @CRLF, 1)
GUICtrlSetData($Edit3, "dxf-Datein : " & $liAnzDXF_l & @CRLF, 1)
EndIf
EndFunc
Func ProgrammEnde()
$hDatei = FileOpen("FileServer.ini", 2)
FileWriteLine($hDatei, $strQuellVerz & @CRLF)
FileWriteLine($hDatei, $strZielVerz & @CRLF)
FileClose($hDatei)
Exit
EndFunc
Func InitStart()
If FileExists("FileServer.ini") Then
$hDatei = FileOpen("FileServer.ini", 0)
If $hDatei = -1 Then
MsgBox(0, "Fehler", "Die Datei konnte nicht geöffnet werden.")
FileClose($hDatei)
Exit
EndIf
$strQuellVerz = FileReadLine($hDatei)
$strZielVerz = FileReadLine($hDatei)
FileClose($hDatei)
Else
$strQuellVerz = @WorkingDir
$strZielVerz = "\\dc1\Dokumentenverwaltung\Fertigung"
$hDatei = FileOpen("FileServer.ini", 2)
FileWriteLine($hDatei, $strQuellVerz & @CRLF)
FileWriteLine($hDatei, $strZielVerz & @CRLF)
FileClose($hDatei)
EndIf
EndFunc
Alles anzeigen