Marecz Posted September 26, 2016 Posted September 26, 2016 Hello, i'm writing a little project for Automation Tests. The program have to choose radiobutton from tabs and add id to listview, after click RUN depending on list he making steps. Program works almost fully but i have one obsticle that i can't reach. After adding any choosen RadioBox (Text) to List View from TabSheet1, The choosen RadioBox from TabSheet2 adding to Listview with name of last from TabSheet1. Any Idea ? expandcollapse popupLocal $Total = "[NAME:_cmdFunctionKey_10]" Local $ProductID = "[NAME:TextBox]" Local $Product02 = "102100" Local $Bnote_100 = "[NAME:tbl_denoms@1@13]" $idTSList = GUICtrlCreateListView ("ListView Steps ", 15, 30, 177, 323) $idAdd = GUICtrlCreateButton("<", 200, 40, 33, 41) $Tablica1 = GUICtrlCreateTab(240, 8, 401, 409) ;1s Tabs------------------------------------------- $TabSheet1 = GUICtrlCreateTabItem("Common") ;1.1s Works in Tab 1----------------------- $idManAuth = GUICtrlCreateRadio("Manager Authorization", 264, 50, 145, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $idScanEAN = GUICtrlCreateRadio("Scan EAN", 264, 75, 145, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $idLogIn = GUICtrlCreateRadio("Log In", 264, 100, 145, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $idRazem = GUICtrlCreateRadio("Sum", 264,125, 145, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $idProduct_1 = GUICtrlCreateRadio("Scan Product 1", 264,150, 145, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") ;1.1e ------------------------------------- $TabSheet2 = GUICtrlCreateTabItem("Nomination") ;1.2s Works in Tab 2----------------------- $idBNote_100 = GUICtrlCreateRadio("Money 100", 264, 50, 145, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") ;1.2e ------------------------------------- $TabSheet3 = GUICtrlCreateTabItem("Special 2") ;1.3s Works in Tab 3----------------------- ;1.3e ------------------------------------- GUICtrlCreateTabItem("") ;1e------------------------------------------------------- GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idAdd ChoosenRadio() EndSwitch WEnd ;3s Choosen RadioBox option + adding to list ----------------------------- Func ChoosenRadio() If GUICtrlRead($idManAuth) = 1 Then $idCaption = ControlGetText("","",$idManAuth) GUICtrlCreateListViewItem($idCaption, $idTSList) ElseIf GUICtrlRead($idScanPLU) = 1 Then $idCaption = ControlGetText("","",$idScanPLU) GUICtrlCreateListViewItem($idCaption, $idTSList) ElseIf GUICtrlRead($idLogIn) = 1 Then $idCaption = ControlGetText("","",$idLogIN) GUICtrlCreateListViewItem($idCaption, $idTSList) ElseIf GUICtrlRead($idRazem) = 1 Then $idCaption = ControlGetText("","",$idRazem) GUICtrlCreateListViewItem($idCaption, $idTSList) ElseIf GUICtrlRead($idProduct_1) = 1 Then $idCaption = ControlGetText("","",$idProduct_1) GUICtrlCreateListViewItem($idCaption, $idTSList) ElseIf GUICtrlRead($idBNote_100) = 1 Then $idCaption = ControlGetText("","",$idBNote_100) GUICtrlCreateListViewItem($idCaption, $idTSList) EndIf EndFunc ;3e ----------------------------------------------------------------------- Please feel thanks from me for any respond
Marecz Posted September 26, 2016 Author Posted September 26, 2016 Ok at least i found out i need to uncheck all radio...mmm i'm so stupid sometimes. There is any other massive option that unradio all GUICtrlSetState($cCheck_1, $GUI_UNCHECKED) in function ?
Moderators Melba23 Posted September 26, 2016 Moderators Posted September 26, 2016 (edited) Marecz, You need to clear the radio after creating the ListViewItem - at present, you are leaving it checked and as the code fires on the first tab radios before even examining the second. M23 Edit: I see you found that yourself - bravo! Edited September 26, 2016 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
pluto41 Posted September 26, 2016 Posted September 26, 2016 (edited) Func ChoosenRadio() If GUICtrlRead($idManAuth) = 1 Then $idCaption = ControlGetText("","",$idManAuth) GUICtrlCreateListViewItem($idCaption, $idTSList) GUICtrlSetState ( $idManAuth, $GUI_UNCHECKED ) ; ADDED You have found the solution yourself like Melba said. You could write a Func / Loop to uncheck all radio buttons or just add the GuiCtrlSetState ( see my code, last line.) after every ( if ) / ( elseIf () ) Edited September 26, 2016 by pluto41
Marecz Posted September 26, 2016 Author Posted September 26, 2016 Ye i already made it Thanks all of you guy and like always Moderators "like a boss" from AutoIt forum
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