That worked great and very elegantly written and thank for simplifying. You also solved my other problem where I was leery to use the "AltSubmit" in the first place but you proved to me that I can still capture the data and the "number" in the list.
1. Is there a way to multselect and send the items as a single string. I added the multi option to the add listbox but without any luck. Ill try playing with it.
2. How do I add more "box ="'s I added one in my complete code below (minus some of the other fields to limit size). Have about 12.
Code: Select all
box1 =
Field1 := "LUNG BASES: "
Findings1 := [["Clear" , "Normal."]
, ["Bibasilar atelectasis" , "Bibasilar atelectasis versus lung scarring."]
, ["Centrilobular emphysematous changes are present." , "Emphysematous/COPD Lung disease."]
, ["Hiatal hernia is present" , "Hiatal hernia is present."]
, ["Pulmonary nodule seen." , "Pulmonary nodule(s). Recommend dedicated CT of the Chest to assess for other nodules and initiate Lung Cancer Screening program."]]
For k, v in Findings1
box1 .= (A_Index > 1 ? "|" : "") v.1
;/////////////////////////////////////////////////////////////
;Color and Brightness/transparancy
Purple := "34294d"
White := "FFFFFF"
Green2 := "007369"
Green := "6A9955"
DarkGrey := "c000000"
Orange := "CC6633"
GuiColor := 0x000111
trans := 110
Brightness := 225
;///////////////////////////////////////////////////////////////////////
box2 =
;Findings2
Field2 := "LIVER:"
Findings2 := [["No biliary obstruction." ," "],["Liver appears hypodense." , "Hypodense liver suggest hepatic steatosis."],["Nodular appearance to the liver." , "Nodular appearance suggests cirrhosis."]]
For k, v in Findings2
box2 .= (A_Index > 1 ? "|" : "") v.1 ;Tried this in a the loop 12 but wasnt sure if have to be done for each to parse?
;/////////////////////////////////////////////////////////////////
;Screen positions
FFI1x := 225 ;lungs
FFI1y := 1475
FFI2x := 0 ;Liver
FFI2y := 675
;///////////////////////////////////////////////////////////
;////////////////////MAIN GUI///////////////////////////////////////////////////
Gui, Destroy
Gui, +AlwaysOnTop +ToolWindow -border +LastFound +HwndMyGuiHwnd ;+E0x08000000
WinSet, Transparent, 190
Gui, Color, %Purple%, %DarkGrey%
Gui, Margin, 0, 0
Gui, Font, c%White% s8, q5 Bold
Gui, Add, Button, x970 y1 w30 h18 gGuiClose, X
Gui, -Caption
Gui, Font, s12 c%Green%, Verdana
Gui, Add, Edit, vMainEdit1 WantTab xm ym+20 w1000 r7 hwndMyEdit1Hwnd
Gui, Font, s12 c%Orange%, Verdana
Gui, Add, Edit,vMainEdit2 WantTab xm ym+160 w1000 r5 hwndMyEdit2Hwnd
Gui Show, x+10 y1625 w1000 h270, DD
;///////////////////////////////////////////////////////////////////////////////
;//////////////////////////////x ALL GUIs with loop////////////////////////
x = 1
loop 12{
Gui, FFI%x%GUI:Destroy
Gui, FFI%x%GUI:+LastFound
Gui, FFI%x%GUI:+AlwaysOnTop +ToolWindow -Border +LastFound ;+E0x08000000
Gui, FFI%x%GUI:Color, %GuiColor%, %Purple%
Gui, FFI%x%GUI:Margin, 0, 0
Gui, FFI%x%GUI:Font, s8 cD0D0D0 Bold
Gui, FFI%x%GUI:Add, Progress, xm-1 ym-12 w110 h35 Background404040 Disabled ;hwndHPROG
Gui, FFI%x%GUI:Add, Text, xm+6 ym-4 w100 h20 r2 gShowHide BackgroundTrans Center 0x200, % Field%x%
Gui, FFI%x%GUI:Font, s10 c%White%, Verdana
Gui, FFI%x%GUI:Add, Edit, vFindingEdit%x% gSENDDATA WantTab R5 xm ym+20 w200 r1 hwndMyEditBox1Hwnd
Gui, FFI%x%GUI:Add, Edit, vImpressionEdit%x% gSENDDATA WantTab xm ym+40 w200 r1 hwndMyEditBox2Hwnd
Gui, FFI%x%GUI:Font, s8 c%green%, Verdana
;Gui, FFI%x%GUI:Add, ListBox, Multi Choose2 xm ym+65 w200 r7 vFind%x% gSENDDATA hwndMyList1BoxHwnd, % Findings%x%
Gui, FFI%x%GUI:Add, ListBox, Multi Choose2 xm ym+65 w200 r7 vFind%x% gSENDDATA AltSubmit hwndMyList1BoxHwnd, box%x%
Gui, FFI%x%GUI:Font, s10 c%Orange%, VerdanaFF
Gui, FFI%x%GUI:-Caption
WinSet, TransColor, %GuiColor% %trans%
Gui, FFI%x%GUI:Show, % "x" FFI%x%x " y" FFI%x%y " w" 200, % FFI%x%
GuiControl, FFI%x%GUI:Show, ListBox%x%
x++
}
Return
;///////////////////////////////////////////////////////////////////////////////
SENDDATA:
x = 1
loop 12{
Gui, FFI%x%:Submit, NoHide
tfinding%x% := Field%x% Findings%x%[finding].1
timpression%x% := "`n" Findings%x%[finding].2
SendInput {Text } tfinding%x%
SendInput {Text} timpression%x%
}
Return
ShowHide:
show = 1
IF XX=1
{
xx=0
loop 12
{
GuiControl, Findings%show%GUI:Show, ListBox1
WinSet, TransColor, %GuiColor% %Brightness%
GuiControl, Findings%show%GUI:Show, Edit1
GuiControl, Findings%show%GUI:Show, Edit2
show++
}
}
else
{
hide = 1
loop 12
{
GuiControl, Findings%hide%GUI:Hide, ListBox1
WinSet, TransColor, %GuiColor% %trans%
GuiControl, Findings%hide%GUI:hide, Edit1
GuiControl, Findings%hide%GUI:hide, Edit2
hide++
}
xx=1
}
return
GuiEscape:
GuiClose:
ExitApp