Jump to content

TreeView with Checkbox


atzoref
 Share

Recommended Posts

  • Moderators

atzoref,

Please post some code that runs - posting just a few snippets means I have to write a lot of additional code just to see what is going on. Paste everything in the script you are using. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

  • Moderators

aztoref,

If the script is that big I am probably not going to be able to debug it as it will take too long to work out what is going on, but you can try if you want to. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

Finally it works with your script (it was my false) - Thanks :)

2 questions:

1) how can I mark a parent checkbox in gray (with "v") if not all its childs are checked?

2) I create an array for this thing (for example [20][2]), and I have now for examplejust 8 items.

Why the rest of the array (from [8][0] to [20][0]) is filling by the first item's handle?

Link to comment
Share on other sites

  • 2 weeks later...

I think I understand why number 2 happens (tell me if I right)

All the rest cells of the array are automaticlly filled with zeros

so if I do a function of treeview, it get the $Iitem as "0".

So it relate to the main Treeview Item Handle.

Right?

If yes, How can I put fake parameters to all array cells if it is 2D array for example: [20][2] ?

Edited by atzoref
Link to comment
Share on other sites

  • 1 month later...

If you are interested here you go:

Func _TreeViewRemoveCheckbox($hWnd, $hItem)
$hItem = GUICtrlGetHandle($hItem)
Local $Struct = DllStructCreate('uint;uint;uint;uint;ptr;int;int;int;int;uint;int')
DllStructSetData($Struct, 1, 0x8)
DllStructSetData($Struct, 2, $hItem)
DllStructSetData($Struct, 3, 0)
DllStructSetData($Struct, 4, 0xF000)
GUICtrlSendMsg($hWnd, 0x110D, 0, DllStructGetPtr($Struct))
EndFunc

Hi D4RKON3,

It's really what I'm looking for but still the problem of having the box checked and hided at the same time. Also I have notice that if I use both your function _TreeViewRemoveCheckbox() to disable the checkbox and GUICtrlSetState(-1, $GUI_CHECKED) to check the box, they are overwritten each other which means only one sate can be set either disabling or checking the box.

Also, for the function that you have created _TreeViewRemoveCheckbox() could you please refer me from where did you get it and which parameter of the structure "$Struct" will disable the checkbox

Thanks,

Anouar

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...