Jump to content

UDF _TreeViewGetItemState


Zedna
 Share

Recommended Posts

In include file GuiTreeView.au3 is Func _TreeViewGetItemText().

On the same basis I made Func _TreeViewGetItemState()

It's useful especially for treeviews with checkboxes

to get the state of each item (checked/unchecked but also other states)

as shown in my little example of using it.

In my example in function Show I intentionally used

TVM_GETNEXTITEM & TVGN_xxx

to demonstrate common working with treeviews.

Developers could add this UDF to include file GuiTreeView.au3

so all users can use benefit from it.

And this example script also could be added in AutoIt HelpFile

as example for UDF _TreeViewGetItemText() and _TreeViewGetItemState()

_TreeViewGetItemState.au3treeview_item_state_example.au3

Link to comment
Share on other sites

In include file GuiTreeView.au3 is Func _TreeViewGetItemText().

On the same basis I made Func _TreeViewGetItemState()

It's useful especially for treeviews with checkboxes

to get the state of each item (checked/unchecked but also other states)

as shown in my little example of using it.

In my example in function Show I intentionally used

TVM_GETNEXTITEM & TVGN_xxx

to demonstrate common working with treeviews.

Developers could add this UDF to include file GuiTreeView.au3

so all users can use benefit from it.

And this example script also could be added in AutoIt HelpFile

as example for UDF _TreeViewGetItemText() and _TreeViewGetItemState()

_TreeViewGetItemState.au3treeview_item_state_example.au3

Hi Zedna :o

you know that you can get the state by using "GUICtrlRead(itemID)" don't you?

So you can check the state for instance with using:

If BitAnd(GUICtrlRead($item1), $GUI_CHECKED)...

If BitAnd(GUICtrlRead($item1), $GUI_UNCHECKED)...

If BitAnd(GUICtrlRead($item1), $GUI_FOCUS)...; item selected

If BitAnd(GUICtrlRead($item1), $GUI_EXPAND)...; item expanded

If BitAnd(GUICtrlRead($item1), $GUI_DEFBUTTON)...; item is bold

Just for your info :graduated:

I think I have to 'extend' the helpfile a little bit B)

So long...

Holger

Link to comment
Share on other sites

...

Hi Holger B)

Of course I know about BitAnd(GUICtrlRead($item1), $GUI_CHECKED)

but it can't be used in case when I haven't control_id for treeview items

and get items from TVM_GETNEXTITEM as it is in my example.

If there is some way to get control_id from handle (HTREEITEM) of item please tell me...

Link to comment
Share on other sites

  • 4 months later...
  • 2 months later...
  • 2 weeks later...

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