Update 'Settings.ahk'

This commit is contained in:
David Daily 2019-12-18 04:40:19 -06:00
parent 2384bbc274
commit 7c4168796d

View File

@ -1,263 +1,263 @@
#SingleInstance force ; Only one instance at a time #SingleInstance force ; Only one instance at a time
SendMode, Input SendMode, Input
FileEncoding, UTF-8 ; Makes sure the special characters don't break stuff FileEncoding, UTF-8 ; Makes sure the special characters don't break stuff
#Include, func.ahk #Include, func.ahk
Menu, Tray, Icon, shell32.dll, 283 Menu, Tray, Icon, shell32.dll, 283
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Read ini ; Read ini
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
ini = %A_MyDocuments%\D3Ksettings.ini ini = %A_MyDocuments%\D3Ksettings.ini
/* /*
This is the part that reads the file to see what your settings are. Variables in the ini file are in all lowercase, variables here are CamelCase for more distinction This is the part that reads the file to see what your settings are. Variables in the ini file are in all lowercase, variables here are CamelCase for more distinction
*/ */
; User Specific things: ; User Specific things:
IniRead, racf, %ini%, USpec, RACF IniRead, racf, %ini%, USpec, RACF
IniRead, email, %ini%, USpec, Email IniRead, email, %ini%, USpec, Email
IniRead, docfile, %ini%, USpec, DocFile IniRead, docfile, %ini%, USpec, DocFile
; General Settings ; General Settings
IniRead, mansol, %ini%, Main, Mansol IniRead, mansol, %ini%, Main, Mansol
IniRead, mjdpaste, %ini%, Main, MJDPaste IniRead, mjdpaste, %ini%, Main, MJDPaste
IniRead, caseformatter, %ini%, Main, CaseFormatter IniRead, caseformatter, %ini%, Main, CaseFormatter
; Replacement ; Replacement
IniRead, symb, %ini%, Replacement, Symbols IniRead, symb, %ini%, Replacement, Symbols
IniRead, jdpn, %ini%, Replacement, JDProductNames IniRead, jdpn, %ini%, Replacement, JDProductNames
IniRead, glovar, %ini%, Replacement, GloVar IniRead, glovar, %ini%, Replacement, GloVar
; Language ; Language
IniRead, ger, %ini%, Language, German IniRead, ger, %ini%, Language, German
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Create GUI ; Create GUI
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
Gui, -MaximizeBox -MinimizeBox +E0x00000400 ; Remove the max+min buttons, add the Help questionmark Gui, -MaximizeBox -MinimizeBox +E0x00000400 ; Remove the max+min buttons, add the Help questionmark
Gui, Add, GroupBox, x8 y2 w67 h37, RACF Gui, Add, GroupBox, x8 y2 w67 h37, RACF
Gui, Add, Edit, x12 y15 w60 h20 vformRACF gRACF, %RACF% Gui, Add, Edit, x12 y15 w60 h20 vformRACF gRACF, %RACF%
Gui, Add, GroupBox, x8 y40 w207 h37, Email Address Gui, Add, GroupBox, x8 y40 w207 h37, Email Address
Gui, Add, Edit, x12 y53 w200 h20 vformEmail gEmail, %Email% Gui, Add, Edit, x12 y53 w200 h20 vformEmail gEmail, %Email%
Gui, Add, GroupBox, x77 y2 w207 h37, Documentation File Gui, Add, GroupBox, x77 y2 w207 h37, Documentation File
Gui, Add, Text, x81 y19 w200 h20 gDocFile, %docfile% Gui, Add, Text, x81 y19 w200 h20 gDocFile, %docfile%
Gui, Add, GroupBox, x8 y83 w107 h105, Main Gui, Add, GroupBox, x8 y83 w107 h105, Main
Gui, Add, CheckBox, x12 y95 w100 h30 vformMansol Checked%mansol% gMansol, ManSol 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 y125 w100 h30 vformMJDPaste Checked%mjdpaste% gMJDPaste, MJDPaste
Gui, Add, CheckBox, x12 y155 w100 h30 vformCaseFormatter Checked%caseformatter% gCaseFormatter, Case Formatter Gui, Add, CheckBox, x12 y155 w100 h30 vformCaseFormatter Checked%caseformatter% gCaseFormatter, Case Formatter
Gui, Add, GroupBox, x128 y83 w157 h105, Text Replacement Gui, Add, GroupBox, x128 y83 w157 h105, Text Replacement
Gui, Add, CheckBox, x132 y95 w150 h30 vformSymb Checked%symb% gSymb, Symbols Gui, Add, CheckBox, x132 y95 w150 h30 vformSymb Checked%symb% gSymb, Symbols
Gui, Add, CheckBox, x132 y125 w150 h30 vformJdpn Checked%jdpn% gJdpn, JD Product Names Gui, Add, CheckBox, x132 y125 w150 h30 vformJdpn Checked%jdpn% gJdpn, JD Product Names
Gui, Add, CheckBox, x132 y155 w150 h30 vformGlovar Checked%glovar% gGlovar, Global Variables Gui, Add, CheckBox, x132 y155 w150 h30 vformGlovar Checked%glovar% gGlovar, Global Variables
Gui, Add, CheckBox, x12 y187 w100 h30 vformGer Checked%ger% gGer, DE ([ as prefix) Gui, Add, CheckBox, x12 y187 w100 h30 vformGer Checked%ger% gGer, DE ([ as prefix)
Gui, Add, Text, x237 y203 w100 h20, %d3k_version% Gui, Add, Text, x237 y203 w100 h20, %d3k_version%
Gui, Show, h225 w295, David 3000 Settings Gui, Show, h225 w295, David 3000 Settings
OnMessage(0x0053, "Help") ; Goes to the Help() function when you click after pressing the help button OnMessage(0x0053, "Help") ; Goes to the Help() function when you click after pressing the help button
Return Return
; All Help stuff is functions, INI writing is labels ; All Help stuff is functions, INI writing is labels
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Edit ini ; Edit ini
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
/* /*
Default ini, sections are in []: Default ini, sections are in []:
[USpec] [USpec]
RACF=LF01234 RACF=LF01234
Email=LastnameFirstname@JohnDeere.com Email=LastnameFirstname@example.com
DocFile= DocFile=
[Main] [Main]
Mansol=1 Mansol=1
MJDPaste=1 MJDPaste=1
CaseFormatter=1 CaseFormatter=1
[Replacement] [Replacement]
Symbols=1 Symbols=1
JDProductNames=1 JDProductNames=1
GloVar=0 GloVar=0
[Language] [Language]
German=0 German=0
[Info] [Info]
Version=2.5 Version=2.5
format for below: format for below:
Button G-label (executes when clicked): Button G-label (executes when clicked):
Submit the gui so that it can change and don't hide it Submit the gui so that it can change and don't hide it
write the state of the check box (a 0 for unchecked, 1 for checked), to the file at %ini%, section with this name, line with this name write the state of the check box (a 0 for unchecked, 1 for checked), to the file at %ini%, section with this name, line with this name
*/ */
RACF: RACF:
Gui, Submit, NoHide Gui, Submit, NoHide
IniWrite, %formRACF%, %ini%, USpec, RACF IniWrite, %formRACF%, %ini%, USpec, RACF
Return Return
Email: Email:
Gui, Submit, NoHide Gui, Submit, NoHide
IniWrite, %formEmail%, %ini%, USpec, Email IniWrite, %formEmail%, %ini%, USpec, Email
Return Return
DocFile: DocFile:
Gui, Submit Gui, Submit
FileSelectFile, SelectedFile, 3, , Open a file, Text Documents (*.txt; *.doc) FileSelectFile, SelectedFile, 3, , Open a file, Text Documents (*.txt; *.doc)
if SelectedFile = if SelectedFile =
MsgBox, You have not selected a file, this will break some things. MsgBox, You have not selected a file, this will break some things.
else else
IniWrite, %SelectedFile%, %ini%, USpec, DocFile IniWrite, %SelectedFile%, %ini%, USpec, DocFile
IniRead, docfile, %ini%, USpec, DocFile IniRead, docfile, %ini%, USpec, DocFile
Gui, Show, h225 w295, David 3000 Settings Gui, Show, h225 w295, David 3000 Settings
OnMessage(0x0053, "Help") ; Goes to the Help() function when you click after pressing the help button OnMessage(0x0053, "Help") ; Goes to the Help() function when you click after pressing the help button
Return Return
Mansol: Mansol:
Gui, Submit, NoHide Gui, Submit, NoHide
IniWrite, %formMansol%, %ini%, Main, Mansol IniWrite, %formMansol%, %ini%, Main, Mansol
Return Return
MJDPaste: MJDPaste:
Gui, Submit, NoHide Gui, Submit, NoHide
IniWrite, %formMJDPaste%, %ini%, Main, MJDPaste IniWrite, %formMJDPaste%, %ini%, Main, MJDPaste
Return Return
CaseFormatter: CaseFormatter:
Gui, Submit, NoHide Gui, Submit, NoHide
IniWrite, %formCaseFormatter%, %ini%, Main, CaseFormatter IniWrite, %formCaseFormatter%, %ini%, Main, CaseFormatter
Return Return
Symb: Symb:
Gui, Submit, NoHide Gui, Submit, NoHide
IniWrite, %formSymb%, %ini%, Replacement, Symbols IniWrite, %formSymb%, %ini%, Replacement, Symbols
Return Return
Jdpn: Jdpn:
Gui, Submit, NoHide Gui, Submit, NoHide
IniWrite, %formJdpn%, %ini%, Replacement, JDProductNames IniWrite, %formJdpn%, %ini%, Replacement, JDProductNames
Return Return
Glovar: Glovar:
Gui, Submit, NoHide Gui, Submit, NoHide
IniWrite, %formGlovar%, %ini%, Replacement, GloVar IniWrite, %formGlovar%, %ini%, Replacement, GloVar
Return Return
Ger: Ger:
Gui, Submit, NoHide Gui, Submit, NoHide
IniWrite, %formGer%, %ini%, Language, German IniWrite, %formGer%, %ini%, Language, German
Return Return
GuiClose: GuiClose:
GuiEscape: GuiEscape:
Run D3K.ahk Run D3K.ahk
ExitApp ; Closes the app when escape or the exit button is pressed ExitApp ; Closes the app when escape or the exit button is pressed
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Help, should replace reading the Readme eventually ; Help, should replace reading the Readme eventually
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
Help() Help()
{ {
mousegetpos,,,, name mousegetpos,,,, name
If RegExMatch(name, "Button1$") If RegExMatch(name, "Button1$")
RACF() RACF()
Else If InStr(name, "Edit1") Else If InStr(name, "Edit1")
RACF() RACF()
Else If InStr(name, "Button2") Else If InStr(name, "Button2")
Email() Email()
Else If InStr(name, "Edit2") Else If InStr(name, "Edit2")
Email() Email()
Else If InStr(name, "Button3") Else If InStr(name, "Button3")
DocFile() DocFile()
Else If InStr(name, "Static1") Else If InStr(name, "Static1")
DocFile() DocFile()
Else If InStr(name, "Button4") Else If InStr(name, "Button4")
Mansol() Mansol()
Else If InStr(name, "Button5") Else If InStr(name, "Button5")
Mansol() Mansol()
Else If InStr(name, "Button6") Else If InStr(name, "Button6")
MJDPaste() MJDPaste()
Else If InStr(name, "Button7") Else If InStr(name, "Button7")
CaseFormatter() CaseFormatter()
Else If InStr(name, "Button8") Else If InStr(name, "Button8")
Symb() Symb()
Else If InStr(name, "Button9") Else If InStr(name, "Button9")
Symb() Symb()
Else If InStr(name, "Button10") Else If InStr(name, "Button10")
Jdpn() Jdpn()
Else If InStr(name, "Button11") Else If InStr(name, "Button11")
Glovar() Glovar()
Else If InStr(name, "Button12") Else If InStr(name, "Button12")
Ger() Ger()
Else Else
Return Return
} }
; 262176 for just the question mark and always on top ; 262176 for just the question mark and always on top
; 278560 adds a help button ; 278560 adds a help button
RACF() RACF()
{ {
MsgBox, 262176, RACF, Typing ]me or [me will replace it with your RACF as you put it here MsgBox, 262176, RACF, Typing ]me or [me will replace it with your RACF as you put it here
} }
Email() Email()
{ {
MsgBox, 262176, Email, Typing @me or @me will replace it with your email as you put it here.`n]email`tEmail templateish thing`n]97010`tSend them to DTAC`n]2yc`t2 Year old COMAR rule MsgBox, 262176, Email, Typing @me or @me will replace it with your email as you put it here.`n]email`tEmail templateish thing`n]97010`tSend them to DTAC`n]2yc`t2 Year old COMAR rule
} }
DocFile() DocFile()
{ {
MsgBox, 262176, Documentation File, The location of the file where you are doing your documentation. This makes the Case Formatter work, since it appends to this file. MsgBox, 262176, Documentation File, The location of the file where you are doing your documentation. This makes the Case Formatter work, since it appends to this file.
} }
Mansol() Mansol()
{ {
MsgBox, 262176, Manual & Solution Opener, Pressing Alt+Shift+S will open the Solution / Manual opener. Input numbers/letters and press enter.`nIf you input just numbers, it will try to open it as a DTAC solution.`nIf you enter letters and numbers, it will try to open it as a manual (best source for SKUs for manuals is Techpubs). MsgBox, 262176, Manual & Solution Opener, Pressing Alt+Shift+S will open the Solution / Manual opener. Input numbers/letters and press enter.`nIf you input just numbers, it will try to open it as a DTAC solution.`nIf you enter letters and numbers, it will try to open it as a manual (best source for SKUs for manuals is Techpubs).
} }
MJDPaste() MJDPaste()
{ {
MsgBox, 262176, MyJohnDeere Paste, Made to use in the customer profile in Stellar Support where you can't paste in the email field for some reason.`n`nPress the Windows key and V to write out your Clipboard (what you copied with Ctrl+C) MsgBox, 262176, MyJohnDeere Paste, Made to use in the customer profile in Stellar Support where you can't paste in the email field for some reason.`n`nPress the Windows key and V to write out your Clipboard (what you copied with Ctrl+C)
} }
CaseFormatter() CaseFormatter()
{ {
MsgBox, 262176, Case Formatter, Made to replace the Case Template for me.`n`nPause`tOpens up a window to choose what language, what source, and what (common) issue is going on. Press Alt and the underlined letter if you don't want to click the buttons. If its not a warrant or a demo, don't press those buttons. This is appended to a file, to be changed. Maybe a choose documentation file?`n`n\case`tTypes a timestamp, and some fields for the person's Name and Username.`n|case`tdoes the same thing as \case but in German MsgBox, 262176, Case Formatter, Made to replace the Case Template for me.`n`nPause`tOpens up a window to choose what language, what source, and what (common) issue is going on. Press Alt and the underlined letter if you don't want to click the buttons. If its not a warrant or a demo, don't press those buttons. This is appended to a file, to be changed. Maybe a choose documentation file?`n`n\case`tTypes a timestamp, and some fields for the person's Name and Username.`n|case`tdoes the same thing as \case but in German
} }
Symb() Symb()
{ {
eq := Chr(0x2248) eq := Chr(0x2248)
deg := Chr(0x00B0) deg := Chr(0x00B0)
MsgBox, 262176, Symbols, Common symbols that aren't on the US keyboard`n`n`(eq)`t=`t%eq%`n(deg)`t=`t%deg% MsgBox, 262176, Symbols, Common symbols that aren't on the US keyboard`n`n`(eq)`t=`t%eq%`n(deg)`t=`t%deg%
} }
Jdpn() Jdpn()
{ {
MsgBox, 262176, John Deere Product Names, Names of JD Products so that you don't have to type that all the time`nStart with ] for English, [ for German.`nat`tAutoTrac`nsf`tStarFire`njdlw`tJDLink Web`njdld`tJDLink Dashboard`njdlc`tJDLink Connect`njdla`tJDLink Access`njdls`tJDLink`njdll`tJDLink`njdp`tJDParts`nmjd`tMyJohnDeere`nopsc`tOperations Center`nseccon`tSection Control`ngs`tGreenStar`ncc`tCommandCenter`nfc`tField Connect`nrs`tRowSense`nsub`tSubscription`nss`tStellar Support`ntman`tTechnical Manual`nhl3`tHarvestLab 3000`nbin`tVirtual Inventory`nwarrep`tWarranty Reports`n`nThe following will complete as you type them:`nRowSense`nCOMAR`nmRTK`nRDA`nRTK`nAutoTrac`nCCMS`nDTAC`nTCSM`niTEC Pro`nSSU`nATU`nMTG`nWDT`niTC`nVIN`nGS2`nGS3`nSF1`nSF2`nSF3`nxID`nPMCalc MsgBox, 262176, John Deere Product Names, Names of JD Products so that you don't have to type that all the time`nStart with ] for English, [ for German.`nat`tAutoTrac`nsf`tStarFire`njdlw`tJDLink Web`njdld`tJDLink Dashboard`njdlc`tJDLink Connect`njdla`tJDLink Access`njdls`tJDLink`njdll`tJDLink`njdp`tJDParts`nmjd`tMyJohnDeere`nopsc`tOperations Center`nseccon`tSection Control`ngs`tGreenStar`ncc`tCommandCenter`nfc`tField Connect`nrs`tRowSense`nsub`tSubscription`nss`tStellar Support`ntman`tTechnical Manual`nhl3`tHarvestLab 3000`nbin`tVirtual Inventory`nwarrep`tWarranty Reports`n`nThe following will complete as you type them:`nRowSense`nCOMAR`nmRTK`nRDA`nRTK`nAutoTrac`nCCMS`nDTAC`nTCSM`niTEC Pro`nSSU`nATU`nMTG`nWDT`niTC`nVIN`nGS2`nGS3`nSF1`nSF2`nSF3`nxID`nPMCalc
} }
Glovar() Glovar()
{ {
MsgBox, 262176, Global Variables, The ini file works like this: Hotstring on the left, result on the right. If you have it like xid=x501183, whenever you type $xid it will complete to x501183 and so on with the rest of them working the same way.`nYou can add more by going to a new line, entering an =, then putting the hotstring on the left.`n`nReplace the name of a section (the things in [square brackets]) with "clear" and it will empty out the whole thing and back up the ini and the documentation file to D3KLog.txt MsgBox, 262176, Global Variables, The ini file works like this: Hotstring on the left, result on the right. If you have it like xid=x501183, whenever you type $xid it will complete to x501183 and so on with the rest of them working the same way.`nYou can add more by going to a new line, entering an =, then putting the hotstring on the left.`n`nReplace the name of a section (the things in [square brackets]) with "clear" and it will empty out the whole thing and back up the ini and the documentation file to D3KLog.txt
} }
Ger() Ger()
{ {
MsgBox, 262176, , Enables the same commands, but also in German (start them with [ instead) MsgBox, 262176, , Enables the same commands, but also in German (start them with [ instead)
} }
General() General()
{ {
MsgBox, ]{shortcut} is the syntax here, [{shortcut} for German if enabled.`n`nEmail specific:`nemail`tEmail templateish thing`n97010`tEmail about DTAC problem`n2yc`t2 Year old COMAR MsgBox, ]{shortcut} is the syntax here, [{shortcut} for German if enabled.`n`nEmail specific:`nemail`tEmail templateish thing`n97010`tEmail about DTAC problem`n2yc`t2 Year old COMAR
} }