kamel Posted June 27, 2013 Share Posted June 27, 2013 hiii i need help from thes script How READ inside the box? if click [read] buttom then print test -0 , Child19 , etc21 test - 2 , Child1 , etc16 Thank Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 27, 2013 Moderators Share Posted June 27, 2013 kamel,Welcome to the AutoIt forum. Loop through the arrays using _GUICtrlTreeView_GetChecked to find out if the items are checked. M23 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 Link to comment Share on other sites More sharing options...
kamel Posted June 27, 2013 Author Share Posted June 27, 2013 kamel, Welcome to the AutoIt forum. Loop through the arrays using _GUICtrlTreeView_GetChecked to find out if the items are checked. M23 Thanks for the reply Already used the function if _GUICtrlTreeView_GetChecked ($TreeView1,$_child[$I]) = True then but how Print all item like test -0 , Child19 , etc21 test - 2 , Child1 , etc16 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 27, 2013 Moderators Share Posted June 27, 2013 kamel,Post the code you have tried (see here how to do it) and then we can see what to change. M23 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 Link to comment Share on other sites More sharing options...
kamel Posted June 27, 2013 Author Share Posted June 27, 2013 expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiTreeView.au3> #include <GuiImageList.au3> #include <WindowsConstants.au3> Global $name[50] Global $_child[50] Global $_child2[50] Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES) GUICreate("TreeView", 400, 300) $Button1 = GUICtrlCreateButton("1",96, 273, 56, 25, 25) $TreeView1 = GUICtrlCreateTreeView(2, 2, 388, 268, $iStyle, $WS_EX_CLIENTEDGE) GUISetState() for $i = 0 to 5 $name[$I]= GuiCtrlCreateTreeViewItem("name" & $i , $TreeView1) Next For $e = 0 to 5 $_child[$e]= GuiCtrlCreateTreeViewItem("Child" & Random(11,22,1) , $name[$e]) Next For $e = 0 to Random(1,9,1) $_child2[$e]= GuiCtrlCreateTreeViewItem("etc" & Random(11,22,1) , $_child[$e]) Next _GUICtrlTreeView_Expand($TreeView1) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 for $x =0 to _GUICtrlTreeView_GetCount($TreeView1) ; IF _GUICtrlTreeView_GetChildren($TreeView1,$name[$x]) = True then FOR $I =0 TO _GUICtrlTreeView_GetChildCount($TreeView1,$name[$x]) if _GUICtrlTreeView_GetChecked ($TreeView1,$_child2[$I]) = True then $nameX = _GUICtrlTreeView_GetText($TreeView1, $name[$x]) $Cild = _GUICtrlTreeView_GetText($TreeView1, $_child[$I]) $Cild2 = _GUICtrlTreeView_GetText($TreeView1, $_child2[$I]) ConsoleWrite($nameX&"<-"&$Cild&"<-"&$Cild2 & @CRLF) EndIf Next ;EndIf Next EndSwitch WEnd Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted June 27, 2013 Moderators Solution Share Posted June 27, 2013 kamel, I would do something like this: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiTreeView.au3> Global $name[50], $_child[50], $_child2[50] Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES) GUICreate("TreeView", 400, 300) $Button1 = GUICtrlCreateButton("1", 96, 273, 56, 25, 25) $TreeView1 = GUICtrlCreateTreeView(2, 2, 388, 268, $iStyle, $WS_EX_CLIENTEDGE) GUISetState() $cStart = GUICtrlCreateDummy() ; This marks the start of the treeview items <<<<<<<<<<<<<<<< For $i = 0 To 5 $name[$i] = GUICtrlCreateTreeViewItem("name" & $i, $TreeView1) Next For $e = 0 To 5 $_child[$e] = GUICtrlCreateTreeViewItem("Child" & Random(11, 22, 1), $name[$e]) Next For $e = 0 To Random(1, 9, 1) $_child2[$e] = GUICtrlCreateTreeViewItem("etc" & Random(11, 22, 1), $_child[$e]) Next $cEnd = GUICtrlCreateDummy() ; And this the end <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< _GUICtrlTreeView_Expand($TreeView1) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ; Run through all the items For $cItem = $cStart + 1 To $cEnd - 1 ; We need the handle of the item $hHandle = GUICtrlGetHandle($cItem) ; is it checked? If _GUICtrlTreeView_GetChecked($TreeView1, $hHandle) = True Then ; Get the full tree $sTree = _GUICtrlTreeView_GetTree($TreeView1, $hHandle) ; Convert to what we want to see $sOutput = StringReplace($sTree, "|", ", ") ; And print it ConsoleWrite($sOutput & @CRLF) EndIf Next EndSwitch WEnd All clear? Please ask if not. M23 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 Link to comment Share on other sites More sharing options...
kamel Posted June 27, 2013 Author Share Posted June 27, 2013 Melba23Thanks for the reply 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