InputBox -Abfrage ersetzen /GUI

  • Hallo, ich habe ein Problem .
    Mein Prog. funzt soweit nun möchte ich nur noch meine 6! InputBox Abfragen vor dem Programmstart durch ein Kleines GUI ersetzen.
    Jedoch komme ich auf keinen "grünen Ast"!
    Der Speicherort soll mittels "Browse" gewählt werden können.
    Als $drive sollten nur verfügbare Laufwerke angesprochen werden können.
    Ist es möglich die verfügbaren COM ports abzufragen? Sonnst müsste man von COM 1 bis COM 20 auswählen können, da Windows Ständig neue Comport anlegt (USB/Com -Adapter Nutzung)

    Und wie kann ich bei KODA einen Text einfügen um z.B die Eingaben zu beschreiben "Speicherort: " ??

    Vielen Dank für EURE Hilfe!

    [autoit]

    #include <GUIConstants.au3>

    [/autoit][autoit][/autoit][autoit]

    #Region ### START Koda GUI section ###
    $Form1 = GUICreate("Setup", 539, 366, 222, 245)
    $Path = GUICtrlCreateCombo("Path", 40, 64, 153, 25)
    $Browse = GUICtrlCreateButton("Browse", 208, 64, 65, 25, 0)
    $Drive = GUICtrlCreateCombo("Drive", 336, 64, 153, 25)
    $Comport = GUICtrlCreateCombo("Comport", 40, 120, 153, 25)
    $Radio_Full = GUICtrlCreateRadio("Full", 48, 240, 113, 17)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    $Radio_Menu = GUICtrlCreateRadio("Menu", 48, 176, 113, 17)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    $Radio_Main = GUICtrlCreateRadio("Main", 48, 208, 113, 17)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    $OK = GUICtrlCreateButton("OK", 296, 280, 105, 41, 0)
    $Anzahl = GUICtrlCreateInput("Anzahl", 336, 120, 153, 21)
    $Time = GUICtrlCreateInput("Time", 336, 176, 153, 21)
    $Abbrechen = GUICtrlCreateButton("Abbrechen", 128, 280, 105, 41, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit][autoit][/autoit][autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit][autoit][/autoit][autoit]

    EndSwitch
    WEnd

    [/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]

    MsgBox(4096,"Programminfo","ROBOTIC" &@CRLF& "Automatic DVD Ripper" &@CRLF& "Version" &@CRLF& "v1.08",10)
    $drive=InputBox("ROBOTIC LAUFWERK","Bitte Laufwerksbuchstaben eingeben","E:")
    $path=InputBox("Pfad","Bitte Speicherort eingeben. ","C:\")
    $funktion=InputBox("Ripping Settings","Wie soll die DVD gerippt werden?" &@CRLF& "/MAIN /MENU /FULL","/MAIN")
    $Comport=InputBox("ROBOTIC COMPORT","Bitte Comport der Robotic eingeben.","COM2")
    $Anzahl=InputBox("Anzahl der Discs","Wieviele Disc´s sollen verarbeitet werden?","1")
    $Zeit=InputBox("Disc Ready","Zeit für Disc Ready [Sekunden] ","25")
    $Version=('V:X:30:2:E');Robotic Version Info Command
    $Calibration=('C:X:30:2:E');Calibration Command
    $Load=('I:X:30:2:E');Get Input (load) Command
    $Unload=('A:X:30:2:E');Unload the Drive Command
    HotKeySet("{ESC}","_exit")
    Global $iCount = 1

    [/autoit]


    Gruß
    Bastian

  • "Automatic DVD Ripper". Ich bin mir nicht sicher, ob ich das unterstützen möchte

    Wer genung Zeit hat kann seine Sammlung auch per Hand einlesen. ;(

    Daran ist nicht verwerflich !!


    Gruß

  • So ungefähr?

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    #region ### START Koda GUI section ###
    $Form1 = GUICreate("Setup", 539, 366, 222, 245)
    $Path = GUICtrlCreateInput("Path", 40, 64, 153, 25)
    $Browse = GUICtrlCreateButton("Browse", 208, 64, 65, 25, 0)
    $Drive = GUICtrlCreateCombo("", 336, 64, 153, 25)
    $Comport = GUICtrlCreateCombo("COM", 40, 120, 153, 25)
    $Radio_Full = GUICtrlCreateRadio("Full", 48, 240, 113, 17)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    $Radio_Menu = GUICtrlCreateRadio("Menu", 48, 176, 113, 17)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    $Radio_Main = GUICtrlCreateRadio("Main", 48, 208, 113, 17)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    $OK = GUICtrlCreateButton("OK", 296, 280, 105, 41, 0)
    $Anzahl = GUICtrlCreateInput("Anzahl", 336, 120, 153, 21)
    $Time = GUICtrlCreateInput("Time", 336, 176, 153, 21)
    $Abbrechen = GUICtrlCreateButton("Abbrechen", 128, 280, 105, 41, 0)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlSetData($Drive, _GetDrives())
    For $i = 1 To 20
    $sCom &= $i & "|"
    GUICtrlSetData($Comport, $sCom)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE, $Abbrechen
    Exit
    Case $Browse
    GUICtrlSetData($Path, FileSaveDialog("Pfad auswählen", @ScriptDir, "All (*.*)", 18))
    Case $Radio_Full
    $sFunktion = "/FULL"
    Case $Radio_Menu
    $sFunktion = "/MENU"
    Case $Radio_Main
    $sFunktion = "/MAIN"
    Case $OK
    $sDrive = GUICtrlRead($Drive)
    $sPath = GUICtrlRead($Path)
    $sComport = GUICtrlRead($Comport)
    $iAnzahl = GUICtrlRead($Anzahl)
    $iTime = GUICtrlRead($Time)
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _GetDrives()
    $sCD_Drives = ""
    $aDrives = DriveGetDrive("CDROM")

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 1 To $aDrives[0]
    $sCD_Drives &= StringUpper($aDrives[$i]) & "|"
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Return $sCD_Drives
    EndFunc ;==>_GetDrives

    [/autoit] [autoit][/autoit] [autoit]

    $Version = ('V:X:30:2:E');Robotic Version Info Command
    $Calibration = ('C:X:30:2:E');Calibration Command
    $Load = ('I:X:30:2:E');Get Input (load) Command
    $Unload = ('A:X:30:2:E');Unload the Drive Command
    Global $iCount = 1

    [/autoit]


    Um Texte in ein GUI zu bringen verwende Labels (GUICtrlCreateLabel) und ohne Koda lernst du sowas eher. ;)

  • Vielen Dank für deine Antwort!
    Das sieht ja schon sehr gut aus!

    Danke!

    Ich habe jedoch noch ein paar Fragen.
    Wo wird die Variable $Zeit übergeben?
    An welchen Stellen muss ich die Variablen von Comport ->comport
    Drive -> drive
    Path -> path
    Funktion -> funktion

    ändern?
    Es ist ein wenig verwirrend das die GUI Buttons fast gleich der Variablen sind die übergeben werden sollen
    Sorry!
    Warum meckert der Compiler bei : $sCom &= $i & "|" ??


    Nochmals vielen Dank!

  • Hier noch die Compilermeldung:

    $sCom &= $i & "|" < : WARNING: $sCom possibly not declared/created yet>
    '&$funktion& < WARNING: $funktion: possibly used before declaration.>
    &$funktion& <: ERROR: $funktion: undeclared global variable.>


    Gruß

  • Sag nichts gegen meinen Namen

    In nem anderen Forum heiße ich "Mattthias", und das forum heisst "Elitepvpers.de", und da habe ich mich einfach "EliteMattthias" genannt
    Mit 3t:

    2 t war bei "Matthias" (Logisch) scho vergebn, ausserdem klingt das geiler

    Der sagt dir das du die declaren musst ;)
    Woher bekommt der die variablen?

    Es gibt sehr viele Leute, die glauben. Aber aus Aberglauben.
    - Blaise Pascal

  • Zitat

    Warum meckert der Compiler bei : $sCom &= $i & "|" ??


    Ups Füg einfach vor der For Schleife noch $sCom = "" ein. :D
    Die Variablennamen kannst du doch auch ändern du hast schließlich die Handles der GUI Controls so benannt nicht ich. :rolleyes:

    Zitat

    Warum &= ?!?


    Erklärung

  • Super es funktioniert fast!
    Da hab ich doch heute Abend noch was gelernt!
    Danke!

    Bei der Angabe von dem Path kann ich momentan nur eine Datei auswählen jedoch keinen path wie z.B. " D:\" angeben.

    Wie kann ich dies noch ändern?


    Gruß
    Bastian

  • Zitat

    Bei der Angabe von dem Path kann ich momentan nur eine Datei auswählen jedoch keinen path wie z.B. " D:\" angeben.

    [autoit]

    FileSaveDialog("Pfad auswählen", @ScriptDir, "All (*.*)", 18)

    [/autoit]


    zu

    [autoit]

    FileSaveDialog("Pfad auswählen", @ScriptDir, "All (*.*)")

    [/autoit]
  • Habe den Code geändert ,
    funzt jedoch nicht. Keine Änderung, kann nur Datei auswählen
    :huh:

    Was muss ich bei dem "OK Button" noch eintragen das das Programm startet?

    [autoit]

    Case $OK
    $sDrive = GUICtrlRead($Drive)
    $sPath = GUICtrlRead($Path)
    $sComport = GUICtrlRead($Comport)
    $iAnzahl = GUICtrlRead($Anzahl)
    $iTime = GUICtrlRead($Time)
    EndSwitch
    WEnd

    [/autoit]

    DANKE!

    Gruß
    Bastian

  • Welches Programm?
    Für eine Exe nimm doch den Run Befehl. Ich kann/will übrigens nicht alles für dich machen :D.
    Dafür gibt es ja schließlich die Hilfe.
    Und nimm statt FileSaveDialog einfach

    [autoit]

    FileSelectFolder("Pfad auswählen", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")

    [/autoit]