Geht das überhaupt?
Beiträge von button421
-
-
Ok, aber dann bleibt immer noch meine Frage, wie ich dann das, was unter Falls in der rechten ListView steht, in die If im Code reinkrieg... Soll der Code sich vielleicht merken, was für eine Arraynummer von $aktionen[] merken, und alles was mehr als die gemerkte Arraynummer ist (bis Falls-Ende) in die Code-If reinschreiben?
-
Kommt schon, so schwer ist meine Erkärung doch wohl nicht zu verstehen...
-
also: es gibt links und rechts eine ListView. In der linken stehen alle möglichen Befehle zur Verfügung, die man dann per Mausklick in die rechte Skript-ListView bringen soll. Dort steht das ganze "Programm". Es gibt nun in der linken ListView, wo alle möglichen Befehle drin stehen, einen Eintrag der heißt "Falls-Schleife". Wenn man da drauf klickt, soll sich eine GUI öffnen in der man $aParam[0] ,$aParam[1] und $aParam[2] eingeben kann.
$aParam[0] = Variable hinter dem If im Code
$aParam[1] = Methode (also =,<,>,Not)
$aParam[2] = Variable hinter der MethodeKlickt man in dieser GUI auf "OK", schließt sich die GUI und in der rechten Skript-ListView soll dann der Eintrag
Falls "Eingegebener Parameter 1" Gleich, Nicht, größer als, kleiner als (Parameter 2) "Eingegebener Parameter 3" ist, dann
Falls Ende
Dabei muss im AutoIt-Code doch auch eine If sein, die das abfragt, was man festgelegt hat (Das Problemgebiet ist ab Zeile 526). Aber irgendein Befehl muss lesen, was unter dem Falls-Eintrag in der ListView steht, und zwar bis "Falls Ende". Das muss er dann wieder in einen String umwandeln, sodass AutoIt es ausführen kann.
Ich hoffe das hast du verstanden
-
Hallo Leute,
schon wieder ein Problem mit meinem SoftCreator:
ich bin jetzt grade bei der "Ausführen"-Funktion. Nicht wundern: Die Funktionen für die ListView-Einträge in der ListView links, sind noch nicht definiert. Daher die vielen Errors...Code
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <GuiStatusBar.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#Include <GuiEdit.au3>
#include <Misc.au3>
#include <Array.au3>
Opt("GUIOnEventMode",1)
;Variablendefinitionen --------------------
Global $pathcha = @ScriptDir&"\logfile.au3"
Global $pathvar = @ScriptDir&"\varfile.ini"
Global $toolwidth = 200
Global $toolheight = 200
Global $inspwidth = 500
Global $inspheight = 200
Global $toolguiname = "GUICreator"
Global $winname
Global $Winpos[4]
Global $newGUI
Global $text
Global $numbercontrol = 0
Global $control[99]
Global $conname[99]
Global $contype[99]
Global $conpos[99][4]
Global $iVarNameControl
Global $close
Global $convarname
Global $numberofcontrol
Global $genGUI
Global $farbeROT = 0xff0000
Global $farbeORANGE = 0xff9900
Global $farbeGRUEN = 0x000B200
;------------------------------------------
;Flag-Meldungstexte------------------------
Global $okmsg = "OK-Meldung"&@CRLF&"**************"&@CRLF&"0 = Knopf ""OK"""&@CRLF&"1 = Knöpfe ""OK"" und ""Abbrechen"""&@CRLF&"2 = Knöpfe ""Abbrechen"" und ""Wiederholen"" und ""Ignorieren"""&@CRLF&"3 = Knöpfe ""Ja"" und ""Nein"" und ""Abrechen"""&@CRLF&"4 = Knöpfe ""Ja"" und ""Nein"""&@CRLF&"5 = Knöpfe ""Wiederholen"" und ""Abbrechen"""&@CRLF&"6 = Knöpfe ""Abbrechen"" und ""Wiederholen"" und ""Weiter"""
Global $errmsg = "**************"&@CRLF&"Fehler-Meldung"&@CRLF&"*****************"&@CRLF&"16 = Knopf ""OK"""&@CRLF&"17 = Knöpfe ""OK"" und ""Abbrechen"""&@CRLF&"18 = Knöpfe ""Abbrechen"" und ""Wiederholen"" und ""Ignorieren"""&@CRLF&"19 = Knöpfe ""Ja"" und ""Nein"" und ""Abbrechen"""&@CRLF&"20 = Knöpfe ""Ja"" und ""Nein"""&@CRLF&"21 = Knöpfe ""Wiederholen"" und ""Abbrechen"""&@CRLF&"22 = Knöpfe ""Abbrechen"" und ""Wiederholen"" und ""Weiter"""
Global $askmsg = "*****************"&@CRLF&"Frage-Meldung"&@CRLF&"*****************"&@CRLF&"32 = Knopf ""OK"""&@CRLF&"33 = Knöpfe ""OK"" und ""Abbrechen"""&@CRLF&"34 = Knöpfe ""Abbrechen"" und ""Wiederholen"" und ""Ignorieren"""&@CRLF&"35 = Knöpfe ""Ja"" und ""Nein"" und ""Abbrechen"""&@CRLF&"36 = Knöpfe ""Ja und ""Nein"""&@CRLF&"37 = Knöpfe ""Wiederholen"" und ""Abbrechen"""&@CRLF&"38 = Knöpfe ""Abbrechen"" und ""Wiederholen"" und ""Weiter"""
Global $warmsg = "*****************"&@CRLF&"Warnung-Meldung"&@CRLF&"********************"&@CRLF&"48 = Knopf ""OK"""&@CRLF&"49 = Knöpfe ""OK"" und ""Abbrechen"""&@CRLF&"50 = Knöpfe ""Abbrechen"" und ""Wiederholen"" und ""Ignorieren"""&@CRLF&"51 = Knöpfe ""Ja"" und ""Nein"" und ""Abbrechen"""&@CRLF&"52 = Knöpfe ""Ja und ""Nein"""&@CRLF&"53 = Knöpfe ""Wiederholen"" und ""Abbrechen"""&@CRLF&"54 = Knöpfe ""Abbrechen"" und ""Wiederholen"" und ""Weiter"""
Global $infmsg = "Info-Meldung"&@CRLF&"***************"&@CRLF&"64 = Knopf ""OK"""&@CRLF&"65 = Knöpfe ""OK"" und ""Abbrechen"""&@CRLF&"66 = Knöpfe ""Abbrechen"" und ""Wiederholen"" und ""Ignorieren"""&@CRLF&"67 = Knöpfe ""Ja"" und ""Nein"" und ""Abbrechen"""&@CRLF&"68 = Knöpfe ""Ja und ""Nein"""&@CRLF&"69 = Knöpfe ""Wiederholen"" und ""Abbrechen"""&@CRLF&"70 = Knöpfe ""Abbrechen"" und ""Wiederholen"" und ""Weiter"""
;------------------------------------------
IniDelete($pathvar,"var")
IniDelete($pathvar,"details")
IniWrite($pathvar, "details","starting","yes")
IniWrite($pathvar, "details","starting infos",@HOUR&":"&@MIN&":"&@SEC&", "&@MDAY&"."&@MON&"."&@YEAR)
;Hauptgui-----------------------
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("SoftCreator 1.0 - Erstelle deine eigenen Windows-Anwendungen!", 623, 600, -1, -1)
$controls = GUICtrlCreateGroup("Befehle", 8, 24, 201, 470)
$comlist = GUICtrlCreateListView("Befehle", 16, 40, 185, 445)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 181)
Global $com[18]
$com[0] = GUICtrlCreateListViewItem("@error setzen", $comlist)
$com[1] = GUICtrlCreateListViewItem("Aus Datei lesen", $comlist)
$com[2] = GUICtrlCreateListViewItem("In Datei schreiben", $comlist)
$com[3] = GUICtrlCreateListViewItem("Beschriftungstext ändern", $comlist)
$com[4] = GUICtrlCreateListViewItem("Externes Programm starten", $comlist)
$com[5] = GUICtrlCreateListViewItem("Falls-Schleife", $comlist)
$com[6] = GUICtrlCreateListViewItem("Fenstertitel ändern", $comlist)
$com[7] = GUICtrlCreateListViewItem("INI-Datei lesen", $comlist)
$com[8] = GUICtrlCreateListViewItem("INI-Datei schreiben", $comlist)
$com[9] = GUICtrlCreateListViewItem("Maus zu Position schicken", $comlist)
$com[10] = GUICtrlCreateListViewItem("Mauscursor ändern", $comlist)
$com[11] = GUICtrlCreateListViewItem("Meldung anzeigen", $comlist)
$com[12] = GUICtrlCreateListViewItem("Sound abspielen", $comlist)
$com[13] = GUICtrlCreateListViewItem("Sound pausieren", $comlist)
$com[14] = GUICtrlCreateListViewItem("Sound stoppen", $comlist)
$com[15] = GUICtrlCreateListViewItem("Variable hinzufügen", $comlist)
$com[16] = GUICtrlCreateListViewItem("Warten", $comlist)
$com[17] = GUICtrlCreateListViewItem("Loop-Schleife", $comlist)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$end = GUICtrlCreateGroup("Skript", 216, 24, 401, 470)
$focuslabel = GUICtrlCreateLabel("Focus", 259, 330, 48, 16)
$script = GUICtrlCreateListView("Skript", 224, 40, 385, 445)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 381)
$script_0 = GUICtrlCreateListViewItem("//Start des Skriptes", $script)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$guicreatoropen = GUICtrlCreateButton("GUICreator öffnen", 8, 0, 105, 25, $WS_GROUP)
$msgflagsopen = GUICtrlCreateButton("Meldung-Flag-Referenz", 120, 0, 139, 25, $WS_GROUP)
$close = GUICtrlCreateButton("Beenden", 544, 0, 75, 25, $WS_GROUP)
$info = GUICtrlCreateButton("Info/Hilfe", 464, 0, 75, 25, $WS_GROUP)
$toau3 = GUICtrlCreateButton("Exportieren", 321, 0, 79, 25, $WS_GROUP)
$console = GUICtrlCreateEdit("", 8, 500, 609, 97, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL,$ES_READONLY))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetData(-1, ">Gestartet um "&@HOUR&":"&@MIN&":"&@SEC&" am "&@MDAY&"."&@MON&"."&@YEAR&@CRLF)
GUICtrlSetColor(-1, $farbeGRUEN)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###GUISetOnEvent($GUI_EVENT_CLOSE, "_cls")
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetOnEvent($close, "_cls")
GUICtrlSetOnEvent($guicreatoropen, "_open")
GUICtrlSetOnEvent($msgflagsopen, "_msgflagsopen")
;ToolGUI------------------------
Global $guicreator = GUICreate($toolguiname, $toolwidth, $toolheight, 815,5)
Global $newwinbut = guictrlcreatebutton("Neues Fenster", 0, 0, $toolwidth/2, $toolheight/5)
Global $delwinbut = guictrlcreatebutton("Fenster löschen", $toolwidth/2, 0, $toolwidth/2, $toolheight/5)
guictrlsetstate(-1, $GUI_DISABLE)
Global $newinputbut = guictrlcreatebutton("Neuer Input", 0, $toolheight/5, $toolwidth/2, $toolheight/5)
guictrlsetstate(-1, $GUI_DISABLE)
Global $newlabelbut = guictrlcreatebutton("Neuer Label", $toolwidth/2, $toolheight/5, $toolwidth/2, $toolheight/5)
guictrlsetstate(-1, $GUI_DISABLE)
Global $newbutbut = guictrlcreatebutton("Neuer Button", 0, $toolheight/5*2, $toolwidth/2, $toolheight/5)
guictrlsetstate(-1, $GUI_DISABLE)
Global $newradiobut = guictrlcreatebutton("Neuer Radiobutton", $toolwidth/2, $toolheight/5*2, $toolwidth/2, $toolheight/5)
guictrlsetstate(-1, $GUI_DISABLE)
Global $undobut = guictrlcreatebutton("Rückgängig", 0, $toolheight/5*3, $toolwidth/2, $toolheight/5)
Global $savebut = guictrlcreatebutton("Fertig", $toolwidth/2, $toolheight/5*3, $toolwidth/2, $toolheight/5)
guictrlsetstate(-1, $GUI_DISABLE)
Global $infobut = GUICtrlCreateButton("Informationen", 0, $toolheight/5*4, $toolwidth/2, $toolheight/5)
Global $exitbut = GUICtrlCreateButton("Beenden", $toolwidth/2, $toolheight/5*4, $toolwidth/2, $toolheight/5)
guisetstate(@SW_HIDE)
GUISetOnEvent($GUI_EVENT_CLOSE, "_clsguicrt")
;Inspektor-----------------------------
Global $inspektorgui = guicreate("Inspektor", $inspwidth, $inspheight, 5,5)
Global $changeslist = guictrlcreatelistview("Name|Typ|X-Koord.|Y-Koord.|Breite|Höhe", 0,0, $inspwidth, $inspheight)
Global $item = guictrlcreatelistviewitem(" | | | | | ", -1)
guisetstate(@SW_HIDE)
guisetonevent($GUI_EVENT_CLOSE, "_clsguicrt")
;Events---------------------------------
GUICtrlSetOnEvent($exitbut, "_clsguicrt")
GUICtrlSetOnEvent($newwinbut, "_testwin")
GUICtrlSetOnEvent($delwinbut, "_delwin")
GUICtrlSetOnEvent($savebut, "_saveau3")
GUICtrlSetOnEvent($newinputbut, "_newinput")
GUICtrlSetOnEvent($newbutbut, "_newbut")
GUICtrlSetOnEvent($newlabelbut, "_newlabel")
GUICtrlSetOnEvent($newradiobut, "_newradio")
GUICtrlSetOnEvent($undobut, "_undo")
GUICtrlSetOnEvent($info, "_info")
;~ GUICtrlSetOnEvent($com[0], "_com0")
;~ GUICtrlSetOnEvent($com[1], "_com1")
;~ GUICtrlSetOnEvent($com[2], "_com2")
;~ GUICtrlSetOnEvent($com[3], "_com3")
;~ GUICtrlSetOnEvent($com[4], "_com4")
;~ GUICtrlSetOnEvent($com[5], "_com5")
;~ GUICtrlSetOnEvent($com[6], "_com6")
;~ GUICtrlSetOnEvent($com[7], "_com7")
;~ GUICtrlSetOnEvent($com[8], "_com8")
;~ GUICtrlSetOnEvent($com[9], "_com9")
;~ GUICtrlSetOnEvent($com[10], "_com10")
;~ GUICtrlSetOnEvent($com[11], "_com11")
;~ GUICtrlSetOnEvent($com[12], "_com12")
;~ GUICtrlSetOnEvent($com[13], "_com13")
;~ GUICtrlSetOnEvent($com[14], "_com14")
;~ GUICtrlSetOnEvent($com[15], "_com15")
;~ GUICtrlSetOnEvent($com[16], "_com16")
;~ GUICtrlSetOnEvent($com[17], "_com17")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_cls()
Case $info
MsgBox(64,"Info/Hilfe","INFO"&@CRLF&"*****"&@CRLF&"Dieses Programm wurde mit AutoIt3 erstellt und von <button421> auf autoit.de programmiert!"&@CRLF&"HILFE"&@CRLF&"******"&@CRLF&"Einfach mit GUICreator ein Windows-Fenster zusammenbasteln und dann programmieren: Einfach Aktion und Befehle in der linken Liste auswählen! Daten eingeben und auf ""OK"" klicken! Dann ist der Befehl in der rechten Liste eingetragen!")
Case $com[0]
MsgBox(0,"","")
EndSwitch
WEndFunc _cls()
[/autoit] [autoit][/autoit] [autoit]
$questionexit = MsgBox(36, "Beenden?","Es sind noch offene Projekte aktiv! Wollen sie wirklich beenden?")
If $questionexit = 6 Then
Exit
Else
;Nix
EndIf
EndFuncFunc _open()
[/autoit] [autoit][/autoit] [autoit]
GUISetState(@SW_SHOW, $guicreator)
GUISetState(@sW_SHOW, $inspektorgui)
EndFuncFunc _clsguicrt()
[/autoit] [autoit][/autoit] [autoit]
GUISetState(@SW_HIDE, $guicreator)
GUISetState(@SW_HIDE, $inspektorgui)
GUISetState(@SW_HIDE, $newGUI)
EndFuncwhile 2
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
if _ispressed(02) then
$cmsg = GUIGetCursorInfo()
if not @error and IsArray($cmsg) Then
if winactive($winname) Then
if $cmsg[4] = 0 Then
GUICtrlSetData($item, $Winname&"|"&"GUI"&"|"&$Winpos[0]&"|"&$winpos[1]&"|"&$Winpos[2]&"|"&$Winpos[3])
EndIf
For $y = 2 to $numbercontrol
if $cmsg[0] > $conpos[$y][0] and $cmsg[0] < $conpos[$y][0]+$conpos[$y][2] and $cmsg[1] > $conpos[$y][1] and $cmsg[1] < $conpos[$y][1]+$conpos[$y][3] Then
GUICtrlSetData($item, $conname[$y]&"|"&$contype[$y]&"|"&$conpos[$y][0]&"|"&$conpos[$y][1]&"|"&$conpos[$y][2]&"|"&$conpos[$y][3])
EndIf
Next
EndIf
EndIf
Do
Until not _ispressed(02)
sleep(40)
EndIf
WEnd
Func _newinput()
_newcontrol(0)
EndFunc
Func _newbut()
_newcontrol(1)
EndFunc
Func _newlabel()
_newcontrol(2)
EndFunc
Func _newradio()
_newcontrol(3)
EndFuncFunc _gethelp()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
MsgBox(0, "Hilfe", "Zum Erstellen eines neuen Fensters einfach auf 'Neues Fenster' drücken."&@CRLF&"Dort den gewünschten Namen eingeben und das Fenster durch Bewegen mit der Maus positionieren. Anschliessend einfach klicken."&@CRLF&@TAB&"ACHTUNG: Nachfolgendes Verschieben hat keinen Effekt mehr auf die festgelegte Position!"&@CRLF&"Die Größe des Fensters durch Bewegen mit der Maus definieren. Anschliessend einfach klicken."&@CRLF&"Erst dann können die vier zur Auswahl stehenden Controls auf die gleiche Weise erstellt werden."&@CRLF&"Mit Rechtsklick auf das jeweilige Control lassen sich die Werte im Inspektor ansehen."&@CRLF&" "&@CRLF&"Wenn das GUI fertig erstellt ist, einfach auf 'Als *.au3 speichern' klicken, und den gewünschten Speicherort/namen eingeben.")
EndFunc
Func _getinfo()
if $winname <> "" Then
$infotext = ""
$infotext = $infotext&"Aktueller GUI-Titel: "&$Winname&@CRLF
$infotext = $infotext&"Anzahl der Controls: "&$numbercontrol-1&@CRLF
$infotext = $infotext&@TAB&"Einzelinformationen: "&@CRLF
for $z = 2 to $numbercontrol
$infotext = $infotext&@TAB&@TAB&$z-1&"."&@CRLF
$infotext = $infotext&@TAB&@TAB&"Name: "&$conname[$z]&@CRLF
Switch $contype[$z]
Case 0
$infotext = $infotext&@TAB&@TAB&"Typ: "&"Input"&@CRLF
Case 1
$infotext = $infotext&@TAB&@TAB&"Typ: "&"Button"&@CRLF
Case 2
$infotext = $infotext&@TAB&@TAB&"Typ: "&"Label"&@CRLF
Case 3
$infotext = $infotext&@TAB&@TAB&"Typ: "&"Radiobutton"&@CRLF
EndSwitch
$infotext = $infotext&@TAB&@TAB&"Abmessungen: X-Pos.: "&$conpos[$z][0]&" Y-Pos.: "&$conpos[$z][1]&" Länge: "&$conpos[$z][2]&" Höhe: "&$conpos[$z][3]&@CRLF
$infotext = $infotext&@TAB&@TAB&" "&@CRLF
Next
MsgBox(0, "Informationen", $infotext)
Else
MsgBox(0, "Informationen", "Noch kein Fenster erstellt.")
EndIf
EndFuncFunc _testwin()
[/autoit] [autoit][/autoit] [autoit]
if $winname <> "" Then
$del = MsgBox(4, "Altes GUI", "Altes GUI überschreiben?")
if $del = 6 then
guidelete($newGUI)
$numbercontrol = 0
_newwin()
EndIf
Else
_newwin()
EndIfEndFunc
[/autoit] [autoit][/autoit] [autoit]Func _newwin()
[/autoit] [autoit][/autoit] [autoit]
$Winname = inputbox("Neues Fenster", "1. Geben sie den Fenster-Namen ein."&@CRLF&"2. Positionieren sie das Fenster."&@CRLF&"3. Verändern sie die Größe des Fensters.")
if $Winname <> "" Then
$newGUI = GUICreate($winname, 150, 150)
GUISetOnEvent($GUI_EVENT_CLOSE, "_clsguicrt")
guisetstate()
while not _ispressed(01)
$mousepos = mousegetpos()
$winpos = wingetpos($Winname)
winmove($winname, "", $mousepos[0]-150, $mousepos[1]-170)
ToolTip($winpos[0]&"/"&$winpos[1], $mousepos[0], $mousepos[1])
sleep(40)
WEnd
$winpos = wingetpos($Winname)
while _ispressed(01)
WEnd
_MouseTrap($winpos[0]+50, $winpos[1]+10, @Desktopwidth, @Desktopheight)
while not _ispressed(01)
$mousepos = mousegetpos()
$winpos = wingetpos($Winname)
winmove($winname, "",$winpos[0], $winpos[1] , $mousepos[0]-($winpos[0]-20), $mousepos[1]-($winpos[1]-20))
ToolTip($winpos[2]&"/"&$winpos[3]-20, $mousepos[0], $mousepos[1])
sleep(40)
WEnd
_mousetrap()
ToolTip("")
$numbercontrol = 1
$winpos = wingetpos($Winname)
guictrlsetstate($delwinbut, $GUI_ENABLE)
guictrlsetstate($savebut, $GUI_ENABLE)
guictrlsetstate($newinputbut, $GUI_ENABLE)
guictrlsetstate($newlabelbut, $GUI_ENABLE)
guictrlsetstate($newbutbut, $GUI_ENABLE)
guictrlsetstate($newradiobut, $GUI_ENABLE)
Else
_removevar()
EndIf
EndFuncFunc _newcontrol($type)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$numbercontrol += 1
$convarname = InputBox("Neues Control","Geben sie den Variablennamen ein!") ;Variablenabfrage!
$conname[$numbercontrol] = inputbox("Neues Control", "1. Geben sie den Control-Namen ein."&@CRLF&"2. Positionieren sie das Control."&@CRLF&"3. Verändern sie die Größe des Controls.")
;~ IniWrite($pathvar,"var","var"&+$numberofcontrol,$convarname)
if $conname[$numbercontrol] <> "" Then
$contype[$numbercontrol] = $type
while _ispressed(01)
WEnd
$actpos = wingetpos($Winname)
mousemove($actpos[0]+$winpos[2]/2, $actpos[1]+$actpos[3]/2, 0)
switch $type
Case 0
$control[$numbercontrol] = guictrlcreateinput($conname[$numbercontrol], 0, 0, 100, 30)
Case 1
$control[$numbercontrol] = guictrlcreatebutton($conname[$numbercontrol], 0, 0, 100, 30)
Case 2
$control[$numbercontrol] = guictrlcreatelabel($conname[$numbercontrol], 0, 0, 100, 30)
Case 3
$control[$numbercontrol] = GUICtrlCreateRadio($conname[$numbercontrol], 0, 0, 100, 30)
EndSwitch
_mousetrap($actpos[0]+1, $actpos[1]+30, $actpos[0]+$actpos[2], $actpos[1]+$actpos[3])
While not _ispressed(01)
$mousepos = mousegetpos()
guictrlsetpos($control[$numbercontrol], $mousepos[0]-$actpos[0]-101, $mousepos[1]-$actpos[1]-51)
sleep(40)
WEnd
$tempconpos = controlgetpos($Winname, "", $control[$numbercontrol])
$conpos[$numbercontrol][0] = $tempconpos[0]
$conpos[$numbercontrol][1] = $tempconpos[1]
while _ispressed(01)
WEnd
_mousetrap($conpos[$numbercontrol][0]+$actpos[0]+5, $conpos[$numbercontrol][1]+$actpos[1]+30, $actpos[0]+$actpos[2], $actpos[1]+$actpos[3])
$actpos = wingetpos($Winname)
While not _ispressed(01)
$mousepos = mousegetpos()
guictrlsetpos($control[$numbercontrol], $conpos[$numbercontrol][0], $conpos[$numbercontrol][1], $mousepos[0]-($actpos[0]+$conpos[$numbercontrol][0]), $mousepos[1]-($actpos[1]+$conpos[$numbercontrol][1]+20))
sleep(40)
WEnd
_mousetrap()
$tempconpos = controlgetpos($Winname, "", $control[$numbercontrol])
$conpos[$numbercontrol][2] = $tempconpos[2]
$conpos[$numbercontrol][3] = $tempconpos[3]
Else
$numbercontrol -= 1
EndIfEndFunc
[/autoit] [autoit][/autoit] [autoit]Func _undo()
[/autoit] [autoit][/autoit] [autoit]
if $numbercontrol > 1 Then
guictrldelete($control[$numbercontrol])
$conpos[$numbercontrol][0] = ""
$conpos[$numbercontrol][1] = ""
$conpos[$numbercontrol][2] = ""
$conpos[$numbercontrol][3] = ""
$conname[$numbercontrol] = ""
$contype[$numbercontrol] = ""
$numbercontrol -= 1
Else
MsgBox(64, "SoftCreator", "Nichts zu widerrufen!")
EndIf
EndFuncFunc _saveau3()
[/autoit] [autoit][/autoit] [autoit]
guisetstate(@SW_HIDE, $guicreator)
guisetstate(@SW_HIDE, $newGUI)
$fehler = 0
$path = FileSaveDialog("Speichere *.au3...", @SCRIPTDIR&"\", "Autoit(*.au3)")
if $path <> "" Then
if stringright($path, 4) = ".au3" Then
$newfile = fileopen($path, 10)
if @error then $fehler = 1
Else
$path = $path&".au3"
$newfile = fileopen($path, 10)
if @error then $fehler = 1
EndIf
if not $fehler = 1 Then
Global $genGUI = GUICreate("Erstelle Datei...", 300, 300, -1, $WS_EX_TOPMOST)
$progress = guictrlcreateprogress(0, 20, 300, 50)
GUICtrlCreateLabel("Aktuell: ", 0, 5, 40, 15)
$aktuelllabel = guictrlcreatelabel("", 40, 5, 260, 15)
$edit = guictrlcreateedit("Starte speichern...", 0, 75, 300, 195)
guisetstate()
$text = ""
guictrlsetdata($aktuelllabel, "Erstelle Kopf...")
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Erstelle Kopf...")
$text = $text&"#include <GUIConstantsEx.au3>"&@CRLF
$text = $text&"#include <WindowsConstants.au3>"&@CRLF
guictrlsetdata($progress, 1)
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Abgeschlossen!")
guictrlsetdata($aktuelllabel, "Erstelle GUI...")
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Erstelle GUI...")
$text = $text&"$Form = GUICreate('"&$winname&"',"&$winpos[2]&","&$winpos[3]-20&","&$winpos[0]&","&$winpos[1]&")"&@CRLF
guictrlsetdata($progress, 50)
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Abgeschlossen!")
guictrlsetdata($aktuelllabel, "Lade GUIControls...")
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Lade GUIControls...")
For $x = 2 to $numbercontrol
switch $contype[$x]
Case 0
$text = $text&"$"&$convarname&" = guictrlcreateinput('"&$conname[$x]&"', "&$conpos[$x][0]&", "&$conpos[$x][1]&", "&$conpos[$x][2]&", "&$conpos[$x][3]&")"&@CRLF
Case 1
$text = $text&"$"&$convarname&" = guictrlcreatebutton('"&$conname[$x]&"', "&$conpos[$x][0]&", "&$conpos[$x][1]&", "&$conpos[$x][2]&", "&$conpos[$x][3]&")"&@CRLF
Case 2
$text = $text&"$"&$convarname&" = guictrlcreatelabel('"&$conname[$x]&"', "&$conpos[$x][0]&", "&$conpos[$x][1]&", "&$conpos[$x][2]&", "&$conpos[$x][3]&")"&@CRLF
Case 3
$text = $text&"$"&$convarname&" = GUICtrlCreateRadio('"&$conname[$x]&"', "&$conpos[$x][0]&", "&$conpos[$x][1]&", "&$conpos[$x][2]&", "&$conpos[$x][3]&")"&@CRLF
EndSwitch
Next
$text = $text&"GUISetState(@SW_SHOW)"&@CRLF
$text = $text&" "&@CRLF
guictrlsetdata($progress, 90)
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Abgeschlossen!")
guictrlsetdata($aktuelllabel, "Erstelle notwendigen Code...")
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Erstelle notwendigen Code...")
$text = $text&"While 1"&@CRLF
$text = $text&@TAB&"$Msg = guigetmsg()"&@CRLF
$text = $text&@TAB&"Switch $msg"&@CRLF
$text = $text&@TAB&@TAB&"Case $GUI_EVENT_CLOSE"&@CRLF
$text = $text&@TAB&@TAB&@TAB&"exit"&@CRLF
$text = $text&@TAB&"Endswitch"&@CRLF
$text = $text&"WEnd"&@CRLF
guictrlsetdata($progress, 100)
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Abgeschlossen!")
guictrlsetdata($progress, 0)
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Speichern...")
guictrlsetdata($aktuelllabel, "Speichere...")
FileWrite($newfile, $text)
if not @error Then
guictrlsetdata($progress, 100)
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Datei erfolgreich erstellt!")
guictrlsetdata($aktuelllabel, "Erfolgreich abgeschlossen!")
$readybut = guictrlcreatebutton("Fertig", 250, 270, 50, 30)
GUICtrlSetOnEvent($readybut, "_ready")
Else
MsgBox(0, "Error", "Ein Fehler beim Erstellen der Datei ist aufgetreten.")
guictrlsetdata($aktuelllabel, "Fehlerbedingter Abbruch!")
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Ein Fehler ist aufgetreten!")
$readybut = guictrlcreatebutton("Fertig", 250, 270, 50, 30)
GUICtrlSetOnEvent($readybut, "_ready")
EndIfElse
[/autoit] [autoit][/autoit] [autoit]
MsgBox(0, "Error", "Ein Fehler beim Erstellen der Datei ist aufgetreten.")
EndIfElse
[/autoit] [autoit][/autoit] [autoit]
guisetstate(@SW_SHOW, $guicreator)
guisetstate(@SW_SHOW, $newGUI)
EndIfEndfunc
[/autoit] [autoit][/autoit] [autoit]Func _ready()
[/autoit] [autoit][/autoit] [autoit]
guisetstate(@SW_HIDE, $genGUI)
GUIDelete($genGUI)
guisetstate(@SW_SHOW, $guicreator)
guisetstate(@SW_SHOW, $newGUI)
EndFuncFunc _delwin()
[/autoit] [autoit][/autoit] [autoit]
$del = MsgBox(4, "Altes GUI", "Altes GUI wirklich löschen?")
if $del = 6 then
guidelete($newGUI)
_removevar()
EndIf
EndFuncFunc _removevar()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$winname = ""
$numbercontrol = 0
guictrlsetdata($item, " | | | | | ")
guictrlsetstate($delwinbut, $GUI_DISABLE)
guictrlsetstate($savebut, $GUI_DISABLE)
guictrlsetstate($newinputbut, $GUI_DISABLE)
guictrlsetstate($newlabelbut, $GUI_DISABLE)
guictrlsetstate($newbutbut, $GUI_DISABLE)
guictrlsetstate($newradiobut, $GUI_DISABLE)
EndFuncFunc _exit()
[/autoit] [autoit][/autoit] [autoit]
if $winname <> "" Then
$close = MsgBox(4, "Wirklich beenden?", "Es existiert noch ein neu erstelltes Fenster. Wirklich beenden?")
if $close = 6 Then Exit
Else
Exit
EndIfEndFunc
[/autoit] [autoit][/autoit] [autoit]Func _info()
[/autoit] [autoit][/autoit] [autoit]
MsgBox(64,"Info/Hilfe","INFO"&@CRLF&"*****"&@CRLF&"Dieses Programm wurde mit AutoIt3 erstellt und von <button421> auf autoit.de programmiert!"&@CRLF&"HILFE"&@CRLF&"******"&@CRLF&"Einfach mit GUICreator ein Windows-Fenster zusammenbasteln und dann programmieren: Einfach Aktion und Befehle in der linken Liste auswählen! Daten eingeben und auf ""OK"" klicken! Dann ist der Befehl in der rechten Liste eingetragen!")
EndFuncFunc _msgflagsopen()
[/autoit] [autoit][/autoit] [autoit]
MsgBox(64,"Flags",$okmsg&@CRLF&$errmsg&@CRLF&$askmsg&@CRLF&$warmsg&@CRLF&""&@CRLF&"Klicke ""OK"" um weiterzugehen")
MsgBox(64, "Flags", $infmsg)
EndFuncFunc _run()
[/autoit]
For $Aktion In $com
$sCommand = StringSplit($Aktion, ";", 2)
Switch $sCommand[0]
Case "@error" ;@error setzen
$aErrorCode = StringSplit($sCommand[1], ",", 2)
SetError($aErrorCode)
Case "FileRead" ;Aus Datei Lesen
$aPathRead = StringSplit($sCommand[1], ";", 2)
$sLoadedFile = FileRead($aPathRead[0])
Case "FileWrite" ;In Datei Schreiben
$aParam = StringSplit($sCommand[1], ",", 2)
FileWrite($aParam[0], $aParam[1])
Case "LabelText" ;Beschriftungstext ändern
$aParam = StringSplit($sCommand[1],",",2)
GUICtrlSetData($aParam[0], $aParam[1])
Case "Run" ;Externes Programm starten
$aRunPath = StringSplit($sCommand[1], ";", 2)
Run($aRunPath)
Case "If" ;Falls-Schleife
$aParam = StringSplit($sCommand[1], ",", 2)
If $aParam[1] = "=" Then ;Falls-Schleife mit =-Methode
If $aParam[0] = $aParam[2] Then
;Hier müssten dann die Aktionen unter dem Eintrag in der ListView ausgeführt werden
EndIf
EndIf
If $aParam[1] = "<" Then ;Falls-Schleife mit <-Methode
If $aParam[0] < $aParam[2] Then
;Hier müssten dann die Aktionen unter dem Eintrag in der ListView ausgeführt werden
EndIf
EndIf
If $aParam[1] = ">" Then ;Falls-Schleife mit >-Methode
If $aParam[0] > $aParam[2] Then
;Hier müssten dann die Aktionen unter dem Eintrag in der ListView ausgeführt werden
EndIf
EndIf
If $aParam[1] = "Not" Then ;Falls-Schleife mit Nicht-Methode
If $aParam[0] Not $aParam[2] Then
;Hier müssten dann die Aktionen unter dem Eintrag in der ListView ausgeführt werden
EndIf
EndIf
EndSwitch
Next
EndFunc
;---------------------------------- Funktionen der Commands ------------------------------
Ab Zeile 526 fängt das Krisengebiet meines Problems an.
Und zwar: die Aktionen in der If müssen die sein, die in der rechten ListView unter dem If-Eintrag stehen. Damit ihr die GUI trotzdem sehen könnt, habe ich die GUICtrlSetOnEvents für die ListView-Einträge links auskommentiert. Da kommen immernoch Fehler mit der If bei "Not" (Zeile 544 bis 546). Geht einfach in SciTE auf Continune anyway!Danke
MfG button421
-
Danke Sprenger120!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
Also so?
[autoit]
[/autoit][autoit][/autoit][autoit]
$aktionen[0] = "Run" ;Pfad durch GUICtrlRead($pfadinput)
$aktionen[1] = "Msg" ;Flag, Titel und Test durch GUICtrlRead
$aktionen[2] = "Exit"For $i = $aktionengesamt In $aktionen
[/autoit]
If StringInStr($aktionen[$aktionengesamt], "Run") = Not 0 Or 1 Then
Run(GUICtrlRead($runpath)
EndIf
Next -
Hmmm... also so?
[autoit]
[/autoit]
;Arrays definieren (Kommt dann natürlich immer nach dem "OK" klick, des Erstellen-Fensters
$aktionen[0] = "Run; Path=EingegebenerPfad"
$aktionen[1] = "Msg; Flag=EingegebeneFlag; Title=EingegebenerTitel; Text=EingegebenerText"
$aktionen[2] = "Exit"
;For-Schleife
For $i = $gesamtaktionen In $aktionen
If $aktionen[0] = StringInStr($aktionen[?], "Run;")
$runpath = GUICtrlRead($okbutton);
Run($runpath)
EndIf
NextEdit: ? heißt das, wo ich nicht weiß was dahin kommen soll!
-
Hallo Leute,
ich hab vor langer Zeit mal ein Projekt mit dem Namen "SoftCreator" programmiert, mit dem man sich eigene Programme zusammenklicken kann. Der Skript beinhaltet auch einen GUICreator, den ich von einem User übernommen habe. Leider fällt mir sein Name nicht mehr ein... Wenn jemand weiß, wie er hieß, schreibt mir!
Zurück zum Thema:
die GUI ist fertig und Aktionen wie "Info & Hilfe" und "GUICreator öffnen" sind programmiert. Das Problem ist das ich nicht weiß, wie ich eine Schleife erstelle, die alles Nach und Nach ausführt. Beispiel:
Das Programm guckt, was als erstes in der Liste steht und führt das als erstes aus. Danach führt er der Reihe nach, die anderen Aktionen auf der Liste aus.
Weiß jemand wie das funktionieren könnte?Danke.
Skript
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <GuiStatusBar.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#Include <GuiEdit.au3>
#include <Misc.au3>
Opt("GUIOnEventMode",1)
;Variablendefinitionen --------------------
Global $pathcha = @ScriptDir&"\logfile.au3"
Global $pathvar = @ScriptDir&"\varfile.ini"
Global $toolwidth = 200
Global $toolheight = 200
Global $inspwidth = 500
Global $inspheight = 200
Global $toolguiname = "GUICreator"
Global $winname
Global $Winpos[4]
Global $newGUI
Global $text
Global $numbercontrol = 0
Global $control[99]
Global $conname[99]
Global $contype[99]
Global $conpos[99][4]
Global $iVarNameControl
Global $close
Global $convarname
Global $numberofcontrol
Global $genGUI
;------------------------------------------
IniDelete($pathvar,"var")
IniWrite($pathvar, "var","starting","yes")
;Hauptgui-----------------------
#Region ### START Koda GUI section ### Form=C:\Users\Jonathan Verbeek\Desktop\Desktop Ordner\Monopoly Besitzerrechte 1.0\Form1.kxf
$Form1 = GUICreate("SoftCreator 1.0 - Erstelle deine eigenen Windows-Anwendungen!", 625, 425, 192, 124)
$controls = GUICtrlCreateGroup("Befehle", 8, 24, 201, 377)
$focuslabel = GUICtrlCreateLabel("",3,450,0,0)
$comlist = GUICtrlCreateList("", 16, 40, 185, 357, $WS_BORDER)
GUICtrlSetData(-1, "Meldung anzeigen|Beschriftungstext ändern|Fenstertitel ändern|Variable hinzufügen|@error setzten|Falls-Schleife|Wiederhol-Schleife|Maus zu Position schicken|Mauscursor ändern|Warten|Externes Programm starten|Sound abspielen|Sound pausieren|Sound stoppen|INI-Datei schreiben|INI-Datei lesen|Datei erstellen|In Datei schreiben|Aus Datei lesen")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$end = GUICtrlCreateGroup("Skript", 216, 24, 401, 377)
$script = GUICtrlCreateListView("Befehle", 224, 40, 385, 353)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 381)
$script_0 = GUICtrlCreateListViewItem("//Start SoftCreator Program", $script)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$guicreatoropen = GUICtrlCreateButton("GUICreator öffnen", 8, 0, 105, 25, $WS_GROUP)
$msgflagsopen = GUICtrlCreateButton("Meldung-Flag-Referenz", 120, 0, 139, 25, $WS_GROUP)
$close = GUICtrlCreateButton("Beenden", 544, 0, 75, 25, $WS_GROUP)
$info = GUICtrlCreateButton("Info/Hilfe", 464, 0, 75, 25, $WS_GROUP)
$dekolabel = GUICtrlCreateLabel("Erstelle deine eigenen Anwendungen!", 272, 8, 183, 17)
$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
Dim $StatusBar1_PartsWidth[2] = [493, -1]
_GUICtrlStatusBar_SetParts($StatusBar1, $StatusBar1_PartsWidth)
_GUICtrlStatusBar_SetText($StatusBar1, "Aktion", 0)
_GUICtrlStatusBar_SetText($StatusBar1, "created by button421", 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUISetOnEvent($GUI_EVENT_CLOSE, "_cls")
GUICtrlSetOnEvent($close, "_cls")
GUICtrlSetOnEvent($guicreatoropen, "_open")
;ToolGUI------------------------
Global $guicreator = GUICreate($toolguiname, $toolwidth, $toolheight, 815,5)
Global $newwinbut = guictrlcreatebutton("Neues Fenster", 0, 0, $toolwidth/2, $toolheight/5)
Global $delwinbut = guictrlcreatebutton("Fenster löschen", $toolwidth/2, 0, $toolwidth/2, $toolheight/5)
guictrlsetstate(-1, $GUI_DISABLE)
Global $newinputbut = guictrlcreatebutton("Neuer Input", 0, $toolheight/5, $toolwidth/2, $toolheight/5)
guictrlsetstate(-1, $GUI_DISABLE)
Global $newlabelbut = guictrlcreatebutton("Neuer Label", $toolwidth/2, $toolheight/5, $toolwidth/2, $toolheight/5)
guictrlsetstate(-1, $GUI_DISABLE)
Global $newbutbut = guictrlcreatebutton("Neuer Button", 0, $toolheight/5*2, $toolwidth/2, $toolheight/5)
guictrlsetstate(-1, $GUI_DISABLE)
Global $newradiobut = guictrlcreatebutton("Neuer Radiobutton", $toolwidth/2, $toolheight/5*2, $toolwidth/2, $toolheight/5)
guictrlsetstate(-1, $GUI_DISABLE)
Global $undobut = guictrlcreatebutton("Rückgängig", 0, $toolheight/5*3, $toolwidth/2, $toolheight/5)
Global $savebut = guictrlcreatebutton("Fertig", $toolwidth/2, $toolheight/5*3, $toolwidth/2, $toolheight/5)
guictrlsetstate(-1, $GUI_DISABLE)
Global $infobut = GUICtrlCreateButton("Informationen", 0, $toolheight/5*4, $toolwidth/2, $toolheight/5)
Global $exitbut = GUICtrlCreateButton("Beenden", $toolwidth/2, $toolheight/5*4, $toolwidth/2, $toolheight/5)
guisetstate(@SW_HIDE)
GUISetOnEvent($GUI_EVENT_CLOSE, "_clsguicrt")
;Inspektor-----------------------------
Global $inspektorgui = guicreate("Inspektor", $inspwidth, $inspheight, 5,5)
Global $changeslist = guictrlcreatelistview("Name|Typ|X-Koord.|Y-Koord.|Breite|Höhe", 0,0, $inspwidth, $inspheight)
Global $item = guictrlcreatelistviewitem(" | | | | | ", -1)
guisetstate(@SW_HIDE)
guisetonevent($GUI_EVENT_CLOSE, "_clsguicrt")
;Events---------------------------------
GUICtrlSetOnEvent($exitbut, "_clsguicrt")
GUICtrlSetOnEvent($newwinbut, "_testwin")
GUICtrlSetOnEvent($delwinbut, "_delwin")
GUICtrlSetOnEvent($savebut, "_saveau3")
GUICtrlSetOnEvent($newinputbut, "_newinput")
GUICtrlSetOnEvent($newbutbut, "_newbut")
GUICtrlSetOnEvent($newlabelbut, "_newlabel")
GUICtrlSetOnEvent($newradiobut, "_newradio")
GUICtrlSetOnEvent($undobut, "_undo")
GUICtrlSetOnEvent($info, "_info")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_cls()
Case $info
MsgBox(64,"Info/Hilfe","INFO"&@CRLF&"*****"&@CRLF&"Dieses Programm wurde mit AutoIt3 erstellt und von <button421> auf autoit.de programmiert!"&@CRLF&"HILFE"&@CRLF&"******"&@CRLF&"Einfach mit GUICreator ein Windows-Fenster zusammenbasteln und dann programmieren: Einfach Aktion und Befehle in der linken Liste auswählen! Daten eingeben und auf ""OK"" klicken! Dann ist der Befehl in der rechten Liste eingetragen!")
EndSwitch
WEndFunc _cls()
[/autoit] [autoit][/autoit] [autoit]
$questionexit = MsgBox(36, "Beenden?","Es sind noch offene Projekte aktiv! Wollen sie wirklich beenden?")
If $questionexit = 6 Then
Exit
Else
;Nix
EndIf
EndFuncFunc _open()
[/autoit] [autoit][/autoit] [autoit]
GUISetState(@SW_SHOW, $guicreator)
GUISetState(@sW_SHOW, $inspektorgui)
EndFuncFunc _clsguicrt()
[/autoit] [autoit][/autoit] [autoit]
GUISetState(@SW_HIDE, $guicreator)
GUISetState(@SW_HIDE, $inspektorgui)
GUISetState(@SW_HIDE, $newGUI)
EndFuncwhile 2
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
if _ispressed(02) then
$cmsg = GUIGetCursorInfo()
if not @error and IsArray($cmsg) Then
if winactive($winname) Then
if $cmsg[4] = 0 Then
GUICtrlSetData($item, $Winname&"|"&"GUI"&"|"&$Winpos[0]&"|"&$winpos[1]&"|"&$Winpos[2]&"|"&$Winpos[3])
EndIf
For $y = 2 to $numbercontrol
if $cmsg[0] > $conpos[$y][0] and $cmsg[0] < $conpos[$y][0]+$conpos[$y][2] and $cmsg[1] > $conpos[$y][1] and $cmsg[1] < $conpos[$y][1]+$conpos[$y][3] Then
GUICtrlSetData($item, $conname[$y]&"|"&$contype[$y]&"|"&$conpos[$y][0]&"|"&$conpos[$y][1]&"|"&$conpos[$y][2]&"|"&$conpos[$y][3])
EndIf
Next
EndIf
EndIf
Do
Until not _ispressed(02)
sleep(40)
EndIf
WEnd
Func _newinput()
_newcontrol(0)
EndFunc
Func _newbut()
_newcontrol(1)
EndFunc
Func _newlabel()
_newcontrol(2)
EndFunc
Func _newradio()
_newcontrol(3)
EndFuncFunc _gethelp()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
MsgBox(0, "Hilfe", "Zum Erstellen eines neuen Fensters einfach auf 'Neues Fenster' drücken."&@CRLF&"Dort den gewünschten Namen eingeben und das Fenster durch Bewegen mit der Maus positionieren. Anschliessend einfach klicken."&@CRLF&@TAB&"ACHTUNG: Nachfolgendes Verschieben hat keinen Effekt mehr auf die festgelegte Position!"&@CRLF&"Die Größe des Fensters durch Bewegen mit der Maus definieren. Anschliessend einfach klicken."&@CRLF&"Erst dann können die vier zur Auswahl stehenden Controls auf die gleiche Weise erstellt werden."&@CRLF&"Mit Rechtsklick auf das jeweilige Control lassen sich die Werte im Inspektor ansehen."&@CRLF&" "&@CRLF&"Wenn das GUI fertig erstellt ist, einfach auf 'Als *.au3 speichern' klicken, und den gewünschten Speicherort/namen eingeben.")
EndFunc
Func _getinfo()
if $winname <> "" Then
$infotext = ""
$infotext = $infotext&"Aktueller GUI-Titel: "&$Winname&@CRLF
$infotext = $infotext&"Anzahl der Controls: "&$numbercontrol-1&@CRLF
$infotext = $infotext&@TAB&"Einzelinformationen: "&@CRLF
for $z = 2 to $numbercontrol
$infotext = $infotext&@TAB&@TAB&$z-1&"."&@CRLF
$infotext = $infotext&@TAB&@TAB&"Name: "&$conname[$z]&@CRLF
Switch $contype[$z]
Case 0
$infotext = $infotext&@TAB&@TAB&"Typ: "&"Input"&@CRLF
Case 1
$infotext = $infotext&@TAB&@TAB&"Typ: "&"Button"&@CRLF
Case 2
$infotext = $infotext&@TAB&@TAB&"Typ: "&"Label"&@CRLF
Case 3
$infotext = $infotext&@TAB&@TAB&"Typ: "&"Radiobutton"&@CRLF
EndSwitch
$infotext = $infotext&@TAB&@TAB&"Abmessungen: X-Pos.: "&$conpos[$z][0]&" Y-Pos.: "&$conpos[$z][1]&" Länge: "&$conpos[$z][2]&" Höhe: "&$conpos[$z][3]&@CRLF
$infotext = $infotext&@TAB&@TAB&" "&@CRLF
Next
MsgBox(0, "Informationen", $infotext)
Else
MsgBox(0, "Informationen", "Noch kein Fenster erstellt.")
EndIf
EndFuncFunc _testwin()
[/autoit] [autoit][/autoit] [autoit]
if $winname <> "" Then
$del = MsgBox(4, "Altes GUI", "Altes GUI überschreiben?")
if $del = 6 then
guidelete($newGUI)
$numbercontrol = 0
_newwin()
EndIf
Else
_newwin()
EndIfEndFunc
[/autoit] [autoit][/autoit] [autoit]Func _newwin()
[/autoit] [autoit][/autoit] [autoit]
$Winname = inputbox("Neues Fenster", "1. Geben sie den Fenster-Namen ein."&@CRLF&"2. Positionieren sie das Fenster."&@CRLF&"3. Verändern sie die Größe des Fensters.")
if $Winname <> "" Then
$newGUI = GUICreate($winname, 150, 150)
GUISetOnEvent($GUI_EVENT_CLOSE, "_clsguicrt")
guisetstate()
while not _ispressed(01)
$mousepos = mousegetpos()
$winpos = wingetpos($Winname)
winmove($winname, "", $mousepos[0]-150, $mousepos[1]-170)
ToolTip($winpos[0]&"/"&$winpos[1], $mousepos[0], $mousepos[1])
sleep(40)
WEnd
$winpos = wingetpos($Winname)
while _ispressed(01)
WEnd
_MouseTrap($winpos[0]+50, $winpos[1]+10, @Desktopwidth, @Desktopheight)
while not _ispressed(01)
$mousepos = mousegetpos()
$winpos = wingetpos($Winname)
winmove($winname, "",$winpos[0], $winpos[1] , $mousepos[0]-($winpos[0]-20), $mousepos[1]-($winpos[1]-20))
ToolTip($winpos[2]&"/"&$winpos[3]-20, $mousepos[0], $mousepos[1])
sleep(40)
WEnd
_mousetrap()
ToolTip("")
$numbercontrol = 1
$winpos = wingetpos($Winname)
guictrlsetstate($delwinbut, $GUI_ENABLE)
guictrlsetstate($savebut, $GUI_ENABLE)
guictrlsetstate($newinputbut, $GUI_ENABLE)
guictrlsetstate($newlabelbut, $GUI_ENABLE)
guictrlsetstate($newbutbut, $GUI_ENABLE)
guictrlsetstate($newradiobut, $GUI_ENABLE)
Else
_removevar()
EndIf
EndFuncFunc _newcontrol($type)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$numbercontrol += 1
$convarname = InputBox("Neues Control","Geben sie den Variablennamen ein!") ;Variablenabfrage!
$conname[$numbercontrol] = inputbox("Neues Control", "1. Geben sie den Control-Namen ein."&@CRLF&"2. Positionieren sie das Control."&@CRLF&"3. Verändern sie die Größe des Controls.")
;~ IniWrite($pathvar,"var","var"&+$numberofcontrol,$convarname)
if $conname[$numbercontrol] <> "" Then
$contype[$numbercontrol] = $type
while _ispressed(01)
WEnd
$actpos = wingetpos($Winname)
mousemove($actpos[0]+$winpos[2]/2, $actpos[1]+$actpos[3]/2, 0)
switch $type
Case 0
$control[$numbercontrol] = guictrlcreateinput($conname[$numbercontrol], 0, 0, 100, 30)
Case 1
$control[$numbercontrol] = guictrlcreatebutton($conname[$numbercontrol], 0, 0, 100, 30)
Case 2
$control[$numbercontrol] = guictrlcreatelabel($conname[$numbercontrol], 0, 0, 100, 30)
Case 3
$control[$numbercontrol] = GUICtrlCreateRadio($conname[$numbercontrol], 0, 0, 100, 30)
EndSwitch
_mousetrap($actpos[0]+1, $actpos[1]+30, $actpos[0]+$actpos[2], $actpos[1]+$actpos[3])
While not _ispressed(01)
$mousepos = mousegetpos()
guictrlsetpos($control[$numbercontrol], $mousepos[0]-$actpos[0]-101, $mousepos[1]-$actpos[1]-51)
sleep(40)
WEnd
$tempconpos = controlgetpos($Winname, "", $control[$numbercontrol])
$conpos[$numbercontrol][0] = $tempconpos[0]
$conpos[$numbercontrol][1] = $tempconpos[1]
while _ispressed(01)
WEnd
_mousetrap($conpos[$numbercontrol][0]+$actpos[0]+5, $conpos[$numbercontrol][1]+$actpos[1]+30, $actpos[0]+$actpos[2], $actpos[1]+$actpos[3])
$actpos = wingetpos($Winname)
While not _ispressed(01)
$mousepos = mousegetpos()
guictrlsetpos($control[$numbercontrol], $conpos[$numbercontrol][0], $conpos[$numbercontrol][1], $mousepos[0]-($actpos[0]+$conpos[$numbercontrol][0]), $mousepos[1]-($actpos[1]+$conpos[$numbercontrol][1]+20))
sleep(40)
WEnd
_mousetrap()
$tempconpos = controlgetpos($Winname, "", $control[$numbercontrol])
$conpos[$numbercontrol][2] = $tempconpos[2]
$conpos[$numbercontrol][3] = $tempconpos[3]
Else
$numbercontrol -= 1
EndIfEndFunc
[/autoit] [autoit][/autoit] [autoit]Func _undo()
[/autoit] [autoit][/autoit] [autoit]
if $numbercontrol > 1 Then
guictrldelete($control[$numbercontrol])
$conpos[$numbercontrol][0] = ""
$conpos[$numbercontrol][1] = ""
$conpos[$numbercontrol][2] = ""
$conpos[$numbercontrol][3] = ""
$conname[$numbercontrol] = ""
$contype[$numbercontrol] = ""
$numbercontrol -= 1
Else
MsgBox(64, "SoftCreator", "Nichts zu widerrufen!")
EndIf
EndFuncFunc _saveau3()
[/autoit] [autoit][/autoit] [autoit]
guisetstate(@SW_HIDE, $guicreator)
guisetstate(@SW_HIDE, $newGUI)
$fehler = 0
$path = FileSaveDialog("Speichere *.au3...", @SCRIPTDIR&"\", "Autoit(*.au3)")
if $path <> "" Then
if stringright($path, 4) = ".au3" Then
$newfile = fileopen($path, 10)
if @error then $fehler = 1
Else
$path = $path&".au3"
$newfile = fileopen($path, 10)
if @error then $fehler = 1
EndIf
if not $fehler = 1 Then
Global $genGUI = GUICreate("Erstelle Datei...", 300, 300, -1, $WS_EX_TOPMOST)
$progress = guictrlcreateprogress(0, 20, 300, 50)
GUICtrlCreateLabel("Aktuell: ", 0, 5, 40, 15)
$aktuelllabel = guictrlcreatelabel("", 40, 5, 260, 15)
$edit = guictrlcreateedit("Starte speichern...", 0, 75, 300, 195)
guisetstate()
$text = ""
guictrlsetdata($aktuelllabel, "Erstelle Kopf...")
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Erstelle Kopf...")
$text = $text&"#include <GUIConstantsEx.au3>"&@CRLF
$text = $text&"#include <WindowsConstants.au3>"&@CRLF
guictrlsetdata($progress, 1)
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Abgeschlossen!")
guictrlsetdata($aktuelllabel, "Erstelle GUI...")
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Erstelle GUI...")
$text = $text&"$Form = GUICreate('"&$winname&"',"&$winpos[2]&","&$winpos[3]-20&","&$winpos[0]&","&$winpos[1]&")"&@CRLF
guictrlsetdata($progress, 50)
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Abgeschlossen!")
guictrlsetdata($aktuelllabel, "Lade GUIControls...")
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Lade GUIControls...")
For $x = 2 to $numbercontrol
switch $contype[$x]
Case 0
$text = $text&"$"&$convarname&" = guictrlcreateinput('"&$conname[$x]&"', "&$conpos[$x][0]&", "&$conpos[$x][1]&", "&$conpos[$x][2]&", "&$conpos[$x][3]&")"&@CRLF
Case 1
$text = $text&"$"&$convarname&" = guictrlcreatebutton('"&$conname[$x]&"', "&$conpos[$x][0]&", "&$conpos[$x][1]&", "&$conpos[$x][2]&", "&$conpos[$x][3]&")"&@CRLF
Case 2
$text = $text&"$"&$convarname&" = guictrlcreatelabel('"&$conname[$x]&"', "&$conpos[$x][0]&", "&$conpos[$x][1]&", "&$conpos[$x][2]&", "&$conpos[$x][3]&")"&@CRLF
Case 3
$text = $text&"$"&$convarname&" = GUICtrlCreateRadio('"&$conname[$x]&"', "&$conpos[$x][0]&", "&$conpos[$x][1]&", "&$conpos[$x][2]&", "&$conpos[$x][3]&")"&@CRLF
EndSwitch
Next
$text = $text&"GUISetState(@SW_SHOW)"&@CRLF
$text = $text&" "&@CRLF
guictrlsetdata($progress, 90)
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Abgeschlossen!")
guictrlsetdata($aktuelllabel, "Erstelle notwendigen Code...")
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Erstelle notwendigen Code...")
$text = $text&"While 1"&@CRLF
$text = $text&@TAB&"$Msg = guigetmsg()"&@CRLF
$text = $text&@TAB&"Switch $msg"&@CRLF
$text = $text&@TAB&@TAB&"Case $GUI_EVENT_CLOSE"&@CRLF
$text = $text&@TAB&@TAB&@TAB&"exit"&@CRLF
$text = $text&@TAB&"Endswitch"&@CRLF
$text = $text&"WEnd"&@CRLF
guictrlsetdata($progress, 100)
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Abgeschlossen!")
guictrlsetdata($progress, 0)
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Speichern...")
guictrlsetdata($aktuelllabel, "Speichere...")
FileWrite($newfile, $text)
if not @error Then
guictrlsetdata($progress, 100)
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Datei erfolgreich erstellt!")
guictrlsetdata($aktuelllabel, "Erfolgreich abgeschlossen!")
$readybut = guictrlcreatebutton("Fertig", 250, 270, 50, 30)
GUICtrlSetOnEvent($readybut, "_ready")
Else
MsgBox(0, "Error", "Ein Fehler beim Erstellen der Datei ist aufgetreten.")
guictrlsetdata($aktuelllabel, "Fehlerbedingter Abbruch!")
guictrlsetdata($edit, guictrlread($edit)&@CRLF&"Ein Fehler ist aufgetreten!")
$readybut = guictrlcreatebutton("Fertig", 250, 270, 50, 30)
GUICtrlSetOnEvent($readybut, "_ready")
EndIfElse
[/autoit] [autoit][/autoit] [autoit]
MsgBox(0, "Error", "Ein Fehler beim Erstellen der Datei ist aufgetreten.")
EndIfElse
[/autoit] [autoit][/autoit] [autoit]
guisetstate(@SW_SHOW, $guicreator)
guisetstate(@SW_SHOW, $newGUI)
EndIfEndfunc
[/autoit] [autoit][/autoit] [autoit]Func _ready()
[/autoit] [autoit][/autoit] [autoit]
guisetstate(@SW_HIDE, $genGUI)
GUIDelete($genGUI)
guisetstate(@SW_SHOW, $guicreator)
guisetstate(@SW_SHOW, $newGUI)
EndFuncFunc _delwin()
[/autoit] [autoit][/autoit] [autoit]
$del = MsgBox(4, "Altes GUI", "Altes GUI wirklich löschen?")
if $del = 6 then
guidelete($newGUI)
_removevar()
EndIf
EndFuncFunc _removevar()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$winname = ""
$numbercontrol = 0
guictrlsetdata($item, " | | | | | ")
guictrlsetstate($delwinbut, $GUI_DISABLE)
guictrlsetstate($savebut, $GUI_DISABLE)
guictrlsetstate($newinputbut, $GUI_DISABLE)
guictrlsetstate($newlabelbut, $GUI_DISABLE)
guictrlsetstate($newbutbut, $GUI_DISABLE)
guictrlsetstate($newradiobut, $GUI_DISABLE)
EndFuncFunc _exit()
[/autoit] [autoit][/autoit] [autoit]
if $winname <> "" Then
$close = MsgBox(4, "Wirklich beenden?", "Es existiert noch ein neu erstelltes Fenster. Wirklich beenden?")
if $close = 6 Then Exit
Else
Exit
EndIfEndFunc
[/autoit] [autoit][/autoit] [autoit]Func _info()
[/autoit]
MsgBox(64,"Info/Hilfe","INFO"&@CRLF&"*****"&@CRLF&"Dieses Programm wurde mit AutoIt3 erstellt und von <button421> auf autoit.de programmiert!"&@CRLF&"HILFE"&@CRLF&"******"&@CRLF&"Einfach mit GUICreator ein Windows-Fenster zusammenbasteln und dann programmieren: Einfach Aktion und Befehle in der linken Liste auswählen! Daten eingeben und auf ""OK"" klicken! Dann ist der Befehl in der rechten Liste eingetragen!")
EndFunc -
WOW! Die GUI sieht erstklassig aus! Jetzt wärst du bereit, einen 3D-Figuren-Creator (ähnlich wie Blender) zu prgrammieren! Hut Ab!
-
Hallo Leute,
mein 2 Tage 3 Stunden dauerndes Projekt "Arduino Tools 1.0" ist fertig!
Mann kann:
- Sich Hilfe in der Befehlsreferenz zu den Befehlen holen
- Sich eigene LCD-Display-Schriftzeichen erstellenMehr kommt natürlich in Updates.
ToDo-List
- Ganzskripteditor zum programmieren(ohne direkten Upload)
- HTML-Code Creator für Arduino Skripte
- PinMapping Listenersteller zum Ausdrucken
- Bilder von Arduino-Schaltungen zum verständlichen Projektaufbau
- Bessere Grafik
- Fernsteuerung von Arduino über SerialPort und Arduino Skript
Hoffentlich schaffe ich das alles...
Vielleicht hilft mir ja einer.ZIP Datei unten angehängt.
Viel Spaß!
MfG button421
-
-
Hallo Leute,
[autoit]
melde mich mal wieder zu meinem Projekt "Arduino Tools".
Ich bin soweit, das man sich ein LCD-Char, über die weißen Kästchen, erstellen kann. Nun bin ich bei der automatischen Anpassung des Skriptes rechts daneben. Wird beispielsweise das erste Kästchen in der ersten Zeile geklickt, soll in dem Codefenster(erste Zeile nach"byte myChar[8] {") anstatt "B00000" "B10000" stehen.
Ich hab schon so angefangen:
[/autoit]
Case $aBitPics[1][1]
MsgBox(0,"Test","Test")Das funzt nicht...
Ich hab nen Kommentar ins Krisengebiet des Skriptes geschrieben(Zeile 136).
Die Meldung(überhaupt die Aktion" funktioniert nicht...Weiß jemand wie ich das Problem beheben kann?
Danke
MfG button421
Skript im Anhang!
-
Wisst ihr, wie ich es programmieren kann, dass wen man einmal auf einen Charakter klickt, dass der das grau ist(GUICTrlSetImage(...)), und wenn man nocheinmal draufklickt, dass er dann wieder weiß wird(Das alles mit Pics)?
-
-
so sieht es bei mir aus:
[Blockierte Grafik: http://img850.imageshack.us/img850/4712/sosiehtsaus.jpg]
By taxe410 at 2011-04-27und mein Skript:
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <ListViewConstants.au3>
;----------------------------------HOME-------------------------------------------------------
$homeform = GUICreate("Arduino Tools 1.2", 627, 443, 192, 124)
$background = GUICtrlCreatePic(@ScriptDir&"\Images\computer_0014.jpg", 0, 0, 625, 441, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUICtrlSetState($background, $GUI_DISABLE)
$was = GUICtrlCreateLabel("Was möchten sie tun?", 176, 24, 257, 33, $SS_SUNKEN)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0x00FF00)
$befehlsreferenz = GUICtrlCreateButton("Befehlsreferenz", 8, 136, 249, 41, $WS_GROUP)
GUICtrlSetTip(-1, "Zeigt eine Referenz aller Grundbefehle an")
$lcdcharacter = GUICtrlCreateButton("LCD-Charakter-Creator", 10, 191, 249, 41, $WS_GROUP)
GUICtrlSetTip(-1, "Damit können sie einen LCD-Charakter selbst erstellen")
$linktoarduino = GUICtrlCreateButton("Arduino-Homepage", 8, 248, 249, 41, $WS_GROUP)
GUICtrlSetTip(-1, "Blättern sie in vielen Schaltungsbildern!")
$exit = GUICtrlCreateButton("Beenden", 400, 384, 217, 49, $WS_GROUP)
$infohelp = GUICtrlCreateButton("Info/ Hilfe", 8, 384, 177, 49, $WS_GROUP)
GUISetState(@SW_SHOW)
;----------------------------------------------------------------------------------------------
;--------------------------------BEFEHLSREFERENZ-----------------------------------------------
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$befehlsreferenzform = GUICreate("Arduino Tools - Befehlsreferenz", 627, 444, 192, 124)
$background = GUICtrlCreatePic(@ScriptDir&"\Images\computer_0014.jpg", 0, 0, 625, 441, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUICtrlSetState($background, $GUI_DISABLE)
$das1 = GUICtrlCreateLabel("Befehlsreferenz", 216, 24, 188, 33, $SS_SUNKEN)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0x00FF00)
$befehle = GUICtrlCreateListView("Befehl", 8, 64, 241, 369)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 237)
$befehle_0 = GUICtrlCreateListViewItem("int", $befehle)
$befehle_1 = GUICtrlCreateListViewItem("LiquidCrystal", $befehle)
$befehle_2 = GUICtrlCreateListViewItem("void setup()", $befehle)
$befehle_3 = GUICtrlCreateListViewItem("void loop()", $befehle)
$befehle_4 = GUICtrlCreateListViewItem("tone", $befehle)
$befehle_5 = GUICtrlCreateListViewItem("lcd.begin()", $befehle)
$befehle_6 = GUICtrlCreateListViewItem("lcd.setCursor()", $befehle)
$befehle_7 = GUICtrlCreateListViewItem("lcd.print()", $befehle)
$befehle_8 = GUICtrlCreateListViewItem("lcd.noBlink()", $befehle)
$befehle_9 = GUICtrlCreateListViewItem("lcd.noCursor", $befehle)
$befehle_10 = GUICtrlCreateListViewItem("digitalWrite()", $befehle)
$befehle_11 = GUICtrlCreateListViewItem("delay()", $befehle)
$befehle_12 = GUICtrlCreateListViewItem("pinMode()", $befehle)
$befehle_13 = GUICtrlCreateListViewItem("Serial.begin()", $befehle)
$befehle_14 = GUICtrlCreateListViewItem("Serial.print()", $befehle)
$referenz = GUICtrlCreateEdit("", 280, 64, 337, 369)
GUICtrlSetData(-1, "<---- Bitte links Befehl auswählen!")
$cls1 = GUICtrlCreateButton("Beenden", 536, 0, 89, 25, $WS_GROUP)
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###
;----------------------------------------------------------------------------------------------
;-------------------------------LCD-CHARAKTER-CREATOR------------------------------------------
$lcdcharcreator = GUICreate("Arduino Tools - LCD-Charakter-Creator", 627, 442, 192, 124)
$background = GUICtrlCreatePic(@ScriptDir&"\Images\computer_0014.jpg", 0, 0, 625, 441,$SS_NOTIFY)
GUICtrlSetState($background, $GUI_DISABLE)
$das2 = GUICtrlCreateLabel("LCD-Charakter-Creator", 176, 16, 272, 33, $SS_SUNKEN)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0x00FF00)
$b10000 = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 16, 80, 33, 33)
;~ GUICtrlSetState($b10000, $GUI_DISABLE)
$b01000 = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 54, 80, 33, 33)
$b00100 = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 95, 80, 33, 33)
$b00010 = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 135, 80, 33, 33)
$b00001 = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 175, 80, 33, 33)
;-
$b10000b = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 16, 120, 33, 33)
$b01000b = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 54, 120, 33, 33)
$b00100b = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 95, 120, 33, 33)
$b00010b = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 135, 120, 33, 33)
$b00001b = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 175, 120, 33, 33)
;-
$b10000c = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 16, 160, 33, 33)
$b01000c = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 54, 160, 33, 33)
$b00100c = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 95, 160, 33, 33)
$b00010c = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 135, 160, 33, 33)
$b00001c = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 175, 160, 33, 33)
;-
$b10000d = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 16, 200, 33, 33)
$b01000d = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 54, 200, 33, 33)
$b00100d = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 95, 200, 33, 33)
$b00010d = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 135, 200, 33, 33)
$b00001d = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 175, 200, 33, 33)
;-
$b10000e = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 16, 240, 33, 33)
$b01000e = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 54, 240, 33, 33)
$b00100e = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 95, 240, 33, 33)
$b00010e = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 135, 240, 33, 33)
$b00001e = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 175, 240, 33, 33)
;-
$b10000f = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 16, 280, 33, 33)
$b01000f = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 54, 280, 33, 33)
$b00100f = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 95, 280, 33, 33)
$b00010f = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 135, 280, 33, 33)
$b00001f = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 175, 280, 33, 33)
;-
$b10000g = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 16, 320, 33, 33)
$b01000g = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 54, 320, 33, 33)
$b00100g = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 95, 320, 33, 33)
$b00010g = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 135, 320, 33, 33)
$b00001g = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 175, 320, 33, 33)
;-
$b10000h = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 16, 360, 33, 33)
$b01000h = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 54, 360, 33, 33)
$b00100h = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 95, 360, 33, 33)
$b00010h = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 135, 360, 33, 33)
$b00001h = GUICtrlCreatePic(@ScriptDir&"\Images\lcddeactiv.bmp", 175, 360, 33, 33)
;-
$cls2 = GUICtrlCreateButton("Beenden", 536, 0, 89, 25, $WS_GROUP)
$script = GUICtrlCreateEdit("", 304, 80, 313, 353, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, StringFormat("#include <LiquidCrystal.h>\r\n\r\nLiquidCrystal lcd(12,11,10,5,4,3,2);\r\n\r\nbyte myChar[8] =\r\n{\r\n B00000,\r\n B00000,\r\n B00000,\r\n B00000,\r\n B00000,\r\n B00000,\r\n B00000,\r\n B00000\r\n};\r\n\r\nvoid setup()\r\n{\r\n lcd.createChar(0, myChar);\r\n lcd.begin(16,2);\r\n lcd.write(0);\r\n}\r\n\r\nvoid loop() {}"))
GUISetState(@SW_HIDE)
;----------------------------------------------------------------------------------------------
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $befehlsreferenz
GUISetState(@SW_SHOW, $befehlsreferenzform)
Case $lcdcharacter
GUISetState(@SW_SHOW, $lcdcharcreator)
Case $cls1
_clswindow()
Case $cls2
_clswindow()
Case $linktoarduino
ShellExecute("http://arduino.cc/")
Case $infohelp
MsgBox(64,"Info/Hilfe","Zuerst wählen sie ein Menüpunkt aus! Klicken sie auf ""Befehlsreferenz"" um eine vollständige Referenz für alle Grundbefehle zu erhalten! Klicken sie auf ""LCD-Charakter-Creator"", um einen eigenen LCD-Charakter zu erstellen. Der Quellcode wird rechts angezeigt."&@CRLF&""&@CRLF&"created by button421 on autoit.de!")
Case $exit
Exit
Case $b10000
;~ $b10000 = GUICtrlCreatePic(@ScriptDir&"\Images\lcdactiv.bmp", 16, 80, 33, 33)
MsgBox(0,"","")
EndSwitch
WEndFunc _clswindow()
[/autoit]
GUISetState(@SW_HIDE, $befehlsreferenzform)
GUISetState(@SW_HIDE, $lcdcharcreator)
EndFunc -
Was meinst du? Die sind bei mir nicht übereinander.
-
Ineluki: sorry, hab eben die .zip Datei verändert. Probiere es nochmal!
-
Hallo Leute,
ich hab mit meiner neuen software ein Problem.
Eigentlich sollte keiner davon erfahren, aber jetzt muss ich mal was fragen(ist nicht das erste mal zu diesem Projekt):Ich will ein Programm mit dem Namen "Arduino-Tools" erstellen. Wer Arduino kennt, weiß was es ist. Wer nicht, guckt hier nach.
Nun will ich einen LCD-Charakter-Creator einbauen. Die GUI ist schon fertig. Nun habe ich das Problem,
[autoit]
das wenn man auf ein weißen Kasten(5x8 Raster), der ein Pic ist klickt, passiert nichts. Ich habe es so versucht:
[/autoit]
;While Schleife...
Case $b10000 ;<---Pic Variable
MsgBox(0,"","") ;<-- Nur zum Test
;WEnd
Das klappt nicht. Warscheinlich wird garnicht erkannt, wenn man auf das Bild klickt.
Wisst ihr woran das liegt?Skript unten als .zip Datei angehängt!
MfG button421
Edit: Bitte Dateien entpacken, da sonst die Bilder nicht auftauchen
-
Hallo Leute,
da mir in der Shoutbox ja keiner geholfen hat, muss ich es so versuchen
Gibt es einen Befehl, der mir alle Geräte, Ordner und Dateien in einer TreeView anzeigen kann?
Ich hab mir das so vorgestellt:Desktop
+C://
+D://
---E://
| -autoit3.exe
| -logfile.ini
|_MfG button421