behdadsoft

do action after TreeViewChild is Selected

15 posts in this topic

Hi.

I created a treeView with some Items and child. and I want add some action for each child but I don't know how can check child is selected.

Please Guide Me.

Thanks.

Share this post


Link to post
Share on other sites



Please check this post

TD :)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I checked it but don't work "GUICtrlRead() and GUICtrlGetState()" for check TreeViewChild.

i wrote an example code, please see and tell me how to check child is selected or no.

$GetFolderList = _FileListToArray()

for $a = 1 to UBound($GetFolderList)-1
   $AddTreeItem = _GUICtrlTreeView_Add()
   $RecordChildFolder = _FileListToArrayRec()
   ;Add Child to Item
   for $b = 1 to UBound($RecordChildFolder)-1
     $AddTreeChild = _GUICtrlTreeView_AddChild()
   Next
Next

Thanks

Edited by behdadsoft

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

This is my code I tested all things but can't do it.

#RequireAdmin
#include <File.au3>
#include <Array.au3>
#include <GUIConstantsEx.au3>
#include <GuiTreeView.au3>
#include <StaticConstants.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiButton.au3>
#include <IE.au3>

;variables
Global $RecordChildFolder = 0
Global $RecordFiles = 0
Global $GetFolderList = 0
Global $GUI = 0
Global $TreeObject = 0
Global $AddTreeItem = 0
Global $AddTreeChild = 0
Global $aStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS)

;Create GUI Form
$GUI = GUICreate("TreeView Add", 320, 400)

;Create TreeView
$TreeObject = GUICtrlCreateTreeView(2, 2, 300, 428,$aStyle, $WS_EX_CLIENTEDGE)

;Get Folder name to Array
$GetFolderList = _FileListToArray(@ScriptDir,"*",$FLTA_FOLDERS)

;Get SubFolders and Add Child to Tree View Item
for $a = 1 to UBound($GetFolderList)-1
   $AddTreeItem = GUICtrlCreateTreeViewItem($GetFolderList[$a],$TreeObject)
   $RecordChildFolder = _FileListToArrayRec($GetFolderList[$a],"*",$FLTAR_FOLDERS,$FLTAR_RECUR ,$FLTAR_SORT ,"" )
   ;Add Child to Item
   for $b = 1 to UBound($RecordChildFolder)-1
      $AddTreeChild = GUICtrlCreateTreeViewItem($RecordChildFolder[$b],$AddTreeItem)
   Next
Next

GUISetState(@SW_SHOW)

;Repeat Show GUI
   While 1
      Switch GUIGetMsg()
         Case $GUI_EVENT_CLOSE
            ExitLoop
      EndSwitch
   WEnd

GUIDelete($GUI)
Edited by behdadsoft

Share this post


Link to post
Share on other sites

behdadsoft,

What you want to do is trivial, but I am concerned by the following lines in your code:

Global $PatchBtn = 0
Global $CrackBtn = 0
Global $KeygenBtn = 0
Would you care to explain why you have these rather suspiciously sounding controls in your script?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

 

What you want to do is trivial, but I am concerned by the following lines in your code:

Global $PatchBtn = 0

Global $CrackBtn = 0

Global $KeygenBtn = 0

 

sorry, this variables are relate to old part of my script and I forgot remove them.I fix them at above code.

Edited by behdadsoft

Share this post


Link to post
Share on other sites

behdadsoft,

Of course you did.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Melba23

there is any solution for my problem?

Share this post


Link to post
Share on other sites

behdadsoft,

I have already told you that the problem is trivial. I suggest you search the forum as I have already answered this same question several times.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
I have already told you that the problem is trivial. I suggest you search the forum as I have already answered this same question several times.

 

yes this problem is trivial and I search in forum but can't find good example relate to my problem for Select TreeViewChild.

Share this post


Link to post
Share on other sites

behdadsoft

 

can't find good example

How about >this one?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
How about this one? 

 

 

yes, I seen.but can't understand it.

if possible please show it in my code.

Thanks.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

behdadsoft,

What do you not understand? If you are not used to Windows message handling, perhaps the GUIRegisterMsg tutorial in the Wiki would be a good read.

M23

Edited by Melba23
Fixed link

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

OK, I read it and if there is any problem I ask.

Thanks.

Share this post


Link to post
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