Der Neu-Button geht doch?
Edit: Du meinst die Buttons bleiben Disable?
Habs oben editiert: Geht jetzt!
Beiträge von button421
-
-
Gut. Aber die GUI sieht besser aus als die von PrideRage. Bin gerade hierbei:
-Hintergrundfarbe änderbar
-Zeilenumbruch zwischen Controls -
Hi Leute,
dieser HTML-Creator von PrideRage hat mich beeindruckt:
https://autoit.de/index.php?page…2766#post202766Ich habe für sein Projekt ein neues Design und ein Beenden-Button hinzugefügt.
Jetzt gibt es nicht mehr 2 sondern nur noch 1 Fenster, was die Taskleiste unten schont...
Die Beenden?-Abfrage ist jetzt eine MsgBox.
Trotzdem Hut-Ab an PrideRage! Mein persönlicher Websiten-Freak
Der jetzige Skipt: (Update 1)
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=HTML Creator.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#include <WinAPI.au3>
#include <Array.au3>
#include <GUIEdit.au3>
Global $sHTMLText = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' & @CRLF
Global $iSaved = 0, $sFileName, $FuncPromt, $hWnd, $mainX = 450, $mainY = 300, $srcX = $mainX - 370, $srcY = 250, $gui, $srcEditor, $sHTMLBackup
Global $sIEFile, $sFFFile, $htmlStarted = 0, $bodyStarted = 0, $listStarted = 0, $formStarted = 0
Global $hS = 0, $lS = 0, $fS = 0, $bs = 0
Global Const $G_D = $GUI_DISABLE, $G_E = $GUI_ENABLE
Global $sFFPath, $sIEPath
Global $isHTML = 0, $isBody = 0, $ih = 0, $ib = 0
Global $lastLineIf IniReadSection("infos.ini", "Brosers") = @error Then
[/autoit] [autoit][/autoit] [autoit]
_CheckFF()
_CheckIE()
EndIfGlobal $sFFPath = IniRead("infos.ini", "Browsers", "FF", 0)
[/autoit] [autoit][/autoit] [autoit]
Global $sIEPath = IniRead("infos.ini", "Browsers", "IE", 0)#include <ButtonConstants.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$gui = GUICreate("Create2HTML - Kinderleicht HTML-Seiten erstellen!", 626, 421, 192, 124)
$hsourcegroup = GUICtrlCreateGroup("Quellcode-Ansicht", 8, 0, 609, 209)
$srcEditor = GUICtrlCreateEdit("", 16, 16, 593, 185)
GUICtrlSetData(-1, "")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$hcontrolsgroup = GUICtrlCreateGroup("Steuerelemente", 8, 208, 609, 161)
$htmlstart = GUICtrlCreateButton("HTML-Anfang", 16, 224, 81, 33, $WS_GROUP)
$head = GUICtrlCreateButton("Head", 104, 224, 57, 33, $WS_GROUP)
$bodystart = GUICtrlCreateButton("Body-Anfang", 168, 224, 73, 33, $WS_GROUP)
$js = GUICtrlCreateButton("JavaSkript", 248, 224, 67, 33, $WS_GROUP)
$css = GUICtrlCreateButton("CSS", 320, 224, 57, 33, $WS_GROUP)
$text = GUICtrlCreateButton("Text", 384, 224, 49, 33, $WS_GROUP)
$image = GUICtrlCreateButton("Bild", 440, 224, 49, 33, $WS_GROUP)
$flash = GUICtrlCreateButton("Flash-Objekt", 496, 224, 75, 33, $WS_GROUP)
$video = GUICtrlCreateButton("Video", 16, 264, 41, 33, $WS_GROUP)
$button = GUICtrlCreateButton("Button", 64, 264, 59, 33, $WS_GROUP)
$addlist = GUICtrlCreateButton("Neuer Listeneintrag", 128, 264, 107, 33, $WS_GROUP)
$newlist = GUICtrlCreateButton("Liste Anfang", 240, 264, 73, 33, $WS_GROUP)
$endlist = GUICtrlCreateButton("Liste Ende", 320, 264, 65, 33, $WS_GROUP)
$header = GUICtrlCreateButton("Header", 392, 264, 49, 33, $WS_GROUP)
$link = GUICtrlCreateButton("Link", 448, 264, 33, 33, $WS_GROUP)
$htmlend = GUICtrlCreateButton("HTML-Ende", 488, 264, 73, 33, $WS_GROUP)
$bodyend = GUICtrlCreateButton("Body-Ende", 16, 304, 65, 33, $WS_GROUP)
$beginnform = GUICtrlCreateButton("Form-Anfang", 88, 304, 73, 33, $WS_GROUP)
$endform = GUICtrlCreateButton("Form-Ende", 168, 304, 65, 33, $WS_GROUP)
$textfield = GUICtrlCreateButton("Eingabefeld", 240, 304, 73, 33, $WS_GROUP)
$useJSFile = GUICtrlCreateButton("JavaSkript Datei einbinden", 320, 304, 145, 33, $WS_GROUP)
$useCSSFile = GUICtrlCreateButton("CSS Datei einbinden", 472, 304, 113, 33, $WS_GROUP)
$crlf = GUICtrlCreateButton("Zeilenumbruch", 16, 336, 89, 33, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$new = GUICtrlCreateButton("Neu", 8, 368, 59, 25, $WS_GROUP)
$save = GUICtrlCreateButton("Speichern", 72, 368, 75, 25, $WS_GROUP)
$infos = GUICtrlCreateButton("Infos", 160, 368, 75, 25, $WS_GROUP)
$help = GUICtrlCreateButton("Hilfe", 240, 368, 75, 25, $WS_GROUP)
$exit = GUICtrlCreateButton("Beenden", 328, 368, 75, 25, $WS_GROUP)
$execFF = GUICtrlCreateButton("Ausführen in Firefox", 8, 392, 107, 25, $WS_GROUP)
$execIE = GUICtrlCreateButton("Ausführen in Internet Explorer", 120, 392, 155, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###While 1
[/autoit] [autoit][/autoit] [autoit]
If $iSaved = 0 Then
_WinAPI_SetWindowText($gui, "Create2HTML (Nicht gespeichert)")
Else
_WinAPI_SetWindowText($gui, "Create2HTML")
EndIf
$nMsg = GUIGetMsg(1)
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE, $exit
If $nMsg[1] = $gui Then
If $iSaved = 0 Then
$msgbox = MsgBox(35, "Beenden?","Wollen sie wirklich beenden?")
If @error Then GUIDelete($hWnd)
If $msgbox = 6 Then
FileClose($sFileName)
Exit
ElseIf $msgbox = 8 Then
GUIDelete($hWnd)
If $iSaved = 0 And Not FileExists($sFileName) Then
$sFileName = _FileSaveDialog("Speichern unter...", @ScriptDir, "HTML (*.html)")
If $sFileName <> "" Then
FileWrite($sFileName, $sHTMLText)
$iSaved = 1
EndIf
Else
FileWrite($sFileName, $sHTMLText)
EndIf
EndIf
Else
FileClose($sFileName)
Exit
EndIf
EndIfCase $help
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
MsgBox(64, "Hilfen", "Falls sie hilfe benötigen, lesen sie die Readme, falls sie ein paar JavaScript und CSS Beispiele brauchen, " & @CRLF & _
"laden sie sich die Beispiele.rar aus dem HTML Creator Thread herunter, dort sind einige Beispiele vorhanden.")
Case $infos
MsgBox(64, "Infos", "Dieses Tool erzeugt eine HTML Datei im Handumdrehen." & @CRLF & _
"Ich hoffe ihnen gefällt dieses Tool. Es ist besonders für diejenigen gemacht, die wenig bis garkeine HTML kenntnisse haben." & @CRLF & _
"Falls sie einen Bug finden, bitte an PrideRage im deutschen AutoIt Forum (AutoIt.de) berichten.!" & @CRLF & _
"Made by PrideRage"&@CRLF&"Neues Design by button421")Case $new
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$msgbox = MsgBox(292, "Bestätigen", "Möchten sie wirklich eine neue Datei erstellen ?")
If $msgbox = 6 Then
$sHTMLText = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' & @CRLF
_startup()
EndIfCase $htmlstart
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$htmlStarted = 1
$isHTML = 1
$sHTMLText &= "<html>" & @CRLFCase $head
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$headText = InputBox("Head Text", "Fügen sie einen Head Text ein (Optional)")
If $headText <> "" Then
$sHTMLText &= "<head>" & @CRLF & "<title>" & $headText & "</title>" & @CRLF & "</head>" & @CRLF
GUICtrlSetState($head, $G_D)
Else
$sHTMLText &= "<head />" & @CRLF
GUICtrlSetState($head, $G_D)
EndIfCase $save
[/autoit] [autoit][/autoit] [autoit]
If $iSaved = 0 And Not FileExists($sFileName) Then
$sFileName = _FileSaveDialog("Speichern unter...", @ScriptDir, "HTML (*.html)")
If $sFileName <> "" Then
FileOpen($sFileName, 2)
FileWrite($sFileName, $sHTMLText)
$iSaved = 1
EndIf
Else
FileWrite($sFileName, $sHTMLText)
EndIfCase $bodystart
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$bodyStarted = 1
$isBody = 1
;~ $sHTMLText &= "<body>" & @CRLF
$iBodyMode = InputBox("Body Modus","Geben sie hier den Modus vom Hintergrund vom Body ein"&@CRLF&"0 = Standardhintergrund(Weiß)"&@CRLF&"1 = Benutzerdefinierte Farbe")
If $iBodyMode = "0" Then
$sHTMLText &= "<body>" & @CRLF
ElseIf $iBodyMode = "1" Then
;~ MsgBox(64,"Test","iBodyMode = 1")
$iBodyBackground = InputBox("Hintergrund","Geben sie hier den HTML-Farbcode für den Hintergrund ein!")
$sHTMLText &= "<body bgcolor="""&$iBodyBackground&""">" & @CRLF
EndIfCase $js
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$JavaCode = _ScriptEdit("Geben sie ihren JavaScript ein")
GUIDelete($FuncPromt)
If $JavaCode <> False Then
$sHTMLText &= '<script type="text/javascript">' & @CRLF & "<!--" & @CRLF & $JavaCode & @CRLF & "//-->" & @CRLF & "</script>" & @CRLF
EndIfCase $css
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$CSSCode = _ScriptEdit("Geben sie ihren CSS Code ein")
GUIDelete($FuncPromt)
If $CSSCode <> False Then
$sHTMLText &= '<style type="text/css">' & @CRLF & $CSSCode & @CRLF & @CRLF & "</style>" & @CRLF
EndIfCase $text
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$textToPut = InputBox("Geben sie einen Text ein!", "Geben sie einen Text ein, der auf der Seite angezeigt werden soll!")
If $textToPut <> "" And IsString($textToPut) Then $sHTMLText &= "<p>" & $textToPut & "</p>" & @CRLFCase $image
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$Datei = InputBox("Datei auswählen", "Geben sie den Pfad zum Bild an (siehe Readme)")
$Alt = InputBox("Alternativtext", "Geben sie den Alternativtext ein")
If $Datei <> "" And $Alt <> "" And IsString($Datei) And IsString($Alt) Then $sHTMLText &= '<img src="' & $Datei & '" alt="' & $Alt & '">' & @CRLFCase $flash
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$flvDatei = InputBox("Version angeben", "Geben sie den Pfad der Flash Datei an (siehe Readme)")
$hexColor = InputBox("Farbe angeben", "Geben sie eine Hintergrundfarbe an (Format: #RRGGBB bsp. #000040)")
$width = InputBox("Breite angeben", "Geben sie die gewünschte Breite an (in px)")
$height = InputBox("Höhe angeben", "Geben sie die gewünschte Höhe an (in px)")
If IsString($flvDatei) And StringInStr($hexColor, "#") And StringLen($hexColor) = 7 And StringIsInt($width) And StringIsInt($height) Then
If $flvDatei <> "" Then
$sHTMLText &= '<object classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" ' & 'width="' & $width & '" ' & 'height="' & $height & '">' & @CRLF
$sHTMLText &= '<param name="movie" value="' & $flvDatei & '">' & @CRLF
$sHTMLText &= '<param name="quality" value="high">' & @CRLF & '<param name="scale" value="exactfit">' & @CRLF & '<param name="menu" value="true">' & @CRLF
$sHTMLText &= '<param name="bgcolor" value="' & $hexColor & '">' & @CRLF
$sHTMLText &= '<embed src="' & $flvDatei & '" quality="high" scale="exactfit" menu="false" bgcolor="' & $hexColor & '" width="' & $width & '" height="' & $height & '" swLiveConnect="false"' & @CRLF
$sHTMLText &= 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">' & @CRLF
$sHTMLText &= '</embed></object>' & @CRLF
EndIf
EndIfCase $video
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$videoData = InputBox("Videodatei angeben", "Bitte geben sie den Pfad zur Videodatei an. (siehe Readme)")
$width1 = InputBox("Breite angeben", "Geben sie die gewünschte Breite an (in px)")
$height1 = InputBox("Höhe angeben", "Geben sie die gewünschte Höhe an (in px)")
If IsString($videoData) And StringIsInt($width1) And StringIsInt($height1) Then
If $videoData <> "" Then
$sHTMLText &= '<embed src="' & $videoData & '" width="' & $width1 & '" height="' & $height1 & '"></embed>' & @CRLF
EndIf
EndIfCase $button
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$name = InputBox("Namen angeben", "Bitte geben sie einen Namen und den Text für den Button an (mit // trennen bsp. btn1//Klick mich)")
$onclick = InputBox("OnClick Funktion definieren", "Definieren sie eine Funktion, die beim Klicken des Buttons ausgeführt werden soll. (Cancel drücken um keine Funktion zu definieren)")
$name = StringSplit($name, "//", 1)
If $name <> "" And $onclick = "" And $name[0] = 2 And $name[2] <> "" Then
$sHTMLText &= '<input type="button" name="' & $name[1] & '" value="' & $name[2] & '">' & @CRLF
ElseIf $name <> "" And $onclick <> "" And $name[0] = 2 And $name[2] <> "" Then
$sHTMLText &= '<input type="button" name="' & $name[1] & '" value="' & $name[2] & '" onclick="' & $onclick & '">' & @CRLF
EndIfCase $newList
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$listStarted = 1
GUICtrlSetState($endList, $G_E)
$sHTMLText &= "<ul>" & @CRLFCase $endList
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$listStarted = 0
$sHTMLText &= "</ul>" & @CRLFCase $addList
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$listEntry = InputBox("Text eingeben", "Geben sie den Text für ihren Listeneintrag ein")
If $listEntry <> "" Then $sHTMLText &= "<li>" & $listEntry & "</li>" & @CRLFCase $header
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$headerEntry = InputBox("Text eingeben", "Geben sie den Text für ihren Header ein")
$headerNum = InputBox("Nummer definieren", "Definieren sie eine Nummer, die die größe des Headers repräsentiert (1 größte - 6 kleinste)")
If $headerEntry <> "" And $headerNum < 7 Then
$sHTMLText &= "<h" & $headerNum & ">" & $headerEntry & "</h" & $headerNum & ">" & @CRLF
EndIfCase $link
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$reference = InputBox("Link eingeben", "Geben sie einen Link ein")
$hrText = InputBox("Text eingeben", "Geben sie den Text ein, der als Link erscheinen soll")
If $reference <> "" And $hrText <> "" Then $sHTMLText &= '<a href="' & $reference & '">' & $hrText & '</a>' & @CRLFCase $bodyend
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$bodyStarted = 0
GUICtrlSetState($head, $G_D)
$sHTMLText &= "</body>" & @CRLFCase $htmlend
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$htmlStarted = 0
$sHTMLText &= "</html>" & @CRLFCase $execFF
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
If _CheckFF() = -1 Then
MsgBox(62, "Firefox nicht installiert", "Firefox ist nicht installiert oder wurde nicht gefunden!")
Else
If $iSaved = 0 Or Not FileExists($sFileName) Then
$sFFFile = _FileSaveDialog("Speichern unter...", @ScriptDir, "HTML (*.html)")
If $sFFFile <> "" Then
$sFileName = $sFFFile
FileOpen($sFileName, 2)
FileWrite($sFFFile, $sHTMLText)
$iSaved = 1
$sFFFile = StringReplace($sFFFile, "\", "/")
$sFFFile = StringReplace($sFFFile, " ", "%20")
$sFFFile = _StringInsert($sFFFile, "file:///", 0)
ShellExecute($sFFPath, $sFFFile)
EndIf
Else
$sFFFile = $sFileName
$sFFFile = StringReplace($sFFFile, "\", "/")
$sFFFile = StringReplace($sFFFile, " ", "%20")
$sFFFile = _StringInsert($sFFFile, "file:///", 0)
ShellExecute($sFFPath, $sFFFile)
EndIf
EndIfCase $execIE
[/autoit] [autoit][/autoit] [autoit]
If _CheckIE() = -1 Then
MsgBox(62, "Internet Explorer fehler", "Der Internet Explorer wurde nicht gefunden!")
Else
If $iSaved = 0 Or Not FileExists($sFileName) Then
$sIEFile = _FileSaveDialog("Speichern unter...", @ScriptDir, "HTML (*.html)")
If $sIEFile <> "" Then
FileOpen($sIEFile, 2)
FileWrite($sIEFile, $sHTMLText)
$iSaved = 1
ShellExecute($sIEPath, $sIEFile)
EndIf
Else
$sIEFile = $sFileName
ShellExecute($sIEPath, $sIEFile)
EndIf
EndIfCase $beginnform
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$fName = InputBox("Namen angeben", "Geben sie den Namen für die Form an")
$action = InputBox("Pfad für Aktion", "Geben sie den Pfad zur Datei an, die diese Daten verarbeiten soll. (Leerlassen falls keine Datei vorhanden)")
$method = InputBox("Methode eingeben", "Geben sie eine Methode zur weiterverarbeitung ein. (get, post oder lassen sie das Feld frei.)")
If $fName <> "" Then
$formStarted = 1
$sHTMLText &= '<form name="' & $fName & '" action="' & $action & '" method="' & $method & '">' & @CRLF
EndIfCase $endform
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$formStarted = 0
$sHTMLText &= "</form>" & @CRLFCase $textfield
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$name = InputBox("Namen angeben", "Geben sie den Namen für das Textfeld ein")
$size = InputBox("Größe angeben", "Geben sie die größe des Textfeldes ein")
$maxlen = InputBox("Länge angeben", "Geben sie die länge für das Textfeld ein (Diese Zahl repräsentiert die maximale Anzahl an Buchstaben)")
$stdVal = InputBox("Standard Text", "Geben sie einen standard Text ein (Optional)")
If $name <> "" And $size <> "" And $maxlen <> "" Then
$sHTMLText &= '<input name="' & $name & '" type="text" size=' & $size & ' maxlength = ' & $maxlen & ' value="' & $stdVal & '">' & @CRLF
EndIfCase $useJSFile
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$jsPath = InputBox("Pfad angeben", "Geben sie den Pfad zu der JavaScript (*.js) Datei an")
If $jsPath <> "" And StringInStr($jsPath, ".js") Then
$sHTMLText &= '<script src="' & $jsPath & '" type="text/javascript"></script>' & @CRLF
EndIfCase $useCSSFile
[/autoit] [autoit][/autoit] [autoit]
$iSaved = 0
$cssPath = InputBox("Pfad angeben", "Geben sie den Pfad zu der CSS (*.css) Datei an")
If $cssPath <> "" And StringInStr($cssPath, ".css") Then
$sHTMLText &= '<link rel="stylesheet" type="text/css" href="' & $cssPath & '">' & @CRLF
EndIfCase $crlf
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
_GUICtrlEdit_AppendText($srcEditor, _br())EndSwitch
[/autoit] [autoit][/autoit] [autoit]If $sHTMLText <> $sHTMLBackup Then GUICtrlSetData($srcEditor, $sHTMLText)
[/autoit] [autoit][/autoit] [autoit]
If $sHTMLText <> GUICtrlRead($srcEditor) Then $sHTMLText = GUICtrlRead($srcEditor)
$sHTMLBackup = $sHTMLTextIf $htmlStarted = 0 And $hS = 0 Then
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($head, $G_D)
GUICtrlSetState($bodystart, $G_D)
GUICtrlSetState($js, $G_D)
GUICtrlSetState($css, $G_D)
GUICtrlSetState($text, $G_D)
GUICtrlSetState($image, $G_D)
GUICtrlSetState($flash, $G_D)
GUICtrlSetState($video, $G_D)
GUICtrlSetState($button, $G_D)
GUICtrlSetState($addList, $G_D)
GUICtrlSetState($newList, $G_D)
GUICtrlSetState($endList, $G_D)
GUICtrlSetState($header, $G_D)
GUICtrlSetState($link, $G_D)
GUICtrlSetState($htmlend, $G_D)
GUICtrlSetState($bodyend, $G_D)
GUICtrlSetState($beginnform, $G_D)
GUICtrlSetState($endform, $G_D)
GUICtrlSetState($textfield, $G_D)
GUICtrlSetState($useJSFile, $G_D)
GUICtrlSetState($useCSSFile, $G_D)
GUICtrlSetState($crlf, $G_D)
$hS = 1
ElseIf $htmlStarted = 1 And $hS = 1 Then
GUICtrlSetState($bodystart, $G_E)
GUICtrlSetState($head, $G_E)
$hS = 0
EndIfIf $bodyStarted = 0 And $bs = 0 Then
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($js, $G_D)
GUICtrlSetState($css, $G_D)
GUICtrlSetState($text, $G_D)
GUICtrlSetState($image, $G_D)
GUICtrlSetState($flash, $G_D)
GUICtrlSetState($video, $G_D)
GUICtrlSetState($button, $G_D)
GUICtrlSetState($addList, $G_D)
GUICtrlSetState($newList, $G_D)
GUICtrlSetState($endList, $G_D)
GUICtrlSetState($header, $G_D)
GUICtrlSetState($link, $G_D)
GUICtrlSetState($bodyend, $G_D)
GUICtrlSetState($beginnform, $G_D)
GUICtrlSetState($endform, $G_D)
GUICtrlSetState($textfield, $G_D)
GUICtrlSetState($useJSFile, $G_D)
GUICtrlSetState($useCSSFile, $G_D)
GUICtrlSetState($crlf, $G_D)
$bs = 1
ElseIf $bodyStarted = 1 And $bs = 1 Then
GUICtrlSetState($js, $G_E)
GUICtrlSetState($css, $G_E)
GUICtrlSetState($text, $G_E)
GUICtrlSetState($image, $G_E)
GUICtrlSetState($flash, $G_E)
GUICtrlSetState($video, $G_E)
GUICtrlSetState($button, $G_E)
GUICtrlSetState($newList, $G_E)
GUICtrlSetState($header, $G_E)
GUICtrlSetState($link, $G_E)
GUICtrlSetState($htmlend, $G_E)
GUICtrlSetState($bodyend, $G_E)
GUICtrlSetState($beginnform, $G_E)
GUICtrlSetState($textfield, $G_E)
GUICtrlSetState($useJSFile, $G_E)
GUICtrlSetState($useCSSFile, $G_E)
GUICtrlSetState($crlf, $G_E)
$bs = 0
EndIfIf $listStarted = 0 And $lS = 0 Then
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($addList, $G_D)
GUICtrlSetState($endList, $G_D)
$lS = 1
ElseIf $listStarted = 1 And $lS = 1 Then
GUICtrlSetState($addList, $G_E)
GUICtrlSetState($endList, $G_E)
$lS = 0
EndIfIf $formStarted = 0 And $fS = 0 Then
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($endform, $G_D)
$fS = 1
ElseIf $formStarted = 1 And $fS = 1 Then
GUICtrlSetState($endform, $G_E)
$fS = 0
EndIfIf $isHTML = 1 And $ih = 0 Then
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($htmlstart, $G_D)
$ih = 1
ElseIf $isBody = 1 And $ib = 0 Then
GUICtrlSetState($bodystart, $G_D)
$ib = 1
EndIfSleep(10)
[/autoit] [autoit][/autoit] [autoit]
WEndFunc _ScriptEdit($sTitle)
[/autoit] [autoit][/autoit] [autoit]
$FuncPromt = GUICreate($sTitle, 634, 455, 191, 123)
$script = GUICtrlCreateEdit("", 0, 0, 633, 393)
GUICtrlSetFont(-1, 12, 400, 0, "Courier New")
$done = GUICtrlCreateButton("Fertig", 8, 400, 81, 41, $WS_GROUP)
GUISetState(@SW_SHOW)While 1
[/autoit] [autoit][/autoit] [autoit]
Switch GUIGetMsg()
Case -3
Return False
Case $done
Return GUICtrlRead($script)
EndSwitch
WEnd
EndFunc ;==>_ScriptEditFunc _FileSaveDialog($sTitle, $sInitDir, $sFilter = 'All (*.*)')
[/autoit] [autoit][/autoit] [autoit]
Local $sDiag = FileSaveDialog($sTitle, $sInitDir, $sFilter)
If Not @error Then
$sDiag &= ".html"
FileWrite($sDiag, $sHTMLText)
Return $sDiag
EndIf
EndFunc ;==>_FileSaveDialogFunc _MsgBoxEx($sTitle, $sText, $iButtonNum, $sButton1 = "", $sButton2 = "", $sButton3 = "", $sButton4 = "")
[/autoit] [autoit][/autoit] [autoit]
Local $iHwndLen = $iButtonNum * 120, $iBtnDist = 0
Dim $hButtons[$iButtonNum], $sBtnText[4] = [$sButton1, $sButton2, $sButton3, $sButton4]$hWnd = GUICreate($sTitle, $iHwndLen, 150, -1, -1, BitOR($WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER, $WS_CLIPSIBLINGS), BitOR($WS_EX_APPWINDOW, $WS_EX_WINDOWEDGE))
[/autoit] [autoit][/autoit] [autoit]
$hLabel = GUICtrlCreateLabel($sText, 16, 8, $iHwndLen - 10, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
For $i = 0 To $iButtonNum - 1
$hButtons[$i] = GUICtrlCreateButton($sBtnText[$i], 15 + $iBtnDist, 70, 80, 40, $WS_GROUP)
$iBtnDist += 90
Next
GUISetState(@SW_SHOW)While 1
[/autoit] [autoit][/autoit] [autoit]
$gMsg = GUIGetMsg()
If $gMsg = -3 Then Return SetError(-1, 0, -1)
For $a = 0 To $iButtonNum - 1
If $gMsg = $hButtons[$a] Then Return $a
Next
WEnd
EndFunc ;==>_MsgBoxExFunc _CheckFF()
[/autoit] [autoit][/autoit] [autoit]
$FFVersion = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\", "CurrentVersion")
If @error Then Return -1
$FFPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\" & $FFVersion & "\Main", "PathToExe")
IniWrite("infos.ini", "Browsers", "FF", $FFPath)
EndFunc ;==>_CheckFFFunc _CheckIE()
[/autoit] [autoit][/autoit] [autoit]
$IEPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IE Setup\Setup", "Path")
If @error Then Return -1
If StringInStr($IEPath, "%programfiles%") Then $IEPath = StringReplace($IEPath, "%programfiles%", @ProgramFilesDir)
$IEPath &= "\iexplore.exe"
IniWrite("infos.ini", "Browsers", "IE", $IEPath)
EndFunc ;==>_CheckIEFunc _br()
[/autoit] [autoit][/autoit] [autoit]
$sHTMLText &= "<br>"
EndFuncFunc _startup()
[/autoit] [autoit][/autoit] [autoit]
If $htmlStarted = 0 And $hS = 0 Then
GUICtrlSetState($head, $G_D)
GUICtrlSetState($bodystart, $G_D)
GUICtrlSetState($js, $G_D)
GUICtrlSetState($css, $G_D)
GUICtrlSetState($text, $G_D)
GUICtrlSetState($image, $G_D)
GUICtrlSetState($flash, $G_D)
GUICtrlSetState($video, $G_D)
GUICtrlSetState($button, $G_D)
GUICtrlSetState($addList, $G_D)
GUICtrlSetState($newList, $G_D)
GUICtrlSetState($endList, $G_D)
GUICtrlSetState($header, $G_D)
GUICtrlSetState($link, $G_D)
GUICtrlSetState($htmlend, $G_D)
GUICtrlSetState($bodyend, $G_D)
GUICtrlSetState($beginnform, $G_D)
GUICtrlSetState($endform, $G_D)
GUICtrlSetState($textfield, $G_D)
GUICtrlSetState($useJSFile, $G_D)
GUICtrlSetState($useCSSFile, $G_D)
GUICtrlSetState($crlf, $G_D)
$hS = 1
ElseIf $htmlStarted = 1 And $hS = 1 Then
GUICtrlSetState($bodystart, $G_E)
GUICtrlSetState($head, $G_E)
$hS = 0
EndIfIf $bodyStarted = 0 And $bs = 0 Then
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($js, $G_D)
GUICtrlSetState($css, $G_D)
GUICtrlSetState($text, $G_D)
GUICtrlSetState($image, $G_D)
GUICtrlSetState($flash, $G_D)
GUICtrlSetState($video, $G_D)
GUICtrlSetState($button, $G_D)
GUICtrlSetState($addList, $G_D)
GUICtrlSetState($newList, $G_D)
GUICtrlSetState($endList, $G_D)
GUICtrlSetState($header, $G_D)
GUICtrlSetState($link, $G_D)
GUICtrlSetState($bodyend, $G_D)
GUICtrlSetState($beginnform, $G_D)
GUICtrlSetState($endform, $G_D)
GUICtrlSetState($textfield, $G_D)
GUICtrlSetState($useJSFile, $G_D)
GUICtrlSetState($useCSSFile, $G_D)
GUICtrlSetState($crlf, $G_D)
$bs = 1
ElseIf $bodyStarted = 1 And $bs = 1 Then
GUICtrlSetState($js, $G_E)
GUICtrlSetState($css, $G_E)
GUICtrlSetState($text, $G_E)
GUICtrlSetState($image, $G_E)
GUICtrlSetState($flash, $G_E)
GUICtrlSetState($video, $G_E)
GUICtrlSetState($button, $G_E)
GUICtrlSetState($newList, $G_E)
GUICtrlSetState($header, $G_E)
GUICtrlSetState($link, $G_E)
GUICtrlSetState($htmlend, $G_E)
GUICtrlSetState($bodyend, $G_E)
GUICtrlSetState($beginnform, $G_E)
GUICtrlSetState($textfield, $G_E)
GUICtrlSetState($useJSFile, $G_E)
GUICtrlSetState($useCSSFile, $G_E)
GUICtrlSetState($crlf, $G_E)
$bs = 0
EndIfIf $listStarted = 0 And $lS = 0 Then
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($addList, $G_D)
GUICtrlSetState($endList, $G_D)
$lS = 1
ElseIf $listStarted = 1 And $lS = 1 Then
GUICtrlSetState($addList, $G_E)
GUICtrlSetState($endList, $G_E)
$lS = 0
EndIfIf $formStarted = 0 And $fS = 0 Then
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($endform, $G_D)
$fS = 1
ElseIf $formStarted = 1 And $fS = 1 Then
GUICtrlSetState($endform, $G_E)
$fS = 0
EndIfIf $isHTML = 1 And $ih = 0 Then
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($htmlstart, $G_D)
$ih = 1
ElseIf $isBody = 1 And $ib = 0 Then
GUICtrlSetState($bodystart, $G_D)
$ib = 1
EndIfIf $formStarted = 0 And $fS = 0 Then
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($endform, $G_D)
$fS = 1
ElseIf $formStarted = 1 And $fS = 1 Then
GUICtrlSetState($endform, $G_E)
$fS = 0
EndIfIf $isHTML = 1 And $ih = 0 Then
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($htmlstart, $G_D)
$ih = 1
ElseIf $isBody = 1 And $ib = 0 Then
GUICtrlSetState($bodystart, $G_D)
$ib = 1
EndIfSleep(10)
[/autoit] [autoit][/autoit] [autoit][/autoit]
EndFuncHoffentlich meldet sich PrideRage zu diesem Thread...
MfG button421
-
Hi, gutes Projekt! Das Design könntest du vlt. noch mal ändern. Kann ich mit diesem Skript ein alternatives Programm skripten?
-
Ein Tipp:
Ich kann es zwar selbst nicht, aber in der InputBox könnte man auch noch den Variablennamen eingeben. -
Danke. Ist zwar für euch eine leichte Sache, aber für mich

-
Hallo Leute,
ich hab gestern abend in der Shoutbox eine Antwort auf meine Frage mit der Progressbar bekommen.
Ich sollte eine Marquee Progressbar benutzen. Wie muss ich das in Koda einstellen.
Ich habs versucht mit dem Style $PBS_MARQUEE. Das geht nicht. Wie muss dann das GUICtrlSetData einstellen?Danke erstmal.
MfG button421
-
Happy Birthday progandy und alles Gute nachträglich!
PS: Du hast am gleichen Tag wie meine Schwester Geburtstag!

-
aha, aber es funktioniert so, also lasse ich es so

-
Danke, bei der Zeile
Zitat[autoit]
[/autoit]
If @error = "an" Then ;diese Zeile verstehe ich garnicht da GuiSetState keinen @Error-Wert setztist es so, da die Radiobuttons Einschalten und Ausschalten irgendwas setzen müssen, damit die Zeile oben weiß, was ausgewählt wurde. Da steht ja:
[autoit]
[/autoit]
Case $onoutput
If BitAND(GUICtrlRead($onoutput),$GUI_CHECKED)Then ;Ist "Einschalten" gewählt? Wenn ja,
SetError("an") ;@error auf "an" setzen
EndIf
Case $offoutput
If BitAND(GUICtrlRead($offoutput),$GUI_CHECKED)Then ;Ist "Auschalten" gewählt? Wenn ja,
SetError("aus") ;@error auf "aus" setzen
EndIf
Verstanden? -
bitte könnt ihr mir das sagen, meine Mitschüler warten schon auf das Programm.
Ich will nicht pushen.
Danke! -
Du kannst ja die erste GUI auf @SW_HIDE und die Hauptgui auf @SW_SHOW stellen, so kommst du vorbei. Es steht aus irgendeinem Grund da aber immer ".: Ist 0 ein? Wenn ja, dann :." Kannst du mir sagen was das Problem ist? Danke
-
versteht ihr was ich meine?
-
Hallo Leute,
Ich habe mit meinem K8055 Programmer mal wieder ein Problem und zwar:
Wenn ich eine Aktion in "Aktion Hinzufügen" auswähle, und die Daten festlege und auf OK klicke, stehen in der ListView nicht nur "Aktion" sondern gleich andere auch, die ich garnicht ausgewählt habe.
Die IniSection "Aktion" wird davor ja aber immer gelöscht.
Was mache ich Falsch?Mein Skript
[autoit]
[/autoit]
#region includes ;########################
#include <k8055udf.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiStatusBar.au3>
#include <ListViewConstants.au3>
#include <ComboConstants.au3>
#endregion includes
;##########################################
Global $adressebin=""
Global $aktion="Programm erfolgreich gestartet"
Global $ini=@ScriptDir&"\logdatei.ini"
Global $title,$text,$probs,$outputlabel,$outputcombo,$onoutput,$offoutput
global $inisection2
IniDelete($ini,"log")
IniDelete($ini,"startdaten")
IniDelete($ini,"inputs")
IniDelete($ini,"outputs")
IniDelete($ini,"aktion")
IniWrite($ini,"log","Startdaten",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&"-Datum:"&@MDAY&"."&@MON&"."&@YEAR)
#Region ### START Verbindungsform ### Form=
$verbindungsform = GUICreate("Verbindung", 184, 100, 190, 126, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
$SK5 = GUICtrlCreateCheckbox("SK5", 24, 16, 41, 17)
$SK6 = GUICtrlCreateCheckbox("SK6", 128, 16, 41, 17)
$Adresse = GUICtrlCreateGroup("Adresse", 8, 0, 169, 41)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateLabel("<---------------->", 64, 16, 64, 17)
$Progress1 = GUICtrlCreateProgress(0, 80, 182, 17)
$mitboardverbinden = GUICtrlCreateButton("Mit K8055 Board verbinden", 8, 48, 171, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Verbindungsform ###
;##########################################
#Region ### START Hauptform ### Form=c:\users\jonathan verbeek\desktop\k8055 programmer\hauptform.kxf
$Form1_1 = GUICreate("K8055 Board Programmer Basicpack - created by button421", 519, 412, 187, 121)
$statusleiste = _GUICtrlStatusBar_Create($Form1_1)
Dim $statusleiste_PartsWidth[2] = [439, -1]
_GUICtrlStatusBar_SetParts($statusleiste, $statusleiste_PartsWidth)
_GUICtrlStatusBar_SetText($statusleiste, $aktion, 0)
_GUICtrlStatusBar_SetText($statusleiste, "Verbunden", 1)
$DigitaleEingaenge = GUICtrlCreateGroup("Digitale Eingänge", 8, 0, 169, 41)
$I1 = GUICtrlCreateCheckbox("I1", 16, 16, 25, 17)
$I2 = GUICtrlCreateCheckbox("I2", 48, 16, 25, 17)
$I3 = GUICtrlCreateCheckbox("I3", 80, 16, 25, 17)
$I4 = GUICtrlCreateCheckbox("I4", 112, 16, 25, 17)
$I5 = GUICtrlCreateCheckbox("I5", 144, 16, 25, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$DigitaleAusgaenge = GUICtrlCreateGroup("Digitale Ausgänge", 184, 0, 329, 41)
$O1 = GUICtrlCreateCheckbox("O1", 192, 16, 33, 17)
$O2 = GUICtrlCreateCheckbox("O2", 232, 16, 33, 17)
$O3 = GUICtrlCreateCheckbox("O3", 272, 16, 33, 17)
$O4 = GUICtrlCreateCheckbox("O4", 312, 16, 33, 17)
$O5 = GUICtrlCreateCheckbox("O5", 352, 16, 33, 17)
$O6 = GUICtrlCreateCheckbox("O6", 392, 16, 33, 17)
$O7 = GUICtrlCreateCheckbox("O7", 432, 16, 33, 17)
$O8 = GUICtrlCreateCheckbox("O8", 472, 16, 33, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$ListView1 = GUICtrlCreateListView("Aktionen", 8, 48, 506, 310)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 502)
$addaktion = GUICtrlCreateButton("Aktion hinzufügen", 8, 360, 107, 25, $WS_GROUP)
$delaktion = GUICtrlCreateButton("Aktion löschen", 120, 360, 91, 25, $WS_GROUP)
$anleitung = GUICtrlCreateButton("Anleitung für Experimente", 216, 360, 131, 25, $WS_GROUP)
$hilfe = GUICtrlCreateButton("Hilfe und Info", 352, 360, 75, 25, $WS_GROUP)
$beenden = GUICtrlCreateButton("Beenden", 432, 360, 75, 25, $WS_GROUP)
GUISetState(@SW_HIDE)
#EndRegion ### END Hauptform ###
;#######################################
#Region ### START Aktion hinzufügen ### Form=
$actionadd = GUICreate("Aktion hinzufügen", 246, 187, 192, 124, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
$Aktionlabel = GUICtrlCreateLabel("Aktion:", 8, 8, 37, 17)
$aktioncombo = GUICtrlCreateCombo("", 48, 8, 193, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Meldung anzeigen|Digitalen Ausgang ein/ausschalten|Abfrage ob Digitaler Eingang ein")
$probs = GUICtrlCreateGroup("Einstellungen für Aktion festlegen", 8, 32, 233, 121)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$cancelactionadd = GUICtrlCreateButton("Abbrechen", 168, 160, 75, 25, $WS_GROUP)
$okactionadd = GUICtrlCreateButton("OK", 88, 160, 75, 25, $WS_GROUP)
GUISetState(@SW_HIDE)
#EndRegion ### END Aktion hinzufügen ###
;#######################################
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3, $beenden
Exit
Case $SK5
If BitAND(GUICtrlRead($SK5),$GUI_CHECKED) Then
$adressebin = "SK5/"
EndIf
Case $SK6
If BitAND(GUICtrlRead($SK6),$GUI_CHECKED) Then
$adressebin = "SK6/"
EndIf
Case $mitboardverbinden
If GUICtrlRead($adressebin) = "SK5/SK6/" Then
USB_DLLOpen()
initial_board(0)
GUICtrlSetState($Progress1, 100)
MsgBox(64,"Info","Mit Board verbunden!")
GUISetState(@SW_SHOW, $Form1_1)
GUISetState(@SW_HIDE, $verbindungsform)
ElseIf GUICtrlRead($adressebin) = "SK6/" Then
USB_DLLOpen()
initial_board(1)
GUICtrlSetState($Progress1, 100)
MsgBox(64,"Info","Mit Board verbunden!")
GUISetState(@SW_SHOW, $Form1_1)
GUISetState(@SW_HIDE, $verbindungsform)
ElseIf GUICtrlRead($adressebin) = "SK5/" Then
USB_DLLOpen()
initial_board(2)
GUICtrlSetState($Progress1, 100)
MsgBox(64,"Info","Mit Board verbunden!")
GUISetState(@SW_SHOW, $Form1_1)
GUISetState(@SW_HIDE, $verbindungsform)
Else
USB_DLLOpen()
initial_board(3)
GUICtrlSetState($Progress1, 100)
MsgBox(64,"Info","Mit Board verbunden!")
GUISetState(@SW_SHOW, $Form1_1)
GUISetState(@SW_HIDE, $verbindungsform)
EndIf
$msg = MsgBox(36,"Du weißt es?","Weißt du wie das Programm funktioniert? Wenn ja, klick auf Nein!"&@CRLF&"Brauchst du Hilfe?")
If $msg = 7 Then
MsgBox(64,"OK","Viel Spass noch!")
ElseIf $msg = 6 Then
MsgBox(64,"Hilfe","Also:"&@CRLF&"Als erstes musst du die Eingänge und Ausgänge die du verwenden willst auswählen,"&@CRLF&"dann klickst du auf Neue Aktion und wählst den Aktionstyp aus. Wenn du dabei Hilfe brauchst, schreibe eine Mail an:"&@CRLF&"jverbeek@freenet.de"&@CRLF&"Drücke F2 um Sleep einzusetzen.")
EndIf
;Eingänge
Case $I1
If BitAND(GUICtrlRead($I1),$GUI_CHECKED)Then
IniDelete($ini,"inputs")
IniWrite($ini,"inputs","I1","1")
Else
IniDelete($ini,"inputs")
IniWrite($ini,"inputs","I1","0")
EndIf
Case $I2
If BitAND(GUICtrlRead($I2),$GUI_CHECKED)Then
IniDelete($ini,"inputs","I2")
IniWrite($ini,"inputs","I2","1")
Else
IniDelete($ini,"inputs","I2")
IniWrite($ini,"inputs","I2","0")
EndIf
Case $I3
If BitAND(GUICtrlRead($I3),$GUI_CHECKED)Then
IniDelete($ini,"inputs","I3")
IniWrite($ini,"inputs","I3","1")
Else
IniDelete($ini,"inputs","I3")
IniWrite($ini,"inputs","I3","0")
EndIf
Case $I4
If BitAND(GUICtrlRead($I4),$GUI_CHECKED)Then
IniDelete($ini,"inputs","I4")
IniWrite($ini,"inputs","I4","1")
Else
IniDelete($ini,"inputs","I4")
IniWrite($ini,"inputs","I4","0")
EndIf
Case $I5
If BitAND(GUICtrlRead($I5),$GUI_CHECKED)Then
IniDelete($ini,"inputs","I5")
IniWrite($ini,"inputs","I5","1")
Else
IniDelete($ini,"inputs","I5")
IniWrite($ini,"inputs","I5","0")
EndIf
;Ausgänge
Case $O1
If BitAND(GUICtrlRead($O1),$GUI_CHECKED)Then
IniDelete($ini,"outputs","O1")
IniWrite($ini,"outputs","O1","1")
Else
IniDelete($ini,"outputs","O2")
IniWrite($ini,"outputs","O1","0")
EndIf
Case $O2
If BitAND(GUICtrlRead($O2),$GUI_CHECKED)Then
IniDelete($ini,"outputs","O2")
IniWrite($ini,"outputs","O2","1")
Else
IniDelete($ini,"outputs","O2")
IniWrite($ini,"outputs","O2","0")
EndIf
Case $O3
If BitAND(GUICtrlRead($O3),$GUI_CHECKED)Then
IniDelete($ini,"outputs","O3")
IniWrite($ini,"outputs","O3","1")
Else
IniDelete($ini,"outputs","O3")
IniWrite($ini,"outputs","O3","0")
EndIf
Case $O4
If BitAND(GUICtrlRead($O4),$GUI_CHECKED)Then
IniDelete($ini,"outputs","O4")
IniWrite($ini,"outputs","O4","1")
Else
IniDelete($ini,"outputs","O4")
IniWrite($ini,"outputs","O4","0")
EndIf
Case $O5
If BitAND(GUICtrlRead($O5),$GUI_CHECKED)Then
IniDelete($ini,"outputs","O5")
IniWrite($ini,"outputs","O5","1")
Else
IniDelete($ini,"outputs","O5")
IniWrite($ini,"outputs","O5","0")
EndIf
Case $O6
If BitAND(GUICtrlRead($O6),$GUI_CHECKED)Then
IniDelete($ini,"outputs","O6")
IniWrite($ini,"outputs","O6","1")
Else
IniDelete($ini,"outputs","O6")
IniWrite($ini,"outputs","O6","0")
EndIf
Case $O7
If BitAND(GUICtrlRead($O7),$GUI_CHECKED)Then
IniDelete($ini,"outputs","O7")
IniWrite($ini,"outputs","O7","1")
Else
IniDelete($ini,"outputs","O7")
IniWrite($ini,"outputs","O7","0")
EndIf
Case $O8
If BitAND(GUICtrlRead($O8),$GUI_CHECKED)Then
IniDelete($ini,"outputs","O8")
IniWrite($ini,"outputs","O8","1")
Else
IniDelete($ini,"outputs","O8")
IniWrite($ini,"outputs","O8","0")
EndIf
Case $addaktion
GUISetState(@SW_SHOW, $actionadd)
GUICtrlDelete($probs)
Case $aktioncombo
If GUICtrlRead($aktioncombo) = "Meldung anzeigen" Then
$probs = GUICtrlCreateGroup("Einstellungen für Meldung festlegen", 8, 32, 233, 121)
$title = GUICtrlCreateInput("Titel der Meldung",17,45,217,21)
$text = GUICtrlCreateInput("Text der Meldung",17,70,217,73)
IniDelete($ini,"aktion")
IniWrite($ini,"aktion","Msg","1")
EndIf
If GUICtrlRead($aktioncombo) = "Digitalen Ausgang Ein/Ausschalten" Then
GUICtrlDelete($probs)
GUICtrlDelete($title)
GUICtrlDelete($text)
$probs = GUICtrlCreateGroup("Einstellungen für Ausgang festlegen", 8, 32, 233, 121)
$outputlabel = GUICtrlCreateLabel("Ausgang:",11,80,49,17)
$outputcombo = GUICtrlCreateCombo("",64,80,153,17, $CBS_DROPDOWNLIST)
$inisection = IniReadSection($ini, "outputs")
For $i = 1 To $inisection[0][0]
If $inisection[$i][1] Then GUICtrlSetData($outputcombo, $inisection[$i][0])
Next
IniDelete($ini,"aktion")
IniWrite($ini,"aktion","SetDigitalChannel","1")
$onoutput = GUICtrlCreateRadio("Einschalten",20,115,81,17,$BS_AUTORADIOBUTTON)
$offoutput = GUICtrlCreateRadio("Ausschalten",20,130,81,17, $BS_AUTORADIOBUTTON)
EndIf
If GUICtrlRead($aktioncombo) = "Abfrage ob Digitaler Eingang ein" Then
GUICtrlDelete($probs)
GUICtrlDelete($title)
GUICtrlDelete($text)
GUICtrlDelete($probs)
GUICtrlDelete($outputlabel)
GUICtrlDelete($outputcombo)
GUICtrlDelete($onoutput)
GUICtrlDelete($offoutput)
$probs = GUICtrlCreateGroup("Einstellung für Abfrage festlegen",8,32,233,121)
$inputlabel = GUICtrlCreateLabel("Eingang:",8,100,49,17)
$inputcombo = GUICtrlCreateCombo("",72,100,145,25,$CBS_DROPDOWNLIST)
$inisection2 = IniReadSection($ini, "inputs")
For $i_2 = 1 To $inisection2[0][0]
If $inisection2[$i_2][1] Then GUICtrlSetData($inputcombo, $inisection2[$i_2][0])
Next
IniDelete($ini,"aktion")
IniWrite($ini,"aktion","ReadDigitalChannel","1")
EndIf
Case $onoutput
If BitAND(GUICtrlRead($onoutput),$GUI_CHECKED)Then
SetError("an")
EndIf
Case $offoutput
If BitAND(GUICtrlRead($offoutput),$GUI_CHECKED)Then
SetError("aus")
EndIf
Case $okactionadd
If IniRead($ini,"aktion","Msg","1")Then
IniDelete($ini,"aktion","SetDigitalChannel")
IniDelete($ini,"aktion","ReadDigitalChannel")
GUISetState(@SW_HIDE,$actionadd)
GUICtrlCreateListViewItem("Meldung anzeigen("&GUICtrlRead($title)&","&GUICtrlRead($text)&")",$ListView1)
EndIf
If IniRead($ini,"aktion","SetDigitalChannel","1")Then
IniDelete($ini,"aktion","Msg")
IniDelete($ini,"aktion","ReadDigitalChannel")
GUISetState(@SW_HIDE,$actionadd)
If @error = "an" Then
GUICtrlCreateListViewItem("Digitalen Ausgang setzen("&GUICtrlRead($outputcombo)&",an)",$ListView1)
Else
GUICtrlCreateListViewItem("Digitalen Ausgang setzen("&GUICtrlRead($outputcombo)&",aus)",$ListView1)
EndIf
EndIf
If IniRead($ini,"aktion","ReadDigitalChannel","1")Then
IniDelete($ini,"aktion","SetDigitalChannel")
IniDelete($ini,"aktion","Msg")
GUICtrlCreateListViewItem(".: Ist Input "&GUICtrlRead($inputcombo)&" ein? Wenn ja, dann :.",$ListView1)
IniWrite($ini,"aktiondetails","ReadDigitalInput-Input",GUICtrlRead($inputcombo))
EndIf
EndSwitch
WEnd
MfG
button421 -
Danke für die ganzen Antworten. Ich habe es jetzt so hingekriegt:
plan
|----Schalter----150Ohm---Pin Display
|----Schalter----150Ohm---Pin Display
|----Schalter----150Ohm---Pin Display
|----Schalter----150Ohm---Pin Display
|----Schalter----150Ohm---Pin Display
|----Schalter----150Ohm---Pin Display
|----Schalter----150Ohm---Pin Display
|----Schalter----150Ohm---Pin Display
-
4.5v
+ -------Powerpin DisplayWas findet ihr denn jetzt mal besser?
Hab oben eine Umfrage gemacht.button421
-
Andy: Ich kann aber leider nicht löten
Muss ich den -Pol überhaupt verbinden oder kann ich ihn einfach leer lassen? Ich möchte bei diesem Projekt nicht mit dem K8055 arbeiten, daher brauche ich irgendeine Masse.
Reicht auch einfach nur ne Murmel oder so was? -
ich besitze das Display bereits und habe es genauso wie oben (ohne Schalter) aufgebaut, und es funktioniert.
Außerdem habe ich das noch vergessen:+--------------------Powerpin von Display
4.5v
-
|
|
|
GNDEDIT// Wie soll ich überhaupt GND bauen? Ein Stück Metall? Als ich es aufgebaut hatte, habe ich die GND-Stelle an die GND Klemme vom K8055 geschraubt. Ohne das, weiß ich leider nicht wie ich GND bauen soll.
-
Oscar : ich habe ein 7-Segment Display und 150Ohm Widerstände.
So soll es werden:Plan
|---Kippschalter-------150Ohm Widerstand-----Pin von 7-Segment-Display
|---Kippschalter-------150Ohm Widerstand-----Pin von 7-Segment-Display
|---Kippschalter-------150Ohm Widerstand-----Pin von 7-Segment-Display
|---Kippschalter-------150Ohm Widerstand-----Pin von 7-Segment-Display
|---Kippschalter-------150Ohm Widerstand-----Pin von 7-Segment-Display
|---Kippschalter-------150Ohm Widerstand-----Pin von 7-Segment-Display
|---Kippschalter-------150Ohm Widerstand-----Pin von 7-Segment-Display
|---Kippschalter-------150Ohm Widerstand-----Pin von 7-Segment-Display
+
9v
|
GNDFunktioniert das so?
-
Hallo!
Hab was vor mit Elektronik zu bauen, dazu brauch ich 8 Schalter.
Nun stellt sich die Frage, was für Schalter: Kippschalter oder Wippschalter?
Nebenbei brauche ich noch eine gelbe LED.
Meine Rechnungen:Kippschalter und LED:
Kippschalter BILLIG - Conrad BN: 701351-62 - 8x = 6.32€
+LED GELB - Conrad BN: 140099-62 - 1x = 0,19€
--------------------------------------------------------------------------
Alles zusammen: 6,51€Wippschalter und LED:
Wippschalter BILLIG - Conrad BN: 70862-62 - 8x = 5,60€
+LED GELB - Conrad BN: 140099-62 - 1x = 0,19€
-------------------------------------------------------------------------
Alles zusammen: 5,79€Vom Preis her kann ich alles bezahlen, ich kann mich nur zwischen beiden Arten nicht richtig entscheiden.
Was würdet ihr nehmen?MfG button421

-
Oh, es kam weil ich keine Outputs gewählt hatte! Fehlalarm!