;-- TIME_STAMP 2018-11-26 02:25:30 v 0.1 ; User: Bitnugger ; Link: https://autoit.de/index.php?thread/86216-sehr-schnell-in-gui-schreiben/&postID=692506#post692506 ; verändert von Mücke mit mehreren GUI`s und tastenkürzeln #Region ;************ Includes ************ #include #include #include #include #include #include #EndRegion ;************ Includes ************ Global $Taste_Abbruch ; Tastaturbelegung für Programm Abbruch Global $Taste_Button ; Tastaturbelegung für Button Global $Taste_Formular_Save ; Tastaturbelegung für Formulare speichern Global $Taste_Hilfe ; Tastaturbelegung für Hilfe der Tastaturbelegung Global $ID_GUI_Start ; ID für die GUI beim Programm Start Global $ID_GUI_Warten ; ID für die GUI beim Warten auf PushButton Global $ID_GUI_Play ; ID für die GUI beim Stopuhr laufen Global $ID_GUI_Formular ; ID für die GUI beim Formular Global $GUI_Start_BG_Color ; GUI Background Color Global $GUI_Start_Font_Color ; GUI Font Color Global $GUI_Start_Font_Size ; GUI Schriftgröße Global $GUI_Warten_BG_Color ; GUI Background Color Global $GUI_Warten_Font_Color ; GUI Font Color Global $GUI_Warten_Font_Size ; GUI Schriftgröße Global $GUI_Play_BG_Color ; GUI Background Color Global $GUI_Play_Font_Color ; GUI Background Color Global $GUI_Play_Font_Size ; GUI Schriftgröße Global $GUI_Formular_BG_Color ; GUI Background Color Global $GUI_Formular_Font_Color ; GUI Background Color Global $GUI_Formular_Font_Size ; GUI Schriftgröße Global $Status = "Start" ; Programm Status Global $Status_GUI_Open = "" ; Welche GUI als letztes geöffnet wurde Global $ToolTip_Display = False ; False = Anzeige inaktive // True = Anzeige Aktive Global $ToolTip_Text Global $Dateinamen ; Datei Pfad und Name ; Timer: Deklarieren der Variable als global für den Timer Global $g_hTimer Global $g_sTime, $g_iHours Global $g_iMins, $g_iSecs Global $g_iMilliSecs Global $g_iTicks Global $g_iOldHours Global $g_iOldMins Global $g_iOldSecs Global $g_iOldMilliSecs ; Timer: Deklarieren der Variable als global GUI Start für den Timer Global $ID_GUI_Play Global $idLabel_Play Global $aPosNum Global $aPosSpc Global $ixPos Global $iyPos Global $iwNum Global $ihNum Global $iwSpc Global $ihSpc Global $idLabelHours Global $idLabelMins Global $idLabelSecs Global $idLabelMilli Global $Player_Zeit ; Formular Felder Global $idLabelVName Global $idLabelNName Global $idLabelFirma Global $idLabelStrasse Global $idLabelPLZ Global $idLabelOrt Global $idLabelMail Global $idLabelSpielzeit Global $idLabelCheckbox_1 Global $idLabelCheckbox_2 Global $idLabelCheckbox_3 Global $Formular_Text_Vorname Global $Formular_Text_Nachname Global $Formular_Text_Firma Global $Formular_Text_Strasse Global $Formular_Text_PLZ Global $Formular_Text_Ort Global $Formular_Text_Mail Global $Formular_Text_Timer Global $Formular_Info_Text_1 Global $Formular_Info_Text_2 Global $Formular_Info_Text_3 _INI_Lesen() ; INI Datei einlesen HotKeySet($Taste_Abbruch, _HotKeyPressed) ; Programm beenden HotKeySet($Taste_Button, _HotKeyPressed) ; Button wurde gedrückt HotKeySet($Taste_Formular_Save, _HotKeyPressed) ; Formular soll gespeichert werden HotKeySet($Taste_Hilfe, _HotKeyPressed) ; Tastenbelegung anzeigen ; GUI Zeichnen aufrufen _GUI_Start() _GUI_Warten() _GUI_Play() _GUI_Formular() ; GUI Zeichnen aufrufen GUISetState(@SW_HIDE) ; Alle GUI`s ausblenden ; ################################################################################################################################################################## ; ############## Hauptprogramm Schleife ############## ; ################################################################################################################################################################## While 1 _GUI_setzen() ; GUI unsichtbar / sichtbar machen _Timer_Status() ; Timer darstellung Prüfen WEnd Exit ; Sollte das Programm warum auch immer bis hierher es schaffen wird das Programm beendet ! ; ################################################################################################################################################################## ; ############## Timer Status, Timer darstellen ############## ; ################################################################################################################################################################## func _Timer_Status() IF $Status = "Play" and $Status_GUI_Open = "Play" then Sleep(44) ;44 ; Aktualisierungsinterval in ms _GetTime() ; Aktuelle Zeit holen If $g_iMilliSecs <> $g_iOldMilliSecs Then ; Prüfen ob MilliSecs sich verändert hat $g_iOldMilliSecs = $g_iMilliSecs ; Aktuelle Zeit in Alte zeit schreiben GUICtrlSetData($idLabelMilli, StringFormat('%03i', StringLeft($g_iMilliSecs, 3))) ; Zeit ausgeben --> Millisekunden gibt man normal 3-stellig (999) aus EndIf If $g_iSecs <> $g_iOldSecs Then ; Prüfen ob MilliSecs sich verändert hat $g_iOldSecs = $g_iSecs ; Aktuelle Zeit in Alte zeit schreiben GUICtrlSetData($idLabelSecs, StringFormat('%02i', $g_iSecs)) ; Zeit ausgeben EndIf If $g_iMins <> $g_iOldMins Then ; Prüfen ob MilliSecs sich verändert hat $g_iOldMins = $g_iMins ; Aktuelle Zeit in Alte zeit schreiben GUICtrlSetData($idLabelMins, StringFormat('%02i', $g_iMins)) ; Zeit ausgeben EndIf If $g_iHours <> $g_iOldHours Then ; Prüfen ob MilliSecs sich verändert hat $g_iOldHours = $g_iHours ; Aktuelle Zeit in Alte zeit schreiben GUICtrlSetData($idLabelHours, StringFormat('%02i', $g_iHours)) ; Zeit ausgeben EndIf EndIf EndFunc ; ################################################################################################################################################################## ; ############## GUI unsichtbar / sichtbar machen ############## ; ################################################################################################################################################################## Func _GUI_setzen() if $Status = "Play" and $Status_GUI_Open <> "Play" then GUISetState(@SW_SHOW, $ID_GUI_Play) ; GUI Play anzeigen GUISetState(@SW_HIDE, $ID_GUI_Warten) ; GUI Warten ausblenden GUISetState(@SW_HIDE, $ID_GUI_Start) ; GUI Start ausblenden GUISetState(@SW_HIDE, $ID_GUI_Formular) ; GUI Formular ausblenden $Status_GUI_Open = "Play" ElseIf $Status = "Formular" and $Status_GUI_Open <> "Formular" then GUISetState(@SW_SHOW, $ID_GUI_Formular) ; GUI Formular anzeigen GUISetState(@SW_HIDE, $ID_GUI_Play) ; GUI Play ausblenden GUISetState(@SW_HIDE, $ID_GUI_Warten) ; GUI Warten ausblenden GUISetState(@SW_HIDE, $ID_GUI_Start) ; GUI Start ausblenden $Status_GUI_Open = "Formular" GUICtrlSetData($idLabelSpielzeit, $Player_Zeit) ; Spielerzeit eintragen ElseIf $Status = "Warten" and $Status_GUI_Open <> "Warten" then GUISetState(@SW_SHOW, $ID_GUI_Warten) ; GUI Warten anzeigen GUISetState(@SW_HIDE, $ID_GUI_Play) ; GUI Play ausblenden GUISetState(@SW_HIDE, $ID_GUI_Formular) ; GUI Formular ausblenden GUISetState(@SW_HIDE, $ID_GUI_Start) ; GUI Start ausblenden $Status_GUI_Open = "Warten" ElseIf $Status = "Start" and $Status_GUI_Open <> "Start" then GUISetState(@SW_SHOW, $ID_GUI_Start) ; GUI Start anzeigen GUISetState(@SW_HIDE, $ID_GUI_Play) ; GUI Play ausblenden GUISetState(@SW_HIDE, $ID_GUI_Formular) ; GUI Formular ausblenden GUISetState(@SW_HIDE, $ID_GUI_Warten) ; GUI Warten ausblenden $Status_GUI_Open = "Start" EndIf EndFunc ; ################################################################################################################################################################## ; ############## HotKey ausführen ############## ; ################################################################################################################################################################## Func _HotKeyPressed() Switch @HotKeyPressed ; The last hotkey pressed. Case $Taste_Button ; Button wurde gedrückt if $Status = "Start" then $Status = "Warten" ElseIf $Status = "Warten" then $Status = "Play" $g_hTimer = TimerInit() ; Startzeit merken ElseIf $Status = "Play" then $Status = "Formular" _GetTime() ; Tasechliche Spilerzeit holen $Player_Zeit = $g_sTime ; Zeit vom Spieler merken fürs Formular EndIf Case $Taste_Formular_Save ; Formular Speichern wurde gedrückt If $Status = "Formular" then $Status = "Warten" _Formular_Speichern() Endif Case $Taste_Abbruch ; ESC wurde gedrückt Exit Case $Taste_Hilfe ; F1 wurde gedrückt if $ToolTip_Display = True then ToolTip("") $ToolTip_Display = False ElseIf $ToolTip_Display = False then ToolTip($ToolTip_Text, 0, 0) $ToolTip_Display = True EndIf EndSwitch EndFunc ;==>_HotKeyPressed ; ################################################################################################################################################################## ; ############## Timer Elemente ############## ; ################################################################################################################################################################## Func _CreateLabel($sText, $x, $y, $w, $h) Local $idLabel_Play = GUICtrlCreateLabel($sText, $x, $y, $w, $h) ; Label erstellen und ID holen GUICtrlSetColor($idLabel_Play, $GUI_Play_Font_Color) ; Label Frontfarbe GUICtrlSetBkColor($idLabel_Play, $GUI_Play_BG_Color) ; Label Background Color Return $idLabel_Play ; Lable ID zurück geben EndFunc ;==>_CreateLabel Func _GetTime() $g_iTicks = TimerDiff($g_hTimer) ; Zeitunterschied zum $g_hTimer = Startzeit $g_iMilliSecs = Int(Mod($g_iTicks, 1000)) ; 29 Sekunden für 1000000 Durchläufe _TicksToTime(Int($g_iTicks), $g_iHours, $g_iMins, $g_iSecs) ; Timer zerlegen in Hours:Mins:Secs $g_sTime = StringFormat("%02i : %02i : %02i . %03i", $g_iHours, $g_iMins, $g_iSecs, StringLeft($g_iMilliSecs, 3)) ; to Hours:Mins:Secs:MilliSecs EndFunc ;==>_GetTime ; ################################################################################################################################################################## ; ############## Formular Speichern und zurücksetzen ############## ; ################################################################################################################################################################## Func _Formular_Speichern() ; Überschriften für Dateianfang erstellen Local $Kopf = "Datum;" & _ $Formular_Text_Vorname & ";" & _ $Formular_Text_Nachname& ";" & _ $Formular_Text_Firma & ";" & _ $Formular_Text_Strasse & ";" & _ $Formular_Text_PLZ & ";" & _ $Formular_Text_Ort & ";" & _ $Formular_Text_Mail & ";" & _ $Formular_Text_Timer & ";" & _ "Checkbox_1" & ";" & _ "Checkbox_2" & ";" & _ "Checkbox_3" ; Checkbox auslesen und Lesbar umschreiben if GuictrlRead($idLabelCheckbox_1) = 1 Then Local $TMP_Checkbox_1 = "OK" if GuictrlRead($idLabelCheckbox_1) <> 1 Then Local $TMP_Checkbox_1 = "NOK" if GuictrlRead($idLabelCheckbox_2) = 1 Then Local $TMP_Checkbox_2 = "OK" if GuictrlRead($idLabelCheckbox_2) <> 1 Then Local $TMP_Checkbox_2 = "NOK" if GuictrlRead($idLabelCheckbox_3) = 1 Then Local $TMP_Checkbox_3 = "OK" if GuictrlRead($idLabelCheckbox_3) <> 1 Then Local $TMP_Checkbox_3 = "NOK" ;Spieler Datensatz erstellen Local $Zeile = _DateTimeFormat(_NowCalc(), 0) & ";" & _ GuictrlRead($idLabelVName) & ";" & _ GuictrlRead($idLabelNName) & ";" & _ GuictrlRead($idLabelFirma) & ";" & _ GuictrlRead($idLabelStrasse) & ";" & _ GuictrlRead($idLabelPLZ) & ";" & _ GuictrlRead($idLabelOrt) & ";" & _ GuictrlRead($idLabelMail) & ";" & _ GuictrlRead($idLabelSpielzeit) & ";" & _ $TMP_Checkbox_1 & ";" & _ $TMP_Checkbox_2 & ";" & _ $TMP_Checkbox_3 ; Formular in Datei Schreiben if FileExists($Dateinamen) then ; Prüft ob Datei Existirt Local $hFileOpen = Fileopen ($Dateinamen, $FO_APPEND) ; Datei Öffnen / Lesen und Schreiben am Ende FileWrite($hFileOpen, $Zeile & @CRLF) ; in Datei schreiben Fileclose($hFileOpen) ; Datei schlißen Else ; Datei Existirt NICHT Local $hFileOpen = Fileopen ($Dateinamen, $FO_APPEND) ; Datei Öffnen / Lesen und Schreiben am Ende FileWrite($hFileOpen, $Kopf & @CRLF) ; in Datei schreiben FileWrite($hFileOpen, $Zeile & @CRLF) ; in Datei schreiben Fileclose($hFileOpen) ; Datei schlißen EndIf ; Formular zurück setzen GUICtrlSetData($idLabelVName, $Formular_Text_Vorname) GUICtrlSetData($idLabelNName, $Formular_Text_Nachname) GUICtrlSetData($idLabelFirma, $Formular_Text_Firma) GUICtrlSetData($idLabelStrasse, $Formular_Text_Strasse) GUICtrlSetData($idLabelPLZ, $Formular_Text_PLZ) GUICtrlSetData($idLabelOrt, $Formular_Text_Ort) GUICtrlSetData($idLabelMail, $Formular_Text_Mail) GUICtrlSetData($idLabelSpielzeit, $Formular_Text_Timer) GUICtrlSetState($idLabelCheckbox_1, "4") GUICtrlSetState($idLabelCheckbox_2, "4") GUICtrlSetState($idLabelCheckbox_3, "4") EndFunc ; ################################################################################################################################################################## ; ############## GUI Erstellung inkl. allen Labels ############## ; ################################################################################################################################################################## Func _GUI_Start() $ID_GUI_Start = GUICreate("Sleep-Timer", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP) ; GUI erstellen GUISetBkColor($GUI_Start_BG_Color, $ID_GUI_Start) ; GUI Background Color GUISetFont($GUI_Start_Font_Size, $FW_NORMAL, $GUI_FONTNORMAL, "Calibri", $ID_GUI_Start) ; GUI Schriftgröße und Art Einstellen GUICtrlCreateLabel($ToolTip_Text, 10, 10) ; Label erstellen GUICtrlSetColor(-1, $GUI_Start_Font_Color) ; Label Frontfarbe EndFunc ;==>_GUI_Start Func _GUI_Warten() $ID_GUI_Warten = GUICreate("Sleep-Timer", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP) ; GUI erstellen GUISetBkColor($GUI_Warten_BG_Color, $ID_GUI_Warten) ; GUI Background Color GUISetFont($GUI_Warten_Font_Size, $FW_NORMAL, $GUI_FONTNORMAL, "Calibri", $ID_GUI_Warten) ; GUI Schriftgröße und Art Einstellen Local $Text = "Start => Button" Local $idLabel = GUICtrlCreateLabel($Text, 0, 0) ; Label erstellen Local $aPos = ControlGetPos($ID_GUI_Warten, '', $idLabel) ; so viel Platz brauchen wir GUICtrlDelete($idLabel) ; Label Löschen Local $X = (@DesktopWidth/2) - ($aPos[2]/2) Local $Y = (@DesktopHeight/2)- ($aPos[3]/2) GUICtrlCreateLabel($Text,$X, $Y) ; Label erstellen GUICtrlSetColor(-1, $GUI_Warten_Font_Color) ; Label Frontfarbe EndFunc ;==>_GUI_Warten Func _GUI_Play() $ID_GUI_Play = GUICreate("Sleep-Timer", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP) ; GUI erstellen GUISetBkColor($GUI_Play_BG_Color) ; GUI Background Color Einstellen GUISetFont($GUI_Play_Font_Size, $FW_NORMAL, $GUI_FONTNORMAL, "Calibri") ; GUI Schriftgröße und Art Einstellen $idLabel_Play = GUICtrlCreateLabel("00", 0, 0) ; Label erstellen $aPosNum = ControlGetPos($ID_GUI_Play, '', $idLabel_Play) ; so viel Platz brauchen wir für "00" GUICtrlDelete($idLabel_Play) ; Label Löschen $idLabel_Play = GUICtrlCreateLabel(" : ", 0, 0) ; Label erstellen $aPosSpc = ControlGetPos($ID_GUI_Play, '', $idLabel_Play) ; so viel Platz brauchen wir für " : " bzw. " . " GUICtrlDelete($idLabel_Play) ; Label Löschen $ixPos = (@DesktopWidth / 2) - (($aPosNum[2] * 4.5) + ($aPosSpc[2] * 3)) / 2 ; X-Position des ersten Labels $iyPos = (@DesktopHeight / 2) - ($aPosNum[3] / 2) ; Y-Position des ersten Labels $iwNum = $aPosNum[2] ; Breite der Labels mit "00" $ihNum = $aPosNum[3] ; Höhe der Labels mit "00" $iwSpc = $aPosSpc[2] ; Breite der Labels mit " : " bzw. " . " $ihSpc = $aPosSpc[3] ; Höhe der Labels mit " : " bzw. " . " $idLabelHours = _CreateLabel("00", $ixPos, $iyPos, $iwNum, $ihNum) ; Uhrleabel erstellen für Stunde $ixPos += $iwNum + 1 ; Platzbedarf weiterzählen _CreateLabel(" : ", $ixPos, $iyPos, $iwSpc, $ihSpc) ; Label Zeichnen Seperator $ixPos += $iwSpc + 1 ; Platzbedarf weiterzählen $idLabelMins = _CreateLabel("00", $ixPos, $iyPos, $iwNum, $ihNum) ; Uhrleabel erstellen für Minuten $ixPos += $iwNum + 1 ; Platzbedarf weiterzählen _CreateLabel(" : ", $ixPos, $iyPos, $iwSpc, $ihSpc) ; Label Zeichnen Seperator $ixPos += $iwSpc + 1 ; Platzbedarf weiterzählen $idLabelSecs = _CreateLabel("00", $ixPos, $iyPos, $iwNum, $ihNum) ; Uhrleabel erstellen für Sekunden $ixPos += $iwNum + 1 ; Platzbedarf weiterzählen _CreateLabel(" . ", $ixPos, $iyPos, $iwSpc, $ihSpc) ; Label Zeichnen Seperator $ixPos += $iwSpc + 1 ; Platzbedarf weiterzählen $idLabelMilli = _CreateLabel("000", $ixPos, $iyPos, $iwNum * 1.5, $ihNum) ; Uhrleabel erstellen für Millisekunden $g_hTimer = TimerInit() ; Startzeit merken _GetTime() ; Aktuelle Zeit holen $g_iOldHours = $g_iHours ; Aktuelle Zeit in Alte zeit schreiben $g_iOldMins = $g_iMins ; Aktuelle Zeit in Alte zeit schreiben $g_iOldSecs = $g_iSecs ; Aktuelle Zeit in Alte zeit schreiben $g_iOldMilliSecs = $g_iMilliSecs ; Aktuelle Zeit in Alte zeit schreiben EndFunc ;==>_GUI_Play Func _GUI_Formular() $ID_GUI_Formular = GUICreate("Sleep-Timer", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP) ; GUI erstellen GUISetBkColor($GUI_Formular_BG_Color, $ID_GUI_Formular) ; GUI Background Color GUISetFont($GUI_Formular_Font_Size, $FW_NORMAL, $GUI_FONTNORMAL, "Calibri", $ID_GUI_Formular) ; GUI Schriftgröße und Art Einstellen Local $Formular_Links = @DesktopWidth * 0.15 ; 15% der Monitorbreite soll Links abstand gehalten werden Local $Formular_Breite = @DesktopWidth * 0.70 ; Das Formular soll 70% vom Monitor breit sein Local $Formular_Trennen = 20 ; Abstand zwischen den Input felden (Links, Rechst, Oben, Unten) Local $Text = " 00 : 00 : 00 . 000 " Local $idLabel = GUICtrlCreateLabel($Text, 0, 0) ; Muster Label erstellen Local $aPos = ControlGetPos($ID_GUI_Formular, '', $idLabel) ; so viel Platz brauchen wir GUICtrlDelete($idLabel) ; Muster Label Löschen Local $Formular_Input_Hohe = $aPos[3] LOcal $Formular_Input_Breite_Kurz = $aPos[2] Local $X ; Position von Oben Local $Y ; Position von Links Local $Breite Local $Hohe Local $Style Local $Text $Text = $Formular_Text_Vorname $X = $Formular_Links $Y = $Y + $Formular_Input_Hohe + $Formular_Trennen $Breite = $Formular_Breite $Hohe = $Formular_Input_Hohe $Style = 0x1000 $idLabelVName = GUICtrlCreateInput($Text, $X, $Y, $Breite, $Hohe, $Style) $Text = $Formular_Text_Nachname $X = $Formular_Links $Y = $Y + $Formular_Input_Hohe + $Formular_Trennen $Breite = $Formular_Breite $Hohe = $Formular_Input_Hohe $Style = 0x1000 $idLabelNName = GUICtrlCreateInput($Text, $X, $Y, $Breite, $Hohe, $Style) $Text = $Formular_Text_Firma $X = $Formular_Links $Y = $Y + $Formular_Input_Hohe + $Formular_Trennen $Breite = $Formular_Breite $Hohe = $Formular_Input_Hohe $Style = 0x1000 $idLabelFirma = GUICtrlCreateInput($Text, $X, $Y, $Breite, $Hohe, $Style) $Text = $Formular_Text_Strasse $X = $Formular_Links $Y = $Y + $Formular_Input_Hohe + $Formular_Trennen $Breite = $Formular_Breite $Hohe = $Formular_Input_Hohe $Style = 0x1000 $idLabelStrasse = GUICtrlCreateInput($Text, $X, $Y, $Breite, $Hohe, $Style) $Text = $Formular_Text_PLZ $X = $Formular_Links $Y = $Y + $Formular_Input_Hohe + $Formular_Trennen $Breite = $Formular_Input_Breite_Kurz $Hohe = $Formular_Input_Hohe $Style = 0x1000 $idLabelPLZ = GUICtrlCreateInput($Text, $X, $Y, $Breite, $Hohe, $Style) $Text = $Formular_Text_Ort $X = $Formular_Links + $Breite + $Formular_Trennen $Y = $Y $Breite = $Formular_Breite - ($Formular_Input_Breite_Kurz + $Formular_Trennen) $Hohe = $Formular_Input_Hohe $Style = 0x1000 $idLabelOrt = GUICtrlCreateInput($Text, $X, $Y, $Breite, $Hohe, $Style) $Text = $Formular_Text_Mail $X = $Formular_Links $Y = $Y + $Formular_Input_Hohe + $Formular_Trennen $Breite = $Formular_Breite $Hohe = $Formular_Input_Hohe $Style = 0x1000 $idLabelMail = GUICtrlCreateInput($Text, $X, $Y, $Breite, $Hohe, $Style) $Text = $Formular_Text_Timer $X = $Formular_Links $Y = $Y + $Formular_Input_Hohe + $Formular_Trennen $Breite = $Formular_Input_Breite_Kurz $Hohe = $Formular_Input_Hohe $Style = 0x0800 $idLabelSpielzeit = GUICtrlCreateInput($Text, $X, $Y, $Breite, $Hohe, $Style) $Text = $Formular_Info_Text_1 $X = $Formular_Links $Y = $Y + $Formular_Input_Hohe + $Formular_Trennen $Breite = $Formular_Breite $Style = $BS_MULTILINE Local $idLabel = GUICtrlCreateCheckbox($Text, 0, 0, $Breite, -1, $BS_MULTILINE) ; Muster Label erstellen Local $aPos = ControlGetPos($ID_GUI_Formular, '', $idLabel) ; so viel Platz brauchen wir GUICtrlDelete($idLabel) ; Muster Label Löschen Local $Formular_Checkbox_Hohe = $aPos[3] LOcal $Formular_Checkbox_Breite = $aPos[2] $Hohe = $Formular_Checkbox_Hohe $idLabelCheckbox_1 = GUICtrlCreateCheckbox($Text, $X, $Y, $Breite, $Hohe, $Style) $Text = $Formular_Info_Text_2 $X = $Formular_Links $Y = $Y + $Hohe + $Formular_Trennen $Breite = $Formular_Breite $Style = $BS_MULTILINE Local $idLabel = GUICtrlCreateCheckbox($Text, 0, 0, $Breite, -1, $BS_MULTILINE) ; Muster Label erstellen Local $aPos = ControlGetPos($ID_GUI_Formular, '', $idLabel) ; so viel Platz brauchen wir GUICtrlDelete($idLabel) ; Muster Label Löschen Local $Formular_Checkbox_Hohe = $aPos[3] LOcal $Formular_Checkbox_Breite = $aPos[2] $Hohe = $Formular_Checkbox_Hohe $idLabelCheckbox_2 = GUICtrlCreateCheckbox($Text, $X, $Y, $Breite, $Hohe, $Style) $Text = $Formular_Info_Text_3 $X = $Formular_Links $Y = $Y + $Hohe + $Formular_Trennen $Breite = $Formular_Breite $Style = $BS_MULTILINE Local $idLabel = GUICtrlCreateCheckbox($Text, 0, 0, $Breite, -1, $BS_MULTILINE) ; Muster Label erstellen Local $aPos = ControlGetPos($ID_GUI_Formular, '', $idLabel) ; so viel Platz brauchen wir GUICtrlDelete($idLabel) ; Muster Label Löschen Local $Formular_Checkbox_Hohe = $aPos[3] LOcal $Formular_Checkbox_Breite = $aPos[2] $Hohe = $Formular_Checkbox_Hohe $idLabelCheckbox_3 = GUICtrlCreateCheckbox($Text, $X, $Y, $Breite, $Hohe, $Style) EndFunc ;==>_GUI_Formular ; ################################################################################################################################################################## ; ############## INI Einlesen und Default Werte setzen ############## ; ################################################################################################################################################################## Func _INI_Lesen() $GUI_Start_BG_Color = IniRead("Stoppuhr.ini", "Screen_Start", "Start_BG_Color", "0x000000") ; Default = Schwarz $GUI_Start_Font_Color = IniRead("Stoppuhr.ini", "Screen_Start", "Start_Font_Color", "0xffffff") ; Default = Weiss $GUI_Start_Font_Size = IniRead("Stoppuhr.ini", "Screen_Start", "Start_Font_Size", "20") ; Default = 20 $GUI_Warten_BG_Color = IniRead("Stoppuhr.ini", "Screen_Warten", "Warten_BG_Color", "0x000000") ; Default = Schwarz $GUI_Warten_Font_Color = IniRead("Stoppuhr.ini", "Screen_Warten", "Warten_Font_Color", "0xffffff") ; Default = Weiss $GUI_Warten_Font_Size = IniRead("Stoppuhr.ini", "Screen_Warten", "Warten_Font_Size", "200") ; Default = 200 $GUI_Play_BG_Color = IniRead("Stoppuhr.ini", "Screen_Play", "Play_BG_Color", "0x000000") ; Default = Schwarz $GUI_Play_Font_Color = IniRead("Stoppuhr.ini", "Screen_Play", "Play_Font_Color", "0xffffff") ; Default = Weiss $GUI_Play_Font_Size = IniRead("Stoppuhr.ini", "Screen_Play", "Play_Font_Size", "200") ; Default = 200 $GUI_Formular_BG_Color = IniRead("Stoppuhr.ini", "Screen_Formular", "Formular_BG_Color", "0x000000") ; Default = Schwarz $GUI_Formular_Font_Color = IniRead("Stoppuhr.ini", "Screen_Formular", "Formular_Font_Color", "0xffffff") ; Default = Weiss $GUI_Formular_Font_Size = IniRead("Stoppuhr.ini", "Screen_Formular", "Formular_Font_Size", "30") ; Defaul = 30 $Dateinamen = IniRead("Stoppuhr.ini", "Speichername", "Dateinamen_Ergebnis", "TIME_STAMP") ; Default = TIME_STAMP $Dateinamen = @ScriptDir & "\" & _NowDate() & "_" & $Dateinamen & ".csv" ; Datei Pfad und Name $ToolTip_Text = IniRead("Stoppuhr.ini", "Text_Ausgabe", "ToolTip_Text", "Button ==> [Alt]+[Shift]+B") ; Default = $ToolTip_Text = StringReplace($ToolTip_Text, "@CRLF", @CRLF) $Taste_Abbruch = IniRead("Stoppuhr.ini", "Tastaturbelegung", "Taste_Abbruch", "{ESC}") ; Default = ESC $Taste_Button = IniRead("Stoppuhr.ini", "Tastaturbelegung", "Taste_Button", "+!b") ; Default = Shift-Alt-B $Taste_Formular_Save = IniRead("Stoppuhr.ini", "Tastaturbelegung", "Taste_Formular_Save", "+!s") ; Default = Shift-Alt-S $Taste_Hilfe = IniRead("Stoppuhr.ini", "Tastaturbelegung", "Taste_Hilfe", "{F1}") ; Default = F1 $Formular_Text_Vorname = IniRead("Stoppuhr.ini", "Formular_beschriftung", "Formular_Text_Vorname", "Vornamen") ; Default =Vornamen $Formular_Text_Nachname = IniRead("Stoppuhr.ini", "Formular_beschriftung", "Formular_Text_Nachname", "Nachname") ; Default =Nachname $Formular_Text_Firma = IniRead("Stoppuhr.ini", "Formular_beschriftung", "Formular_Text_Firma", "Firma") ; Default =Firma $Formular_Text_Strasse = IniRead("Stoppuhr.ini", "Formular_beschriftung", "Formular_Text_Strasse", "Strasse + Nummer") ; Default =Strasse + Nummer $Formular_Text_PLZ = IniRead("Stoppuhr.ini", "Formular_beschriftung", "Formular_Text_PLZ", "PLZ") ; Default =PLZ $Formular_Text_Ort = IniRead("Stoppuhr.ini", "Formular_beschriftung", "Formular_Text_Ort", "Ort") ; Default =Ort $Formular_Text_Mail = IniRead("Stoppuhr.ini", "Formular_beschriftung", "Formular_Text_Mail", "E-Mail") ; Default =E-Mail $Formular_Text_Timer = IniRead("Stoppuhr.ini", "Formular_beschriftung", "Formular_Text_Timer", "Spielzeit") ; Default =Spielzeit $Formular_Info_Text_1 = IniRead("Stoppuhr.ini", "Formular_beschriftung", "Formular_Info_Text_1", "Foto") ; Default =Foto $Formular_Info_Text_2 = IniRead("Stoppuhr.ini", "Formular_beschriftung", "Formular_Info_Text_2", "Newsletter") ; Default =Newsletter $Formular_Info_Text_3 = IniRead("Stoppuhr.ini", "Formular_beschriftung", "Formular_Info_Text_3", "Gewinnbenachrichtigung und Besuche") ; Default =Gewinnbenachrichtigung und Besuche $Formular_Info_Text_1 = StringReplace($Formular_Info_Text_1, "@CRLF", @CRLF) $Formular_Info_Text_2 = StringReplace($Formular_Info_Text_2, "@CRLF", @CRLF) $Formular_Info_Text_3 = StringReplace($Formular_Info_Text_3, "@CRLF", @CRLF) EndFunc ;==>_==>INI_Lesen