Controls lassen sich nicht verstecken

  • Hallo Community

    Ich steh vor einem Rätsel.
    In manchen GUIs lassen sich die Controls verstecken, warum nicht in diesem:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <Process.au3>
    #include <File.au3>

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

    $exe = "CMD.EXE"
    $indir = "C:\TEMP"
    $outfile = "C:\TEST.ISO"
    $fsinmb = "5000"
    $savdrv = "C:"
    $fspace = 10000
    $isofertig = 4900

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

    Example()
    Local $outfile, $isofertig, $isoaktuell, $command, $exe, $delete, $indir, $fsinmb, $space, $savdrv, $fspace, $PID ;
    Sleep(5000)
    Func Example()
    Local $progressbar1, $button, $wait, $s, $msg, $m, $percent, $outsizeupd, $fs, $wtwf, $PID, $elc, $aved, $aved2, $GUI_HIDE
    $PID = ProcessExists($exe)
    ;----------------------------------------
    $delete = FileExists($outfile)
    If $delete = 1 Then ; file exists
    $fs = "YES"
    $elc = "0x66FF33"
    Else
    $fs = "NO"
    $elc = "0xFF0000"
    EndIf
    ;----------------------------------------
    GUICreate("MKISOFS - PreMastering - 90330", 660, 260, 50, 500) ; erstellt GUI-Fenster so groß wie DOS-Box
    $button = GUICtrlCreateButton("START", 20, 210, 80, 30) ; erstellt START-Button ; ID = 3
    GUICtrlSetState (-1, $GUI_HIDE)
    GUICtrlSetState (3, $GUI_HIDE)
    GuiCtrlSetBkColor(-1, 0xFFFF00) ; gelb
    GUICtrlCreateLabel("Input: ", 20, 15) ; ID = 4
    GUICtrlSetState (-1, $GUI_HIDE)
    GUICtrlCreateInput($indir, 60, 13, 350, 15) ; ID = 5
    GUICtrlSetState (-1, $GUI_HIDE)
    GUICtrlCreateLabel("Output: ", 20, 45) ; ID = 6
    GUICtrlSetState (-1, $GUI_HIDE)
    GUICtrlCreateInput($outfile, 60, 43, 350, 15) ; ID = 7
    GUICtrlCreateLabel("File exists: ", 560, 45) ; ID = 8
    GUICtrlCreateInput($fs, 615, 43, 30, 15) ; ID = 9
    GuiCtrlSetBkColor(9, $elc)
    $progressbar1 = GUICtrlCreateProgress(10, 80, 640, 20) ; ID = 10 ; Fortschrittsbalken

    GUISetState(@SW_SHOW) ; startet die GUI
    $m = GUIGetMsg()
    If $msg = $button Then GUICtrlSetState (-1, $GUI_HIDE)
    EndFunc ;==>Example

    [/autoit]


    Kann ich diese Abfrage als Funktion formulieren:

    [autoit]

    $delete = FileExists($outfile)
    If $delete = 1 Then ; file exists
    $fs = "YES"
    $elc = "0x66FF33"
    Else
    $fs = "NO"
    $elc = "0xFF0000"
    EndIf

    [/autoit]


    Bin dankbar für jeden Hinweis.
    Gruß M.

    Einmal editiert, zuletzt von Macrostop (1. April 2009 um 23:10)

    • Offizieller Beitrag

    Zu deinem 1.Problem , nehme mal $GUI_HIDE aus deiner Variablendeklaration . Du überschreibst den Wert von $GUI_HIDE wenn du ihn in der Function als Local deklarierst.

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <Process.au3>
    #include <File.au3>

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

    $exe = "CMD.EXE"
    $indir = "C:\TEMP"
    $outfile = "C:\TEST.ISO"
    $fsinmb = "5000"
    $savdrv = "C:"
    $fspace = 10000
    $isofertig = 4900

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

    Example()
    Local $outfile, $isofertig, $isoaktuell, $command, $exe, $delete, $indir, $fsinmb, $space, $savdrv, $fspace, $PID ;
    Sleep(5000)
    Func Example()
    Local $progressbar1, $button, $wait, $s, $msg, $m, $percent, $outsizeupd, $fs, $wtwf, $PID, $elc, $aved, $aved2
    $PID = ProcessExists($exe)
    ;----------------------------------------
    $delete = FileExists($outfile)
    If $delete = 1 Then ; file exists
    $fs = "YES"
    $elc = "0x66FF33"
    Else
    $fs = "NO"
    $elc = "0xFF0000"
    EndIf
    ;----------------------------------------
    GUICreate("MKISOFS - PreMastering - 90330", 660, 260, 50, 500) ; erstellt GUI-Fenster so groß wie DOS-Box
    $button = GUICtrlCreateButton("START", 20, 210, 80, 30)
    GUICtrlSetState (-1, $GUI_HIDE)
    GuiCtrlSetBkColor(-1, 0xFFFF00) ; gelb
    GUICtrlCreateLabel("Input: ", 20, 15) ; ID = 4
    GUICtrlSetState (-1, $GUI_HIDE)
    GUICtrlCreateInput($indir, 60, 13, 350, 15) ; ID = 5
    GUICtrlSetState (-1, $GUI_HIDE)
    GUICtrlCreateLabel("Output: ", 20, 45) ; ID = 6
    GUICtrlSetState (-1, $GUI_HIDE)
    GUICtrlCreateInput($outfile, 60, 43, 350, 15) ; ID = 7
    GUICtrlCreateLabel("File exists: ", 560, 45) ; ID = 8
    GUICtrlCreateInput($fs, 615, 43, 30, 15) ; ID = 9
    GuiCtrlSetBkColor(9, $elc)
    $progressbar1 = GUICtrlCreateProgress(10, 80, 640, 20) ; ID = 10 ; Fortschrittsbalken

    GUISetState(@SW_SHOW) ; startet die GUI
    $m = GUIGetMsg()
    If $msg = $button Then GUICtrlSetState (-1, $GUI_HIDE)
    EndFunc ;==>Example

    [/autoit]
  • solange du die dort verwendeten variablen global deklarierst sollte das gehen,
    anderenfalls glaub ich nicht

    ABER -> probiers doch aus ^^ mehr als ein fehler in der console kann nicht passieren ;)