Jump to content

GUICtrlCreateTreeView event?


jokke
 Share

Recommended Posts

Hiya,

Iwe got a treeview and its so damn big i cant use the item-node itself to trigger treeview event.

15 sub categories, where each have about 150+ nodes, how would i be able to trigger a event when clicking on a node?

All help appreciated =)

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

Hiya,

Iwe got a treeview and its so damn big i cant use the item-node itself to trigger treeview event.

15 sub categories, where each have about 150+ nodes, how would i be able to trigger a event when clicking on a node?

All help appreciated =)

You might want to post how you are trying to do it now. I have a treeview that dynamically creates items and I've seen it go well over a thousand items with no problems when I click the item. Maybe I'm just sneaking in under a limitation of some kind.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Not my actual script cause that script is way to big to post, but a snippet with the all the basic.

#include <guiconstants.au3>

Dim $item[451], $i = 0

GUICreate("Testing treeview",400,400)
$tree = GUICtrlCreateTreeView(5,5,190,390)
$group1 = GUICtrlCreateTreeViewItem("Sub 1",$tree)
For $x = 0 to 150
    $item[$x] = GUICtrlCreateTreeViewItem("Item "&$x,$group1)
Next
$group2 = GUICtrlCreateTreeViewItem("Sub 2",$tree)
For $x = 151 to 300
    $item[$x] = GUICtrlCreateTreeViewItem("Item "&$x,$group2)
Next
$group3 = GUICtrlCreateTreeViewItem("Sub 3",$tree)
For $x = 301 to 450
    $item[$x] = GUICtrlCreateTreeViewItem("Item "&$x,$group3)
Next

$label = GUICtrlCreateLabel("....",200,5,100,22)
GUISetState()


While 1
    
    $i += 1
    If $i = 450 Then $i = 0
    
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $item[$i] ;hehe not workinbg to well :P
            $item = GUICtrlRead($tree)
            GUICtrlSetData($label,GUICtrlRead($item, 1))
    EndSwitch
WEnd
UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

Not my actual script cause that script is way to big to post, but a snippet with the all the basic.

#include <guiconstants.au3>

Dim $item[451], $i = 0

GUICreate("Testing treeview",400,400)
$tree = GUICtrlCreateTreeView(5,5,190,390)
$group1 = GUICtrlCreateTreeViewItem("Sub 1",$tree)
For $x = 0 to 150
    $item[$x] = GUICtrlCreateTreeViewItem("Item "&$x,$group1)
Next
$group2 = GUICtrlCreateTreeViewItem("Sub 2",$tree)
For $x = 151 to 300
    $item[$x] = GUICtrlCreateTreeViewItem("Item "&$x,$group2)
Next
$group3 = GUICtrlCreateTreeViewItem("Sub 3",$tree)
For $x = 301 to 450
    $item[$x] = GUICtrlCreateTreeViewItem("Item "&$x,$group3)
Next

$label = GUICtrlCreateLabel("....",200,5,100,22)
GUISetState()
While 1
    
    $i += 1
    If $i = 450 Then $i = 0
    
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $item[$i] ;hehe not workinbg to well :P
            $item = GUICtrlRead($tree)
            GUICtrlSetData($label,GUICtrlRead($item, 1))
    EndSwitch
WEnd

hehe not workinbg to well :)

Guess not!!

This MIGHT do it. I'm just winging it here,

While 1
   $i += 1
   If $i >= 450 Then $I = 1
   $Msg = GUIGetMsg()
   Switch $Msg
      Case $GUI_EVENT_CLOSE
         Exit
      Case $Tree
         $item = GUICtrlRead($Msg)
         GUICtrlSetData($label, GUICtrlRead($msg))
   EndSwitch
Wend

A much better solution would be to use the functions in GUITreeView.au3

Follow the link in my sig for UDF's web-help and go to GUITreeView Management

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

I came upp with a way of cheating it :)

#include <guiconstants.au3>

Dim $item[451], $i = 0

GUICreate("Testing treeview",400,400)
$tree = GUICtrlCreateTreeView(5,5,190,390)
$group1 = GUICtrlCreateTreeViewItem("Sub 1",$tree)
For $x = 0 to 9
    $item[$x] = GUICtrlCreateTreeViewItem("Item "&$x,$group1)
Next
$group2 = GUICtrlCreateTreeViewItem("Sub 2",$tree)
For $x = 151 to 300
    $item[$x] = GUICtrlCreateTreeViewItem("Item "&$x,$group2)
Next
$group3 = GUICtrlCreateTreeViewItem("Sub 3",$tree)
For $x = 301 to 450
    $item[$x] = GUICtrlCreateTreeViewItem("Item "&$x,$group3)
Next

$label = GUICtrlCreateLabel("....",200,5,100,22)
GUISetState()

$old = ""
While 1
    
    $current = GUICtrlRead(GUICtrlRead($tree),1)
    If $current <> $old Then
        GUICtrlSetData($label,$current)
        $old = $current
    EndIf

    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
    
WEndoÝ÷ Ù8b²+j·ë¢gåk    ^²Ë"Ç¢·¥©l¢Ç­¦Þ'ò¢ëç-jËåÊ)ízw^vÚ,'¡×¬aj·m¡Ú+axn­¶¬¶.')ÞyÛhv(ëax%G­+ºÚ"µÍIÌÍØÝ[HÕRPÝXY
ÕRPÝXY
    ÌÍÝYJKJBRY   ÌÍØÝ[   ÉÝÈ  ÌÍÛÛ[BRY    ÌÍØÝ[][ÝÔÝXI][ÝÈÜ  ÌÍØÝ[][ÝÔÝXI][ÝÈÜ  ÌÍØÝ[][ÝÔÝXÉ][ÝÈ[BBBBQ[ÙBBBQÕRPÝÙ]]J   ÌÍÛX[    ÌÍØÝ[
BBBIÌÍÛÛH   ÌÍØÝ[BQ[YQ[Y
Edited by jokke
UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

Whatever works but I would still take a serious look at the GUITreeView functions in the udf. IIR there is a function that will return the parent node. I just haven't looked in a while.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...