Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
matmignin committed Dec 28, 2020
1 parent d9e7631 commit 8ddf4d8
Show file tree
Hide file tree
Showing 19 changed files with 1,415 additions and 0 deletions.
89 changes: 89 additions & 0 deletions CreateGuiWindow.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@


CreateGUITable(){ ;Display Excel Table
Global
; GuiControl, -Redraw, IngredientList
Gui, IngredientList:Default
Gui +LastFound +ToolWindow +Owner +AlwaysOnTop
Gui, IngredientList:Add, ListView, x0 y0 r%Table_height% w430 Grid NoSortHdr checked gIngredientList, Position|Name|LabelClaim|MinLimit|MaxLimit|Units|Percision|LabelName|Description
loop, %Total_Rows%
LV_add(,""Position[A_index],Name[A_index],LabelClaim[A_index],MinLimit[A_index],MaxLimit[A_index],Units[A_index],Percision[A_index],LabelName[A_index],Description[A_index])
;GuiControl, +Redraw, IngredientList
LV_ModifyCol(1,50)
LV_ModifyCol(2,250)
LV_ModifyCol(3,100)
LV_ModifyCol(4,0)
LV_ModifyCol(5,0)
LV_ModifyCol(6,0)
LV_ModifyCol(7,0)
LV_ModifyCol(8,0)
LV_ModifyCol(9,0)
LV_Delete(Table_Height)
sleep 200
Gui, IngredientList:Show, x50 y100 autosize, Ingredients
return

GuiClose:
Gui, IngredientList:destroy
Return

}




IngredientList:
if (A_GuiEvent = "DoubleClick")
{
LV_GetText(Position, A_EventInfo,1)
LV_GetText(Name, A_EventInfo,2)
LV_GetText(LabelClaim, A_EventInfo,3)
LV_GetText(MinLimit, A_EventInfo,4)
LV_GetText(MaxLimit, A_EventInfo,5)
LV_GetText(Units, A_EventInfo,6)
LV_GetText(Percision, A_EventInfo,7)
LV_GetText(LabelName, A_EventInfo,8)
LV_GetText(Description, A_EventInfo,9)
sendinput, {space}
Gui, IngredientList:submit,NoHide

IfWinExist, Edit Ingredient - \\Remote
{
Winactivate, Edit Ingredient - \\Remote
sleep 200
EditIngredient(LabelName,LabelClaim,Position)
sleep 200
send,{enter}
WinWaitActive, Edit Ingredient - \\Remote
sleep 400
gosub Composition
Return
}
IfWinExist, Result Editor - \\Remote
{
WinActivate, Result Editor - \\Remote
ResultEditor()
return
}
IfWinExist, Test Definition Editor - \\Remote
{
WinActivate, Test Definition Editor - \\Remote
TestDefinitionEditor()
Send, {tab 19}{space}
winwait, Results Definition - \\Remote
{
sleep 100
Click,84, 72 ;Edit
winwait, Result Editor - \\Remote
{
WinActivate,
Sleep 100
ResultEditor()
return
}
}
}
else
msgbox % "A_eventInfo: `t" A_EventInfo " `nPosition: `t" Position " `nLabelName: `t" LabelName " `nLabelClaim: `t" LabelClaim " `nMin/max: `t" MinLimit "/" MaxLimit " `nUnits: `t" units " `nPercision: `t" Percision
return
}
51 changes: 51 additions & 0 deletions Editor.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#IfWinActive, ahk_class AutoHotkeyGUI
Capslock & ,::send, ^j
Wheelleft::
Wheelright::Tab
Rbutton & Lbutton::SaveRestart()
Rbutton & WheelUp::WheelCut()
Rbutton & Mbutton::Rbutton
F13 & lbutton::!h
F13 & Rbutton::+!h
F13 & F14::^b

;Rbutton::wheelCopy()
:*:#ifw::`#IfWinActive,
PrintScreen::SaveRestart()
Mbutton::Sendinput, !m
Capslock & `;::SaveRestart()
Insert::
Rshift & Enter::SaveRestart()
F15 & Wheelright::Sendinput,{home}+{end}
#ifwinactive,
Rshift & Enter::SaveRestart()
F9::Send,% ShowMouseLocation()
enter & \::SaveRestart()
+backspace::ExitApp


SaveRestart(){
sendinput, ^s
sleep 100
;WinMenuSelectItem, ahk_class AutoHotkeyGUI, ,4&, 8&
traytip, restart,Restart
sleep 300
reload
return
}
ShowMouseLocation(){
global
if (A_ThisHotkey = A_PriorHotkey && A_TimeSincePriorHotkey < 250)
Run, C:\Users\MMIGNIN\OneDrive - Vitaquest International\AHK\Autohotkey\WindowSpy.ahk
else
{

MouseGetPos, MouseLocationX, MouseLocationY
WinGet, CurrentWindow, ProcessName, A
WinGetTitle, Title, A
Clipboard:="ahk_exe " . CurrentWindow " " Title
TrayTip, %CurrentWindow%, Mouse: %MouselocationX% `, %MouselocationY%
}
return
}

