Pfex Posted September 8, 2006 Share Posted September 8, 2006 Hello. I made a script that helps with a very stupid task at work, instead of repeating a stupid sequence, now the user just has to select a person from a tab, and press a button. It is for indexing mails to the different users. The problem is that, visually, if I select a Radio from a tab, it stays selected even if I go to an other tab and back to the first tab again. The program takes as input only the radio that was last kicked. It does not check in any way on what tab the user is, as the Tabs are more or less just a thing to make it more user-friendly and not to have a page long list of names. Please advise me on this. Here comes the code. it is in 2 parts as I have split the script in 2 at some point. main part with GUI: expandcollapse popup#region --- GuiBuilder code Start --- ; Script generated by AutoBuilder 0.6 Prototype #include <GuiConstants.au3> #include <data_and_functions.au3> HotKeySet("{ESC}", "request_end") GuiCreate("Index Helper 0.108 Beta", 299, 420,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) GuiCtrlCreateTab(-1,-1,299,280) GUISetState () GUIStartGroup() $Radio_18 = GuiCtrlCreateRadio("Query", 20, 310, 70, 20) $Radio_19 = GuiCtrlCreateRadio("Order", 110, 310, 70, 20) $Radio_20 = GuiCtrlCreateRadio("OPG", 210, 310, 70, 20) $Group_21 = GuiCtrlCreateGroup("Transaction Code", 10, 280, 280, 70) ; select the TRansaction Code Code ;~ $Group_22 = GuiCtrlCreateGroup("", 10, 20, 280, 260) ; Select the person GUIStartGroup() $Button_23 = GuiCtrlCreateButton("Index... please check", 10, 370, 280, 40) GuiSetState() GUIStartGroup() #region Swiss TAB $tab0=GUICtrlCreateTabitem ("Swiss") $Radio_1 = GuiCtrlCreateRadio("Bogdan", 20, 30, 120, 20) ;~ $Radio_2 = GuiCtrlCreateRadio("Radio2", 20, 60, 120, 20) ;~ $Radio_3 = GuiCtrlCreateRadio("Radio3", 20, 90, 120, 20) ;~ $Radio_4 = GuiCtrlCreateRadio("Radio4", 20, 120, 120, 20) ;~ $Radio_5 = GuiCtrlCreateRadio("Radio5", 20, 150, 120, 20) ;~ $Radio_6 = GuiCtrlCreateRadio("Radio6", 20, 180, 120, 20) ;~ $Radio_7 = GuiCtrlCreateRadio("Radio7", 20, 210, 120, 20) ;~ $Radio_8 = GuiCtrlCreateRadio("Radio8", 20, 240, 120, 20) ;~ $Radio_10 = GuiCtrlCreateRadio("Radio10", 160, 30, 120, 20) $Radio_11 = GuiCtrlCreateRadio("Raluca", 160, 60, 120, 20) ;~ $Radio_12 = GuiCtrlCreateRadio("Radio12", 160, 90, 120, 20) ;~ $Radio_13 = GuiCtrlCreateRadio("Radio13", 160, 120, 120, 20) ;~ $Radio_14 = GuiCtrlCreateRadio("Radio14", 160, 150, 120, 20) ;~ $Radio_15 = GuiCtrlCreateRadio("Radio15", 160, 180, 120, 20) ;~ $Radio_16 = GuiCtrlCreateRadio("Radio16", 160, 210, 120, 20) $Radio_17 = GuiCtrlCreateRadio("Liviu", 160, 240, 120, 20) #endregion Swiss tab #region UK Tab $tab1=GUICtrlCreateTabitem ("UK") ;~ GUICtrlSetState(-1,$GUI_SHOW) ; will be display first, does ot work like I want it $Radio_24 = GuiCtrlCreateRadio("Ancuta", 20, 30, 120, 20) $Radio_25 = GuiCtrlCreateRadio("Andreea", 20, 60, 120, 20) $Radio_26 = GuiCtrlCreateRadio("Claudia", 20, 90, 120, 20) $Radio_27 = GuiCtrlCreateRadio("Doinita", 20, 120, 120, 20) ;~ $Radio_28 = GuiCtrlCreateRadio("Radio28", 20, 150, 120, 20) ;~ $Radio_29 = GuiCtrlCreateRadio("Radio6", 20, 180, 120, 20) ;~ $Radio_30 = GuiCtrlCreateRadio("Radio7", 20, 210, 120, 20) ;~ $Radio_31 = GuiCtrlCreateRadio("Radio8", 20, 240, 120, 20) $Radio_32 = GuiCtrlCreateRadio("Manuela", 160, 30, 120, 20) $Radio_33 = GuiCtrlCreateRadio("Marius", 160, 60, 120, 20) $Radio_34 = GuiCtrlCreateRadio("Dorin", 160, 90, 120, 20) ;~ $Radio_35 = GuiCtrlCreateRadio("Raluca", 160, 120, 120, 20) ;~ $Radio_36 = GuiCtrlCreateRadio("Radio14", 160, 150, 120, 20) ;~ $Radio_37 = GuiCtrlCreateRadio("Radio15", 160, 180, 120, 20) ;~ $Radio_38 = GuiCtrlCreateRadio("Radio16", 160, 210, 120, 20) ;~ $Radio_39 = GuiCtrlCreateRadio("Liviu", 160, 240, 120, 20) #endregion UK TAB #region Geman TAB $tab2=GUICtrlCreateTabitem ("Germany") $Radio_40 = GuiCtrlCreateRadio("Dragos", 20, 30, 120, 20) $Radio_41 = GuiCtrlCreateRadio("Daniela", 20, 60, 120, 20) $Radio_42 = GuiCtrlCreateRadio("Veronica", 20, 90, 120, 20) $Radio_43 = GuiCtrlCreateRadio("Laura ", 20, 120, 120, 20) $Radio_44 = GuiCtrlCreateRadio("Denisa ", 20, 150, 120, 20) $Radio_45 = GuiCtrlCreateRadio("Alina ", 20, 180, 120, 20) $Radio_46 = GuiCtrlCreateRadio("Edward ", 20, 210, 120, 20) $Radio_47 = GuiCtrlCreateRadio("Roxana ", 20, 240, 120, 20) ;------------Right side----------------- $Radio_48 = GuiCtrlCreateRadio("Grig ", 160, 30, 120, 20) $Radio_49 = GuiCtrlCreateRadio("Sinziana ", 160, 60, 120, 20) $Radio_50 = GuiCtrlCreateRadio("Cristina ", 160, 90, 120, 20) $Radio_51 = GuiCtrlCreateRadio("Alexandru ", 160, 120, 120, 20) $Radio_52 = GuiCtrlCreateRadio("Corina ", 160, 150, 120, 20) $Radio_53 = GuiCtrlCreateRadio("Irina ", 160, 180, 120, 20) ;~ $Radio_54 = GuiCtrlCreateRadio("Radio16", 160, 210, 120, 20) ;~ $Radio_55 = GuiCtrlCreateRadio("Liviu", 160, 240, 120, 20) #endregion German TAB #region France TAB $tab3=GUICtrlCreateTabitem ("France") $Radio_56 = GuiCtrlCreateRadio("Silviu", 20, 30, 120, 20) $Radio_57 = GuiCtrlCreateRadio("Elena T", 20, 60, 120, 20) $Radio_58 = GuiCtrlCreateRadio("Emilia", 20, 90, 120, 20) $Radio_59 = GuiCtrlCreateRadio("Zora", 20, 120, 120, 20) ;~ $Radio_60 = GuiCtrlCreateRadio("Radio5", 20, 150, 120, 20) ;~ $Radio_61 = GuiCtrlCreateRadio("Radio6", 20, 180, 120, 20) ;~ $Radio_62 = GuiCtrlCreateRadio("Radio7", 20, 210, 120, 20) ;~ $Radio_63 = GuiCtrlCreateRadio("Radio8", 20, 240, 120, 20) $Radio_64 = GuiCtrlCreateRadio("Bogdan", 160, 30, 120, 20) $Radio_65 = GuiCtrlCreateRadio("Raluca", 160, 60, 120, 20) $Radio_66 = GuiCtrlCreateRadio("Elena Cucu", 160, 90, 120, 20) ;~ $Radio_67 = GuiCtrlCreateRadio("Raluca", 160, 120, 120, 20) ;~ $Radio_68 = GuiCtrlCreateRadio("Radio14", 160, 150, 120, 20) ;~ $Radio_69 = GuiCtrlCreateRadio("Radio15", 160, 180, 120, 20) ;~ $Radio_70 = GuiCtrlCreateRadio("Radio16", 160, 210, 120, 20) ;~ $Radio_71 = GuiCtrlCreateRadio("Liviu", 160, 240, 120, 20) #endregion France TAB #region Italy TAB $tab4=GUICtrlCreateTabitem ("Italy") $Radio_72 = GuiCtrlCreateRadio("Alin", 20, 30, 120, 20) $Radio_73 = GuiCtrlCreateRadio("Iuliana", 20, 60, 120, 20) $Radio_74 = GuiCtrlCreateRadio("Florin", 20, 90, 120, 20) $Radio_75 = GuiCtrlCreateRadio("Iulia", 20, 120, 120, 20) ;~ $Radio_76 = GuiCtrlCreateRadio("Radio5", 20, 150, 120, 20) ;~ $Radio_77 = GuiCtrlCreateRadio("Radio6", 20, 180, 120, 20) ;~ $Radio_78 = GuiCtrlCreateRadio("Radio7", 20, 210, 120, 20) ;~ $Radio_79 = GuiCtrlCreateRadio("Radio8", 20, 240, 120, 20) $Radio_80 = GuiCtrlCreateRadio("Ana Maria", 160, 30, 120, 20) $Radio_81 = GuiCtrlCreateRadio("Adina", 160, 60, 120, 20) $Radio_82 = GuiCtrlCreateRadio("Luana", 160, 90, 120, 20) ;~ $Radio_83 = GuiCtrlCreateRadio("Raluca", 160, 120, 120, 20) ;~ $Radio_84 = GuiCtrlCreateRadio("Radio14", 160, 150, 120, 20) ;~ $Radio_85 = GuiCtrlCreateRadio("Radio15", 160, 180, 120, 20) ;~ $Radio_86 = GuiCtrlCreateRadio("Radio16", 160, 210, 120, 20) ;~ $Radio_87 = GuiCtrlCreateRadio("Liviu", 160, 240, 120, 20) #endregion Italy TAB #region Austria TAB $tab5=GUICtrlCreateTabitem ("Austria") $Radio_88 = GuiCtrlCreateRadio("George", 20, 30, 120, 20) ;~ $Radio_89 = GuiCtrlCreateRadio("Radio2", 20, 60, 120, 20) ;~ $Radio_90 = GuiCtrlCreateRadio("Radio3", 20, 90, 120, 20) ;~ $Radio_91 = GuiCtrlCreateRadio("Radio4", 20, 120, 120, 20) ;~ $Radio_92 = GuiCtrlCreateRadio("Radio5", 20, 150, 120, 20) ;~ $Radio_93 = GuiCtrlCreateRadio("Radio6", 20, 180, 120, 20) ;~ $Radio_94 = GuiCtrlCreateRadio("Radio7", 20, 210, 120, 20) ;~ $Radio_95 = GuiCtrlCreateRadio("Radio8", 20, 240, 120, 20) $Radio_96 = GuiCtrlCreateRadio("Valeria", 160, 30, 120, 20) ;~ $Radio_97 = GuiCtrlCreateRadio("Radio11", 160, 60, 120, 20) ;~ $Radio_98 = GuiCtrlCreateRadio("Radio12", 160, 90, 120, 20) ;~ $Radio_99 = GuiCtrlCreateRadio("Raluca", 160, 120, 120, 20) ;~ $Radio_100 = GuiCtrlCreateRadio("Radio14", 160, 150, 120, 20) ;~ $Radio_101 = GuiCtrlCreateRadio("Radio15", 160, 180, 120, 20) ;~ $Radio_102 = GuiCtrlCreateRadio("Radio16", 160, 210, 120, 20) ;~ $Radio_103 = GuiCtrlCreateRadio("Liviu", 160, 240, 120, 20) #endregion Austria TAB ;~ $tab0= Swiss, $tab1=UK, $tab2=germany $tab3=France, $tab4=Italy, $tab5=Austria GUICtrlSetState($tab0,$GUI_SHOW) ; will be display first, has to be set aftr the tab is filled GuiSetState() ; read controles and set variables according to the controles While 1 $msg = GuiGetMsg() Select #region tra code Case $msg = $Radio_18 $T_code = $Query Case $msg = $Radio_19 $T_code = $Order Case $msg = $Radio_20 $T_code = $OPG Case $msg = $Button_23 Call("Ind") #endregion tr code #region Swiss Case $msg = $Radio_1 $ass_to = $Bogdan Case $msg = $Radio_11 $ass_to = $Raluca Case $msg = $Radio_17 $ass_to = $Liviu #endregion Swiss #region UK Case $msg= $Radio_24 $ass_to= $Ancuta Case $msg= $Radio_25 $ass_to= $Andreea Case $msg= $Radio_26 $ass_to= $Claudia Case $msg= $Radio_27 $ass_to= $Doinita Case $msg= $Radio_32 $ass_to= $Manuela Case $msg= $Radio_33 $ass_to= $Marius Case $msg= $Radio_34 $ass_to= $Dorin #endregion UK #region Germany Case $msg= $Radio_40 $ass_to= $Dragos Case $msg= $Radio_41 $ass_to= $Daniela Case $msg= $Radio_42 $ass_to= $Veronica Case $msg= $Radio_43 $ass_to= $Laura Case $msg= $Radio_44 $ass_to= $Denisa Case $msg= $Radio_45 $ass_to= $Alina Case $msg= $Radio_46 $ass_to= $Edward Case $msg= $Radio_47 $ass_to= $Roxana ;------------right side------------------ Case $msg= $Radio_48 $ass_to= $Grigore Case $msg= $Radio_49 $ass_to= $Sinziana Case $msg= $Radio_50 $ass_to= $Cristina Case $msg= $Radio_51 $ass_to= $Alexandru Case $msg= $Radio_52 $ass_to= $Corina Case $msg= $Radio_53 $ass_to= $Irina #endregion germany #region France Case $msg= $Radio_56 $ass_to= $Silviu Case $msg= $Radio_57 $ass_to= $Elena_Tsaliocoglu Case $msg= $Radio_58 $ass_to= $Emilia Case $msg= $Radio_59 $ass_to= $Zora Case $msg= $Radio_64 $ass_to= $Bogdan_stef Case $msg= $Radio_65 $ass_to= $Raluca Case $msg= $Radio_66 $ass_to= $Elena_Cucu #endregion France #region Italy Case $msg= $Radio_72 $ass_to= $Alin Case $msg= $Radio_73 $ass_to= $Iuliana Case $msg= $Radio_74 $ass_to= $Florin Case $msg= $Radio_75 $ass_to= $Iulia Case $msg= $Radio_80 $ass_to= $Ana_Maria Case $msg= $Radio_81 $ass_to= $Adina Case $msg= $Radio_82 $ass_to= $Luana #endregion #region Austria Case $msg= $Radio_88 $ass_to= $George Case $msg= $Radio_96 $ass_to= $Valeria #endregion Austria Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit #endregion --- GuiBuilder generated code End --- oÝ÷ Ùû§rب«¶·¦¢÷zjhÈÚ²Ê&zf²±ç¢µ«,z{"¶+Þwèjëh×6 #region Imput Data $Query= ("{home}q") $Order= ("{home}") $OPG= ("{home}o") ;bugfix if no selection, then crash $T_code="" $ass_to="" #endregion Imput Data #region Swiss $Bogdan= 0;2 $Raluca= 0 ;11 $Liviu= 0 ;17 #endregion Swiss #region UK $Ancuta= 0 ;24 $Andreea= 0 ;25 $Claudia= 0 ;26 $Manuela= 0 ;32 $Marius= 0 ;33 $Dorin= 0 ;34 $Doinita= 2 ;27 #endregion UK #region France $Silviu= 0 ;56 $Bogdan_stef= 0 ;64 $Elena_Tsaliocoglu= 204 ;57 $Emilia= 0 ;58 $Elena_Cucu= 0 ;66 $Zora= 0 ;59 #endregion France #region Italy $Iuliana= 0 $Adina= 0 ;81 $Alin= 0 ;72 $Ana_Maria= 0 ;80 $Florin= 0 ;74 $Iulia= 0 ;75 $Luana= 0 ;82 #endregion Italy #region Germany $Dragos= 0 ;40 $Daniela= 0;41 $Veronica= 2;42 $Laura= 0 ;43 $Denisa= 0 ;44 $Alina=0 ;45 $Edward=0 ;46 $Roxana= 2 ;47 ;-------- coloana 2-------- $Grigore= 2 ;48 $Sinziana= 2 ;49 $Cristina= 2 ;50 $Alexandru= 2;51 $Corina= 2 ;52 $Irina= 2 ;53 #endregion Germany #region Austria $George= 0 ;88 $Valeria= 0 ;96 #endregion Austria #region Functions #region- Date as dd.MMM.yyyy > today() $m= @MON if $m=1 Then $m="JAN" EndIf if $m=2 Then $m="FEB" EndIf if $m=3 Then $m="MAR" EndIf if $m=4 Then $m="APR" EndIf if $m=5 Then $m="MAY" EndIf if $m=6 Then $m="JUN" EndIf If $m=7 Then $m="JUL" EndIf if $m=8 Then $m="AUG" EndIf If $m=9 Then $m="SEP" EndIf If $m=10 Then $m="OCT" EndIf If $m=11 Then $m="NOV" EndIf If $m=12 Then $m="DEC" EndIf #endregion Date Func today() ;Return the current date in dd.mm.yyyy form return (@MDAY & "." & $m & "." & @YEAR) EndFunc func tab($v) ; Presses TAB as often as var $t= 0 Do Send("{tab}") $t= $t +1 Until $t= $v EndFunc func Ind() ; Does the indexing using the imput from the user if $T_code="" Or $ass_to="" Then MsgBox(0,"ERROR", "NO option selected.") Else Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) WinWait("Processing Screen","") If Not WinActive("Processing Screen","") Then WinActivate("Processing Screen","") WinWaitActive("Processing Screen","") If Not WinActive("Processing Screen","") Then MsgBox(0,"ERROR", "Appropriate Bird window not active") Else ;click pe Modify BlockInput(1) ; blocks user imput untill the script moves teh mouse where it has to buton is pressed ControlFocus("","",1051); press modify Send("{space}") BlockInput(0) Sleep(1500) ;dus si selectat campul de status If Not WinActive("Processing Screen","") Then BlockInput(0) ;no blocking when en error, this is very bad., temporary it works MsgBox(0,"ERROR", "Appropriate Bird window not active") Else ControlClick("","", 1024,"left",2) Sleep(100) BlockInput(0) ; block of user imput canceled ;ales "Index" If Not WinActive("Processing Screen","") Then MsgBox(0,"ERROR", "Appropriate Bird window not active") Else Send("{home}") send("i") ;do 2x tab If Not WinActive("Processing Screen","") Then MsgBox(0,"ERROR", "Appropriate Bird window not active") Else tab(2) ;index to ID Send($ass_to) Send("{tab}") ;scris data ca dd.MMM.yyyy If Not WinActive("Processing Screen","") Then MsgBox(0,"ERROR", "Appropriate Bird window not active") Else Send("{UP}{UP}{UP}{UP}{UP}{UP}{home}") Send(today()) ;~ send("{enter}") ; this enter is not needed Sleep(5) tab(1) ;selectat Document type "trade" If Not WinActive("Processing Screen","") Then MsgBox(0,"ERROR", "Appropriate Bird window not active") Else send("trade") Send("{tab}") ;select Transaction code If Not WinActive("Processing Screen","") Then MsgBox(0,"ERROR", "Appropriate Bird window not active") Else Send($T_code) ;do 10x tab ( dus la "add") si apasat tab(10) If Not WinActive("Processing Screen","") Then MsgBox(0,"ERROR", "Appropriate Bird window not active") Else Send("{space}") Sleep(5) Sleep(1000) ;do 5x tab ( dus la "save") si apasat tab(5) If Not WinActive("Processing Screen","") Then MsgBox(0,"ERROR", "Appropriate Bird window not active") Else Send("{space}") Sleep(100) EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndFunc func request_end() ; pups up a window and asks if the script is to be stopped. any action untill the answer is stopped. $MB_YESNO = 4 $MB_YES = 6 if MsgBox($MB_YESNO, "Stop Request", "Do you want to stop/end the Program?") == $MB_YES then Exit endif endfunc #region temp #endregion temp Link to comment Share on other sites More sharing options...
ReverendJ1 Posted September 8, 2006 Share Posted September 8, 2006 (edited) The easy way to do it would be to add a function that would uncheck all other radios whenever you check another radio. But for that to work easily you would have to put all radios into an array. i.e. instead of declaring your radios like this: $Radio_1 = GuiCtrlCreateRadio("Bogdan", 20, 30, 120, 20)oÝ÷ Û*.Â¥uת޶¦)¶¬jëh×6$arrEmployee[1] = GuiCtrlCreateRadio("Bogdan", 20, 30, 120, 20)oÝ÷ ÚØ^Ú,¢g)à)¶¬jëh×6Func _UncheckRadios($strRadioToKeep) $i = 1 do if $arrEmployee[$i] <> $strRadioToKeep then GuiCtrlSetState($arrEmployee[$i], $GUI_UNCHECKED) endif While $i < UBound($arrEmployees) EndFunc I am still kind of new at this, so there might be an easier way. I haven't done much work with tabs. Edited September 8, 2006 by ReverendJ1 Link to comment Share on other sites More sharing options...
Pfex Posted September 8, 2006 Author Share Posted September 8, 2006 Thank yo for the fast reply ReverendJ1. I personally started programing and using AutoIT ~1 month ago... so a am n00b that wants to learn . I will look into it. It is a bit of work for a stupid bug, but will do it as it will solve the problem for sure . There still is the possible bug that visually the other radio stays checked even thou it is not. You may see that even thou they are in different tabs, the radios are in one big group so only one may be active at any time. Hmm, shell I post this in the bug sections too ? Link to comment Share on other sites More sharing options...
Valuater Posted September 8, 2006 Share Posted September 8, 2006 Rev gave the right idea examples expandcollapse popupHotKeySet("{ESC}", "request_end") GuiCreate("Index Helper 0.108 Beta", 299, 420,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) GuiCtrlCreateTab(-1,-1,299,280) ;GUISetState () GUIStartGroup() $Radio_QU = GuiCtrlCreateRadio("Query", 20, 310, 70, 20) $Radio_OR = GuiCtrlCreateRadio("Order", 110, 310, 70, 20) $Radio_OP = GuiCtrlCreateRadio("OPG", 210, 310, 70, 20) GuiCtrlCreateGroup("Transaction Code", 10, 280, 280, 70) ; select the TRansaction Code Code ;~ $Group_22 = GuiCtrlCreateGroup("", 10, 20, 280, 260) ; Select the person ; GUIStartGroup() $Button_23 = GuiCtrlCreateButton("Index... please check", 10, 370, 280, 40) ;GuiSetState() ; GUIStartGroup() #region Swiss TAB $tab0=GUICtrlCreateTabitem ("Swiss") $Radio_[1] = GuiCtrlCreateRadio("Bogdan", 20, 30, 120, 20) $Radio_[2] = GuiCtrlCreateRadio("Radio2", 20, 60, 120, 20) $Radio_[3] = GuiCtrlCreateRadio("Radio3", 20, 90, 120, 20) $Radio_[4] = GuiCtrlCreateRadio("Radio4", 20, 120, 120, 20) $Radio_[5] = GuiCtrlCreateRadio("Radio5", 20, 150, 120, 20) $Radio_[6] = GuiCtrlCreateRadio("Radio6", 20, 180, 120, 20) $Radio_[7] = GuiCtrlCreateRadio("Radio7", 20, 210, 120, 20) $Radio_[8] = GuiCtrlCreateRadio("Radio8", 20, 240, 120, 20) $Radio_[10] = GuiCtrlCreateRadio("Radio10", 160, 30, 120, 20) $Radio_[11] = GuiCtrlCreateRadio("Raluca", 160, 60, 120, 20) $Radio_[12] = GuiCtrlCreateRadio("Radio12", 160, 90, 120, 20) $Radio_[13] = GuiCtrlCreateRadio("Radio13", 160, 120, 120, 20) $Radio_[14] = GuiCtrlCreateRadio("Radio14", 160, 150, 120, 20) $Radio_[15] = GuiCtrlCreateRadio("Radio15", 160, 180, 120, 20) $Radio_[16] = GuiCtrlCreateRadio("Radio16", 160, 210, 120, 20) $Radio_[17] = GuiCtrlCreateRadio("Liviu", 160, 240, 120, 20) #endregion Swiss tab #region UK Tab $tab1=GUICtrlCreateTabitem ("UK") ;~ GUICtrlSetState(-1,$GUI_SHOW) ; will be display first, does ot work like I want it $Radio_[18] = GuiCtrlCreateRadio("Ancuta", 20, 30, 120, 20) $Radio_[19] = "" ; GuiCtrlCreateRadio("Andreea", 20, 60, 120, 20) $Radio_[20] = "" ; GuiCtrlCreateRadio("Claudia", 20, 90, 120, 20) $Radio_[21] = "" ; GuiCtrlCreateRadio("Doinita", 20, 120, 120, 20) $Radio_[22] = "" ; GuiCtrlCreateRadio("Radio28", 20, 150, 120, 20) $Radio_[23] = GuiCtrlCreateRadio("Radio6", 20, 180, 120, 20) $Radio_[24] = GuiCtrlCreateRadio("Radio7", 20, 210, 120, 20) $Radio_[25] = GuiCtrlCreateRadio("Radio8", 20, 240, 120, 20) $Radio_[26] = GuiCtrlCreateRadio("Manuela", 160, 30, 120, 20) $Radio_[27] = GuiCtrlCreateRadio("Marius", 160, 60, 120, 20) $Radio_[28] = GuiCtrlCreateRadio("Dorin", 160, 90, 120, 20) $Radio_[29] = GuiCtrlCreateRadio("Raluca", 160, 120, 120, 20) $Radio_[30] = GuiCtrlCreateRadio("Radio14", 160, 150, 120, 20) $Radio_[31] = GuiCtrlCreateRadio("Radio15", 160, 180, 120, 20) $Radio_[32] = GuiCtrlCreateRadio("Radio16", 160, 210, 120, 20) $Radio_[33] = GuiCtrlCreateRadio("Liviu", 160, 240, 120, 20) #endregion UK TAB ; continue in this order oÝ÷ Ù«¢+Ø(()Õ¹Ñ½ä ¤íIÑÕɸѡÕÉɹÐÑ¥¸¹µ´¹åååä½É´(ÀÌØí´ô5=8(ÀÌØí}´ôMÑÉ¥¹MÁ±¥Ð ÅÕ½Ðí)8±±5H±AH±5d±)U8±)U0±U±M@±= P±9=X±ÅÕ½Ðì°ÅÕ½Ðì°ÅÕ½Ðì¤(½ÈÀÌØíàôÄѼÀÌØí}µlÁt(%ÀÌØíàôÀÌØí´Q¡¸(ÀÌØí´ôÀÌØí}µlÀÌØíát(á¥Ñ1½½À(¹%(9áÐ(IÑÕɸ¡5dµÀìÅÕ½Ðì¸ÅÕ½ÐìµÀìÀÌØí´µÀìÅÕ½Ðì¸ÅÕ½ÐìµÀìeH¤)¹Õ¹()Õ¹Ñ ÀÌØíؤìAÉÍÍÌQ̽ѸÌÙÈ(½ÈÀÌØíàôÄѼÀÌØíØ(M¹ ÅÕ½ÐííÑôÅÕ½Ðì¤(9áÐ)¹Õ¹( 8) Link to comment Share on other sites More sharing options...
Pfex Posted September 11, 2006 Author Share Posted September 11, 2006 A.... back to work. And at tome AutoIT. I do also have some AutoIT projects at home, but I refuse to do anything on the "work" Project in my free time. Anyway.... @Valuater: Thank you for the guidance and the simple solutions for my clumsy solutions that I made for some of the functions. Like I sad, I am at the beginning. Thank you very much for the support. I will start to implement the solution for the Radio problem. It should do the job. Link to comment Share on other sites More sharing options...
Pfex Posted September 11, 2006 Author Share Posted September 11, 2006 OK, started to do the work on it... changed the script as instructed... but now, the next problem that I do not manage to solve. I know that it might sound simple, but I am unable/ do not know how declare an array. as you may see from my script I do not know anything how they work and so have not used them at all. Please advise. Link to comment Share on other sites More sharing options...
Pfex Posted September 11, 2006 Author Share Posted September 11, 2006 ok, solved the dim problem.... but something is not working right. I do not really know where to execute the _UncheckRadios($checked_rad) function. i tried to place it at the end of the ind() function, at the start of it and it still does not work. I have put in a control line MsgBox(0,"test",$checked_rad) and I get really strange results, I simply do not get the correct Radio in the msg box. I the program works as intended, but the radios are not cleared as intended by the function. here is the code again, sorry for the spamming. Please advise: [autoit]#comments-start This script helps with teh indexing... a lot. For any sugestions or bug reports please contact Bogdan Belcea Still to do: - index when Enter is pressed - to add tool Tips - Speed up the process by checking if the ticket is open or if "Modify" has to be pressed. After "Modify" is pressed it then check by the same process if the ticket has opened or not. IF it is open, it dose the task, if not it waits 0,1 s or so ( have to decide) and does the check again until it can "see" that it is open. - make a Icon for the Program - Add reference section, credits info, help contact, licence info ( it is free but as anything done by a ### employee for ###it belongs to###### bla bla bla, and all that stuff.. think is one of the useless stuff that has to be done before the full relies of the program. Version History 08.09.2006 -v0.108 Beta -Changed the way Index is selected. Now it will select index every time, o matter whet Status it is. -Changed the way the transaction code is selected, now it is not changed any more to the some wrong status 07.09.2006 -v0.107 Beta -fixed a bug that blocked the program when the ticket was alreaduy open ( modify ' was already pressed, now the modify buton is pressed in a diffrent way 07.09.2006 -v0.106 Beta -Removed the block imput as it was no longer needed (the mouse is not moved any more), program remained locked if teh ticket is locked, Bug reported By Raluca 06.09.2006 -v0.105 Beta -Changed the buttons are pressed, mouse is no longer moved, preventing this way user interference 29.08.2006 -v0.104 Beta -Blocks the User Impute as long as the mouse is moved to prevent User interference -v0.103 Beta -Added lots of checks. If the active window is the wrong one, scrip will stop running informing the user that the active window is not the right one. the usage of the script may be easily resumed once the appropriate window is open. 28.08.2006 -v 0.102 Beta -Added ESC as hotkey. When pressed the execution of the script is stopped and it can be terminated or resumed depending on user choice 28.08.2006 -v 0.101 Beta -Reduced waiting time after pressing of TAB to speed up the process. 25.08.2006 -v 0.1 Beta -This is the first Beta!!!!! no more Alpha on this one. -Split the code in "GUI and Main" and data_and_functions" -Added tabs for Swiss, UK, German, Italy, France teams -Added the team members in for the above countries -Fixed bug that crashed the program if no option was selected -Select at start a given tab. Swiss is now selected. #comments-end #region --- GuiBuilder code Start --- ; Script generated by AutoBuilder 0.6 Prototype #include <GuiConstants.au3> #include <data_and_functions.au3> Global $checked_rad HotKeySet("{ESC}", "request_end") GuiCreate("Index Helper 0.108 Beta", 299, 420,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) GuiCtrlCreateTab(-1,-1,299,280) GUISetState () GUIStartGroup() $Radio_QU = GuiCtrlCreateRadio("Query", 20, 310, 70, 20) $Radio_OR = GuiCtrlCreateRadio("Order", 110, 310, 70, 20) $Radio_OP = GuiCtrlCreateRadio("OPG", 210, 310, 70, 20) $Group_21 = GuiCtrlCreateGroup("Transaction Code", 10, 280, 280, 70) ; select the TRansaction Code Code ;~ $Group_22 = GuiCtrlCreateGroup("", 10, 20, 280, 260) ; Select the person GUIStartGroup() $Button_23 = GuiCtrlCreateButton("Index... please check", 10, 370, 280, 40) GuiSetState() GUIStartGroup() #region Swiss TAB $tab0=GUICtrlCreateTabitem ("Swiss") $Radio_[1] = GuiCtrlCreateRadio("Bogdan", 20, 30, 120, 20) ;~ $Radio_[2] = GuiCtrlCreateRadio("Radio2", 20, 60, 120, 20) ;~ $Radio_[3] = GuiCtrlCreateRadio("Radio3", 20, 90, 120, 20) ;~ $Radio_[4] = GuiCtrlCreateRadio("Radio4", 20, 120, 120, 20) ;~ $Radio_[5] = GuiCtrlCreateRadio("Radio5", 20, 150, 120, 20) ;~ $Radio_[6] = GuiCtrlCreateRadio("Radio6", 20, 180, 120, 20) ;~ $Radio_[7] = GuiCtrlCreateRadio("Radio7", 20, 210, 120, 20) ;~ $Radio_[8] = GuiCtrlCreateRadio("Radio8", 20, 240, 120, 20) ;~ $Radio_[10] = GuiCtrlCreateRadio("Radio10", 160, 30, 120, 20) $Radio_[11] = GuiCtrlCreateRadio("Raluca", 160, 60, 120, 20) ;~ $Radio_[12] = GuiCtrlCreateRadio("Radio12", 160, 90, 120, 20) ;~ $Radio_[13] = GuiCtrlCreateRadio("Radio13", 160, 120, 120, 20) ;~ $Radio_[14] = GuiCtrlCreateRadio("Radio14", 160, 150, 120, 20) ;~ $Radio_[15] = GuiCtrlCreateRadio("Radio15", 160, 180, 120, 20) ;~ $Radio_[16] = GuiCtrlCreateRadio("Radio16", 160, 210, 120, 20) $Radio_[17] = GuiCtrlCreateRadio("Liviu", 160, 240, 120, 20) #endregion Swiss tab #region UK Tab $tab1=GUICtrlCreateTabitem ("UK") ;~ GUICtrlSetState(-1,$GUI_SHOW) ; will be display first, does ot work like I want it $Radio_[24] = GuiCtrlCreateRadio("Ancuta", 20, 30, 120, 20) $Radio_[25] = GuiCtrlCreateRadio("Andreea", 20, 60, 120, 20) $Radio_[26] = GuiCtrlCreateRadio("Claudia", 20, 90, 120, 20) $Radio_[27] = GuiCtrlCreateRadio("Doinita", 20, 120, 120, 20) ;~ $Radio_[28] = GuiCtrlCreateRadio("Radio28", 20, 150, 120, 20) ;~ $Radio_[29] = GuiCtrlCreateRadio("Radio6", 20, 180, 120, 20) ;~ $Radio_[30] = GuiCtrlCreateRadio("Radio7", 20, 210, 120, 20) ;~ $Radio_[31] = GuiCtrlCreateRadio("Radio8", 20, 240, 120, 20) $Radio_[32] = GuiCtrlCreateRadio("Manuela", 160, 30, 120, 20) $Radio_[33] = GuiCtrlCreateRadio("Marius", 160, 60, 120, 20) $Radio_[34] = GuiCtrlCreateRadio("Dorin", 160, 90, 120, 20) ;~ $Radio_[35] = GuiCtrlCreateRadio("Raluca", 160, 120, 120, 20) ;~ $Radio_[36] = GuiCtrlCreateRadio("Radio14", 160, 150, 120, 20) ;~ $Radio_[37] = GuiCtrlCreateRadio("Radio15", 160, 180, 120, 20) ;~ $Radio_[38] = GuiCtrlCreateRadio("Radio16", 160, 210, 120, 20) ;~ $Radio_[39] = GuiCtrlCreateRadio("Liviu", 160, 240, 120, 20) #endregion UK TAB #region Geman TAB $tab2=GUICtrlCreateTabitem ("Germany") $Radio_[40] = GuiCtrlCreateRadio("Dragos", 20, 30, 120, 20) $Radio_[41] = GuiCtrlCreateRadio("Daniela", 20, 60, 120, 20) $Radio_[42] = GuiCtrlCreateRadio("Veronica", 20, 90, 120, 20) $Radio_[43] = GuiCtrlCreateRadio("Laura ", 20, 120, 120, 20) $Radio_[44] = GuiCtrlCreateRadio("Denisa ", 20, 150, 120, 20) $Radio_[45] = GuiCtrlCreateRadio("Alina ", 20, 180, 120, 20) $Radio_[46] = GuiCtrlCreateRadio("Edward ", 20, 210, 120, 20) $Radio_[47] = GuiCtrlCreateRadio("Roxana ", 20, 240, 120, 20) ;------------Right side----------------- $Radio_[48] = GuiCtrlCreateRadio("Grig ", 160, 30, 120, 20) $Radio_[49] = GuiCtrlCreateRadio("Sinziana ", 160, 60, 120, 20) $Radio_[50] = GuiCtrlCreateRadio("Cristina ", 160, 90, 120, 20) $Radio_[51] = GuiCtrlCreateRadio("Alexandru ", 160, 120, 120, 20) $Radio_[52] = GuiCtrlCreateRadio("Corina ", 160, 150, 120, 20) $Radio_[53] = GuiCtrlCreateRadio("Irina ", 160, 180, 120, 20) ;~ $Radio_[54] = GuiCtrlCreateRadio("Radio16", 160, 210, 120, 20) ;~ $Radio_[55] = GuiCtrlCreateRadio("Liviu", 160, 240, 120, 20) #endregion German TAB #region France TAB $tab3=GUICtrlCreateTabitem ("France") $Radio_[56] = GuiCtrlCreateRadio("Silviu", 20, 30, 120, 20) $Radio_[57] = GuiCtrlCreateRadio("Elena T", 20, 60, 120, 20) $Radio_[58] = GuiCtrlCreateRadio("Emilia", 20, 90, 120, 20) $Radio_[59] = GuiCtrlCreateRadio("Zora", 20, 120, 120, 20) ;~ $Radio_[60] = GuiCtrlCreateRadio("Radio5", 20, 150, 120, 20) ;~ $Radio_[61] = GuiCtrlCreateRadio("Radio6", 20, 180, 120, 20) ;~ $Radio_[62] = GuiCtrlCreateRadio("Radio7", 20, 210, 120, 20) ;~ $Radio_[63] = GuiCtrlCreateRadio("Radio8", 20, 240, 120, 20) $Radio_[64] = GuiCtrlCreateRadio("Bogdan", 160, 30, 120, 20) $Radio_[65] = GuiCtrlCreateRadio("Raluca", 160, 60, 120, 20) $Radio_[66] = GuiCtrlCreateRadio("Elena Cucu", 160, 90, 120, 20) ;~ $Radio_[67] = GuiCtrlCreateRadio("Raluca", 160, 120, 120, 20) ;~ $Radio_[68] = GuiCtrlCreateRadio("Radio14", 160, 150, 120, 20) ;~ $Radio_[69] = GuiCtrlCreateRadio("Radio15", 160, 180, 120, 20) ;~ $Radio_[70] = GuiCtrlCreateRadio("Radio16", 160, 210, 120, 20) ;~ $Radio_[71] = GuiCtrlCreateRadio("Liviu", 160, 240, 120, 20) #endregion France TAB #region Italy TAB $tab4=GUICtrlCreateTabitem ("Italy") $Radio_[72] = GuiCtrlCreateRadio("Alin", 20, 30, 120, 20) $Radio_[73] = GuiCtrlCreateRadio("Iuliana", 20, 60, 120, 20) $Radio_[74] = GuiCtrlCreateRadio("Florin", 20, 90, 120, 20) $Radio_[75] = GuiCtrlCreateRadio("Iulia", 20, 120, 120, 20) ;~ $Radio_[76] = GuiCtrlCreateRadio("Radio5", 20, 150, 120, 20) ;~ $Radio_[77] = GuiCtrlCreateRadio("Radio6", 20, 180, 120, 20) ;~ $Radio_[78] = GuiCtrlCreateRadio("Radio7", 20, 210, 120, 20) ;~ $Radio_[79] = GuiCtrlCreateRadio("Radio8", 20, 240, 120, 20) $Radio_[80] = GuiCtrlCreateRadio("Ana Maria", 160, 30, 120, 20) $Radio_[81] = GuiCtrlCreateRadio("Adina", 160, 60, 120, 20) $Radio_[82] = GuiCtrlCreateRadio("Luana", 160, 90, 120, 20) ;~ $Radio_[83] = GuiCtrlCreateRadio("Raluca", 160, 120, 120, 20) ;~ $Radio_[84] = GuiCtrlCreateRadio("Radio14", 160, 150, 120, 20) ;~ $Radio_[85] = GuiCtrlCreateRadio("Radio15", 160, 180, 120, 20) ;~ $Radio_[86] = GuiCtrlCreateRadio("Radio16", 160, 210, 120, 20) ;~ $Radio_[87] = GuiCtrlCreateRadio("Liviu", 160, 240, 120, 20) #endregion Italy TAB #region Austria TAB $tab5=GUICtrlCreateTabitem ("Austria") $Radio_[88] = GuiCtrlCreateRadio("George", 20, 30, 120, 20) ;~ $Radio_[89] = GuiCtrlCreateRadio("Radio2", 20, 60, 120, 20) ;~ $Radio_[90] = GuiCtrlCreateRadio("Radio3", 20, 90, 120, 20) ;~ $Radio_[91] = GuiCtrlCreateRadio("Radio4", 20, 120, 120, 20) ;~ $Radio_[92] = GuiCtrlCreateRadio("Radio5", 20, 150, 120, 20) ;~ $Radio_[93] = GuiCtrlCreateRadio("Radio6", 20, 180, 120, 20) ;~ $Radio_[94] = GuiCtrlCreateRadio("Radio7", 20, 210, 120, 20) ;~ $Radio_[95] = GuiCtrlCreateRadio("Radio8", 20, 240, 120, 20) $Radio_[96] = GuiCtrlCreateRadio("Valeria", 160, 30, 120, 20) ;~ $Radio_[97] = GuiCtrlCreateRadio("Radio11", 160, 60, 120, 20) ;~ $Radio_[98] = GuiCtrlCreateRadio("Radio12", 160, 90, 120, 20) ;~ $Radio_[99] = GuiCtrlCreateRadio("Raluca", 160, 120, 120, 20) ;~ $Radio_[100] = GuiCtrlCreateRadio("Radio14", 160, 150, 120, 20) ;~ $Radio_[101] = GuiCtrlCreateRadio("Radio15", 160, 180, 120, 20) ;~ $Radio_[102] = GuiCtrlCreateRadio("Radio16", 160, 210, 120, 20) ;~ $Radio_[103] = GuiCtrlCreateRadio("Liviu", 160, 240, 120, 20) #endregion Austria TAB ;~ $tab0= Swiss, $tab1=UK, $tab2=germany $tab3=France, $tab4=Italy, $tab5=Austria GUICtrlSetState($tab0,$GUI_SHOW) ; will be display first, has to be set aftr the tab is filled GuiSetState() ; read controles and set variables according to the controles While 1 $msg = GuiGetMsg() Select #region tra code Case $msg = $Radio_QU $T_code = $Query Case $msg = $Radio_OR $T_code = $Order Case $msg = $Radio_OP $T_code = $OPG Case $msg = $Button_23 Call("Ind") #endregion tr code #region Swiss Case $msg = $Radio_[1] $ass_to = $Bogdan $checked_rad= $Radio_[1] Case $msg = $Radio_[11] $ass_to = $Raluca $checked_rad= $Radio_[11] Case $msg = $Radio_[17] $ass_to = $Liviu $checked_rad= $Radio_[17] #endregion Swiss #region UK Case $msg= $Radio_[24] $ass_to= $Ancuta $checked_rad= $Radio_[24] Case $msg= $Radio_[25] $ass_to= $Andreea $checked_rad= $Radio_[25] Case $msg= $Radio_[26] $ass_to= $Claudia $checked_rad= $Radio_[26] Case $msg= $Radio_[27] $ass_to= $Doinita $checked_rad= $Radio_[27] Case $msg= $Radio_[32] $ass_to= $Manuela $checked_rad= $Radio_[32] Case $msg= $Radio_[33] $ass_to= $Marius $checked_rad= $Radio_[33] Case $msg= $Radio_[34] $ass_to= $Dorin $checked_rad= $Radio_[34] #endregion UK #region Germany Case $msg= $Radio_[40] $ass_to= $Dragos $checked_rad= $Radio_[40] Case $msg= $Radio_[41] $ass_to= $Daniela $checked_rad= $Radio_[41] Case $msg= $Radio_[42] $ass_to= $Veronica $checked_rad= $Radio_[42] Case $msg= $Radio_[43] $ass_to= $Laura $checked_rad= $Radio_[43] Case $msg= $Radio_[44] $ass_to= $Denisa $checked_rad= $Radio_[44] Case $msg= $Radio_[45] $ass_to= $Alina $checked_rad= $Radio_[45] Case $msg= $Radio_[46] $ass_to= $Edward $checked_rad= $Radio_[46] Case $msg= $Radio_[47] $ass_to= $Roxana $checked_rad= $Radio_[47] ;------------right side------------------ Case $msg= $Radio_[48] $ass_to= $Grigore $checked_rad= $Radio_[48] Case $msg= $Radio_[49] $ass_to= $Sinziana $checked_rad= $Radio_[49] Case $msg= $Radio_[50] $ass_to= $Cristina $checked_rad= $Radio_[50] Case $msg= $Radio_[51] $ass_to= $Alexandru $checked_rad= $Radio_[51] Case $msg= $Radio_[52] $ass_to= $Corina $checked_rad= $Radio_[52] Case $msg= $Radio_[53] $ass_to= $Irina $checked_rad= $Radio_[53] #endregion germany #region France Case $msg= $Radio_[56] $ass_to= $Silviu $checked_rad= $Radio_[56] Case $msg= $Radio_[57] $ass_to= $Elena_Tsaliocoglu $checked_rad= $Radio_[57] Case $msg= $Radio_[58] $ass_to= $Emilia $checked_rad= $Radio_[58] Case $msg= $Radio_[59] $ass_to= $Zora $checked_rad= $Radio_[59] Case $msg= $Radio_[64] $ass_to= $Bogdan_stef $checked_rad= $Radio_[64] Case $msg= $Radio_[65] $ass_to= $Raluca $checked_rad= $Radio_[65] Case $msg= $Radio_[66] $ass_to= $Elena_Cucu $checked_rad= $Radio_[66] #endregion France #region Italy Case $msg= $Radio_[72] $ass_to= $Alin $checked_rad= $Radio_[72] Case $msg= $Radio_[73] $ass_to= $Iuliana $checked_rad= $Radio_[73] Case $msg= $Radio_[74] $ass_to= $Florin $checked_rad= $Radio_[74] Case $msg= $Radio_[75] $ass_to= $Iulia $checked_rad= $Radio_[75] Case $msg= $Radio_[80] $ass_to= $Ana_Maria $checked_rad= $Radio_[80] Case $msg= $Radio_[81] $ass_to= $Adina $checked_rad= $Radio_[81] Case $msg= $Radio_[82] $ass_to= $Luana $checked_rad= $Radio_[82] #endregion #region Austria Case $msg= $Radio_[88] $ass_to= $George $checked_rad= $Radio_[88] Case $msg= $Radio_[96] $ass_to= $Valeria $checked_rad= $Radio_[96] #endregion Austria Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit #endregion --- GuiBuilder generated code End --- Func _UncheckRadios($checked_rad) ; unchecks not selected Radios $i = 1 do if $Radio_[$i] <> $checked_rad then GuiCtrlSetState($Radio_[$i], $GUI_UNCHECKED) endif Until $i < UBound($Radio_) EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now