Sign in to follow this  
Followers 0
Zedna

UDF _TreeViewGetItemState

7 posts in this topic

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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

@Holger

Five months later in version 3.1.1.116 you added _GUICtrlTreeViewGetState() which is the same as my proposed UDF _TreeViewGetItemState() from here. So you can see that also other peoples and not only developers have sometimes good ideas :think:

Keep your good work on AutoIt.

Share this post


Link to post
Share on other sites

@Zedna

DllStructDelete() does not exits in Autoit Beta anymore.

I'm having problems with these scripts

Regards,

RK


"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Share this post


Link to post
Share on other sites

Instead of DllStructDelete($struct_name) use $struct_name = 0

Thanks,

RK


"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

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
Sign in to follow this  
Followers 0