Clever stuff guys. Problem is I would have to change all controls and I have alot. Let me show you my code to get the picture.
I ended up doing the control coordinates in relation to % of the screen to work on different sized monitors/resolutions.
Its not elegant but it does the job. We need something that controls a list of all existing controls! This is useful for bulky existing GUI projects.
Code: Select all
WinGetPos,,,,taskh, ahk_class Shell_TrayWnd
ScreenHeight := A_ScreenHeight - taskh - 29, ScreenWidth := A_ScreenWidth - 6, SetPrintersX := 42, SetPrintersY := ScreenHeight - (0.0481 * ScreenHeight), ScreenHeightBorder := ScreenHeight - 4, ScreenWidthBorder := ScreenWidth - 4
GrpBoxPosX := 0.02232 * ScreenWidth, GrpBoxPosY := 0.02286 * ScreenHeight, GrpBoxPosW := 0.95537 * ScreenWidth, GrpBoxPosH := 0.13237 * ScreenHeight
CurrFuncX := 0.02928 * ScreenWidth, CurrFuncY := 0.0589 * ScreenHeight, CurrFuncW := 0.1673 * ScreenWidth, CurrFuncH := 0.07220 * ScreenHeight
CurrUserX := 0.21757 * ScreenWidth, CurrUserY := 0.05897 * ScreenHeight, CurrUserW := 0.16736 * ScreenWidth, CurrUserH := 0.0722 * ScreenHeight
CurrDeptX := 0.40586 * ScreenWidth, CurrDeptY := 0.05897 * ScreenHeight, CurrDeptW := 0.16736 * ScreenWidth, CurrDeptH := 0.0722 * ScreenHeight
ChangeUserX := 0.59414 * ScreenWidth, ChangeUserY := 0.05897 * ScreenHeight, ChangeUserW := 0.16736 * ScreenWidth, ChangeUserH := 0.0722 * ScreenHeight
SIRTPX := 0.02929 * ScreenWidth, SIRTPY := 0.22744 * ScreenHeight, SIRTPW := 0.16736 * ScreenWidth, SIRTPH := 0.15644 * ScreenHeight
OPX := 0.21757 * ScreenWidth, OPY := 0.22744 * ScreenHeight, OPW := 0.16736 * ScreenWidth, OPH := 0.15644 * ScreenHeight
OHOX := 0.40586 * ScreenWidth, OHOY := 0.22744 * ScreenHeight, OHOW := 0.16736 * ScreenWidth, OHOH := 0.15644 * ScreenHeight
OLIVX:= 0.59414 * ScreenWidth, OLIVY:= 0.22744 * ScreenHeight, OLIVW:= 0.16736 * ScreenWidth, OLIVH:= 0.15644 * ScreenHeight
ORX := 0.78243 * ScreenWidth, ORY := 0.22744 * ScreenHeight, ORW := 0.16736 * ScreenWidth, ORH := 0.15644 * ScreenHeight
FuncX := 0.02232 * ScreenWidth, FuncY := 0.19134 * ScreenHeight, FuncW := 0.95537 * ScreenWidth, FuncH := 0.21661 * ScreenHeight
Groups2TierX := 0.02232 * ScreenWidth, Groups2TierY := 0.40794 * ScreenHeight, Groups2TierW := 0.95537 * ScreenWidth, Groups2TierH := 0.24067 * ScreenHeight
Tier2ButtonsX := 0.02929 * ScreenWidth, Tier2ButtonsY := 0.44404 * ScreenHeight, Tier2ButtonsW := 0.16736 * ScreenWidth, Tier2ButtonsH := 0.15644 * ScreenHeight
Tier2ButtonsBX := 0.21757 * ScreenWidth, Tier2ButtonsBY := 0.44404 * ScreenHeight, Tier2ButtonsBW := 0.16736 * ScreenWidth, Tier2ButtonsBH := 0.15644 * ScreenHeight
PrinterSettingsX := 0.5802 * ScreenWidth, PrinterSettingsY := 0.44404 * ScreenHeight
PrinterSettingsBX := 0.45467 * ScreenWidth, PrinterSettingsBY := 0.44404 * ScreenHeight
PrinterSettingsCX := 0.56974 * ScreenWidth, PrinterSettingsCY := 0.44404 * ScreenHeight
ReasonChoiceX := 0.02929 * ScreenWidth, ReasonChoiceY := 0.44404 * ScreenHeight, ReasonChoiceW := 0.16736 * ScreenWidth, ReasonChoiceH := 0.15644 * ScreenHeight
ReorderChoiceX := 0.21757 * ScreenWidth, ReorderChoiceY := 0.44404 * ScreenHeight, ReorderChoiceW := 0.16736 * ScreenWidth, ReorderChoiceH := 0.15644 * ScreenHeight
DropDownAH := 0.15042 * ScreenHeight, DropDownBH := 0.02407 * ScreenHeight
DEPT3X := 0.40586 * ScreenWidth, DEPT3Y := 0.44404 * ScreenHeight, DEPT3W := 0.16736 * ScreenWidth, DEPT3H := 0.15644 * ScreenHeight
DEPT4X := 0.59414 * ScreenWidth, DEPT4Y := 0.44404 * ScreenHeight, DEPT4W := 0.16736 * ScreenWidth, DEPT4H := 0.15644 * ScreenHeight
DEPT5X := 0.78243 * ScreenWidth, DEPT5Y := 0.44404 * ScreenHeight, DEPT5W := 0.16736 * ScreenWidth, DEPT5H := 0.15644 * ScreenHeight
InvScannerX := 0.02232 * ScreenWidth, InvScannerY := 0.66065 * ScreenHeight, InvScannerW := 0.95537 * ScreenWidth, InvScannerH := 0.13237 * ScreenHeight
InvScanEditX := 0.03626 * ScreenWidth, InvScanEditY := 0.68472 * ScreenHeight, InvScanEditW := 0.92748 * ScreenWidth, InvScanEditH := 0.02407 * ScreenHeight
MovInvScanEditX := 0.03626 * ScreenWidth, MovInvScanEditY := 0.68472 * ScreenHeight, MovInvScanEditW := 0.92748 * ScreenWidth, MovInvScanEditH := 0.09627 * ScreenHeight
GroupResultsX := 0.02232 * ScreenWidth, GroupResultsY := 0.80505 * ScreenHeight, GroupResultsW := 0.95537 * ScreenWidth, GroupResultsH := 0.13237 * ScreenHeight
ResDiagX := 0.03626 * ScreenWidth, ResDiagY := 0.82912 * ScreenHeight, ResDiagW := 0.92748 * ScreenWidth, ResDiagH := 0.09627 * ScreenHeight
Gui +LastFound +OwnDialogs +AlwaysOnTop
Gui, Add, GroupBox, x%GrpBoxPosX% y%GrpBoxPosY% w%GrpBoxPosW% h%GrpBoxPosH% , Position
Gui, Add, Text, x%CurrFuncX% y%CurrFuncY% w%CurrFuncW% h%CurrFuncH% 0x1000 Center 0x200 vCurrentFunction hwnd1x1, CURRENT FUNCTION
Gui, Add, Text, x%CurrUserX% y%CurrUserY% w%CurrUserW% h%CurrUserH% 0x1000 Center 0x200 vCurrentUser hwnd3x3, CURRENT USER
Gui, Add, Text, x%CurrDeptX% y%CurrDeptY% w%CurrDeptW% h%CurrDeptH% 0x1000 Center 0x200 vCurrentDept hwnd2x2, CURRENT DEPARTMENT
Gui, Add, Button, x%ChangeUserX% y%ChangeUserY% w%ChangeUserW% h%ChangeUserH% vChangeUser gChangeUser, CHANGE USER
Gui, Add, CheckBox, 0x1000 -Theme x%SIRTPX% y%SIRTPY% w%SIRTPW% h%SIRTPH% vSIRTP gSIRTP, Scan Invoice Ready to Pack
Gui, Add, CheckBox, 0x1000 -Theme x%OPX% y%OPY% w%OPW% h%OPH% vOP gOP, Order Packed
Gui, Add, CheckBox, 0x1000 -Theme x%OHOX% y%OHOY% w%OHOW% h%OHOH% vOHO gOHO, Order Handed Over
Gui, Add, CheckBox, 0x1000 -Theme x%OLIVX% y%OLIVY% w%OLIVW% h%OLIVH% vOLIV gOLIV, Order Loaded in Van
Gui, Add, CheckBox, 0x1000 -Theme x%ORX% y%ORY% w%ORW% h%ORH% vOR gOR, Order Returned
Gui, Add, GroupBox, x%FuncX% y%FuncY% w%FuncW% h%FuncH%, Functions
Gui, Add, GroupBox, x%Groups2TierX% y%Groups2TierY% w%Groups2TierW% h%Groups2TierH% vGroupDept, Department
Gui, Add, GroupBox, x%Groups2TierX% y%Groups2TierY% w%Groups2TierW% h%Groups2TierH% vGroupOrderPacked, Packing
Gui, Add, GroupBox, x%Groups2TierX% y%Groups2TierY% w%Groups2TierW% h%Groups2TierH% vGroupHandedOver, Hand-Over
Gui, Add, GroupBox, x%Groups2TierX% y%Groups2TierY% w%Groups2TierW% h%Groups2TierH% vGroupReturned, Returned
Gui, Add, CheckBox, 0x1000 -Theme x%Tier2ButtonsX% y%Tier2ButtonsY% w%Tier2ButtonsW% h%Tier2ButtonsH% vDept1 gDept1, DEPARTMENT 1
Gui, Add, CheckBox, 0x1000 -Theme x%Tier2ButtonsX% y%Tier2ButtonsY% w%Tier2ButtonsW% h%Tier2ButtonsH% vPackerReport gPackerReport, PACKER REPORT
Gui, Add, CheckBox, 0x1000 -Theme x%Tier2ButtonsX% y%Tier2ButtonsY% w%Tier2ButtonsW% h%Tier2ButtonsH% vHandOverReport gHandOverReport, HAND-OVER REPORT
Gui, Add, CheckBox, 0x1000 -Theme x%Tier2ButtonsBX% y%Tier2ButtonsBY% w%Tier2ButtonsBW% h%Tier2ButtonsBH% vDept2 gDept2, DEPARTMENT 2
Gui, Add, DropDownList, x%Tier2ButtonsBX% y%Tier2ButtonsBY% w%Tier2ButtonsBW% h%Tier2ButtonsBH% hwndhcbx gDepartmentChoice vDepartmentChoice, DEPARTMENT 1|DEPARTMENT 2|DEPARTMENT 3|DEPARTMENT 4|DEPARTMENT 5|ALL DEPARTMENTS
Gui, Add, DropDownList, x%Tier2ButtonsBX% y%Tier2ButtonsBY% w%Tier2ButtonsBW% h%Tier2ButtonsBH% hwndhcby gRouteChoice vRouteChoice, ROUTE 1|ROUTE 2|ROUTE 3|ROUTE 4|ROUTE 5|ALL ROUTES
IniRead, PrintLabelsONOFF, C:\AHK\PackLabelPrinter\PrinterSettings.ini, PrinterSettings, PrintLabelsONOFF
Gui, Add, Checkbox, x%PrinterSettingsX% y%PrinterSettingsY% vPrintLabelsONOFF gPrintLabelsONOFF Checked%PrintLabelsONOFF%, Labels to Printer
IniRead, LabelsChromeONOFF, C:\AHK\PackLabelPrinter\PrinterSettings.ini, PrinterSettings, LabelsChromeONOFF
Gui, Add, Checkbox, x%PrinterSettingsX% y%PrinterSettingsY% vLabelsChromeONOFF gLabelsChromeONOFF Checked%LabelsChromeONOFF%, Labels to Chrome
IniRead, PrintPackerReportONOFF, C:\AHK\PackLabelPrinter\PrinterSettings.ini, PrinterSettings, PrintPackerReportONOFF
Gui, Add, Checkbox, x%PrinterSettingsBX% y%PrinterSettingsBY% vPrintPackerReportONOFF gPrintPackerReportONOFF Checked%PrintPackerReportONOFF%, Packer Report to Printer
IniRead, PackerReportChromeONOFF, C:\AHK\PackLabelPrinter\PrinterSettings.ini, PrinterSettings, PackerReportChromeONOFF
Gui, Add, Checkbox, x%PrinterSettingsBX% y%PrinterSettingsBY% vPackerReportChromeONOFF gPackerReportChromeONOFF Checked%PackerReportChromeONOFF%, Packer Report to Chrome
IniRead, PrintHandOverReportONOFF, C:\AHK\PackLabelPrinter\PrinterSettings.ini, PrinterSettings, PrintHandOverReportONOFF
Gui, Add, Checkbox, x%PrinterSettingsCX% y%PrinterSettingsCY% vPrintHandOverReportONOFF gPrintHandOverReportONOFF Checked%PrintHandOverReportONOFF%, Hand Over Report to Printer
IniRead, HandOverReportChromeONOFF, C:\AHK\PackLabelPrinter\PrinterSettings.ini, PrinterSettings, HandOverReportChromeONOFF
Gui, Add, Checkbox, x%PrinterSettingsCX% y%PrinterSettingsCY% vHandOverReportChromeONOFF gHandOverReportChromeONOFF Checked%HandOverReportChromeONOFF%, Hand Over Report to Chrome
Gui, Add, DropDownList, x%ReasonChoiceX% y%ReasonChoiceY% w%ReasonChoiceW% h%ReasonChoiceH% r6 hwndhcba gReasonChoice vReasonChoice, INCORRECT ITEMS|DAMAGED|INCORRECT INVOICE|SHORT DATED|OTHER
Gui, Add, DropDownList, xx%ReorderChoiceX% y%ReorderChoiceY% w%ReorderChoiceW% h%ReorderChoiceH% r6 hwndhcbb gReorderChoice vReorderChoice, REORDER|CANCEL
GuiControl, Choose, ReasonChoice, 1
GuiControl, Choose, ReorderChoice, 1
PostMessage, 0x153, -1, %DropDownAH%,, ahk_id %hcbx% ; Set height of selection field.
PostMessage, 0x153, 0, %DropDownBH%,, ahk_id %hcbx%
PostMessage, 0x153, -1, %DropDownAH%,, ahk_id %hcby% ; Set height of selection field.
PostMessage, 0x153, 0, %DropDownBH%,, ahk_id %hcby%
PostMessage, 0x153, -1, %DropDownAH%,, ahk_id %hcba% ; Set height of selection field.
PostMessage, 0x153, 0, %DropDownBH%,, ahk_id %hcba%
PostMessage, 0x153, -1, %DropDownAH%,, ahk_id %hcbb% ; Set height of selection field.
PostMessage, 0x153, 0, %DropDownBH%,, ahk_id %hcbb%
GuiControl, Choose, DepartmentChoice, 6
GuiControl, Choose, RouteChoice, 6
Gui, Add, CheckBox, 0x1000 -Theme x%DEPT3X% y%DEPT3Y% w%DEPT3W% h%DEPT3H% vDept3 gDept3, DEPARTMENT 3
Gui, Add, CheckBox, 0x1000 -Theme x%DEPT4X% y%DEPT4Y% w%DEPT4W% h%DEPT4H% vDept4 gDept4, DEPARTMENT 4
Gui, Add, CheckBox, 0x1000 -Theme x%DEPT5X% y%DEPT5Y% w%DEPT5W% h%DEPT5H% vDept5 gDept5, DEPARTMENT 5
Gui, Add, GroupBox, x%InvScannerX% y%InvScannerY% w%InvScannerW% h%InvScannerH%, Invoice Scanner
Gui, Add, Edit, x%InvScanEditX% y%InvScanEditY% w%InvScanEditW% h%InvScanEditH% -E0x200 vInvoiceScanEdit hwndHED1
Gui, Add, Button, Hidden Default gInvoiceQRCapture, OK
SetEditCueBanner(HED1, "Scan Invoice Here Ex. SIMS_001_IN_000999_ABCDEF_000010.00_0_0_R1")
GuiControl, Move, InvoiceScanEdit, x%MovInvScanEditX% y%MovInvScanEditY% w%MovInvScanEditW% h%MovInvScanEditH%
GuiControl, +Center 0x200 -VScroll -HScroll, InvoiceScanEdit
Gui, Add, GroupBox, x%GroupResultsX% y%GroupResultsY% w%GroupResultsW% h%GroupResultsH%, Results
Gui, Add, Text, x%ResDiagX% y%ResDiagY% w%ResDiagW% h%ResDiagH% 0x1000 vResultDialog, Stand-by for result.
Gui, Font, cBlue
Gui, Add, Text, x%SetPrintersX% y%SetPrintersY% gSetPrinters, Set Printers
Gui, Font,
GuiControl, Hide, GroupOrderPacked
GuiControl, Hide, PackerReport
GuiControl, Hide, GroupHandedOver
GuiControl, Hide, HandOverReport
GuiControl, Hide, RouteChoice
GuiControl, Hide, DepartmentChoice
;GuiControl, Hide, Dept5
GuiControl, Hide, GroupReturned
GuiControl, Hide, ReasonChoice
GuiControl, Hide, ReorderChoice
GuiControl, Hide, PrintLabelsONOFF
GuiControl, Hide, LabelsChromeONOFF
GuiControl, Hide, PrintPackerReportONOFF
GuiControl, Hide, PackerReportChromeONOFF
GuiControl, Hide, PrintHandOverReportONOFF
GuiControl, Hide, HandOverReportChromeONOFF
GuiControl, Hide, CurrentUser
GuiControl, Hide, ChangeUser
Gui, Add, Picture, % "x" 0 " y" 0 " w" ScreenWidth " h" 4 " +0x4E +HWNDhPicture1"
CreatePixel("000000", hPicture1)
Gui, Add, Picture, % "x" 0 " y" ScreenHeightBorder " w" ScreenWidth " h" 4 " +0x4E +HWNDhPicture2"
CreatePixel("000000", hPicture2)
Gui, Add, Picture, % "x" 0 " y" 0 " w" 4 " h" ScreenHeight " +0x4E +HWNDhPicture3"
CreatePixel("000000", hPicture3)
Gui, Add, Picture, % "x" ScreenWidthBorder " y" 0 " w" 4 " h" ScreenHeight " +0x4E +HWNDhPicture4"
CreatePixel("000000", hPicture4)
Gui, Show, x0 y0 h%ScreenHeight% w%ScreenWidth%, Pack Tracking
SetStaticColor(1x1, 0xFF0000)
SetStaticColor(2x2, 0xFF0000)
SetStaticColor(3x3, 0xFF0000)
Initialize()
IniRead, LabelPrinter, C:\AHK\PackLabelPrinter\PrinterSettings.ini, PrinterSettings, LabelPrinter
{
If LabelPrinter = ERROR
GoTo, SetPrinters
}
IniRead, ReportPrinter, C:\AHK\PackLabelPrinter\PrinterSettings.ini, PrinterSettings, ReportPrinter
{
If ReportPrinter = ERROR
GoTo, SetPrinters
}
Return
Below I have cleaned the code to remove labels and functions (so one can open without errors) so one can test resizing on prefabricated controls.
Code: Select all
WinGetPos,,,,taskh, ahk_class Shell_TrayWnd
ScreenHeight := A_ScreenHeight - taskh - 29, ScreenWidth := A_ScreenWidth - 6, SetPrintersX := 42, SetPrintersY := ScreenHeight - (0.0481 * ScreenHeight), ScreenHeightBorder := ScreenHeight - 4, ScreenWidthBorder := ScreenWidth - 4
GrpBoxPosX := 0.02232 * ScreenWidth, GrpBoxPosY := 0.02286 * ScreenHeight, GrpBoxPosW := 0.95537 * ScreenWidth, GrpBoxPosH := 0.13237 * ScreenHeight
CurrFuncX := 0.02928 * ScreenWidth, CurrFuncY := 0.0589 * ScreenHeight, CurrFuncW := 0.1673 * ScreenWidth, CurrFuncH := 0.07220 * ScreenHeight
CurrUserX := 0.21757 * ScreenWidth, CurrUserY := 0.05897 * ScreenHeight, CurrUserW := 0.16736 * ScreenWidth, CurrUserH := 0.0722 * ScreenHeight
CurrDeptX := 0.40586 * ScreenWidth, CurrDeptY := 0.05897 * ScreenHeight, CurrDeptW := 0.16736 * ScreenWidth, CurrDeptH := 0.0722 * ScreenHeight
ChangeUserX := 0.59414 * ScreenWidth, ChangeUserY := 0.05897 * ScreenHeight, ChangeUserW := 0.16736 * ScreenWidth, ChangeUserH := 0.0722 * ScreenHeight
SIRTPX := 0.02929 * ScreenWidth, SIRTPY := 0.22744 * ScreenHeight, SIRTPW := 0.16736 * ScreenWidth, SIRTPH := 0.15644 * ScreenHeight
OPX := 0.21757 * ScreenWidth, OPY := 0.22744 * ScreenHeight, OPW := 0.16736 * ScreenWidth, OPH := 0.15644 * ScreenHeight
OHOX := 0.40586 * ScreenWidth, OHOY := 0.22744 * ScreenHeight, OHOW := 0.16736 * ScreenWidth, OHOH := 0.15644 * ScreenHeight
OLIVX:= 0.59414 * ScreenWidth, OLIVY:= 0.22744 * ScreenHeight, OLIVW:= 0.16736 * ScreenWidth, OLIVH:= 0.15644 * ScreenHeight
ORX := 0.78243 * ScreenWidth, ORY := 0.22744 * ScreenHeight, ORW := 0.16736 * ScreenWidth, ORH := 0.15644 * ScreenHeight
FuncX := 0.02232 * ScreenWidth, FuncY := 0.19134 * ScreenHeight, FuncW := 0.95537 * ScreenWidth, FuncH := 0.21661 * ScreenHeight
Groups2TierX := 0.02232 * ScreenWidth, Groups2TierY := 0.40794 * ScreenHeight, Groups2TierW := 0.95537 * ScreenWidth, Groups2TierH := 0.24067 * ScreenHeight
Tier2ButtonsX := 0.02929 * ScreenWidth, Tier2ButtonsY := 0.44404 * ScreenHeight, Tier2ButtonsW := 0.16736 * ScreenWidth, Tier2ButtonsH := 0.15644 * ScreenHeight
Tier2ButtonsBX := 0.21757 * ScreenWidth, Tier2ButtonsBY := 0.44404 * ScreenHeight, Tier2ButtonsBW := 0.16736 * ScreenWidth, Tier2ButtonsBH := 0.15644 * ScreenHeight
PrinterSettingsX := 0.5802 * ScreenWidth, PrinterSettingsY := 0.44404 * ScreenHeight
PrinterSettingsBX := 0.45467 * ScreenWidth, PrinterSettingsBY := 0.44404 * ScreenHeight
PrinterSettingsCX := 0.56974 * ScreenWidth, PrinterSettingsCY := 0.44404 * ScreenHeight
ReasonChoiceX := 0.02929 * ScreenWidth, ReasonChoiceY := 0.44404 * ScreenHeight, ReasonChoiceW := 0.16736 * ScreenWidth, ReasonChoiceH := 0.15644 * ScreenHeight
ReorderChoiceX := 0.21757 * ScreenWidth, ReorderChoiceY := 0.44404 * ScreenHeight, ReorderChoiceW := 0.16736 * ScreenWidth, ReorderChoiceH := 0.15644 * ScreenHeight
DropDownAH := 0.15042 * ScreenHeight, DropDownBH := 0.02407 * ScreenHeight
DEPT3X := 0.40586 * ScreenWidth, DEPT3Y := 0.44404 * ScreenHeight, DEPT3W := 0.16736 * ScreenWidth, DEPT3H := 0.15644 * ScreenHeight
DEPT4X := 0.59414 * ScreenWidth, DEPT4Y := 0.44404 * ScreenHeight, DEPT4W := 0.16736 * ScreenWidth, DEPT4H := 0.15644 * ScreenHeight
DEPT5X := 0.78243 * ScreenWidth, DEPT5Y := 0.44404 * ScreenHeight, DEPT5W := 0.16736 * ScreenWidth, DEPT5H := 0.15644 * ScreenHeight
InvScannerX := 0.02232 * ScreenWidth, InvScannerY := 0.66065 * ScreenHeight, InvScannerW := 0.95537 * ScreenWidth, InvScannerH := 0.13237 * ScreenHeight
InvScanEditX := 0.03626 * ScreenWidth, InvScanEditY := 0.68472 * ScreenHeight, InvScanEditW := 0.92748 * ScreenWidth, InvScanEditH := 0.02407 * ScreenHeight
MovInvScanEditX := 0.03626 * ScreenWidth, MovInvScanEditY := 0.68472 * ScreenHeight, MovInvScanEditW := 0.92748 * ScreenWidth, MovInvScanEditH := 0.09627 * ScreenHeight
GroupResultsX := 0.02232 * ScreenWidth, GroupResultsY := 0.80505 * ScreenHeight, GroupResultsW := 0.95537 * ScreenWidth, GroupResultsH := 0.13237 * ScreenHeight
ResDiagX := 0.03626 * ScreenWidth, ResDiagY := 0.82912 * ScreenHeight, ResDiagW := 0.92748 * ScreenWidth, ResDiagH := 0.09627 * ScreenHeight
Gui +LastFound +OwnDialogs +AlwaysOnTop
Gui, Add, GroupBox, x%GrpBoxPosX% y%GrpBoxPosY% w%GrpBoxPosW% h%GrpBoxPosH% , Position
Gui, Add, Text, x%CurrFuncX% y%CurrFuncY% w%CurrFuncW% h%CurrFuncH% 0x1000 Center 0x200 vCurrentFunction hwnd1x1, CURRENT FUNCTION
Gui, Add, Text, x%CurrUserX% y%CurrUserY% w%CurrUserW% h%CurrUserH% 0x1000 Center 0x200 vCurrentUser hwnd3x3, CURRENT USER
Gui, Add, Text, x%CurrDeptX% y%CurrDeptY% w%CurrDeptW% h%CurrDeptH% 0x1000 Center 0x200 vCurrentDept hwnd2x2, CURRENT DEPARTMENT
Gui, Add, Button, x%ChangeUserX% y%ChangeUserY% w%ChangeUserW% h%ChangeUserH% vChangeUser, CHANGE USER
Gui, Add, CheckBox, 0x1000 -Theme x%SIRTPX% y%SIRTPY% w%SIRTPW% h%SIRTPH% vSIRTP, Scan Invoice Ready to Pack
Gui, Add, CheckBox, 0x1000 -Theme x%OPX% y%OPY% w%OPW% h%OPH% vOP, Order Packed
Gui, Add, CheckBox, 0x1000 -Theme x%OHOX% y%OHOY% w%OHOW% h%OHOH% vOHO, Order Handed Over
Gui, Add, CheckBox, 0x1000 -Theme x%OLIVX% y%OLIVY% w%OLIVW% h%OLIVH% vOLIV, Order Loaded in Van
Gui, Add, CheckBox, 0x1000 -Theme x%ORX% y%ORY% w%ORW% h%ORH% vOR, Order Returned
Gui, Add, GroupBox, x%FuncX% y%FuncY% w%FuncW% h%FuncH%, Functions
Gui, Add, GroupBox, x%Groups2TierX% y%Groups2TierY% w%Groups2TierW% h%Groups2TierH% vGroupDept, Department
Gui, Add, GroupBox, x%Groups2TierX% y%Groups2TierY% w%Groups2TierW% h%Groups2TierH% vGroupOrderPacked, Packing
Gui, Add, GroupBox, x%Groups2TierX% y%Groups2TierY% w%Groups2TierW% h%Groups2TierH% vGroupHandedOver, Hand-Over
Gui, Add, GroupBox, x%Groups2TierX% y%Groups2TierY% w%Groups2TierW% h%Groups2TierH% vGroupReturned, Returned
Gui, Add, CheckBox, 0x1000 -Theme x%Tier2ButtonsX% y%Tier2ButtonsY% w%Tier2ButtonsW% h%Tier2ButtonsH% vDept1, DEPARTMENT 1
Gui, Add, CheckBox, 0x1000 -Theme x%Tier2ButtonsX% y%Tier2ButtonsY% w%Tier2ButtonsW% h%Tier2ButtonsH% vPackerReport, PACKER REPORT
Gui, Add, CheckBox, 0x1000 -Theme x%Tier2ButtonsX% y%Tier2ButtonsY% w%Tier2ButtonsW% h%Tier2ButtonsH% vHandOverReport, HAND-OVER REPORT
Gui, Add, CheckBox, 0x1000 -Theme x%Tier2ButtonsBX% y%Tier2ButtonsBY% w%Tier2ButtonsBW% h%Tier2ButtonsBH% vDept2, DEPARTMENT 2
Gui, Add, DropDownList, x%Tier2ButtonsBX% y%Tier2ButtonsBY% w%Tier2ButtonsBW% h%Tier2ButtonsBH% hwndhcbx x42 vDepartmentChoice, DEPARTMENT 1|DEPARTMENT 2|DEPARTMENT 3|DEPARTMENT 4|DEPARTMENT 5|ALL DEPARTMENTS
Gui, Add, DropDownList, x%Tier2ButtonsBX% y%Tier2ButtonsBY% w%Tier2ButtonsBW% h%Tier2ButtonsBH% hwndhcby x42 vRouteChoice, ROUTE 1|ROUTE 2|ROUTE 3|ROUTE 4|ROUTE 5|ALL ROUTES
IniRead, PrintLabelsONOFF, C:\AHK\PackLabelPrinter\PrinterSettings.ini, PrinterSettings, PrintLabelsONOFF
Gui, Add, Checkbox, x%PrinterSettingsX% y%PrinterSettingsY% vPrintLabelsONOFF x42 Checked%PrintLabelsONOFF%, Labels to Printer
IniRead, LabelsChromeONOFF, C:\AHK\PackLabelPrinter\PrinterSettings.ini, PrinterSettings, LabelsChromeONOFF
Gui, Add, Checkbox, x%PrinterSettingsX% y%PrinterSettingsY% vLabelsChromeONOFF x42 Checked%LabelsChromeONOFF%, Labels to Chrome
IniRead, PrintPackerReportONOFF, C:\AHK\PackLabelPrinter\PrinterSettings.ini, PrinterSettings, PrintPackerReportONOFF
Gui, Add, Checkbox, x%PrinterSettingsBX% y%PrinterSettingsBY% vPrintPackerReportONOFF x42 Checked%PrintPackerReportONOFF%, Packer Report to Printer
IniRead, PackerReportChromeONOFF, C:\AHK\PackLabelPrinter\PrinterSettings.ini, PrinterSettings, PackerReportChromeONOFF
Gui, Add, Checkbox, x%PrinterSettingsBX% y%PrinterSettingsBY% vPackerReportChromeONOFF x42 Checked%PackerReportChromeONOFF%, Packer Report to Chrome
IniRead, PrintHandOverReportONOFF, C:\AHK\PackLabelPrinter\PrinterSettings.ini, PrinterSettings, PrintHandOverReportONOFF
Gui, Add, Checkbox, x%PrinterSettingsCX% y%PrinterSettingsCY% vPrintHandOverReportONOFF x42 Checked%PrintHandOverReportONOFF%, Hand Over Report to Printer
IniRead, HandOverReportChromeONOFF, C:\AHK\PackLabelPrinter\PrinterSettings.ini, PrinterSettings, HandOverReportChromeONOFF
Gui, Add, Checkbox, x%PrinterSettingsCX% y%PrinterSettingsCY% vHandOverReportChromeONOFF x42 Checked%HandOverReportChromeONOFF%, Hand Over Report to Chrome
Gui, Add, DropDownList, x%ReasonChoiceX% y%ReasonChoiceY% w%ReasonChoiceW% h%ReasonChoiceH% r6 hwndhcba x42 vReasonChoice, INCORRECT ITEMS|DAMAGED|INCORRECT INVOICE|SHORT DATED|OTHER
Gui, Add, DropDownList, xx%ReorderChoiceX% y%ReorderChoiceY% w%ReorderChoiceW% h%ReorderChoiceH% r6 hwndhcbb x42 vReorderChoice, REORDER|CANCEL
GuiControl, Choose, ReasonChoice, 1
GuiControl, Choose, ReorderChoice, 1
PostMessage, 0x153, -1, %DropDownAH%,, ahk_id %hcbx% ; Set height of selection field.
PostMessage, 0x153, 0, %DropDownBH%,, ahk_id %hcbx%
PostMessage, 0x153, -1, %DropDownAH%,, ahk_id %hcby% ; Set height of selection field.
PostMessage, 0x153, 0, %DropDownBH%,, ahk_id %hcby%
PostMessage, 0x153, -1, %DropDownAH%,, ahk_id %hcba% ; Set height of selection field.
PostMessage, 0x153, 0, %DropDownBH%,, ahk_id %hcba%
PostMessage, 0x153, -1, %DropDownAH%,, ahk_id %hcbb% ; Set height of selection field.
PostMessage, 0x153, 0, %DropDownBH%,, ahk_id %hcbb%
GuiControl, Choose, DepartmentChoice, 6
GuiControl, Choose, RouteChoice, 6
Gui, Add, CheckBox, 0x1000 -Theme x%DEPT3X% y%DEPT3Y% w%DEPT3W% h%DEPT3H% vDept3, DEPARTMENT 3
Gui, Add, CheckBox, 0x1000 -Theme x%DEPT4X% y%DEPT4Y% w%DEPT4W% h%DEPT4H% vDept4, DEPARTMENT 4
Gui, Add, CheckBox, 0x1000 -Theme x%DEPT5X% y%DEPT5Y% w%DEPT5W% h%DEPT5H% vDept5, DEPARTMENT 5
Gui, Add, GroupBox, x%InvScannerX% y%InvScannerY% w%InvScannerW% h%InvScannerH%, Invoice Scanner
Gui, Add, Edit, x%InvScanEditX% y%InvScanEditY% w%InvScanEditW% h%InvScanEditH% -E0x200 vInvoiceScanEdit hwndHED1
Gui, Add, Button, Hidden Default, OK
GuiControl, Move, InvoiceScanEdit, x%MovInvScanEditX% y%MovInvScanEditY% w%MovInvScanEditW% h%MovInvScanEditH%
GuiControl, +Center 0x200 -VScroll -HScroll, InvoiceScanEdit
Gui, Add, GroupBox, x%GroupResultsX% y%GroupResultsY% w%GroupResultsW% h%GroupResultsH%, Results
Gui, Add, Text, x%ResDiagX% y%ResDiagY% w%ResDiagW% h%ResDiagH% 0x1000 vResultDialog, Stand-by for result.
Gui, Font, cBlue
Gui, Add, Text, x%SetPrintersX% y%SetPrintersY%, Set Printers
Gui, Font,
GuiControl, Hide, GroupOrderPacked
GuiControl, Hide, PackerReport
GuiControl, Hide, GroupHandedOver
GuiControl, Hide, HandOverReport
GuiControl, Hide, RouteChoice
GuiControl, Hide, DepartmentChoice
;GuiControl, Hide, Dept5
GuiControl, Hide, GroupReturned
GuiControl, Hide, ReasonChoice
GuiControl, Hide, ReorderChoice
GuiControl, Hide, PrintLabelsONOFF
GuiControl, Hide, LabelsChromeONOFF
GuiControl, Hide, PrintPackerReportONOFF
GuiControl, Hide, PackerReportChromeONOFF
GuiControl, Hide, PrintHandOverReportONOFF
GuiControl, Hide, HandOverReportChromeONOFF
GuiControl, Hide, CurrentUser
GuiControl, Hide, ChangeUser
Gui, Show, x0 y0 h%ScreenHeight% w%ScreenWidth%, Pack Tracking
Return