91 lines
2.9 KiB
AutoHotkey
91 lines
2.9 KiB
AutoHotkey
#Include "func.ahk"
|
|
|
|
;------------------------------------------------------------------------------
|
|
; Create GUI
|
|
;------------------------------------------------------------------------------
|
|
myGui := Gui()
|
|
myGui.Opt("-MaximizeBox -MinimizeBox") ; Remove the max+min buttons
|
|
|
|
myGui.Add("Edit", "w200 vEmail", settings["Email"]).OnEvent("LoseFocus", ProcessUserInput) ; settings["Email"]
|
|
|
|
myGui.Add("Text",, "Documentation file:") ; settings["DocFile"]
|
|
myGui.Add("Text",, settings["DocFile"])
|
|
myGui.Add("Button",, "Pick a different file").OnEvent("Click", DocSelect)
|
|
|
|
myGui.Add("Text", "Section", "Text Replacement")
|
|
myGui.Add("CheckBox", "vJDPN Checked" . settings["JDProductNames"], "JD Product Names").OnEvent("Click", ProcessUserInput)
|
|
myGui.Add("CheckBox", "vGloVar Checked" . settings["GloVar"], "Global Variables").OnEvent("Click", ProcessUserInput)
|
|
myGui.Add("CheckBox", "vDE Checked" . settings["German"], "DE ([ as prefix)").OnEvent("Click", ProcessUserInput)
|
|
|
|
switch settings["msmv"] {
|
|
case "always-running": ; run at refresh of d3k, currently running
|
|
msmv_check := 1
|
|
case "always-stopped": ; run at refresh, currently stopped
|
|
msmv_check := 1
|
|
case "no-running": ; don't run at refresh, currently running
|
|
msmv_check := 0
|
|
case "no-stopped": ; don't run at refresh, currently stopped
|
|
msmv_check := 0
|
|
default:
|
|
MsgBox("Unexpected value `"" settings["msmv"] "`" in D3Ksettings.ini")
|
|
Reload
|
|
}
|
|
|
|
myGui.Add("Checkbox", "vMsmv Checked" . msmv_check, "Mouse Mover: silently start on startup").OnEvent("Click", ProcessUserInput)
|
|
|
|
myGui.Add("Link",, "<a href=`"https://daviddaily.dev/david/d3k/wiki`">Click here for help</a>")
|
|
myGui.Add("Text",, "AHK Version: " . A_AhkVersion)
|
|
myGui.Add("Text",, "D3K version " . d3k_version)
|
|
myGui.Title := "D3K settings"
|
|
MyGui.OnEvent("Close", ProcessUserInput)
|
|
myGui.OnEvent("Escape", End)
|
|
myGui.Show("AutoSize")
|
|
Return
|
|
|
|
|
|
;------------------------------------------------------------------------------
|
|
; Edit ini
|
|
;------------------------------------------------------------------------------
|
|
|
|
/*
|
|
Default ini, sections are in []: (0 is off, 1 is on)
|
|
[email protected]
|
|
DocFile=Select File
|
|
JDProductNames=1
|
|
GloVar=0
|
|
German=0
|
|
|
|
*/
|
|
|
|
|
|
ProcessUserInput(*)
|
|
{
|
|
Saved := MyGui.Submit(0) ; Save the contents of named controls into an object.
|
|
ini_write(sett_ini, "Email", Saved.Email)
|
|
ini_write(sett_ini, "JDProductNames", Saved.JDPN)
|
|
ini_write(sett_ini, "GloVar", Saved.GloVar)
|
|
ini_write(sett_ini, "German", Saved.DE)
|
|
if (Saved.Msmv = 1)
|
|
{
|
|
ini_write(sett_ini, "msmv", "always-stopped")
|
|
} else {
|
|
ini_write(sett_ini, "msmv", "no-stopped")
|
|
}
|
|
}
|
|
|
|
DocSelect(*)
|
|
{
|
|
oSaved := myGui.Submit()
|
|
SelectedFile := FileSelect(3,, "Open a file", "Text Documents (*.txt)")
|
|
if !(SelectedFile)
|
|
MsgBox("You have not selected a file, this will break some things.")
|
|
else
|
|
ini_write(sett_ini, "DocFile", SelectedFile)
|
|
Run("Settings.ahk")
|
|
}
|
|
|
|
End(*)
|
|
{
|
|
ProcessUserInput()
|
|
ExitApp
|
|
} |