22 changes: 22 additions & 0 deletions Excel.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#IfWinActive, ahk_exe EXCEL.EXE
Home::reload
Enter::numpadenter
F1::SendInput, ^f!t!h{right}{enter}!s{right}!t!n
Numlock::Sendinput, ^f!t!h{right}{enter}!S{right}!t!n
`::esc
Mbutton & WheelUp::Send,^{up}
Mbutton & Wheeldown::Send,{pgdn}
F13 & WheelDown::CloseWindow()
;~ F15 & WheelDown::
;~ send,{shift down}{ctrl down}{down}{ctrl up}{shift up}
;~ sleep 200
;~ return
Rbutton & F13::sendinput,{delete}
Rbutton::click,right
#ifwinactive, Find and Replace,

enter::Send,!i
Numpadenter::!i
Home::
Numlock::winclose
#ifwinactive
65 changes: 65 additions & 0 deletions Fucnctions_MouseButton.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

WheelPaste() {
ifwinactive, ahk_exe explorer.exe
sendinput, ^v
sleep 300
Send,{enter}
ifwinactive, Find and Replace
Send,!n%Clipboard%!i
else
{
sendinput, ^v
}
sleep 800
return
}
WheelCut() {
global
Sendinput,{ctrl down}x{Ctrl up}
sleep 50
VariableGet()
ToolTip, %clipboard%
sleep 800
tooltip,,
return
}
WheelCopy() {
global
Sendinput,{ctrl down}c{Ctrl up}
sleep 50
VariableGet()
ToolTip, %clipboard%
sleep 800
tooltip,,
return
}




CloseWindow() {
IfWinActive, ahk_exe WFICA32.EXE
{
sendinput, {esc}
sleep 800
return
}
IfWinActive, ahk_class MozillaWindowClass ahk_exe firefox.exe
{
sendinput,{ctrl down}w{Ctrl up}
sleep 800
return
}
ifwinactive, ahk_exe msedge.exe
{
sendinput,{ctrl down}w{Ctrl up}
sleep 800
return
}
else
Sendinput, !{F4}
sleep 400
return
}


42 changes: 42 additions & 0 deletions GetExcelData.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@


GetExcelData(){ ;gather excel data
Global
IfWinExist, Mats Workbook - Excel
XL := ComObjActive("Excel.Application").Sheets("Ingredients")
else
{
Path := "C:\Users\mmignin\OneDrive - Vitaquest International\Mats Workbook.xlsm"
XL := ComObjCreate("Excel.Application")
XL.Visible := False
XL_Workbook := XL.Workbooks.Open(Path)
XL_WorkSheet := XL_Workbook.Worksheets(1)
}
;XL.Visible := 1
Name:=[]
LabelClaim:=[]
MinLimit:=[]
MaxLimit:=[]
Units:=[]
Percision:=[]
Position:=[]
LabelName:=[]
Description:=[]
while (Xl.Range("N" . A_Index).Value != "") {
Position[A_index]:=Xl.Range("M" . A_Index+1).Text
Name[A_index]:=Xl.Range("N" . A_Index + 1).text
LabelClaim[A_index]:=Xl.Range("O" . A_Index+1).Text
MinLimit[A_index]:=Xl.Range("P" . A_Index+1).Text
MaxLimit[A_index]:=Xl.Range("Q" . A_Index+1).Text
Units[A_index]:=Xl.Range("R" . A_Index+1).Text
Percision[A_index]:=Xl.Range("S" . A_Index+1).Text

LabelName[A_index]:=Xl.Range("T" . A_Index+1).Text
Description[A_index]:=Xl.Range("U" . A_Index+1).Text
Total_rows:=A_index -1
Table_Height:=A_index
}
CreateGUITable()
;Gui, Show
Return
}
55 changes: 55 additions & 0 deletions MouseButtons.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Right_Click:
Rbutton & Wheelup::wheelcut()
Rbutton & Wheeldown::wheelpaste()
Rbutton & WheelLeft::MouseSendProductCode()
Rbutton & WheelRight::MouseSendBatchCode()
Rbutton & Mbutton::#v
Rbutton & Lbutton::enter
Rbutton & F15::WinActivate, ahk_exe ONENOTE.EXE
Rbutton & F14::WinActivate, ahk_exe EXCEL.EXE
Rbutton & F13::sendinput, +{Click}
Rbutton::
KeyWait,RButton
sendinput, {Click, Right}
return
Thumb_Click:
F13 & LButton::sendinput, ^{Click}
F13 & RButton::sendinput, ^{F1}
F13 & MButton::sendinput, {F3}
F13 & WheelLeft::Sendinput,{Lwin down}{left}{lwin up}
F13 & WheelRight::Sendinput,{lwin down}{right}{lwin up}
F13 & WheelUp::Sendinput,{lwin down}{up}{lwin up}
F13 & WheelDown::Closewindow()
F13::wheelcopy()
Ctrl_Click:
F15 & Wheelup::MouseClick,WheelUp,,,10,0,D,R
F15 & Wheeldown::MouseClick,WheelDown,,,10,0,D,R
F15 & RButton::+Lbutton
F15 & LButton::^Lbutton
F15 & Mbutton::

F15 & Wheelleft::backspace
F15 & Wheelright::Sendinput,{home}+{end}
F15::ClipboardToProductCode()

Alt_Click:
F14 & WheelRight::MouseSendProductCode()
F14 & Mbutton::^a
F14 & WheelLeft::MouseSendBatchCode()
F14 & Wheelup::^WheelUp
F14 & Wheeldown::^wheeldown
F14 & Lbutton::WheelPaste()
F14 & Rbutton::enter
F14::ClipboardToBatchCode()

Mbutton_Click:
Mbutton & Wheelup::sendinput,^{wheelup}
Mbutton & Wheeldown::send,^{Wheeldown}
Mbutton & Wheelright::send,^#{Right}
Mbutton & Wheelleft::send,^#{left}
Mbutton::Mbutton




#Include Fucnctions_MouseButton.ahk
Loading

0 comments on commit 8ddf4d8

Please sign in to comment.