1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. Njahs

Beiträge von Njahs

  • Funktion in While schleife einfügen

    • Njahs
    • 29. September 2011 um 18:35
    Zitat von i2c

    Die Anzahl der GUIs ist doch irrelevant:

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    Opt("GUIOnEventMode", 1)

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

    $gui1 = GUICreate("GUI-1", 259, 46)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
    $Button1 = GUICtrlCreateButton("zu GUI-1", 8, 8, 75, 25, $WS_GROUP)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $Button2 = GUICtrlCreateButton("zu GUI-2", 88, 8, 75, 25, $WS_GROUP)
    GUICtrlSetOnEvent(-1, "_show2")
    $Button3 = GUICtrlCreateButton("zu GUI-3", 168, 8, 75, 25, $WS_GROUP)
    GUICtrlSetOnEvent(-1, "_show3")
    GUISetState(@SW_SHOW)

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

    $gui2 = GUICreate("GUI-2", 259, 46)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
    $Button1 = GUICtrlCreateButton("zu GUI-1", 8, 8, 75, 25, $WS_GROUP)
    GUICtrlSetOnEvent(-1, "_show1")
    $Button2 = GUICtrlCreateButton("zu GUI-2", 88, 8, 75, 25, $WS_GROUP)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $Button3 = GUICtrlCreateButton("zu GUI-3", 168, 8, 75, 25, $WS_GROUP)
    GUICtrlSetOnEvent(-1, "_show3")
    GUISetState(@SW_HIDE)

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

    $gui3 = GUICreate("GUI-3", 259, 46)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
    $Button1 = GUICtrlCreateButton("zu GUI-1", 8, 8, 75, 25, $WS_GROUP)
    GUICtrlSetOnEvent(-1, "_show1")
    $Button2 = GUICtrlCreateButton("zu GUI-2", 88, 8, 75, 25, $WS_GROUP)
    GUICtrlSetOnEvent(-1, "_show2")
    $Button3 = GUICtrlCreateButton("zu GUI-3", 168, 8, 75, 25, $WS_GROUP)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_HIDE)

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

    While 1
    Sleep(100)
    WEnd

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

    Func _show1()
    GUISetState(@SW_HIDE, $gui2)
    GUISetState(@SW_HIDE, $gui3)
    GUISetState(@SW_SHOW, $gui1)
    EndFunc ;==>_show1

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

    Func _show2()
    GUISetState(@SW_HIDE, $gui1)
    GUISetState(@SW_HIDE, $gui3)
    GUISetState(@SW_SHOW, $gui2)
    EndFunc ;==>_show2

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

    Func _show3()
    GUISetState(@SW_HIDE, $gui1)
    GUISetState(@SW_HIDE, $gui2)
    GUISetState(@SW_SHOW, $gui3)
    EndFunc ;==>_show3

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

    Func _exit()
    Exit
    EndFunc ;==>_exit

    [/autoit]
    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    $gui1 = GUICreate("GUI-1", 259, 46)
    $Button1_1 = GUICtrlCreateButton("zu GUI-1", 8, 8, 75, 25, $WS_GROUP)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $Button2_1 = GUICtrlCreateButton("zu GUI-2", 88, 8, 75, 25, $WS_GROUP)
    $Button3_1 = GUICtrlCreateButton("zu GUI-3", 168, 8, 75, 25, $WS_GROUP)
    GUISetState(@SW_SHOW)

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

    $gui2 = GUICreate("GUI-2", 259, 46)
    $Button1_2 = GUICtrlCreateButton("zu GUI-1", 8, 8, 75, 25, $WS_GROUP)
    $Button2_2 = GUICtrlCreateButton("zu GUI-2", 88, 8, 75, 25, $WS_GROUP)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $Button3_2 = GUICtrlCreateButton("zu GUI-3", 168, 8, 75, 25, $WS_GROUP)
    GUISetState(@SW_HIDE)

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

    $gui3 = GUICreate("GUI-3", 259, 46)
    $Button1_3 = GUICtrlCreateButton("zu GUI-1", 8, 8, 75, 25, $WS_GROUP)
    $Button2_3 = GUICtrlCreateButton("zu GUI-2", 88, 8, 75, 25, $WS_GROUP)
    $Button3_3 = GUICtrlCreateButton("zu GUI-3", 168, 8, 75, 25, $WS_GROUP)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_HIDE)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button2_1
    GUISetState(@SW_HIDE, $gui1)
    GUISetState(@SW_SHOW, $gui2)
    Case $Button3_1
    GUISetState(@SW_HIDE, $gui1)
    GUISetState(@SW_SHOW, $gui3)
    Case $Button1_2
    GUISetState(@SW_HIDE, $gui2)
    GUISetState(@SW_SHOW, $gui1)
    Case $Button3_2
    GUISetState(@SW_HIDE, $gui2)
    GUISetState(@SW_SHOW, $gui3)
    Case $Button1_3
    GUISetState(@SW_HIDE, $gui3)
    GUISetState(@SW_SHOW, $gui1)
    Case $Button2_3
    GUISetState(@SW_HIDE, $gui3)
    GUISetState(@SW_SHOW, $gui2)
    EndSwitch
    WEnd

    [/autoit]
    Alles anzeigen

    *schmunzel* daaaaaaanke!

    Danke auch dir , Schnitzel!

  • Funktion in While schleife einfügen

    • Njahs
    • 29. September 2011 um 17:56
    Zitat von cashmoney

    kannst auch mit case arbeiten.
    also

    case $button1
    anweiseung

    case $button2
    anweisung

    und so weiter

    den genauen syntax hab ich grad nicht im kopf, aber so hab ich auch mein programm gemanaged.

    Ich weiß jez nicht was du genau meinst , aber danke trotzdem :D

    Schnitzel , hab jez durchgeblickt , aber nur für 2 GUI´s , aber die 3. ? 4. ?

  • Funktion in While schleife einfügen

    • Njahs
    • 29. September 2011 um 17:24
    Zitat von Mattthias

    nee das man es in pvp in [code=php] setzt is klar
    autoit-tag = syntax highlighting im browser, also statt [code=php] eben [autoit]

    oki danke :D

    Btw. mit deiner Methode komme ich nicht klar , Schnitzel...

  • Funktion in While schleife einfügen

    • Njahs
    • 29. September 2011 um 15:55
    Zitat von Schnitzel

    Du hast noch nicht viel mit autoit gemacht oder?
    Hier ein Beispiel wie man am besten mit mehreren GUI's umgeht.
    Alles andere (also dynamisch neue Fenster erzeugen) führt bei den meisten ins Chaos.
    [ offen ] 2 GUI Fenster in einem script

    Erweitere das Script einfach nach dem vorgegebenen Muster um deine Fenster

    Kann ich auch machen , aber ich habe nicht viel lust wieder alles neu zu machen...
    Geht es denn auch mit meiner Methode? (also die Funktion)

  • Funktion in While schleife einfügen

    • Njahs
    • 29. September 2011 um 15:10
    Zitat von Mattthias

    wies ausschaut kommst du von ePvP
    hier gibts [autoit ] tags .


    ach mist hatte vergessen das mit dem elitepvper zu entfernen , sry für die fremdwerbung :D

    Was meinst du mit [autoIT] tags?

    Edit:// Ah du meinst das :D ... naja bin noch neu hier...

  • Funktion in While schleife einfügen

    • Njahs
    • 29. September 2011 um 14:43

    Guten tag liebe coder freunde :D

    Habe vor genau 4 Tagen mit AutoIT angefangen , also noch ein anfänger ,
    und hatte mir vorgenommen , ein Multitool zu "programmieren".

    Meine erste version funktioniert einwandfrei , doch diese enthilt nur msgbox und inputbox...
    Also habe ich mich an eine GUI drangesetzt.
    Die Gui steht , aber ich weiss nicht , wie ich die funktionen einbauen soll.

    [autoit]

    #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> $Form1 = GUICreate("Menue", 367, 250, 250, 150)
    GUICtrlCreateList ("Version 0.1", 150, 40, 60, 80)
    $a = GUICtrlCreateButton("Autoklicker", 30, 120, 60, 25)
    GUISetState(@SW_SHOW)
    $panic = GUICtrlCreateButton("Panicmode", 150, 120, 60, 25)
    GUISetState(@SW_SHOW)
    $plbutton = GUICtrlCreateButton("Platzhalter", 270, 120, 60, 25)
    GUISetState(@SW_SHOW)
    $menu2 = GUICtrlCreateButton("Seite 2", 150, 170, 60, 25)
    GUISetState(@SW_SHOW)

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

    $nMsg = GUIGetMsg()

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

    HotKeySet ("^!d", "funktion")

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

    Func funktion()
    Exit
    EndFunc

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

    While 1
    $nMsg = GUIGetMsg()
    if $nMsg=$GUI_EVENT_CLOSE then msgbox (48, "Zugriff verweigert","Ihnen wurde der Zugriff zu diesem Programm verweigert , da es von einer anderen Person benutzt wird.")

    if $nMsg=$a Then

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

    $ak = GUICreate("Autoklicker", 367, 250, 250, 150)
    GUICtrlCreateList ("Version 0.1", 150, 40, 60, 80)
    $akC = GUICtrlCreateButton("Creative", 150, 120, 60, 25)
    GUISetState(@SW_SHOW)
    $akS = GUICtrlCreateButton("Survival", 150, 170, 60, 25)
    GUISetState(@SW_SHOW)
    GuiDelete ( $Form1)
    Endif

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

    if $nMsg=$panic Then

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

    $pm = GUICreate("Panic Mode", 367, 250, 250, 150)
    GUICtrlCreateList ("Version 0.1", 150, 40, 60, 80)
    $pEasy = GUICtrlCreateButton("Easy", 150, 120, 60, 25)
    GUISetState(@SW_SHOW)
    $pHard = GUICtrlCreateButton("Hard", 150, 170, 60, 25)
    GUISetState(@SW_SHOW)
    GuiDelete ( $Form1)
    Endif

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

    if $nMsg=$plbutton Then

    $x = GUICreate("----", 367, 250, 250, 150)
    GUICtrlCreateList ("Version 0.1", 150, 40, 60, 80)
    GuiDelete ( $Form1)
    Endif

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

    if $nMsg=$menu2 Then

    $s2 = GUICreate("Menue S.2", 367, 250, 250, 150)
    GUICtrlCreateList ("Version 0.1", 150, 40, 60, 80)
    $plbutton3 = GUICtrlCreateButton("Platzhalter", 30, 120, 60, 25)
    GUISetState(@SW_SHOW)
    $plbutton4 = GUICtrlCreateButton("Platzhalter", 150, 120, 60, 25)
    GUISetState(@SW_SHOW)
    $plbutton5 = GUICtrlCreateButton("Platzhalter", 270, 120, 60, 25)
    GUISetState(@SW_SHOW)
    $credits = GUICtrlCreateButton("Credits", 150, 170, 60, 25)
    GUISetState(@SW_SHOW)
    GuiDelete ( $Form1)

    Endif
    WEnd

    [/autoit]

    So , nun will ich z.b.

    [autoit]

    If $nMsg=$credits Then
    GuiDelete ( $s2)
    Msgbox (48, "Credits", "Credits gehen zu: xxx @xxx.de")
    Endif

    [/autoit]


    Als ausgabe haben , wenn man den button $credits drückt , doch wenn ich dies in die While schleife einfüge , kommt , wenn ich auf den Button drücke , nichts...

    Danke schonmal im Vorraus!

    Mfg Njahs

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™