
JailDoctor
Active Members-
Posts
118 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by JailDoctor
-
I have an IE form for patients to request medication refills on-line. The problem is that after submitting the form, the patient doesn’t get a list of medications s/he requested. I tried with _IEHeadInsertEventScript to call a function that reads the form’s text boxes, but all I could get is a message (“alert”) about leaving the page. I did not find any documentation to call a function or even get a msgbox that would call the function when clicked. This is my code: #include <IE.au3> #include <Array.au3> Local $avTheDrugs[8] $oIE = _IEAttach ("Order Refill Request Form: Pharmacy Services, University Hospital") $oForm = _IEFormGetObjByName ($oIE, 'Refill_Request_Form') _IEHeadInsertEventScript ($oIE, "window", "onbeforeunload", _ "alert('Example warning follows...');return 'Pending changes may be lost';") Func GetDrugName() $oDrug1 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_1") _ArrayInsert($avTheDrugs,0,_IEFormElementGetValue ($oDrug1)) $oDrug2 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_2") _ArrayInsert($avTheDrugs,1,_IEFormElementGetValue ($oDrug2)) $oDrug3 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_3") _ArrayInsert($avTheDrugs,2,_IEFormElementGetValue ($oDrug3)) $oDrug4 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_4") _ArrayInsert($avTheDrugs,3,_IEFormElementGetValue ($oDrug4)) $oDrug5 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_5") _ArrayInsert($avTheDrugs,4,_IEFormElementGetValue ($oDrug5)) $oDrug6 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_6") _ArrayInsert($avTheDrugs,5,_IEFormElementGetValue ($oDrug6)) $oDrug7 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_7") _ArrayInsert($avTheDrugs,7,_IEFormElementGetValue ($oDrug7)) $oDrug8 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_8") _ArrayInsert($avTheDrugs,8,_IEFormElementGetValue ($oDrug8)) ;Remove blanks For $n = UBound($avTheDrugs) - 1 To 0 Step -1 If StringStripWS($avTheDrugs[$n], 8) = "" Then _ArrayDelete($avTheDrugs, $n) EndIf Next EndFunc _ArrayDisplay($avTheDrugs,"The drugs") Thanks for your help.
-
Mouse selection to array
JailDoctor replied to JailDoctor's topic in AutoIt General Help and Support
Yes, that is why I want to be able to convert a selection (by double clicking the mouse in a spot) into an array. WinGetText does not work. How do you copy the screen contents? -
I wrote a routine that collects data from window by double-clicking a specific address and copying the selection to the clipboard. The cliboard contents then go to an array as a new element. I need a way to send the selection directly to the array without copying it to the clipboard (to save resources). $text = WinGetText("[MyWindow]", "") does not work because the window is from a legacy database run in a mainframe. Here is a sample of my code: ; move and size the window WinMove("MyWindow", "", Default, Default, 800, 500) MouseClick("", 489, 129, 2) ; Copy the selected text Send("{CTRLDOWN}{INS}{CTRLUP}") $XLArrayMyText = (_ClipBoard_GetData()) I would like to get rid of the last two lines and make the selection an array element without copying it into the clipboard. I have not found this topic in the forum. Thank you.
-
I want to have the user enter the number of the excel worksheet column containing the data to be read into an array. If I write the column number I want in the code, it works fine. This is the code: #include <ExcelCOM_UDF.au3> #include <Array.au3> ;Allow user to select an excel file and recommend a specific file. $var = FileOpenDialog($message, @MyDocumentsDir & "\", " (*.xls;*.xlsx)", 0, "Chronic Illnesses") If @error Then ;Check if they did not select a file MsgBox(4096,"","No File(s) chosen", 3) Exit EndIf $oExcel = _ExcelBookOpen($var) ;Open the selected excel file $aSheet = _ExcelSheetList($oExcel) ; how many sheets? $ClmnNr = InputBox("Visit Column", "Enter the search column Number") ;User choses column to use for array $vSheet = $aSheet[$m] $arrayRange = _ExcelSheetUsedRangeGet($oExcel, $vSheet) $XLArray = _ExcelReadArray($oExcel, 2, $ClmnNr, $arrayRange[3], 1,0); Get the data from entered column number. _ArrayDisplay($XLArray,"Stuff") ;display the column values. If I answer the input prompt with a column letter, there is no error but no result either. If I answer the input prompt with a number (like it should be, after all, the input prompt fills the variable $ClmnNr with the number corresponding to the column), I get this error: C:\Program Files\AutoIt3\Include\ExcelCOM_UDF.au3 (618) : ==> The requested action with this object has failed.: $aArray[$xx] = $oExcel.Activesheet.Cells(($xx - $iIndexBase) + $iStartRow, $iStartColumn).Value $aArray[$xx] = $oExcel.Activesheet.Cells(($xx - $iIndexBase) + $iStartRow, $iStartColumn)^ ERROR ->15:08:48 AutoIT3.exe ended.rc:1 I have a feeling it is a very simple thing I'm doing wrong but I just can't put my finger on it. Any help will be appreciated.
-
If you can navigate your EPIC windows by tabbing (press the tab), the field's content is highlighted and ready for a copy command. You then send what you copied to an array for example. Another alternative is to resize your EPIC window and send mouse clicks to the correct buttons (I assume the commands have no ID like in most HMRs).
-
[Resolved]Create GUI elements in a loop
JailDoctor replied to b3vad's topic in AutoIt GUI Help and Support
Outstanding!!!! You are the best!!! It makes perfect sense now. Why not do what worked in the other gui... You make it look so easy. Thank you so much! -
[Resolved]Create GUI elements in a loop
JailDoctor replied to b3vad's topic in AutoIt GUI Help and Support
It works! When I select a folder pointing to a shared drive with 109 sub folders there is a problem displaying all the sub folders. The scroll bar only goes down to folder 56; but I can live with it unless you have any ideas. -
[Resolved]Create GUI elements in a loop
JailDoctor replied to b3vad's topic in AutoIt GUI Help and Support
Melba23, I got this error: >Running AU3Check (1.54.19.0) from:C:Program FilesAutoIt3 C:Program FilesAutoIt3IncludeGUIScrollbars_Size.au3(239,65) : ERROR: _GUIScrollbars_Restore() already defined. Func _GUIScrollbars_Restore($hWnd, $fVert = True, $fHorz = True) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ I commented out this function in your GUIScrollbars_Size.au3 file but it didn't help. Current Problem (commenting out the Func _GUIScrollbars_Restore($hWnd, $fVert = True, $fHorz = True) from the C:\Program Files\AutoIt3\Include\GUIScrollbars_Size.au3 file: If the folder contains less then about 56 sub folders, there is no problem displaying all folders and see them scrolling down in the GUI..When a folder contains a gazillion subfolders (like my users will probably have), the scroll bar does not show all of them. It seems to stop listing folders after the 56th folder.Here is the code. I wrote a little routine to show the window only when the user moves the mouse off the right edge of the desktop. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=..My H drivelogo.ico #AutoIt3Wrapper_outfile=H:My DocumentsPopUpTest.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <GUIButton.au3> #include <File.au3> #include <array.au3> ;for scroll bars #include <StructureConstants.au3> #include <GUIScrollBars.au3> #include <ScrollBarConstants.au3> #include "GUIScrollbars_Ex.au3" #include "GUIScrollbars_Size.au3" ;for "peekaboo effect" right screen show function. Move mouse to the right side of the screen to show the window. #include <GDIPlus.au3> #include <Misc.au3> HotKeySet("{ESC}", "MyExit") dim $whichfolder, $scrollmarker, $scrollmarker2 Global $NewWidth[1], $NewGUIWidth[1] ; Set the working folder ;~ $sPath = @MyDocumentsDir $sPath = FileSelectFolder("Choose a folder.", "") & "" ToolTip("Move your mouse to the rigth margin of the screen to select pamphlets",300,300,"Patient Education Program",2,4) Sleep(2000) Tooltip("") HideTheGUI() Func HideTheGUI() While 1 $mpos = MouseGetPos() Select Case $mpos[0] > @DesktopWidth-50 MyFolderChoice() EndSelect WEnd EndFunc Func MyFolderChoice() ; List the folders in the folder - parameter 2 $aList = _FileListToArray($sPath, "*", 2) _ArrayAdd($aList, "Exit") $aList[0] = $aList[0] + 1 ;Set GUI height based on number of folders $GuiHeight = $aList[0] *22 If $GuiHeight > @DesktopHeight Then $scrollmarker = True ; to show or not the sroll bars $GuiHeight = @DesktopHeight - 100 EndIf ;Set the GUI width based on the longest folder name For $a = 1 to $aList[0] $FolderNameLength = $aList[$a] $FolderNameLength2 =StringLen($FolderNameLength) _ArrayAdd($NewWidth, $FolderNameLength2) Next ;~ $NewWidth2 = _ArrayMax($NewWidth,0,1) $NewWidthSize = _ArrayMax($NewWidth) $GuiWidth = $NewWidthSize * 8 If $GuiWidth < 200 Then ;Make sure it isn't too thin $GuiWidth = 200 EndIf ; Create the radio array to match the number of folders Global $aRadios[$aList[0] + 1] = [$aList[0]] ; Create the GUI $hGUI = GUICreate("Folder List", $GuiWidth, $GuiHeight, 500, 10, BitOR($WS_SIZEBOX, $WS_POPUP)) ; Add the radios For $i = 1 To $aRadios[0] $aRadios[$i] = GUICtrlCreateRadio($aList[$i], 20, 20 * $i, 490, 17) Next GUIRegisterMsg($WM_SIZE, "WM_SIZE") GUIRegisterMsg($WM_VSCROLL, "WM_VSCROLL") GUIRegisterMsg($WM_HSCROLL, "WM_HSCROLL") GUISetState() If $scrollmarker = True Then ;We need the scroll bars _GUIScrollBars_Init($hGUI) EndIf While 1 ; Read the event queue $nMsg = GUIGetMsg() ; Loop through the radio ControlIDs For $i = 1 To $aRadios[0] If $nMsg = $aRadios[$i] Then If GUICtrlRead($aRadios[$i], 1) = "Exit" Then Exit EndIf ; Found one! ;~ MsgBox(0, "Pressed", GUICtrlRead($aRadios[$i], 1)) ; No point in looking any further $whichfolder = $sPath & "" & GUICtrlRead($aRadios[$i], 1) ; Set the path to show files _GUICtrlButton_SetCheck($nMsg, $BST_UNCHECKED) GUIDelete();Delete the gui MyFileChoice(); Call the file selection function ExitLoop EndIf Next WEnd EndFunc Func MyFileChoice() $aList2 = _FileListToArray($whichfolder, "*", 1);file names to array If $aList2 = 0 Then ;empty folder check MsgBox(0,"Error","There are no files to print in " & $whichfolder) MyFolderChoice() EndIf _ArrayAdd($aList2, "Cancel") ;add an extra button for cancelling file selection $aList2[0] = $aList2[0] + 1 ;Fix the number of elements to include the cancel button in the gui ; Create the radio array to match the number of folders Global $aRadios2[$aList2[0] + 1] = [$aList2[0]] ;Set GUI height based on number of folders $GuiHeight2 = $aList2[0] * 22 If $GuiHeight2 > @DesktopHeight Then $scrollmarker2 = True ; to show or not the sroll bars $GuiHeight2 = @DesktopHeight - 100 ElseIf $GuiHeight2 < 150 Then $GuiHeight2 = 150 EndIf ;Set the GUI width based on the longest folder name For $b = 1 to $aList2[0] $FileNameLength = $aList2[$b] $FileNameLength2 =StringLen($FileNameLength) _ArrayAdd($NewGUIWidth, $FileNameLength2) Next $NewWidthSize2 = _ArrayMax($NewGUIWidth) $GuiWidth2 = $NewWidthSize2 * 8 If $GuiWidth2 < 200 Then ;GUI is too thin $GuiWidth2 = 200 EndIf ; Create the GUI $hGUI2 = GUICreate("Files List", $GuiWidth2, $GuiHeight2 , 160, 10, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX)) ; Add the radios For $i = 1 To $aRadios2[0] $aRadios2[$i] = GUICtrlCreateRadio($aList2[$i],20, 20 * $i, 490, 17) GUICtrlSetResizing(-1, $GUI_DOCKRIGHT + $GUI_DOCKWIDTH) Next GUISetState() If $scrollmarker2 = True Then ;We need the scroll bars _GUIScrollBars_Init($hGUI2) $aRet = _GUIScrollbars_Size(0, $aRadios2[0] * 20, $GuiWidth2, $GuiHeight2) ; <<<<<<<<<<<<<<<<<< _GUIScrollBars_SetScrollInfoPage($hGUI2, $SB_VERT, $aRet[2]) ; <<<<<<<<<<<<<<<<<< _GUIScrollBars_SetScrollInfoMax($hGUI2, $SB_VERT, $aRet[3]) ; <<<<<<<<<<<<<<<<<< EndIf ;~ If $scrollmarker2 = True Then ;We need the scroll bars ;~ _GUIScrollBars_Init($hGUI2) ;~ $aRet = _GUIScrollbars_Size(0, $aRadios2[0] * 20, $GuiWidth2, $GuiHeight2) ; <<<<<<<<<<<<<<<<<< ;~ _GUIScrollBars_SetScrollInfoPage($hGUI2, $SB_VERT, $aRet[2]) ; <<<<<<<<<<<<<<<<<< ;~ _GUIScrollBars_SetScrollInfoMax($hGUI2, $SB_VERT, $aRet[3]) ; <<<<<<<<<<<<<<<<<< ;~ EndIf While 1 ; Read the event queue $nMsg2 = GUIGetMsg() If $nMsg2 = $GUI_EVENT_CLOSE Then GUIDelete() HideTheGUI() ;Hide the window ExitLoop EndIf ; Loop through the radio ControlIDs For $i = 1 To $aRadios2[0] If $nMsg2 = $aRadios2[$i] Then If GUICtrlRead($aRadios2[$i], 1) = "Cancel" Then GUIDelete() HideTheGUI() ;Hide the window ExitLoop EndIf ; Found one! ;~ MsgBox(0, "Pressed", GUICtrlRead($aRadios2[$i], 1)) _FilePrint(GUICtrlRead($aRadios2[$i], 1));Print the selected file. GUIDelete() ;~ MyFolderChoice() ;build the other window again HideTheGUI() ExitLoop EndIf Next WEnd EndFunc Func WM_SIZE($hWnd, $Msg, $wParam, $lParam) #forceref $Msg, $wParam Local $index = -1, $yChar, $xChar, $xClientMax, $xClient, $yClient, $ivMax For $x = 0 To UBound($aSB_WindowInfo) - 1 If $aSB_WindowInfo[$x][0] = $hWnd Then $index = $x $xClientMax = $aSB_WindowInfo[$index][1] $xChar = $aSB_WindowInfo[$index][2] $yChar = $aSB_WindowInfo[$index][3] $ivMax = $aSB_WindowInfo[$index][7] ExitLoop EndIf Next If $index = -1 Then Return 0 Local $tSCROLLINFO = DllStructCreate($tagSCROLLINFO) ; Retrieve the dimensions of the client area. $xClient = BitAND($lParam, 0x0000FFFF) $yClient = BitShift($lParam, 16) $aSB_WindowInfo[$index][4] = $xClient $aSB_WindowInfo[$index][5] = $yClient ; Set the vertical scrolling range and page size DllStructSetData($tSCROLLINFO, "fMask", BitOR($SIF_RANGE, $SIF_PAGE)) DllStructSetData($tSCROLLINFO, "nMin", 0) ;~ DllStructSetData($tSCROLLINFO, "nMax", $ivMax) DllStructSetData($tSCROLLINFO, "nMax", 2 + $xClientMax / $xChar) DllStructSetData($tSCROLLINFO, "nPage", $yClient / $yChar) _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) ; Set the horizontal scrolling range and page size DllStructSetData($tSCROLLINFO, "fMask", BitOR($SIF_RANGE, $SIF_PAGE)) DllStructSetData($tSCROLLINFO, "nMin", 0) DllStructSetData($tSCROLLINFO, "nMax", 2 + $xClientMax / $xChar) DllStructSetData($tSCROLLINFO, "nPage", $xClient / $xChar) _GUIScrollBars_SetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO) Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE Func WM_HSCROLL($hWnd, $Msg, $wParam, $lParam) #forceref $Msg, $lParam Local $nScrollCode = BitAND($wParam, 0x0000FFFF) Local $index = -1, $xChar, $xPos Local $Min, $Max, $Page, $Pos, $TrackPos For $x = 0 To UBound($aSB_WindowInfo) - 1 If $aSB_WindowInfo[$x][0] = $hWnd Then $index = $x $xChar = $aSB_WindowInfo[$index][2] ExitLoop EndIf Next If $index = -1 Then Return 0 ;~ ; Get all the horizontal scroll bar information Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_HORZ) $Min = DllStructGetData($tSCROLLINFO, "nMin") $Max = DllStructGetData($tSCROLLINFO, "nMax") $Page = DllStructGetData($tSCROLLINFO, "nPage") ; Save the position for comparison later on $xPos = DllStructGetData($tSCROLLINFO, "nPos") $Pos = $xPos $TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos") #forceref $Min, $Max Switch $nScrollCode Case $SB_LINELEFT ; user clicked left arrow DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1) Case $SB_LINERIGHT ; user clicked right arrow DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1) Case $SB_PAGELEFT ; user clicked the scroll bar shaft left of the scroll box DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page) Case $SB_PAGERIGHT ; user clicked the scroll bar shaft right of the scroll box DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page) Case $SB_THUMBTRACK ; user dragged the scroll box DllStructSetData($tSCROLLINFO, "nPos", $TrackPos) EndSwitch ;~ // Set the position and then retrieve it. Due to adjustments ;~ // by Windows it may not be the same as the value set. DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS) _GUIScrollBars_SetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO) _GUIScrollBars_GetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO) ;// If the position has changed, scroll the window and update it $Pos = DllStructGetData($tSCROLLINFO, "nPos") If ($Pos <> $xPos) Then _GUIScrollBars_ScrollWindow($hWnd, $xChar * ($xPos - $Pos), 0) Return $GUI_RUNDEFMSG EndFunc ;==>WM_HSCROLL Func WM_VSCROLL($hWnd, $Msg, $wParam, $lParam) #forceref $Msg, $wParam, $lParam Local $nScrollCode = BitAND($wParam, 0x0000FFFF) Local $index = -1, $yChar, $yPos Local $Min, $Max, $Page, $Pos, $TrackPos For $x = 0 To UBound($aSB_WindowInfo) - 1 If $aSB_WindowInfo[$x][0] = $hWnd Then $index = $x $yChar = $aSB_WindowInfo[$index][3] ExitLoop EndIf Next If $index = -1 Then Return 0 ; Get all the vertial scroll bar information Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT) $Min = DllStructGetData($tSCROLLINFO, "nMin") $Max = DllStructGetData($tSCROLLINFO, "nMax") $Page = DllStructGetData($tSCROLLINFO, "nPage") ; Save the position for comparison later on $yPos = DllStructGetData($tSCROLLINFO, "nPos") $Pos = $yPos $TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos") Switch $nScrollCode Case $SB_TOP ; user clicked the HOME keyboard key DllStructSetData($tSCROLLINFO, "nPos", $Min) Case $SB_BOTTOM ; user clicked the END keyboard key DllStructSetData($tSCROLLINFO, "nPos", $Max) Case $SB_LINEUP ; user clicked the top arrow DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1) Case $SB_LINEDOWN ; user clicked the bottom arrow DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1) Case $SB_PAGEUP ; user clicked the scroll bar shaft above the scroll box DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page) Case $SB_PAGEDOWN ; user clicked the scroll bar shaft below the scroll box DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page) Case $SB_THUMBTRACK ; user dragged the scroll box DllStructSetData($tSCROLLINFO, "nPos", $TrackPos) EndSwitch ;~ // Set the position and then retrieve it. Due to adjustments ;~ // by Windows it may not be the same as the value set. DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS) _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) _GUIScrollBars_GetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) ;// If the position has changed, scroll the window and update it $Pos = DllStructGetData($tSCROLLINFO, "nPos") If ($Pos <> $yPos) Then _GUIScrollBars_ScrollWindow($hWnd, 0, $yChar * ($yPos - $Pos)) $yPos = $Pos EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_VSCROLL Func MyExit() Exit EndFunc ;==>MyExit Comment: The function Func WM_SIZE($hWnd, $Msg, $wParam, $lParam) makes a solid scroll bar occupying the entire window, so I edited it like this: ; Set the vertical scrolling range and page size DllStructSetData($tSCROLLINFO, "fMask", BitOR($SIF_RANGE, $SIF_PAGE)) DllStructSetData($tSCROLLINFO, "nMin", 0) ;~ DllStructSetData($tSCROLLINFO, "nMax", $ivMax) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< DllStructSetData($tSCROLLINFO, "nMax", 2 + $xClientMax / $xChar) DllStructSetData($tSCROLLINFO, "nPage", $yClient / $yChar) _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) Very confused now -
[Resolved]Create GUI elements in a loop
JailDoctor replied to b3vad's topic in AutoIt GUI Help and Support
I got the GUI to show the folders, then another GUI to show the files of the selected folder. One click prints the selected file. I added a radiobutton to the array to create Exit and Cancel choices. Even played with the size of the windows based on the number for folders or files as well as the length of their names. Looks and feels nice. Two Problems: 1) I have some folders with a lot of files, that is why I add the scroll bar if the number of files will not fit within the @DesktopHeight - 100, the scroll bar will not show all the files (or folders) to the end of the list. How do I make the GUI display all the files or folders? 2) How do I delete the GUI when the user presses the X? I tried If $nMsg = $GUI_EVENT_CLOSE then Exit EndIf but it did not work. Here is the entire code: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <GUIButton.au3> #include <File.au3> #include <array.au3> ;for scroll bars #include <StructureConstants.au3> #include <GUIScrollBars.au3> #include <ScrollBarConstants.au3> HotKeySet("{ESC}", "MyExit") dim $whichfolder, $scrollmarker, $scrollmarker2 Global $NewWidth[1], $NewGUIWidth[1] ; Set the working folder ;~ $sPath = @MyDocumentsDir $sPath = FileSelectFolder("Choose a folder.", "") & "" MyFolderChoice() Func MyFolderChoice() ; List the folders in the folder - parameter 2 $aList = _FileListToArray($sPath, "*", 2) _ArrayAdd($aList, "Exit") $aList[0] = $aList[0] + 1 ;Set GUI height based on number of folders $GuiHeight = $aList[0] *22 If $GuiHeight > @DesktopHeight Then $scrollmarker = True ; to show or not the sroll bars $GuiHeight = @DesktopHeight - 100 EndIf ;Set the GUI width based on the longest folder name For $a = 1 to $aList[0] $FolderNameLength = $aList[$a] $FolderNameLength2 =StringLen($FolderNameLength) _ArrayAdd($NewWidth, $FolderNameLength2) Next ;~ $NewWidth2 = _ArrayMax($NewWidth,0,1) $NewWidthSize = _ArrayMax($NewWidth) $GuiWidth = $NewWidthSize * 8 If $GuiWidth < 200 Then ;Make sure it isn't too thin $GuiWidth = 200 EndIf ; Create the radio array to match the number of folders Global $aRadios[$aList[0] + 1] = [$aList[0]] ; Create the GUI $hGUI = GUICreate("Folder List", $GuiWidth, $GuiHeight, 500, 10, BitOR($WS_SIZEBOX, $WS_POPUP)) ; Add the radios For $i = 1 To $aRadios[0] $aRadios[$i] = GUICtrlCreateRadio($aList[$i], 20, 20 * $i, 490, 17) Next GUIRegisterMsg($WM_SIZE, "WM_SIZE") GUIRegisterMsg($WM_VSCROLL, "WM_VSCROLL") GUIRegisterMsg($WM_HSCROLL, "WM_HSCROLL") GUISetState() If $scrollmarker = True Then ;We need the scroll bars _GUIScrollBars_Init($hGUI) EndIf While 1 ; Read the event queue $nMsg = GUIGetMsg() ; Loop through the radio ControlIDs For $i = 1 To $aRadios[0] If $nMsg = $aRadios[$i] Then If GUICtrlRead($aRadios[$i], 1) = "Exit" Then Exit EndIf ; Found one! ;~ MsgBox(0, "Pressed", GUICtrlRead($aRadios[$i], 1)) ; No point in looking any further $whichfolder = $sPath & "" & GUICtrlRead($aRadios[$i], 1) ; Set the path to show files _GUICtrlButton_SetCheck($nMsg, $BST_UNCHECKED) GUIDelete();Delete the gui MyFileChoice(); Call the file selection function ExitLoop EndIf Next WEnd EndFunc Func MyFileChoice() $aList2 = _FileListToArray($whichfolder, "*", 1);file names to array If $aList2 = 0 Then ;empty folder check MsgBox(0,"Error","There are no files to print in " & $whichfolder) MyFolderChoice() EndIf _ArrayAdd($aList2, "Cancel") ;add an extra button for cancelling file selection $aList2[0] = $aList2[0] + 1 ;Fix the number of elements to include the cancel button in the gui ; Create the radio array to match the number of folders Global $aRadios2[$aList2[0] + 1] = [$aList2[0]] ;Set GUI height based on number of folders $GuiHeight2 = $aList2[0] * 22 If $GuiHeight2 > @DesktopHeight Then $scrollmarker2 = True ; to show or not the sroll bars $GuiHeight2 = @DesktopHeight - 100 ElseIf $GuiHeight2 < 150 Then $GuiHeight2 = 150 EndIf ;Set the GUI width based on the longest folder name For $b = 1 to $aList2[0] $FileNameLength = $aList2[$b] $FileNameLength2 =StringLen($FileNameLength) _ArrayAdd($NewGUIWidth, $FileNameLength2) Next ;~ $NewWidth3 = _ArrayMax($NewGUIWidth,0,1) $NewWidthSize2 = _ArrayMax($NewGUIWidth) $GuiWidth2 = $NewWidthSize2 * 8 If $GuiWidth2 < 200 Then $GuiWidth2 = 200 EndIf ; Create the GUI $hGUI2 = GUICreate("Files List", $GuiWidth2, $GuiHeight2 , 160, 10, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX)) ; Add the radios For $i = 1 To $aRadios2[0] $aRadios2[$i] = GUICtrlCreateRadio($aList2[$i],20, 20 * $i, 490, 17) GUICtrlSetResizing(-1, $GUI_DOCKRIGHT + $GUI_DOCKWIDTH) Next GUIRegisterMsg($WM_SIZE, "WM_SIZE") GUIRegisterMsg($WM_VSCROLL, "WM_VSCROLL") GUISetState() If $scrollmarker2 = True Then ;We need the scroll bars _GUIScrollBars_Init($hGUI2) EndIf While 1 ; Read the event queue $nMsg2 = GUIGetMsg() ; Loop through the radio ControlIDs For $i = 1 To $aRadios2[0] If $nMsg2 = $aRadios2[$i] Then If GUICtrlRead($aRadios2[$i], 1) = "Cancel" Then GUIDelete() MyFolderChoice() ;build the other window again ExitLoop EndIf ; Found one! MsgBox(0, "Pressed", GUICtrlRead($aRadios2[$i], 1)) ;~ _FilePrint(GUICtrlRead($aRadios2[$i], 1));Print the selected file. GUIDelete() MyFolderChoice() ;build the other window again ExitLoop EndIf Next WEnd EndFunc Func WM_SIZE($hWnd, $Msg, $wParam, $lParam) #forceref $Msg, $wParam Local $index = -1, $yChar, $xChar, $xClientMax, $xClient, $yClient, $ivMax For $x = 0 To UBound($aSB_WindowInfo) - 1 If $aSB_WindowInfo[$x][0] = $hWnd Then $index = $x $xClientMax = $aSB_WindowInfo[$index][1] $xChar = $aSB_WindowInfo[$index][2] $yChar = $aSB_WindowInfo[$index][3] $ivMax = $aSB_WindowInfo[$index][7] ExitLoop EndIf Next If $index = -1 Then Return 0 Local $tSCROLLINFO = DllStructCreate($tagSCROLLINFO) ; Retrieve the dimensions of the client area. $xClient = BitAND($lParam, 0x0000FFFF) $yClient = BitShift($lParam, 16) $aSB_WindowInfo[$index][4] = $xClient $aSB_WindowInfo[$index][5] = $yClient ; Set the vertical scrolling range and page size DllStructSetData($tSCROLLINFO, "fMask", BitOR($SIF_RANGE, $SIF_PAGE)) DllStructSetData($tSCROLLINFO, "nMin", 0) ;~ DllStructSetData($tSCROLLINFO, "nMax", $ivMax) DllStructSetData($tSCROLLINFO, "nMax", 2 + $xClientMax / $xChar) DllStructSetData($tSCROLLINFO, "nPage", $yClient / $yChar) _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) ; Set the horizontal scrolling range and page size DllStructSetData($tSCROLLINFO, "fMask", BitOR($SIF_RANGE, $SIF_PAGE)) DllStructSetData($tSCROLLINFO, "nMin", 0) DllStructSetData($tSCROLLINFO, "nMax", 2 + $xClientMax / $xChar) DllStructSetData($tSCROLLINFO, "nPage", $xClient / $xChar) _GUIScrollBars_SetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO) Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE Func WM_HSCROLL($hWnd, $Msg, $wParam, $lParam) #forceref $Msg, $lParam Local $nScrollCode = BitAND($wParam, 0x0000FFFF) Local $index = -1, $xChar, $xPos Local $Min, $Max, $Page, $Pos, $TrackPos For $x = 0 To UBound($aSB_WindowInfo) - 1 If $aSB_WindowInfo[$x][0] = $hWnd Then $index = $x $xChar = $aSB_WindowInfo[$index][2] ExitLoop EndIf Next If $index = -1 Then Return 0 ;~ ; Get all the horizontal scroll bar information Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_HORZ) $Min = DllStructGetData($tSCROLLINFO, "nMin") $Max = DllStructGetData($tSCROLLINFO, "nMax") $Page = DllStructGetData($tSCROLLINFO, "nPage") ; Save the position for comparison later on $xPos = DllStructGetData($tSCROLLINFO, "nPos") $Pos = $xPos $TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos") #forceref $Min, $Max Switch $nScrollCode Case $SB_LINELEFT ; user clicked left arrow DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1) Case $SB_LINERIGHT ; user clicked right arrow DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1) Case $SB_PAGELEFT ; user clicked the scroll bar shaft left of the scroll box DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page) Case $SB_PAGERIGHT ; user clicked the scroll bar shaft right of the scroll box DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page) Case $SB_THUMBTRACK ; user dragged the scroll box DllStructSetData($tSCROLLINFO, "nPos", $TrackPos) EndSwitch ;~ // Set the position and then retrieve it. Due to adjustments ;~ // by Windows it may not be the same as the value set. DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS) _GUIScrollBars_SetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO) _GUIScrollBars_GetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO) ;// If the position has changed, scroll the window and update it $Pos = DllStructGetData($tSCROLLINFO, "nPos") If ($Pos <> $xPos) Then _GUIScrollBars_ScrollWindow($hWnd, $xChar * ($xPos - $Pos), 0) Return $GUI_RUNDEFMSG EndFunc ;==>WM_HSCROLL Func WM_VSCROLL($hWnd, $Msg, $wParam, $lParam) #forceref $Msg, $wParam, $lParam Local $nScrollCode = BitAND($wParam, 0x0000FFFF) Local $index = -1, $yChar, $yPos Local $Min, $Max, $Page, $Pos, $TrackPos For $x = 0 To UBound($aSB_WindowInfo) - 1 If $aSB_WindowInfo[$x][0] = $hWnd Then $index = $x $yChar = $aSB_WindowInfo[$index][3] ExitLoop EndIf Next If $index = -1 Then Return 0 ; Get all the vertial scroll bar information Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT) $Min = DllStructGetData($tSCROLLINFO, "nMin") $Max = DllStructGetData($tSCROLLINFO, "nMax") $Page = DllStructGetData($tSCROLLINFO, "nPage") ; Save the position for comparison later on $yPos = DllStructGetData($tSCROLLINFO, "nPos") $Pos = $yPos $TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos") Switch $nScrollCode Case $SB_TOP ; user clicked the HOME keyboard key DllStructSetData($tSCROLLINFO, "nPos", $Min) Case $SB_BOTTOM ; user clicked the END keyboard key DllStructSetData($tSCROLLINFO, "nPos", $Max) Case $SB_LINEUP ; user clicked the top arrow DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1) Case $SB_LINEDOWN ; user clicked the bottom arrow DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1) Case $SB_PAGEUP ; user clicked the scroll bar shaft above the scroll box DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page) Case $SB_PAGEDOWN ; user clicked the scroll bar shaft below the scroll box DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page) Case $SB_THUMBTRACK ; user dragged the scroll box DllStructSetData($tSCROLLINFO, "nPos", $TrackPos) EndSwitch ;~ // Set the position and then retrieve it. Due to adjustments ;~ // by Windows it may not be the same as the value set. DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS) _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) _GUIScrollBars_GetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) ;// If the position has changed, scroll the window and update it $Pos = DllStructGetData($tSCROLLINFO, "nPos") If ($Pos <> $yPos) Then _GUIScrollBars_ScrollWindow($hWnd, 0, $yChar * ($yPos - $Pos)) $yPos = $Pos EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_VSCROLL Func MyExit() Exit EndFunc ;==>MyExit Thanks for your help -
[Resolved]Create GUI elements in a loop
JailDoctor replied to b3vad's topic in AutoIt GUI Help and Support
Wow! You are amazing! You even solved the next problem I would have. How to do a case select to find out what the user selected. Your approach is so much simpler and efficient. I was thinking of counting how many folders end up in the array, then pass the folders' names to buttons, keep track of the height of the GUI and change the "left" position of the button after a specified "top" value is reached. You rock! All this came about because some colleagues want to print patient education material they have in some folders "on the fly." Instead of calling on the IT department to change the mega-huge electronic medical record, and wait for a couple of months, they came to me. I suggested to make a "floating semi-transparent" form (topmost) listing the subfolders where the documents reside. Based on the folder they choose, they will get a list of relevant documents. For example if they select diabetes from the GUI, a second GUI listing all the documents in that folder pops up and they just click to print. It would be much fancier if the GUI only shows as a tab on the side of the screen and appears on mouse hovering. I will look at the help file for some information on this. Using your technique will save a lot of headaches when they add or delete files or subfolders. Thank you so much! You have made my day! -
[Resolved]Create GUI elements in a loop
JailDoctor replied to b3vad's topic in AutoIt GUI Help and Support
Hi Melba & b3vad,I want to send my directories (folders) not files to an array. I looked at your example and changed *.exe for "" #include <array.au3> Dim $ComboRobot1CmdSet, $data, $Loc Dim $Myarray[1] $Loc = 0 FileChangeDir(@MyDocumentsDir) ComboRobotCmdSetChange() While 1 $a_RobotCmdSetFile = FileFindNextFile($search) If @error Then ExitLoop ;~ $data &= @WorkingDir & "" & $a_RobotCmdSetFile & @CR _ArrayInsert($Myarray, $Loc, @WorkingDir & "" & $a_RobotCmdSetFile) $Loc = $Loc + 1 WEnd[/sup] It works and lists the folders, but it also lists some text files and other strange files without extension (like when you save an au3 file and forget to type the .au3). How can I list only the folders? I am working on a project to have the form expand or shrink based on the number of folders and assign each folder to a radio button. I just can't get only the folders list. Your help is appreciated. -
Thanks!
-
Hi, I went to my web site >Code >> My extra UDFs >> Access.au3 and did not fin the Access.au3 or the zip files. Are they no longer available? Where can I find them?
-
Microsoft Access 2007 Navigation
JailDoctor replied to johnwon's topic in AutoIt General Help and Support
Look at the functions in Access.au3 I think there is a newer version of the UDF but I'm not sure. -
Thanks Reg2Post, but this approach wont work because the "strings" may repeat several times in the same sheet. I did look at this: $WhatCell = $oExcel.ActiveCell.Address And this gives me the address of the first cell the user selected. Something like this: $L$139 So now I know the first cell corresponding to the first element. I thought: _ExcelWriteCell($oExcel,$NewClassroom, $WhatCell + $n) $n= element number But it didn't work. How do I add a row to active address?
-
I am working on a routine to check assigned classrooms versus a roster. The user chooses from an excel spreadsheet the ID numbers and classrooms. The routine checks if the rooms match those in the roster. If the room for one element is different, I need to change it in the spreadsheet. The question: How do I track what cells the user selected when choosing classrooms to change the value when necessary? #include <clipboard.au3> #include <Array.au3> #include <ExcelCOM_UDF.au3> ;Set a hotkey combo for exit HotKeySet("{ESC}", "MyExit") HotKeySet("{F9}", "TogglePause") Global $oExcel, $XLArrayID, $XLArrayRoom Opt("WinTitleMatchMode",2) $message = "Choose the file containig today's list" $var = FileOpenDialog($message, @MyDocumentsDir & "\", "All (*.xls*)", 1 + 4 ) If @error Then MsgBox(4096,"","No File(s) chosen") Exit EndIf ;Open selected file $oExcel = _ExcelBookOpen($var) ;clear clipboard _ClipBoard_Open (0) _ClipBoard_Empty () _ClipBoard_Close () MsgBox(262176, "Choose", "Select ID numbers") ;User selects a group of cells $oExcel.Application.Selection.Copy $XLArrayID = (_ClipBoard_GetData ()) ;~ Convert to Array $XLArrayID = StringSplit($XLArrayID,@LF) _ArrayTrim($XLArrayID, 1, 1, 0) ;clear clipboard _ClipBoard_Open (0) _ClipBoard_Empty () _ClipBoard_Close () MsgBox(262176, "Locations", "Select Class Rooms") ;User selects a group of cells $oExcel.Application.Selection.Copy $XLArrayRoom = (_ClipBoard_GetData ()) ;~ Convert to Array $XLArrayRoom = StringSplit($XLArrayRoom,@LF) _ArrayTrim($XLArrayRoom, 1, 1, 0) ;Remove empty elements For $n = UBound($XLArrayID) - 1 To 0 Step - 1 If StringStripWS($XLArrayID[$n], 8) = "" Then _ArrayDelete($XLArrayID, $n) _ArrayDelete($XLArrayRoom, $n) EndIf Next ; This is where I check the classrooms assigned versus a roster. ;How do I get the Excel spreadsheet location of each element? Your help is trully appreciated.
-
Thanks, but $sText = WinGetText("BASE - EXTRA! Office Client") MsgBox(0, "Text", $sText) Gives me the same result as GUICtrlRead($hEdit): Connected to host county_base [10.10.2.244] Default Toolbar Default Toolbar Is there a way to select an area of the window without highlighting it as the MouseClickDrag command does? MouseClickDrag works because it selects the specific area I want, then I copy the selection and use the clipboard functions to get the content. When one looks at the screen, the mouse moves to that area, selects the area and then continues to another area to click and enter a variable. I want to do all that without the mouse moving, just copying whatever is in the specific area of the window.
-
No, the text I need is not listed in the >>>> Visible Text <<<< Connected to host county_base [10.10.2.244] - This is in the left lower corner of the window, exactly like the first image of the thread posted by myspacee.Default Toolbar - I do not see this anywhere in the window.The top of the black screen shows a line " ---> ENTER DESIRED ACTION"The message changes based on the results of the queries. I can select that text draging the mouse. GUICtrlRead($hEdit) returns: Connected to host county_base [10.10.2.244] Default Toolbar Default Toolbar And I described as "nothing" because I thought these stings are pretty much meaningless. It is not the text I need from the very first line of the window. GUICtrlRead($hEdit) does not return " ---> ENTER DESIRED ACTION" and this is what I need.
-
I apologize Melba, it wasn’t my intention to hijack a thread. I assumed it was related to my issue because the GUICtrlRead($hEdit) command does not return anything from my program’s window. I need to select the top line of the window and copy whatever is in that area. Myspace started the thread with “tool that allow to my user to 'map' some value in a text file” so I assumed the thread referred to finding some text in a specific area of a window. I am sorry I used the word “expected” when what I meant was “what I want is.” Since GUICtrlRead($hEdit) does not produce anything, how can I copy the top of the window to emulate the MouseClickDrag without the mouse moving to that area. MouseClickDrag("left", 19, 288,736, 298) I move and size the window each time before the command, so I know the coordinates to copy are the same. Autoit widow info follows: >>>> Window <<<< Title: BASE - EXTRA! Office Client Class: SDIMainFrame Position: 10, 200 Size: 732, 484 Style: 0x14CFC000 ExStyle: 0x00000110 Handle: 0x00050048 >>>> Control <<<< Class: Instance: ClassnameNN: Advanced (Class): ID: Text: Position: Size: ControlClick Coords: Style: ExStyle: Handle: >>>> Mouse <<<< Position: 541, 218 Cursor ID: 2 Color: 0x87A9D5 >>>> StatusBar <<<< 1: Connected to host county_base [10.10.2.244] 2: 3: 4: 5: NUM 6: 7: 12:02 PM >>>> Visible Text <<<< Connected to host county_base [10.10.2.244] Default Toolbar Default Toolbar >>>> Hidden Text <<<<
-
A window from a program I automated with an Autoit script gives me feedback at the top of the screen. I copy the feedback and compare it to some potential messages that guide how the script will continue. I am sending a MouseClickDrag to select the top portion of window. I then Ctrl C to copy the selection. The mouse movement is annoying and I imagine all the copying may use the CPU resources (slow things down). This is what I have: WinActivate("MyWindow") WinMove("MyWindow", "", 10, 200, 800, 500) ; move and size the window to ensure the mouse goes where it needs to go. MouseClickDrag("left", 19, 288,736, 298) ControlSend("MyWindow", "", "", "{CTRLDOWN}c{CTRLUP}") ; copy the selection. ;etc. I tried $hEdit = WinGetHandle("MyWindow","") ; Set Selection _GUICtrlEdit_SetSel($hEdit, 19, 298) ; got the xy coordinates from the window info tool. It didn't seem _GUICtrlEdit_SetSel actually selected the text in the window because Ctrl + C and then V would not paste what is on supposedly selected. I expected to have the area selected and then use something like _GUICtrlEdit_GetSel to "copy" the text or assign it to some variable like $MyMessage, but _GUICtrlEdit_GetSel only gives me the coordinates of the first and last character of the selection, not the actual text in the selection. Any suggestions about selecting a portion of a window without having the mouse move all over the place, copy the text or maybe assign it to a variable? Your help is appreciated.
-
_GUICtrlButton_SetFocus stopped working
JailDoctor replied to JailDoctor's topic in AutoIt GUI Help and Support
Never mind, I just solved it. _GUICtrlButton_SetFocus goes after GUISetState(@SW_SHOW). -
I have this form with tabs. I run an array called $MyNewUnit with values represented in the form. The forms shows up opened to the correct tab, but the button is not highlighted. I don't know what happend, but it was working fine and now the radio button does not get the focus. I need some orientation to resolve the issue. I need the radio button to get the focus so a simple spabar touch will trigger actions associated with that radio button. Here is the code: #include <GUIConstantsEx.au3> #include <GuiTab.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiButton.au3> $MyNewUnit = "AA" $IDX = GUICreate("IDX Location Tool - ", 440, 480, 400, 100) GUICtrlSetFont(-1, 28, 400, 0, "Niagara Solid") $PageControl1 = GUICtrlCreateTab(8, 8, 426, 344) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) $TabSheet1 = GUICtrlCreateTabItem("First Floor") $Group1 = GUICtrlCreateGroup("MT01", 50, 120, 240, 150) $Radio73 = GUICtrlCreateRadio("Out of County (Karnes City, Elmendorf, La Salle or Zavala Counties)", 80, 140, 200, 30, BitOR($BS_AUTORADIOBUTTON, $BS_MULTILINE)) GUICtrlSetTip(-1, "GP J200") $Radio74 = GUICtrlCreateRadio("MHU", 80, 180, 60, 20) GUICtrlSetTip(-1, " J297 ") $Radio75 = GUICtrlCreateRadio("Infirmary", 80, 210, 60, 20) GUICtrlSetTip(-1, "J205") $Radio76 = GUICtrlCreateRadio("SPU", 80, 240, 60, 20) GUICtrlSetTip(-1, "J206") ;My Advertising $LabelAd1 = GUICtrlCreateLabel("", 300, 60, 80, 81) GUICtrlSetTip(-1, "This program was created by" & @CRLF & @CRLF & "JailDoctor") $Group2 = GUICtrlCreateGroup("Default", 50, 40, 110, 60) $Radio = GUICtrlCreateRadio("Booking", 80, 60, 60, 20) GUICtrlSetTip(-1, "J296") ;Highlight the New Location Select Case $MyNewUnit = "Elmendorf County" _GUICtrlButton_SetFocus($Radio73, True) Case $MyNewUnit = "La Salle County" _GUICtrlButton_SetFocus($Radio73, True) Case $MyNewUnit = "Zavala County" _GUICtrlButton_SetFocus($Radio73, True) Case $MyNewUnit = "Frio County" _GUICtrlButton_SetFocus($Radio73, True) Case $MyNewUnit = "Hospital" _GUICtrlButton_SetFocus($Radio73, True) Case $MyNewUnit = "MHU" _GUICtrlButton_SetFocus($Radio74, True) Case $MyNewUnit = "Infirmary" _GUICtrlButton_SetFocus($Radio75, True) Case $MyNewUnit = "SPU" _GUICtrlButton_SetFocus($Radio76, True) EndSelect $TabSheet2 = GUICtrlCreateTabItem("Second Floor") ;Show this tab if the value is for the second floor Select Case $MyNewUnit = "AA" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "AB" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "AC" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "AD" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "BA" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "BB" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "BC" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "BD" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "CA" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "CB" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "CC" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "CD" GUICtrlSetState(-1, $GUI_SHOW) EndSelect $Group3 = GUICtrlCreateGroup("A Tower", 30, 40, 100, 80) $Radio62 = GUICtrlCreateRadio("AA", 40, 60, 40, 20) GUICtrlSetTip(-1, "J233") $Radio63 = GUICtrlCreateRadio("AC", 80, 60, 40, 20) GUICtrlSetTip(-1, "J237") $Radio64 = GUICtrlCreateRadio("AB", 40, 90, 40, 20) GUICtrlSetTip(-1, "J403") $Radio65 = GUICtrlCreateRadio("AD", 80, 90, 40, 20) GUICtrlSetTip(-1, "J405") ;My Advertising $LabelAd2 = GUICtrlCreateLabel("", 300, 60, 80, 81) GUICtrlSetTip(-1, "This program was created by" & @CRLF & @CRLF & "JailDoctor") $Group5 = GUICtrlCreateGroup("B Tower", 130, 120, 100, 80) $Radio66 = GUICtrlCreateRadio("BA", 140, 140, 40, 20) GUICtrlSetTip(-1, "J240") $Radio67 = GUICtrlCreateRadio("BC", 180, 140, 40, 20) GUICtrlSetTip(-1, "J244") $Radio68 = GUICtrlCreateRadio("BB", 140, 170, 40, 20) GUICtrlSetTip(-1, "J407") $Radio69 = GUICtrlCreateRadio("BD", 180, 170, 40, 20) GUICtrlSetTip(-1, "J409") $Group6 = GUICtrlCreateGroup("C Tower", 230, 200, 100, 80) $Radio70 = GUICtrlCreateRadio("CA", 240, 220, 40, 20) GUICtrlSetTip(-1, "J248") $Radio71 = GUICtrlCreateRadio("CC", 280, 220, 40, 20) GUICtrlSetTip(-1, "J252") $Radio72 = GUICtrlCreateRadio("CB", 240, 250, 40, 20) GUICtrlSetTip(-1, "J411") $Radio79 = GUICtrlCreateRadio("CD", 280, 250, 40, 20) GUICtrlSetTip(-1, "J413") ;Highlight the New Location Select ;2nd floor Case $MyNewUnit = "AA" _GUICtrlButton_SetFocus($Radio62, True) Case $MyNewUnit = "AB" _GUICtrlButton_SetFocus($Radio64, True) Case $MyNewUnit = "AC" _GUICtrlButton_SetFocus($Radio63, True) Case $MyNewUnit = "AD" _GUICtrlButton_SetFocus($Radio65, True) Case $MyNewUnit = "BA" _GUICtrlButton_SetFocus($Radio66, True) Case $MyNewUnit = "BB" _GUICtrlButton_SetFocus($Radio68, True) Case $MyNewUnit = "BC" _GUICtrlButton_SetFocus($Radio67, True) Case $MyNewUnit = "BD" Case $MyNewUnit = "CA" _GUICtrlButton_SetFocus($Radio70, True) Case $MyNewUnit = "CB" _GUICtrlButton_SetFocus($Radio72, True) Case $MyNewUnit = "CC" _GUICtrlButton_SetFocus($Radio71, True) Case $MyNewUnit = "CD" _GUICtrlButton_SetFocus($Radio79, True) EndSelect $TabSheet3 = GUICtrlCreateTabItem("Fourth Floor") ;Show this tab if the value is for the fourth floor Select Case $MyNewUnit = "AE" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "AF" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "AG" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "AH" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "BE" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "BF" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "BG" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "BH" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "CE" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "CF" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "CG" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "CH" GUICtrlSetState(-1, $GUI_SHOW) EndSelect $Group7 = GUICtrlCreateGroup("A Tower", 230, 40, 100, 80) $Radio49 = GUICtrlCreateRadio("AE", 240, 60, 40, 20) GUICtrlSetTip(-1, "J256") $Radio50 = GUICtrlCreateRadio("AG", 280, 60, 40, 20) GUICtrlSetTip(-1, "J260") $Radio51 = GUICtrlCreateRadio("AF", 240, 90, 40, 20) GUICtrlSetTip(-1, "J415") $Radio52 = GUICtrlCreateRadio("AH", 280, 90, 40, 20) GUICtrlSetTip(-1, "J417") $Group8 = GUICtrlCreateGroup("B Tower", 130, 120, 100, 80) $Radio54 = GUICtrlCreateRadio("BE", 140, 140, 40, 20) GUICtrlSetTip(-1, "J264") $Radio55 = GUICtrlCreateRadio("BG", 180, 140, 40, 20) GUICtrlSetTip(-1, "J268") $Radio56 = GUICtrlCreateRadio("BH", 140, 170, 40, 20) GUICtrlSetTip(-1, "J421") $Group9 = GUICtrlCreateGroup("C Tower", 30, 200, 100, 80) $Radio57 = GUICtrlCreateRadio("CE", 40, 220, 40, 20) GUICtrlSetTip(-1, "J272") $Radio59 = GUICtrlCreateRadio("CG", 80, 220, 40, 20) GUICtrlSetTip(-1, "J276") $Radio60 = GUICtrlCreateRadio("CF", 40, 250, 40, 20) GUICtrlSetTip(-1, "J423") $Radio61 = GUICtrlCreateRadio("CH", 80, 250, 40, 20) GUICtrlSetTip(-1, "J425") ;My Advertising $LabelAd3 = GUICtrlCreateLabel("", 300, 200, 80, 81) GUICtrlSetTip(-1, "This program was created by" & @CRLF & @CRLF & "JailDoctor") ;Highlight the New Location Sixth floor. Select Case $MyNewUnit = "AE" _GUICtrlButton_SetFocus($Radio49, True) Case $MyNewUnit = "AF" _GUICtrlButton_SetFocus($Radio51, True) Case $MyNewUnit = "AG" _GUICtrlButton_SetFocus($Radio50, True) Case $MyNewUnit = "AH" _GUICtrlButton_SetFocus($Radio52, True) Case $MyNewUnit = "BE" _GUICtrlButton_SetFocus($Radio54, True) Case $MyNewUnit = "BG" _GUICtrlButton_SetFocus($Radio55, True) Case $MyNewUnit = "BH" _GUICtrlButton_SetFocus($Radio56, True) Case $MyNewUnit = "CE" _GUICtrlButton_SetFocus($Radio57, True) Case $MyNewUnit = "CF" _GUICtrlButton_SetFocus($Radio60, True) Case $MyNewUnit = "CG" _GUICtrlButton_SetFocus($Radio59, True) Case $MyNewUnit = "CH" EndSelect $TabSheet4 = GUICtrlCreateTabItem("Sixth floor") ;Show this tab if the value is for the sixth floor Select Case $MyNewUnit = "AI" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "AJ" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "AK" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "AL" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "BI" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "BJ" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "BK" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "BL" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "CI" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "CJ" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "CK" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "CL" GUICtrlSetState(-1, $GUI_SHOW) EndSelect $Group10 = GUICtrlCreateGroup("A Tower", 30, 40, 100, 80) $Radio35 = GUICtrlCreateRadio("AI", 40, 60, 40, 20) GUICtrlSetTip(-1, "J280") $Radio36 = GUICtrlCreateRadio("AK", 80, 60, 40, 20) GUICtrlSetTip(-1, "J429") $Radio37 = GUICtrlCreateRadio("AJ", 40, 90, 40, 20) GUICtrlSetTip(-1, "J427") $Radio38 = GUICtrlCreateRadio("AL", 80, 90, 40, 20) GUICtrlSetTip(-1, "J284") $Group11 = GUICtrlCreateGroup("B Tower", 130, 120, 100, 80) $Radio40 = GUICtrlCreateRadio("BI", 140, 140, 40, 20) GUICtrlSetTip(-1, "J520") $Radio41 = GUICtrlCreateRadio("BK", 180, 140, 40, 20) GUICtrlSetTip(-1, "J288") $Radio42 = GUICtrlCreateRadio("BJ", 140, 170, 40, 20) GUICtrlSetTip(-1, "J286") $Radio43 = GUICtrlCreateRadio("BL", 180, 170, 40, 20) GUICtrlSetTip(-1, "J430") $Group12 = GUICtrlCreateGroup("C Tower", 230, 200, 100, 80) $Radio45 = GUICtrlCreateRadio("CI", 240, 220, 40, 20) GUICtrlSetTip(-1, "J289") $Radio46 = GUICtrlCreateRadio("CK", 280, 220, 40, 20) GUICtrlSetTip(-1, "J431") $Radio47 = GUICtrlCreateRadio("CL", 240, 250, 40, 20) GUICtrlSetTip(-1, "J291") ;My Advertising $LabelAd4 = GUICtrlCreateLabel("", 300, 60, 80, 81) GUICtrlSetTip(-1, "This program was created by" & @CRLF & @CRLF & "JailDoctor") ;Select the New Location for Sixth floor. Select Case $MyNewUnit = "AI" _GUICtrlButton_SetFocus($Radio35, True) Case $MyNewUnit = "AJ" _GUICtrlButton_SetFocus($Radio37, True) Case $MyNewUnit = "AK" _GUICtrlButton_SetFocus($Radio36, True) Case $MyNewUnit = "AL" Case $MyNewUnit = "BI" _GUICtrlButton_SetFocus($Radio40, True) Case $MyNewUnit = "BJ" _GUICtrlButton_SetFocus($Radio42, True) Case $MyNewUnit = "BK" _GUICtrlButton_SetFocus($Radio41, True) Case $MyNewUnit = "BL" _GUICtrlButton_SetFocus($Radio43, True) Case $MyNewUnit = "CI" _GUICtrlButton_SetFocus($Radio45, True) Case $MyNewUnit = "CK" _GUICtrlButton_SetFocus($Radio46, True) Case $MyNewUnit = "CL" _GUICtrlButton_SetFocus($Radio47, True) EndSelect $TabSheet5 = GUICtrlCreateTabItem("Basement") ;Show this tab if the value is for the basement Select Case $MyNewUnit = "LA" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "LB" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "LC" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "LD" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "WA" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "WB" GUICtrlSetState(-1, $GUI_SHOW) EndSelect $Group13 = GUICtrlCreateGroup("Basement", 130, 120, 100, 120) $Radio90 = GUICtrlCreateRadio("LA", 140, 140, 40, 20) GUICtrlSetTip(-1, "J433") $Radio91 = GUICtrlCreateRadio("LB", 180, 140, 40, 20) GUICtrlSetTip(-1, "J435") $Radio92 = GUICtrlCreateRadio("LC", 140, 170, 40, 20) GUICtrlSetTip(-1, "J437") $Radio93 = GUICtrlCreateRadio("LD", 180, 170, 40, 20) GUICtrlSetTip(-1, "J439") $Radio193 = GUICtrlCreateRadio("WA", 140, 200, 40, 20) GUICtrlSetTip(-1, "J294") $Radio293 = GUICtrlCreateRadio("WB", 180, 200, 40, 20) GUICtrlSetTip(-1, "J441") ;My Advertising $LabelAd6 = GUICtrlCreateLabel("", 300, 200, 80, 81) GUICtrlSetTip(-1, "This program was created by" & @CRLF & @CRLF & "JailDoctor") ;Select the New Basement location. Select Case $MyNewUnit = "LA" _GUICtrlButton_SetFocus($Radio90, True) Case $MyNewUnit = "LB" _GUICtrlButton_SetFocus($Radio91, True) Case $MyNewUnit = "LC" _GUICtrlButton_SetFocus($Radio92, True) Case $MyNewUnit = "LD" _GUICtrlButton_SetFocus($Radio93, True) Case $MyNewUnit = "WA" _GUICtrlButton_SetFocus($Radio193, True) Case $MyNewUnit = "WB" _GUICtrlButton_SetFocus($Radio293, True) EndSelect $TabSheet6 = GUICtrlCreateTabItem("Annex") ;Show this tab if the value is for the Annex floor Select Case $MyNewUnit = "1A" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "2A" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "3A" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "4A" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "5A" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "6A" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "7A" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "8A" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "9A" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "1B" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "2B" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "3B" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "4B" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "5B" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "6B" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "7B" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "8B" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "9B" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "0B" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "1C" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "2C" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "3C" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "4C" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "5C" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "1D" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "2D" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "3D" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "4D" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "5D" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "6D" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "7D" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "8D" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "1E" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "2E" GUICtrlSetState(-1, $GUI_SHOW) EndSelect $Group14 = GUICtrlCreateGroup("A Tower", 50, 45, 210, 65) $Radio1 = GUICtrlCreateRadio("1A", 60, 60, 35, 17) GUICtrlSetTip(-1, "J445") $Radio2 = GUICtrlCreateRadio("2A", 60, 80, 35, 17) GUICtrlSetTip(-1, "J446") $Radio3 = GUICtrlCreateRadio("3A", 100, 60, 35, 17) GUICtrlSetTip(-1, "J448") $Radio4 = GUICtrlCreateRadio("4A", 100, 80, 35, 17) GUICtrlSetTip(-1, "J452") $Radio5 = GUICtrlCreateRadio("5A", 140, 60, 35, 17) GUICtrlSetTip(-1, "J449") $Radio6 = GUICtrlCreateRadio("6A", 140, 80, 35, 17) GUICtrlSetTip(-1, "J464") $Radio7 = GUICtrlCreateRadio("7A", 180, 60, 35, 17) GUICtrlSetTip(-1, "J466") $Radio8 = GUICtrlCreateRadio("8A", 180, 80, 35, 17) GUICtrlSetTip(-1, "J468") $Radio9 = GUICtrlCreateRadio("9A", 220, 60, 35, 17) GUICtrlSetTip(-1, "J469") $Group15 = GUICtrlCreateGroup("B Tower", 50, 110, 210, 70) $Radio10 = GUICtrlCreateRadio("1B", 60, 130, 35, 17) GUICtrlSetTip(-1, "J473") $Radio11 = GUICtrlCreateRadio("2B", 60, 150, 35, 17) GUICtrlSetTip(-1, "J475") $Radio12 = GUICtrlCreateRadio("3B", 100, 130, 35, 17) GUICtrlSetTip(-1, "J477") $Radio13 = GUICtrlCreateRadio("4B", 100, 150, 35, 17) GUICtrlSetTip(-1, "J478") $Radio14 = GUICtrlCreateRadio("5B", 140, 130, 35, 17) GUICtrlSetTip(-1, "J480") $Radio15 = GUICtrlCreateRadio("6B", 140, 150, 35, 17) GUICtrlSetTip(-1, "J481") $Radio16 = GUICtrlCreateRadio("7B", 180, 130, 35, 17) GUICtrlSetTip(-1, "J482") $Radio17 = GUICtrlCreateRadio("8B", 180, 150, 35, 17) GUICtrlSetTip(-1, "J484") $Radio18 = GUICtrlCreateRadio("9B", 220, 130, 35, 17) GUICtrlSetTip(-1, "J485") $Radio19 = GUICtrlCreateRadio("0B", 220, 150, 35, 17) GUICtrlSetTip(-1, "J324") $Group16 = GUICtrlCreateGroup("C Tower", 50, 180, 130, 65) $Radio20 = GUICtrlCreateRadio("1C", 60, 200, 35, 17) GUICtrlSetTip(-1, "J507") $Radio21 = GUICtrlCreateRadio("2C", 60, 220, 35, 17) GUICtrlSetTip(-1, "J509") $Radio22 = GUICtrlCreateRadio("3C", 100, 200, 35, 17) GUICtrlSetTip(-1, "J511") $Radio23 = GUICtrlCreateRadio("4C", 100, 220, 35, 17) GUICtrlSetTip(-1, "J513") $Radio24 = GUICtrlCreateRadio("5C", 140, 200, 35, 17) GUICtrlSetTip(-1, "J515") $Group17 = GUICtrlCreateGroup("D Tower", 50, 250, 180, 65) $Radio25 = GUICtrlCreateRadio("1D", 60, 270, 35, 17) GUICtrlSetTip(-1, "J489") $Radio26 = GUICtrlCreateRadio("2D", 60, 290, 35, 17) GUICtrlSetTip(-1, "J491") $Radio27 = GUICtrlCreateRadio("3D", 100, 270, 35, 17) GUICtrlSetTip(-1, "J493") $Radio28 = GUICtrlCreateRadio("4D", 100, 290, 35, 17) GUICtrlSetTip(-1, "J495") $Radio29 = GUICtrlCreateRadio("5D", 140, 270, 35, 17) GUICtrlSetTip(-1, "J497") $Radio30 = GUICtrlCreateRadio("6D", 140, 290, 35, 17) GUICtrlSetTip(-1, "J499") $Radio31 = GUICtrlCreateRadio("7D", 180, 270, 35, 17) GUICtrlSetTip(-1, "J501") $Radio34 = GUICtrlCreateRadio("8D", 180, 290, 35, 17) GUICtrlSetTip(-1, "J503") $Group18 = GUICtrlCreateGroup("E Tower", 190, 180, 70, 65) $Radio32 = GUICtrlCreateRadio("1E", 200, 200, 35, 17) GUICtrlSetTip(-1, "J301") $Radio33 = GUICtrlCreateRadio("2E", 200, 220, 35, 17) GUICtrlSetTip(-1, "J302") ;My Advertising $LabelAd7 = GUICtrlCreateLabel("", 300, 60, 80, 81) GUICtrlSetTip(-1, "This program was created by" & @CRLF & @CRLF & "JailDoctor") ;Select the new Annex location Select Case $MyNewUnit = "0B" _GUICtrlButton_SetFocus($Radio19, True) Case $MyNewUnit = "1A" _GUICtrlButton_SetFocus($Radio1, True) Case $MyNewUnit = "1B" _GUICtrlButton_SetFocus($Radio10, True) Case $MyNewUnit = "1C" _GUICtrlButton_SetFocus($Radio20, True) Case $MyNewUnit = "1D" _GUICtrlButton_SetFocus($Radio25, True) Case $MyNewUnit = "1E" _GUICtrlButton_SetFocus($Radio32, True) Case $MyNewUnit = "2A" _GUICtrlButton_SetFocus($Radio2, True) Case $MyNewUnit = "2B" _GUICtrlButton_SetFocus($Radio11, True) Case $MyNewUnit = "2C" _GUICtrlButton_SetFocus($Radio21, True) Case $MyNewUnit = "2D" _GUICtrlButton_SetFocus($Radio26, True) Case $MyNewUnit = "2E" _GUICtrlButton_SetFocus($Radio33, True) Case $MyNewUnit = "3A" _GUICtrlButton_SetFocus($Radio3, True) Case $MyNewUnit = "3B" _GUICtrlButton_SetFocus($Radio12, True) Case $MyNewUnit = "3C" _GUICtrlButton_SetFocus($Radio22, True) Case $MyNewUnit = "3D" _GUICtrlButton_SetFocus($Radio27, True) Case $MyNewUnit = "4A" _GUICtrlButton_SetFocus($Radio4, True) Case $MyNewUnit = "4B" _GUICtrlButton_SetFocus($Radio13, True) Case $MyNewUnit = "4C" _GUICtrlButton_SetFocus($Radio23, True) Case $MyNewUnit = "4D" _GUICtrlButton_SetFocus($Radio28, True) Case $MyNewUnit = "5A" _GUICtrlButton_SetFocus($Radio5, True) Case $MyNewUnit = "5B" _GUICtrlButton_SetFocus($Radio14, True) Case $MyNewUnit = "5C" _GUICtrlButton_SetFocus($Radio24, True) Case $MyNewUnit = "5D" _GUICtrlButton_SetFocus($Radio29, True) Case $MyNewUnit = "6A" _GUICtrlButton_SetFocus($Radio6, True) Case $MyNewUnit = "6B" _GUICtrlButton_SetFocus($Radio15, True) Case $MyNewUnit = "6D" _GUICtrlButton_SetFocus($Radio30, True) Case $MyNewUnit = "7A" _GUICtrlButton_SetFocus($Radio7, True) Case $MyNewUnit = "7B" _GUICtrlButton_SetFocus($Radio16, True) Case $MyNewUnit = "7D" _GUICtrlButton_SetFocus($Radio31, True) Case $MyNewUnit = "8A" _GUICtrlButton_SetFocus($Radio8, True) Case $MyNewUnit = "8B" _GUICtrlButton_SetFocus($Radio17, True) Case $MyNewUnit = "8D" _GUICtrlButton_SetFocus($Radio34, True) Case $MyNewUnit = "9A" _GUICtrlButton_SetFocus($Radio9, True) Case $MyNewUnit = "9B" _GUICtrlButton_SetFocus($Radio18, True) EndSelect $TabSheet7 = GUICtrlCreateTabItem("Juvenile") Select Case $MyNewUnit = "Juvenile Mission" GUICtrlSetState(-1, $GUI_SHOW) Case $MyNewUnit = "Juvenile South" GUICtrlSetState(-1, $GUI_SHOW) EndSelect $Group19 = GUICtrlCreateGroup("Juvenile", 100, 100, 130, 65) $Radio77 = GUICtrlCreateRadio("Juvenile Mission", 110, 120, 100, 20) GUICtrlSetTip(-1, "J202") $Radio78 = GUICtrlCreateRadio("Juvenile South", 110, 140, 100, 20) GUICtrlSetTip(-1, "J201") ;My Advertising $LabelAd9 = GUICtrlCreateLabel("", 300, 200, 80, 81) GUICtrlSetTip(-1, "This program was created by" & @CRLF & @CRLF & "JailDoctor") Select Case $MyNewUnit = "Juvenile Mission" _GUICtrlButton_SetFocus($Radio77, True) Case $MyNewUnit = "Juvenile South" _GUICtrlButton_SetFocus($Radio78, True) EndSelect GUICtrlCreateTabItem("") $Label1 = GUICtrlCreateLabel("IDX-Location-Tool", 70, 350, 315, 49) GUICtrlSetFont(-1, 24, 400, 0, "Arial Black") GUICtrlSetColor(-1, 0x00FF00) $Label3 = GUICtrlCreateLabel($MyNewUnit, 250, 435, 110, 49) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetColor(-1, 0xFF0000) $Button1 = GUICtrlCreateButton("Discharge", 360, 440, 60, 20) GUICtrlSetBkColor(-1, 0x00FFFF) GUICtrlSetTip(-1, "RC01/RC02") $Button2 = GUICtrlCreateButton("Skip", 20, 440, 60, 20) GUICtrlSetBkColor(-1, 0x00FFFF) GUICtrlSetTip(-1, "Don't move this patient.") Select Case $MyNewUnit = "RC01/RC02" _GUICtrlButton_SetFocus($Button1, True) Case $MyNewUnit = "Skip" _GUICtrlButton_SetFocus($Button2, True) EndSelect GUICtrlCreateTabItem("") ;Show the window GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button2 ;~ skipping this patient $Skiper = 1 GUIDelete() ExitLoop EndSelect WEnd If $Skiper = 1 Then ;~ ContinueLoop EndIf