Func _OPTIONS() Opt("MustDeclareVars", 1) Global $hDB, $Query, $aNames, $aRow, $t_input1, $t_input2, $t_input3, $t_checkbox, $t_save, $t_close #Region Hauptfenster Global $sGUI = GUICreate("Einstellungen", 350, 350) GUISetBkColor(0x000000) GUISetOnEvent($GUI_EVENT_CLOSE, "_CLOSEButton") GUICtrlCreateLabel("Erste Zeile des einzufügenden Textes", 5, 10, 190, 20) GUICtrlSetColor(-1, 0xFFB400) $t_input1 = GUICtrlCreateInput("", 5, 30, 300, 20) GUICtrlSetLimit(-1, 53) Global $hilfepic = GUICtrlCreatePic(@TempDir & "\hilfe.gif", 195, 10, 15, 15) GUICtrlSetOnEvent($hilfepic, "s_Hilfe") GUICtrlSetCursor($hilfepic, 4) GUICtrlCreateLabel("Zweite Zeile des einzufügenden Textes", 5, 60, 190, 20) GUICtrlSetColor(-1, 0xFFB400) $t_input2 = GUICtrlCreateInput("", 5, 80, 300, 20) GUICtrlSetLimit(-1, 53) Global $hilfepic2 = GUICtrlCreatePic(@TempDir & "\hilfe.gif", 195, 60, 15, 15) GUICtrlSetOnEvent($hilfepic2, "s_Hilfe") GUICtrlSetCursor($hilfepic2, 4) GUICtrlCreateLabel("Dritte Zeile des einzufügenden Textes", 5, 110, 190, 20) GUICtrlSetColor(-1, 0xFFB400) $t_input3 = GUICtrlCreateInput("", 5, 130, 300, 20) GUICtrlSetLimit(-1, 53) Global $hilfepic3 = GUICtrlCreatePic(@TempDir & "\hilfe.gif", 195, 110, 15, 15) GUICtrlSetOnEvent($hilfepic3, "s_Hilfe") GUICtrlSetCursor($hilfepic3, 4) GUICtrlCreateLabel("", 0, 160, 500, 2) $t_checkbox = GUICtrlCreateCheckbox("", 5, 200, 15, 20) GUICtrlCreateLabel("Sofortiges Einfügen des Textes, nachdem dieser kopiert wurde?", 25, 200, 200, 30) GUICtrlSetColor(-1, 0xFFB400) Global $hilfepic4 = GUICtrlCreatePic(@TempDir & "\hilfe.gif", 230, 200, 15, 15) GUICtrlSetOnEvent($hilfepic4, "s_Hilfe2") GUICtrlSetCursor($hilfepic4, 4) $t_save = GUICtrlCreateButton("Speichern", 5, 250, 85, 25) GUICtrlSetOnEvent(-1, "_SAVE") $t_close = GUICtrlCreateButton("Abbrechen", 100, 250, 85, 25) GUICtrlSetOnEvent(-1, "_CLOSEButton") GUISetState(@SW_SHOW, $sGUI) _SQLite_Startup(@TempDir & "\sqlite3.dll", False, 1) If @error Then Exit MsgBox(16, "SQLite Fehler", "SQLite.dll konnte nicht geladen werden!") If FileExists("settings.sqlite") Then $hDB = _SQLite_Open("settings.sqlite") If @error Then Exit MsgBox(16, "SQLite Fehler", "1 - Kann die Datenbank nicht öffnen!") ; DB Abfrage der gesamten Tabelle "settings" _SQLite_Query($hDB, "SELECT * FROM settings", $Query) ; Auslesen der nächsten Zeile While _SQLite_FetchData($Query, $aRow, False, False) = $SQLITE_OK GUICtrlSetData($t_input1, $aRow[1], "") GUICtrlSetData($t_input2, $aRow[2], "") GUICtrlSetData($t_input3, $aRow[3], "") If $aRow[4] == "1" Then GUICtrlSetState($t_checkbox, $GUI_CHECKED) Else GUICtrlSetState($t_checkbox, $GUI_UNCHECKED) EndIf WEnd _SQLite_QueryFinalize($Query) Else $hDB = _SQLite_Open("settings.sqlite") ; eine neue DB anlegen If @error Then Exit MsgBox(16, "SQLite Fehler", "2 - Kann die Datenbank nicht öffnen!") ; eine neue Tabelle anlegen "settings" _SQLite_Exec($hDB, "CREATE TABLE settings (id INTEGER PRIMARY KEY AUTOINCREMENT,line1 Text,line2 Text,line3 Text,spaste INTEGER,version TEXT);" & _ "CREATE TABLE texte (id INTEGER PRIMARY KEY AUTOINCREMENT,subject Text,text Text,key Text, active INTEGER, dreizeiler INTEGER);") ; Einträge als Muster erzeugen, die später angepasst werden können _SQLite_Exec($hDB, "INSERT INTO settings(line1,line2,line3,spaste,version) VALUES ('*****************************************************', '%datum% %zeit% / %name% / Technical Support', '*****************************************************', '1', '2.0');") _SQLite_Exec($hDB, "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('Freier Kommentar', 'Eigener Text', 'STRG+Shift+{F1}', '1', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('SIP Reconf/RVA', 'SIP Reconf/Restore Voice Accounts über ACS durchgeführt', 'STRG+Shift+{F2}', '1', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('SOM Config', 'SOM Configfile neu geschrieben', 'STRG+Shift+{F3}', '1', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('SC Refresh', 'PayTV Pakete kontrolliert, evtl. korrigiert und SC Freischaltung gesendet', 'STRG+Shift+{F4}', '1', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('SMÄ eingestellt', 'SMÄ Auftrag eingestellt, um die Telefonie neu zu prov.', 'STRG+Shift+{F5}', '1', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('Routing korrigiert', 'Routingeintrag kontrolliert und ggf. korrigiert', 'STRG+Shift+{F6}', '1', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('WLAN', 'WLAN Aktivierung geprüft und ggf. über ISS Auftrag aktiviert', 'STRG+Shift+{F7}', '1', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+Shift+{F8}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+Shift+{F9}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+Shift+{F10}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+Shift+{F11}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+Shift+{F12}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+ALT+{F1}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+ALT+{F2}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+ALT+{F3}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+ALT+{F4}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+ALT+{F5}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+ALT+{F6}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+ALT+{F7}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+ALT+{F8}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+ALT+{F9}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+ALT+{F10}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+ALT+{F11}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'STRG+ALT+{F12}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,activev) VALUES ('', '', 'Shift+ALT+{F1}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'Shift+ALT+{F2}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'Shift+ALT+{F3}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'Shift+ALT+{F4}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'Shift+ALT+{F5}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'Shift+ALT+{F6}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'Shift+ALT+{F7}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'Shift+ALT+{F8}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'Shift+ALT+{F9}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'Shift+ALT+{F10}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'Shift+ALT+{F11}', '0', 'Ja');" & _ "INSERT INTO texte(subject,text,key,active,dreizeiler) VALUES ('', '', 'Shift+ALT+{F12}', '0', 'Ja');") GUISetState(@SW_HIDE, $sGUI) ; "Neuer Datensatz"-Fenster verstecken GUISetState(@SW_ENABLE, $hGUI) ; Hauptfenster wieder aktivieren _NeustartNachDBErstellung() EndIf EndFunc ;==>_OPTIONS Func _CLOSEButton() _SQLite_Close() _SQLite_Shutdown() GUISetState(@SW_HIDE, $sGUI) ; "Neuer Datensatz"-Fenster verstecken GUISetState(@SW_ENABLE, $hGUI) ; Hauptfenster wieder aktivieren WinActivate($hGUI) ; und in den Vordergrund holen EndFunc ;==>_CLOSEButton Func _SAVE() Local $sMsg = "" Local $iline1 = GUICtrlRead($t_input1) Local $iline2 = GUICtrlRead($t_input2) Local $iline3 = GUICtrlRead($t_input3) If GUICtrlRead($t_checkbox) = "1" Then Local $icheckbox = "1" Else Local $icheckbox = "0" EndIf ;~ Prüfen, ob ID vorhanden ist. If _SQLite_Exec(-1, "UPDATE settings SET line1 = '" & $iline1 & "',line2 = '" & $iline2 & "',line3 = '" & $iline3 & "',spaste = '" & $icheckbox & "' ") = $SQLITE_OK Then $sMsg = "" ; Erfolgreich Else $sMsg = "SQLite Error => " & _SQLite_ErrMsg() MsgBox(16, "SQLite Fehler", $sMsg) EndIf _SQLite_Close() _SQLite_Shutdown() GUISetState(@SW_HIDE, $sGUI) ; "Neuer Datensatz"-Fenster verstecken GUISetState(@SW_ENABLE, $hGUI) ; Hauptfenster wieder aktivieren WinActivate($hGUI) ; und in den Vordergrund holen $resettings = "1" _SETTINGS($resettings) EndFunc ;==>_SAVE Func s_Hilfe() MsgBox(4128,"Hilfe -> Einstellungen","Die 3 Zeilen bilden das Grundgerüst eines jeden einzufügenden Textes." & @CRLF & "Sie dienen dazu, den eigenen Eintrag vom Rest abzuheben. Zudem gibt man damit sein Namen, die Abteilung, Datum und Uhrzeit des Eintrages an." & @CRLF & "" & @CRLF & "Folgende Variablen können benutzt werden:" & @CRLF & "" & @CRLF & "%datum% -> Fügt das aktuelle Datum ein" & @CRLF & "%zeit% -> Fügt die aktuelle Uhrzeit ein" & @CRLF & "%name% -> Fügt den Windows Benutzernamen ein, mit dem man aktuell in Windows angemeldet ist") EndFunc ;==>s_Hilfe Func s_Hilfe2() MsgBox(4128,"Hilfe -> Einstellungen","Durch Aktivierung dieser Funktion, wird der durch drücken eines Buttons oder einer F-Tasten Kombination ausgewählte Text, der nach entsprechendem drücken sofort in die Windows-Zwischenablage kopiert wurde, sofort an der Stelle eingefügt, an der der Cursor aktuell aktiv steht." & @CRLF & @CRLF & "Das kann aber natürlich nur funktionieren, wenn die F-Tastenkombination gedrückt wurde. Sollte einer der Button gedrückt worden sein, dann befindet sich aktuell der Cursor nicht in einem Eingabefeld, in dem auch etwas eingegeben werden kann. Sollte ja eigentlich klar sein, oder?") EndFunc ;==>s_Hilfe2