How do I delete a Treeview child?
#1
Posted 23 August 2008 - 08:55 PM
s!mpL3 LAN MessengerCurrent version 2.9.7.7 [15/02/2013]Download HeresimpL3
#2
Posted 24 August 2008 - 08:52 AM
Edited by AoRaToS, 24 August 2008 - 09:05 AM.
s!mpL3 LAN MessengerCurrent version 2.9.7.7 [15/02/2013]Download HeresimpL3
#3
Posted 24 August 2008 - 09:36 AM
It's even a nice little sample for you to try out in there. So how f** hard can it be? People spent real time to provide you with a state of the art help file but do you bother to look in it? That is showing disrespect, shame on you!
Now, if the sample does not work, that's another story. but then you should let us know and post some sample code demonstrating your problem.
PS: I know some of the TreeView samples don't work on w2k without some simple tweaking.
#4
Posted 24 August 2008 - 09:47 AM
s!mpL3 LAN MessengerCurrent version 2.9.7.7 [15/02/2013]Download HeresimpL3
#5
Posted 24 August 2008 - 09:58 AM
You want to remove the item but not the children without moving them?
#6
Posted 24 August 2008 - 10:00 AM
Line 12 as I pointed you to in my first post.
#7
Posted 24 August 2008 - 10:01 AM
#8
Posted 24 August 2008 - 10:08 AM
ITEM
--->child1
--->child2
How can I delete child 2?
s!mpL3 LAN MessengerCurrent version 2.9.7.7 [15/02/2013]Download HeresimpL3
#9
Posted 24 August 2008 - 10:16 AM
$child = _GUICtrlTreeView_AddChild($hTreeView, $hItem, StringFormat("[%02d] New Child", $y), $iImage, $iImage) Next Next _GUICtrlTreeView_EndUpdate($hTreeView)oÝ÷ Ù«¢+Ø$$%5Í ½à ÐÄØÀ°ÅÕ½Ðí%¹½Éµ Ñ¥½¸ÅÕ½Ðì°ÅÕ½Ðí±ÑÅÕ½Ðì µÀìMÑÉ¥¹½Éµ Ð ÅÕ½ÐílÀÉt9Ü%Ñ´ÅÕ½Ðì°ÀÌØíà´Ä¤ µÀìÅÕ½Ðì´´ØÈìÅÕ½Ðì µÀìMÑÉ¥¹½Éµ Ð ÅÕ½ÐílÀÉt9Ü ¡¥±ÅÕ½Ðì°ÀÌØíä´Ä¤¤($$%}U% ÑɱQÉY¥Ý}±Ñ ÀÌØí¡QÉY¥Ü°ÀÌØí¡¥±
#10
Posted 24 August 2008 - 10:18 AM
I want to remove one single Child from an item
ITEM
--->child1
--->child2
How can I delete child 2?
Look at:
_GUICtrlTreeView_GetFirstItem
_GUICtrlTreeView_GetFirstChild
_GUICtrlTreeView_GetNextSibling
_GUICtrlTreeView_Delete
#11
Posted 24 August 2008 - 10:20 AM
So here you go. Your answer. Plucked it ALL from in the example in the help file that Uten mentioned. Amazing aint it?
#include <GUIConstants.au3> #Include <GuiTreeView.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("AForm1", 183, 175, 193, 115) $hTreeView = GUICtrlCreateTreeView(8, 8, 169, 129) $parent_1 = _GUICtrlTreeView_Add($hTreeView, 0, "Parent 1") $parent_2 = _GUICtrlTreeView_Add($hTreeView, 0, "Parent 2") $child_1_1 = _GUICtrlTreeView_AddChild($hTreeView, $parent_1, "Child 1") $child_1_2 = _GUICtrlTreeView_AddChild($hTreeView, $parent_1, "Child 2") $child_1_3 = _GUICtrlTreeView_AddChild($hTreeView, $parent_1, "Child 3") $child_2_1 = _GUICtrlTreeView_AddChild($hTreeView, $parent_2, "Child 4") $child_2_2 = _GUICtrlTreeView_AddChild($hTreeView, $parent_2, "Child 4") $child_2_2_1 = _GUICtrlTreeView_AddChild($hTreeView, $child_2_2, "Child 5") $Button1 = GUICtrlCreateButton("Exit", 16, 144, 75, 25, 0) $Button2 = GUICtrlCreateButton("Delete Child 3", 96, 144, 75, 25, 0) _GUICtrlTreeView_Expand($hTreeView) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Exit Case $Button2 $ret = _GUICtrlTreeView_Delete ($hTreeView, $child_1_3) EndSwitch WEnd
#12
Posted 24 August 2008 - 10:20 AM
s!mpL3 LAN MessengerCurrent version 2.9.7.7 [15/02/2013]Download HeresimpL3
#13
Posted 24 August 2008 - 10:22 AM
Cheers,
Brett
#14
Posted 24 August 2008 - 10:23 AM
Adding new information proving that you did not look to hard in the help file does not help much.I don't think that'll work, even if it does, that's adding a child and deleting in, I want to search for achild ad delete it, how hard can it be?nothing seems to work
And *ROLF* Your new question is already answered above
I'm sorry I'm just in that mood this morning..
#15
Posted 24 August 2008 - 10:25 AM
#include <GuiConstantsEx.au3> #include <GuiTreeView.au3> #include <GuiImageList.au3> #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <TreeViewConstants.au3> #include <StaticConstants.au3> #include <String.au3> Opt("GUIOnEventMode",1) Opt("TrayMenuMode",1) TraySetIcon("Shell32.dll",16) Global $LANTree, $Online, $NETVIEW Global $PrivateIP = @IPAddress1 Global $serversocket = 0 Global $signonclientip, $contactcast, $changeaddress, $contactdata MainGUI() Contacts() ;Messenger() Func Messenger() UDPStartup() $chatserver = UDPBind($PrivateIP, 65333) TrayTip("", "LAN Talk: " & @ComputerName & "(" & $PrivateIP & ")", 5) Sleep(3000) If @error <> 0 Then TrayTip("", @error, 10) Call ("OnExit") Else While 1 $data = UDPRecv($chatserver, 5000) If $data <> "" Then MsgBox(0,"a",$data) EndIf sleep(100) WEnd EndIf EndFunc Func Contacts() ;start contact server UDPStartup() $contactserver = UDPBind($PrivateIP, 65335) TrayTip("", "LAN Talk: " & @ComputerName & "(" & $PrivateIP & ")", 5) Sleep(500) ;create multicast address $splitaddress = StringSplit($PrivateIP, ".") $changeaddress = $splitaddress[1] & "." & $splitaddress[2] & "." & $splitaddress[3] & "." & "255" ;send packet $contactcast = UDPOpen($changeaddress, 65335) UDPSend($contactcast, "SIGN-ON" & $PrivateIP & "|" & @ComputerName) UDPCloseSocket($contactcast) While 1 $contactdata = UDPRecv($contactserver, 50) If $contactdata <> "" Then If StringLeft($contactdata,7) = "SIGN-ON" Then $signonclientipname = StringMid($contactdata, 8) $signonclient = StringSplit($signonclientipname, "|") $signonclientip = $signonclient[1] $signonclientname = $signonclient[2] $signonclientid = $signonclientname & " - " & $signonclientip If $signonclientip <> $PrivateIP Then $signonsearchclient = _GUICtrlTreeView_FindItem($NETVIEW,$signonclientid) If $signonsearchclient = 0 Then GUICtrlCreateTreeViewItem($signonclientid, $NETVIEW) GUICtrlSetState($NETVIEW, BitOR($GUI_EXPAND, $GUI_DEFBUTTON)) ;Call("Clientmsg") EndIf EndIf EndIf If StringLeft($contactdata,8) = "SIGN-OFF" Then $signoffclientipname = StringMid($contactdata, 9) $signoffclient = StringSplit($signoffclientipname, "|") $signoffclientip = $signoffclient[1] $signoffclientname = $signoffclient[2] $signoffclientid = $signoffclientname & " - " & $signoffclientip MsgBox(0,".",$signoffclientid) $signoffsearchclient = _GUICtrlTreeView_FindItem($NETVIEW,$signoffclientid) If $signoffsearchclient Then MsgBox(0,".",$signoffsearchclient) _GUICtrlTreeView_Delete($NETVIEW,$signoffsearchclient) EndIf EndIf EndIf Sleep(100) WEnd EndFunc Func MainGUI() GUICreate("LAN Talk", 204, 404) $LANTree = GUICtrlCreateTreeView(2, 2, 200, 400, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) $NETVIEW = GUICtrlCreateTreeViewItem("Local Network", $LANTree) GUISetOnEvent($GUI_EVENT_CLOSE,"OnExit") GUICtrlSetColor(-1, 0x0000C0) GUICtrlSetState($NETVIEW, BitOR($GUI_EXPAND, $GUI_DEFBUTTON)) GUISetState() EndFunc Func OnExit() $sign_off = UDPOpen($changeaddress, 65335) UDPSend($sign_off, "SIGN-OFF" & $PrivateIP & "|" & @ComputerName) UDPCloseSocket($sign_off) GUIDelete($LANTree) Exit EndFunc While 1 Sleep(100) WEnd
Check this out:
_GUICtrlTreeView_Delete($NETVIEW,$signoffsearchclient)
I want to delete the one that sends SIGN-OFF...I've tried allot of things :/
s!mpL3 LAN MessengerCurrent version 2.9.7.7 [15/02/2013]Download HeresimpL3
#16
Posted 24 August 2008 - 11:39 AM
As I'm int that mode and your utterly, sorry to say this, stupid way of starting, bumping and replies this topic there is no way I will provide a working sample.
Post a modified helpfile sample that proves you have tried it. Helpfile sample + the code I posted above should give plenty of clues as that is how I did try it..
You may have to change the *AddIcon stuff to
Local $offset=0 _GUIImageList_AddIcon($hImage, "shell32.dll", $offset + 10) _GUIImageList_AddIcon($hImage, "shell32.dll", $offset + 31) _GUIImageList_AddIcon($hImage, "shell32.dll", $offset + 65) _GUIImageList_AddIcon($hImage, "shell32.dll", $offset + 68) _GUIImageList_AddIcon($hImage, "shell32.dll", $offset + 37) _GUIImageList_AddIcon($hImage, "shell32.dll", $offset + 46)
#17
Posted 25 August 2008 - 03:00 PM
s!mpL3 LAN MessengerCurrent version 2.9.7.7 [15/02/2013]Download HeresimpL3
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users





