Madza91 Posted October 25, 2007 Share Posted October 25, 2007 How to make search for item in treeview? expandcollapse popup#include <GuiConstants.au3> #include <GuiTreeView.au3> Opt('MustDeclareVars', 1) $Debug_TV = False; Check ClassName being passed to functions, set to True and use a handle to another control to see it work Global $hTreeView Example_Internal() Example_External() Func Example_Internal() Local $hItem[10], $hItemFound Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES) GUICreate("(Internal) TreeView Find Item", 400, 300) $hTreeView = GUICtrlCreateTreeView(2, 2, 396, 268, $iStyle, $WS_EX_CLIENTEDGE) GUISetState() GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") _GUICtrlTreeView_BeginUpdate ($hTreeView) For $x = 0 To 3 $hItem[$x] = GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Item", $x), $hTreeView) For $y = 0 To 2 GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Item", $y), $hItem[$x]) Next Next $hItem[4] = GUICtrlCreateTreeViewItem(StringFormat("Looking for me?", $x), $hTreeView) For $x = 5 To 9 $hItem[$x] = GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Item", $x), $hTreeView) For $y = 0 To 2 GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Item", $y), $hItem[$x]) Next Next _GUICtrlTreeView_EndUpdate ($hTreeView) $hItemFound = _GUICtrlTreeView_FindItem($hTreeView, "Looking for me?") If $hItemFound Then MsgBox(4160, "Information", "Item Found:" & @LF & "Handle: " & $hItemFound & @LF & "Text: " & _GUICtrlTreeView_GetText($hTreeView, $hItemFound)) Else MsgBox(4160, "Information", "Not Found") EndIf ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example_Internal Func Example_External() Local $GUI, $hItem[10], $hItemFound Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES) $GUI = GUICreate("(External) TreeView Find Item", 400, 300) $hTreeView = _GUICtrlTreeView_Create ($GUI, 2, 2, 396, 268, $iStyle, $WS_EX_CLIENTEDGE) GUISetState() GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") _GUICtrlTreeView_BeginUpdate ($hTreeView) For $x = 0 To 3 $hItem[$x] = _GUICtrlTreeView_Add ($hTreeView, 0, StringFormat("[%02d] New Item", $x)) For $y = 0 To 2 _GUICtrlTreeView_AddChild ($hTreeView, $hItem[$x], StringFormat("[%02d] New Item", $y)) Next Next $hItem[4] = _GUICtrlTreeView_Add ($hTreeView, 0, "Looking for me?") For $x = 5 To 9 $hItem[$x] = _GUICtrlTreeView_Add ($hTreeView, 0, StringFormat("[%02d] New Item", $x)) For $y = 0 To 2 _GUICtrlTreeView_AddChild ($hTreeView, $hItem[$x], StringFormat("[%02d] New Item", $y)) Next Next _GUICtrlTreeView_EndUpdate ($hTreeView) $hItemFound = _GUICtrlTreeView_FindItem($hTreeView, "Looking for me?") If $hItemFound Then MsgBox(4160, "Information", "Item Found:" & @LF & "Handle: " & $hItemFound & @LF & "Text: " & _GUICtrlTreeView_GetText($hTreeView, $hItemFound)) Else MsgBox(4160, "Information", "Not Found") EndIf ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example_External Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndTreeview $hWndTreeview = $hTreeView If Not IsHWnd($hTreeView) Then $hWndTreeview = GUICtrlGetHandle($hTreeView) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndTreeview Switch $iCode Case $NM_CLICK ; The user has clicked the left mouse button within the control _DebugPrint("$NM_CLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ;~ Return 1; nonzero to not allow the default processing Return 0; zero to allow the default processing Case $NM_DBLCLK ; The user has double-clicked the left mouse button within the control _DebugPrint("$NM_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ;~ Return 1; nonzero to not allow the default processing Return 0; zero to allow the default processing Case $NM_RCLICK ; The user has clicked the right mouse button within the control _DebugPrint("$NM_RCLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ;~ Return 1; nonzero to not allow the default processing Return 0; zero to allow the default processing Case $NM_RDBLCLK ; The user has clicked the right mouse button within the control _DebugPrint("$NM_RDBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ;~ Return 1; nonzero to not allow the default processing Return 0; zero to allow the default processing Case $NM_KILLFOCUS; control has lost the input focus _DebugPrint("$NM_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; No return value Case $NM_RETURN; control has the input focus and that the user has pressed the key _DebugPrint("$NM_RETURN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ;~ Return 1; nonzero to not allow the default processing Return 0; zero to allow the default processing ;~ Case $NM_SETCURSOR; control is setting the cursor in response to a WM_SETCURSOR message ;~ Local $tinfo = DllStructCreate($tagNMMOUSE, $ilParam) ;~ $hWndFrom = HWnd(DllStructGetData($tinfo, "hWndFrom")) ;~ $iIDFrom = DllStructGetData($tinfo, "IDFrom") ;~ $iCode = DllStructGetData($tinfo, "Code") ;~ _DebugPrint("$NM_SETCURSOR" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ ;~ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ ;~ "-->Code:" & @TAB & $iCode & @LF & _ ;~ "-->ItemSpec:" & @TAB & DllStructGetData($tinfo, "ItemSpec") & @LF & _ ;~ "-->ItemData:" & @TAB & DllStructGetData($tinfo, "ItemData") & @LF & _ ;~ "-->X:" & @TAB & DllStructGetData($tinfo, "X") & @LF & _ ;~ "-->Y:" & @TAB & DllStructGetData($tinfo, "Y") & @LF & _ ;~ "-->HitInfo:" & @TAB & DllStructGetData($tinfo, "HitInfo")) ;~ Return 0; to enable the control to set the cursor ;~ Return 1; nonzero to prevent the control from setting the cursor Case $NM_SETFOCUS; control has received the input focus _DebugPrint("$NM_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; No return value Case $TVN_BEGINDRAG, $TVN_BEGINDRAGW _DebugPrint ("$TVN_BEGINDRAG") Case $TVN_BEGINLABELEDIT, $TVN_BEGINLABELEDITW _DebugPrint ("$TVN_BEGINLABELEDIT") Case $TVN_BEGINRDRAG, $TVN_BEGINRDRAGW _DebugPrint ("$TVN_BEGINRDRAG") Case $TVN_DELETEITEM, $TVN_DELETEITEMW _DebugPrint ("$TVN_DELETEITEM") Case $TVN_ENDLABELEDIT, $TVN_ENDLABELEDITW _DebugPrint ("$TVN_ENDLABELEDIT") Case $TVN_GETDISPINFO, $TVN_GETDISPINFOW _DebugPrint ("$TVN_GETDISPINFO") Case $TVN_GETINFOTIP, $TVN_GETINFOTIPW _DebugPrint ("$TVN_GETINFOTIP") Case $TVN_ITEMEXPANDED, $TVN_ITEMEXPANDEDW _DebugPrint ("$TVN_ITEMEXPANDED") Case $TVN_ITEMEXPANDING, $TVN_ITEMEXPANDINGW _DebugPrint ("$TVN_ITEMEXPANDING") Case $TVN_KEYDOWN _DebugPrint ("$TVN_KEYDOWN") Case $TVN_SELCHANGED, $TVN_SELCHANGEDW _DebugPrint ("$TVN_SELCHANGED") Case $TVN_SELCHANGING, $TVN_SELCHANGINGW _DebugPrint ("$TVN_SELCHANGING") Case $TVN_SETDISPINFO, $TVN_SETDISPINFOW _DebugPrint ("$TVN_SETDISPINFO") Case $TVN_SINGLEEXPAND _DebugPrint ("$TVN_SINGLEEXPAND") EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func _DebugPrint($s_text, $line = @ScriptLineNumber) ConsoleWrite( _ "!===========================================================" & @LF & _ "+======================================================" & @LF & _ "-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _ "+======================================================" & @LF) EndFunc ;==>_DebugPrint I founded this in autoit examples but not works,why? [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
GaryFrost Posted October 25, 2007 Share Posted October 25, 2007 expandcollapse popup#include <GuiConstants.au3> #include <GuiTreeView.au3> Opt('MustDeclareVars', 1) $Debug_TV = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work Example_Internal() Example_External() Func Example_Internal() Local $hItem[10], $hItemFound, $hTreeView Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES) GUICreate("(Internal) TreeView Find Item", 400, 300) $hTreeView = GUICtrlCreateTreeView(2, 2, 396, 268, $iStyle, $WS_EX_CLIENTEDGE) GUISetState() _GUICtrlTreeView_BeginUpdate ($hTreeView) For $x = 0 To 3 $hItem[$x] = GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Item", $x), $hTreeView) For $y = 0 To 2 GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Item", $y), $hItem[$x]) Next Next $hItem[4] = GUICtrlCreateTreeViewItem(StringFormat("Looking for me?", $x), $hTreeView) For $x = 5 To 9 $hItem[$x] = GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Item", $x), $hTreeView) For $y = 0 To 2 GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Item", $y), $hItem[$x]) Next Next _GUICtrlTreeView_EndUpdate ($hTreeView) $hItemFound = _GUICtrlTreeView_FindItem($hTreeView, "Looking for me?") If $hItemFound Then MsgBox(4160, "Information", "Item Found:" & @LF & "Handle: " & $hItemFound & @LF & "Text: " & _GUICtrlTreeView_GetText($hTreeView, $hItemFound)) Else MsgBox(4160, "Information", "Not Found") EndIf ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example_Internal Func Example_External() Local $GUI, $hItem[10], $hItemFound, $hTreeView Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES) $GUI = GUICreate("(External) TreeView Find Item", 400, 300) $hTreeView = _GUICtrlTreeView_Create ($GUI, 2, 2, 396, 268, $iStyle, $WS_EX_CLIENTEDGE) GUISetState() _GUICtrlTreeView_BeginUpdate ($hTreeView) For $x = 0 To 3 $hItem[$x] = _GUICtrlTreeView_Add ($hTreeView, 0, StringFormat("[%02d] New Item", $x)) For $y = 0 To 2 _GUICtrlTreeView_AddChild ($hTreeView, $hItem[$x], StringFormat("[%02d] New Item", $y)) Next Next $hItem[4] = _GUICtrlTreeView_Add ($hTreeView, 0, "Looking for me?") For $x = 5 To 9 $hItem[$x] = _GUICtrlTreeView_Add ($hTreeView, 0, StringFormat("[%02d] New Item", $x)) For $y = 0 To 2 _GUICtrlTreeView_AddChild ($hTreeView, $hItem[$x], StringFormat("[%02d] New Item", $y)) Next Next _GUICtrlTreeView_EndUpdate ($hTreeView) $hItemFound = _GUICtrlTreeView_FindItem($hTreeView, "Looking for me?") If $hItemFound Then MsgBox(4160, "Information", "Item Found:" & @LF & "Handle: " & $hItemFound & @LF & "Text: " & _GUICtrlTreeView_GetText($hTreeView, $hItemFound)) Else MsgBox(4160, "Information", "Not Found") EndIf ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example_External Works for me, it finds the item and returns the handle to the item. SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
Madza91 Posted October 25, 2007 Author Share Posted October 25, 2007 C:\Documents and Settings\Nemanja\Desktop\New AutoIt v3 Script.au3(6,126) : WARNING: $Debug_TV possibly not declared/created yet $Debug_TV = False; Check ClassName being passed to functions, set to True and use a handle to another control to see it work ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Nemanja\Desktop\New AutoIt v3 Script.au3(14,42) : WARNING: $TVS_EDITLABELS: possibly used before declaration. Local $iStyle = BitOR($TVS_EDITLABELS, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Nemanja\Desktop\New AutoIt v3 Script.au3(14,42) : ERROR: $TVS_EDITLABELS: undeclared global variable. Local $iStyle = BitOR($TVS_EDITLABELS, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Nemanja\Desktop\New AutoIt v3 Script.au3(21,45) : ERROR: _GUICtrlTreeView_BeginUpdate(): undefined function. _GUICtrlTreeView_BeginUpdate ($hTreeView) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Nemanja\Desktop\New AutoIt v3 Script.au3(35,43) : ERROR: _GUICtrlTreeView_EndUpdate(): undefined function. _GUICtrlTreeView_EndUpdate ($hTreeView) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Nemanja\Desktop\New AutoIt v3 Script.au3(37,74) : ERROR: _GUICtrlTreeView_FindItem(): undefined function. $hItemFound = _GUICtrlTreeView_FindItem($hTreeView, "Looking for me?") ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Nemanja\Desktop\New AutoIt v3 Script.au3(39,151) : ERROR: _GUICtrlTreeView_GetText(): undefined function. MsgBox(4160, "Information", "Item Found:" & @LF & "Handle: " & $hItemFound & @LF & "Text: " & _GUICtrlTreeView_GetText($hTreeView, $hItemFound) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Nemanja\Desktop\New AutoIt v3 Script.au3(57,91) : ERROR: _GUICtrlTreeView_Create(): undefined function. $hTreeView = _GUICtrlTreeView_Create ($GUI, 2, 2, 396, 268, $iStyle, $WS_EX_CLIENTEDGE) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Nemanja\Desktop\New AutoIt v3 Script.au3(62,94) : ERROR: _GUICtrlTreeView_Add(): undefined function. $hItem[$x] = _GUICtrlTreeView_Add ($hTreeView, 0, StringFormat("[%02d] New Item", $x)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Nemanja\Desktop\New AutoIt v3 Script.au3(64,99) : ERROR: _GUICtrlTreeView_AddChild(): undefined function. _GUICtrlTreeView_AddChild ($hTreeView, $hItem[$x], StringFormat("[%02d] New Item", $y)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Nemanja\Desktop\New AutoIt v3 Script.au3 - 8 error(s), 2 warning(s) Why not work for me? :S [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
Zedna Posted October 25, 2007 Share Posted October 25, 2007 Why not work for me? :SAre you running it under latest beta 3.2.9.4 which is needed for this? Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
Madza91 Posted October 25, 2007 Author Share Posted October 25, 2007 (edited) Yes, i have 3.2.9.4beta :| ...but i want to make search for treeview items...to type in edit and on button click to bee selected item with name who is typed in edit :S (Sorry for bad english) Edited October 25, 2007 by n3nE [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
Zedna Posted October 25, 2007 Share Posted October 25, 2007 (edited) Example_Internal() - works OK on my WIN98 Example_External() - doesn't work on my WIN98 -> treeview items are created but all have empty text (no error message) Edited October 25, 2007 by Zedna Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
GaryFrost Posted October 25, 2007 Share Posted October 25, 2007 Just because you have the beta doesn't mean your running it. SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
Madza91 Posted October 25, 2007 Author Share Posted October 25, 2007 I am opened autoit beta and browse for _GUICtrlTreeView_FindItem.au3 file and opened...works but that is not what I want to make :/ [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
GaryFrost Posted October 25, 2007 Share Posted October 25, 2007 (edited) Example_Internal() - works OK on my WIN98Example_External() - doesn't work on my WIN98 -> treeview items are created but all have empty text (no error message)I'm going to take a wild guess, that you never used the create in the A3L libraries, because that is where that is from.Can't check Win98, but checked on Win2k, works fine. Edited October 25, 2007 by GaryFrost SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
Zedna Posted October 25, 2007 Share Posted October 25, 2007 I'm going to take a wild guess, that you never used the create in the A3L libraries, because that is where that is from.Can't check Win98, but checked on Win2k, works fine.You are right I never used _TreeView_Create() and _TreeView_Add() from A3L.I intensively used many treeview functions from A3L to manipulate external treeviews but not create themSo this WIN98 bug probably comes from A3L.I think it's somewhere inside _TreeView_AddNode() in A3L. Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
GaryFrost Posted October 26, 2007 Share Posted October 26, 2007 You are right I never used _TreeView_Create() and _TreeView_Add() from A3L.I intensively used many treeview functions from A3L to manipulate external treeviews but not create themSo this WIN98 bug probably comes from A3L.I think it's somewhere inside _TreeView_AddNode() in A3L.it's called _GUICtrlTreeView_AddItem now, like I said don't have win98 to debug the code on, might try putting some debug code in it to see what it's doing.It should work the same, but could be a bug from the A3L that wasn't found. SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
Madza91 Posted October 26, 2007 Author Share Posted October 26, 2007 ok guys, and where is answer on my question [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
Zedna Posted October 26, 2007 Share Posted October 26, 2007 ok guys, and where is answer on my question Gary gave you solution already. You are only blind @Gary: I will try to do some research probably tomorrow Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
Madza91 Posted October 26, 2007 Author Share Posted October 26, 2007 oh yes, Gary gave to me solution already but I not understand how to add in this script?!#include <GUIConstants.au3>GUICreate("GUI with more treeviews",340,200,-1,-1,BitOr($WS_MINIMIZEBOX,$WS_MAXIMIZEBOX,$WS_GROUP,$WS_CAPTION,$WS_POPUP,$WS_SYSMENU))$maintree = GUICtrlCreateTreeView (10,10,120,150)$aboutitem = GUICtrlCreateTreeViewItem ("About",$maintree)$generalitem = GUICtrlCreateTreeViewItem ("General",$maintree)$toolsitem = GUICtrlCreateTreeViewItem ("Tools",$maintree)$effectitem = GUICtrlCreateTreeViewItem ("Effects",$generalitem)$styleitem = GUICtrlCreateTreeViewItem ("Styles",$generalitem)$cmditem = GUICtrlCreateTreeViewItem ("Commandline",$toolsitem)$miscitem = GUICtrlCreateTreeViewItem ("Misc",$toolsitem)$descgroup = GUICtrlCreateGroup ("Description",140,105,180,55)GUICtrlSetState (-1,$GUI_HIDE)$effectsgroup = GUICtrlCreateGroup ("Effects",140,5,180,95)GUICtrlSetState (-1,$GUI_HIDE)$effectstree = GUICtrlCreateTreeView (150,20,160,70,BitOr($TVS_CHECKBOXES,$TVS_DISABLEDRAGDROP),$WS_EX_CLIENTEDGE)GUICtrlSetState (-1,$GUI_HIDE)$cancelbutton = GUICtrlCreateButton ("Cancel",130,170,70,20)GUISetState()While 1 $msg = GUIGetMsg() Select Case $msg = -3 Or $msg = -1 Or $msg = $cancelbutton ExitLoop EndSelectWEndGUIDelete()Exit [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
Zedna Posted October 26, 2007 Share Posted October 26, 2007 (edited) oh yes, Gary gave to me solution already but I not understand how to add in this script?!Then open-up AutoIt helpfile and study little more before doing complicated projects.We did this too some time ago :-) Edited October 26, 2007 by Zedna Resources UDF  ResourcesEx UDF  AutoIt Forum Search Link to comment Share on other sites More sharing options...
Madza91 Posted October 26, 2007 Author Share Posted October 26, 2007 Hehee ......btw tell me command for slecting treeview item pls, to select "General" item on button in this treeview...#include <GUIConstants.au3>GUICreate("GUI with more treeviews",340,200,-1,-1)$maintree = GUICtrlCreateTreeView (10,10,120,150)$aboutitem = GUICtrlCreateTreeViewItem ("About",$maintree)$generalitem = GUICtrlCreateTreeViewItem ("General",$maintree)$toolsitem = GUICtrlCreateTreeViewItem ("Tools",$maintree)$effectitem = GUICtrlCreateTreeViewItem ("Effects",$generalitem)$styleitem = GUICtrlCreateTreeViewItem ("Styles",$generalitem)$cmditem = GUICtrlCreateTreeViewItem ("Commandline",$toolsitem)$miscitem = GUICtrlCreateTreeViewItem ("Misc",$toolsitem)$cancelbutton = GUICtrlCreateButton ("Cancel",130,170,70,20)GUISetState()While 1$msg = GUIGetMsg()SelectCase $msg = -3 Or $msg = -1 Or $msg = $cancelbuttonExitLoopEndSelectWEndGUIDelete()Exit [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
GaryFrost Posted October 26, 2007 Share Posted October 26, 2007 (edited) Gary gave you solution already. You are only blind @Gary: I will try to do some research probably tomorrow @Zedna give this a try and see if it fixes the external: Func _GUICtrlTreeView_Create($hWnd, $iX, $iY, $iWidth = 150, $iHeight = 150, $iStyle = 0x00000037, $iExStyle = 0x00000000) If Not IsHWnd($hWnd) Then _WinAPI_ShowError ("Invalid Window handle for _GUICtrlTreeView_Create 1st parameter") Local $hTree If $iWidth = -1 Then $iWidth = 150 If $iHeight = -1 Then $iHeight = 150 If $iStyle = -1 Then $iStyle = 0x00000037 If $iExStyle = -1 Then $iExStyle = 0x00000000 ; ============================================================================================= ; Might need this for Pre WinXP OS ; ============================================================================================= Local Const $ICC_TREEVIEW_CLASSES = 0x2 Local $stICCE = DllStructCreate('dword;dword') DllStructSetData($stICCE, 1, DllStructGetSize($stICCE)) DllStructSetData($stICCE, 2, $ICC_TREEVIEW_CLASSES) DllCall('comctl32.dll', 'int', 'InitCommonControlsEx', 'ptr', DllStructGetPtr($stICCE)) ; ============================================================================================= $iStyle = BitOR($iStyle, $WS_CHILD, $WS_VISIBLE) $hTree = _WinAPI_CreateWindowEx ($iExStyle, "SysTreeView32", "", $iStyle, $iX, $iY, $iWidth, $iHeight, $hWnd) _WinAPI_SetFont ($hTree, _WinAPI_GetStockObject ($DEFAULT_GUI_FONT)) _GUICtrlTreeView_SetUnicodeFormat($hTree, False) Return $hTree EndFunc ;==>_GUICtrlTreeView_Create if it does then I suspect there will be a problem with most of the create's Edited October 26, 2007 by GaryFrost SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
Madza91 Posted October 29, 2007 Author Share Posted October 29, 2007 I don't understand :/ [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
Zedna Posted October 29, 2007 Share Posted October 29, 2007 I don't understand :/I can help you:AutoIt Helpfile is here: C:\Program Files\AutoIt3\AutoIt.chm Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
Madza91 Posted October 29, 2007 Author Share Posted October 29, 2007 Hey, is possible to make this but without button bug, see this:#include <GUIConstants.au3>GUICreate("GUI with more treeviews",340,200,-1,-1)$maintree = GUICtrlCreateTreeView (10,10,120,150)$aboutitem = GUICtrlCreateTreeViewItem ("About",$maintree)$generalitem = GUICtrlCreateTreeViewItem ("General",$maintree)$toolsitem = GUICtrlCreateTreeViewItem ("Tools",$maintree)$effectitem = GUICtrlCreateTreeViewItem ("Effects",$maintree)$styleitem = GUICtrlCreateTreeViewItem ("Styles",$maintree)$cmditem = GUICtrlCreateTreeViewItem ("Commandline",$maintree)$miscitem = GUICtrlCreateTreeViewItem ("Misc",$maintree)$edit =GUICtrlCreateEdit("", 150, 44, 163, 20,$ES_AUTOHSCROLL)GUICtrlCreateLabel("Type 'about' in edit",150,25,100,17)$cancelbutton = GUICtrlCreateButton ("Cancel",130,170,70,20)GUISetState()While 1$msg = GUIGetMsg()SelectCase $msg = -3 Or $msg = -1 Or $msg = $cancelbuttonExitLoopEndSelect$item = GUICtrlRead($edit)If $item = "About" ThenGUICtrlCreateButton("Bugged Button:)", 150, 70, 81, 25, 0)EndIfWEndGUIDelete()Exit [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) 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