d3k/Settings.ahk

123 lines
3.4 KiB
AutoHotkey
Raw Normal View History

2019-12-18 04:40:19 -06:00
#Include, func.ahk
2023-02-13 16:21:14 -06:00
#NoTrayIcon
2019-12-18 04:40:19 -06:00
Menu, Tray, Icon, shell32.dll, 283
;------------------------------------------------------------------------------
; Create GUI
;------------------------------------------------------------------------------
2020-01-14 08:36:51 -06:00
Gui, -MaximizeBox -MinimizeBox ; Remove the max+min buttons
2019-12-18 04:40:19 -06:00
2023-02-13 16:21:14 -06:00
Gui, Add, GroupBox, x8 y2 w193 h37, First Name
Gui, Add, Edit, x12 y15 w185 h20 vformName gName, %name%
2019-12-18 04:40:19 -06:00
Gui, Add, GroupBox, x8 y40 w207 h37, Email Address
2023-02-13 16:21:14 -06:00
Gui, Add, Edit, x12 y53 w200 h20 vformEmail gEmail, %email%
2019-12-18 04:40:19 -06:00
Gui, Add, GroupBox, x8 y83 w107 h130, Main
2019-12-18 04:40:19 -06:00
Gui, Add, CheckBox, x12 y95 w100 h30 vformMansol Checked%mansol% gMansol, ManSol
Gui, Add, CheckBox, x12 y125 w100 h30 vformMJDPaste Checked%mjdpaste% gMJDPaste, MJDPaste
Gui, Add, CheckBox, x12 y155 w100 h30 vformCaseFormatter Checked%caseformatter% gCaseFormatter, Case Formatter
Gui, Add, CheckBox, x25 y178 w75 h30 vformCFmail Checked%cfmail% gCFmail, Email option
GuiControl, show%caseformatter%, formCFmail ; only shows the check box for emails if the Case Formatter box is checked
2023-02-13 16:21:14 -06:00
Gui, Add, GroupBox, x8 y215 w277 h50 vformDocFile, Documentation File
Gui, Add, Text, x15 y231 w260 h30 vformDocFile2 gDocFile, %docfile%
2019-12-18 04:40:19 -06:00
2020-01-14 10:05:02 -06:00
Gui, Add, GroupBox, x128 y83 w157 h75, Text Replacement
Gui, Add, CheckBox, x132 y95 w150 h30 vformJdpn Checked%jdpn% gJdpn, JD Product Names
Gui, Add, CheckBox, x132 y125 w150 h30 vformGlovar Checked%glovar% gGlovar, Global Variables
Gui, Add, CheckBox, x132 y155 w100 h30 vformGer Checked%ger% gGer, DE ([ as prefix)
2019-12-18 04:40:19 -06:00
2023-02-13 16:21:14 -06:00
Gui, Add, Link, x132 y190 w150 h26 gHelp, <a href="https://daviddaily.dev/david/d3k/wiki">Click here for help</a>`n%A_AhkVersion%
2019-12-18 04:40:19 -06:00
2023-02-13 16:21:14 -06:00
Gui, Show, h273 w295, D3K version %d3k_version%
2019-12-18 04:40:19 -06:00
Return
;------------------------------------------------------------------------------
; Edit ini
;------------------------------------------------------------------------------
2023-02-13 16:21:14 -06:00
2019-12-18 04:40:19 -06:00
/*
Default ini, sections are in []: (0 is off, 1 is on)
2019-12-18 04:40:19 -06:00
[USpec]
2020-01-14 08:36:51 -06:00
Email=LastnameFirstname@JohnDeere.com
2023-02-13 16:21:14 -06:00
Name=Firstname
DocFile=Select File
2019-12-18 04:40:19 -06:00
[Main]
Mansol=1
MJDPaste=1
CaseFormatter=1
CFmail=0
2019-12-18 04:40:19 -06:00
[Replacement]
JDProductNames=1
GloVar=0
[Language]
German=0
*/
2023-02-13 16:21:14 -06:00
Name:
2020-01-14 08:36:51 -06:00
Gui, Submit, NoHide
2023-02-13 16:21:14 -06:00
ini_write(sett_ini, "Name", formName)
2019-12-18 04:40:19 -06:00
Return
Email:
2020-01-14 08:36:51 -06:00
Gui, Submit, NoHide
2023-02-13 16:21:14 -06:00
ini_write(sett_ini, "Email", formEmail)
2019-12-18 04:40:19 -06:00
Return
DocFile:
2020-01-14 08:36:51 -06:00
Gui, Submit
2023-02-13 16:21:14 -06:00
FileSelectFile, SelectedFile, 3, , Open a file, Text Documents (*.txt)
if !(SelectedFile)
2020-01-14 08:36:51 -06:00
MsgBox, You have not selected a file, this will break some things.
else
2023-02-13 16:21:14 -06:00
ini_write(sett_ini, "DocFile", SelectedFile)
Run, Settings.ahk
2019-12-18 04:40:19 -06:00
Return
Mansol:
2020-01-14 08:36:51 -06:00
Gui, Submit, NoHide
2023-02-13 16:21:14 -06:00
ini_write(sett_ini, "Mansol", formMansol)
2019-12-18 04:40:19 -06:00
Return
MJDPaste:
2020-01-14 08:36:51 -06:00
Gui, Submit, NoHide
2023-02-13 16:21:14 -06:00
ini_write(sett_ini, "MJDPaste", formMJDPaste)
2019-12-18 04:40:19 -06:00
Return
CaseFormatter:
2020-01-14 08:36:51 -06:00
Gui, Submit, NoHide
GuiControl, show%formCaseFormatter%, formCFmail ; only shows the check box for emails if the Case Formatter box is checked
2020-02-20 04:09:57 -06:00
GuiControl,, formCFmail, 0
2023-02-13 16:21:14 -06:00
ini_write(sett_ini, "CaseFormatter", formCaseFormatter)
ini_write(sett_ini, "CFmail", "0") ; if you're toggling this, its either on or off, doesn't hurt to set it here
2019-12-18 04:40:19 -06:00
Return
CFmail:
Gui, Submit, NoHide
2023-02-13 16:21:14 -06:00
ini_write(sett_ini, "CFmail", formCFmail)
Return
2019-12-18 04:40:19 -06:00
Jdpn:
2020-01-14 08:36:51 -06:00
Gui, Submit, NoHide
2023-02-13 16:21:14 -06:00
ini_write(sett_ini, "JDProductNames", formJdpn)
2019-12-18 04:40:19 -06:00
Return
Glovar:
2020-01-14 08:36:51 -06:00
Gui, Submit, NoHide
2023-02-13 16:21:14 -06:00
ini_write(sett_ini, "GloVar", formGlovar)
2019-12-18 04:40:19 -06:00
Return
Ger:
2020-01-14 08:36:51 -06:00
Gui, Submit, NoHide
2023-02-13 16:21:14 -06:00
ini_write(sett_ini, "German", formGer)
2020-01-14 08:36:51 -06:00
Return
Help:
Gui, Submit
2019-12-18 04:40:19 -06:00
Return
GuiClose:
GuiEscape:
2020-01-14 08:36:51 -06:00
Run D3K.ahk
2023-02-13 16:21:14 -06:00
ExitApp ; Closes the app when escape or the exit button is pressed