Jump to content

_GUITreeView_Add() on internal TreeView...


smashly
 Share

Recommended Posts

Hi,

Due to my lack of understaning in AutoIt Treeview controls I'm see something quirky happening.

Using AutoIt v3.2.10.0 and English XP SP2

1) I create an AutoIt interanl GUICtrlCreateTreeView() control

2) Add Autoit internal GUICtrlCreateTreeViewItem() control

3) Add Autoit UDF External _GUICtrlTreeView_Add() new control item

Then GUIGetMsg() or GUICtrlSetOnEvent() now registers when _GUICtrlTreeView_Add() new control item is clicked..

This would be good , but when clicked it's assuming the Control ID of the internal GUICtrlCreateTreeViewItem() control even though the handles are differant to each other.

I notice if I get the Control ID from the handle of _GUICtrlTreeView_Add() and it's the first external added control then the ID is 1. It doesn't seem to give any consideration to what Autoit's internal Control ID's have been given already.

I gather I'm not spose to mix GUICtrlCreateTreeViewItem() And _GUICtrlTreeView_Add() together in a GUICtrlCreateTreeView() ?

Only use one or the other not both?

Maybe this is commonly known already, if this is the case then maybe the Help file may need some info about it.

I can post examples of what I mean when I get home from work.

Cheers

Edited by smashly
Link to comment
Share on other sites

Hi,

Due to my lack of understaning in AutoIt Treeview controls I'm see something quirky happening.

Using AutoIt v3.2.10.0 and English XP SP2

1) I create an AutoIt interanl GUICtrlCreateTreeView() control

2) Add Autoit internal GUICtrlCreateTreeViewItem() control

3) Add Autoit UDF External _GUICtrlTreeView_Add() new control item

Then GUIGetMsg() or GUICtrlSetOnEvent() now registers when _GUICtrlTreeView_Add() new control item is clicked..

This would be good , but when clicked it's assuming the Control ID of the internal GUICtrlCreateTreeViewItem() control even though the handles are differant to each other.

I notice if I get the Control ID from the handle of _GUICtrlTreeView_Add() and it's the first external added control then the ID is 1. It doesn't seem to give any consideration to what Autoit's internal Control ID's have been given already.

I gather I'm not spose to mix GUICtrlCreateTreeViewItem() And _GUICtrlTreeView_Add() together in a GUICtrlCreateTreeView() ?

Only use one or the other not both?

Maybe this is commonly known already, if this is the case then maybe the Help file may need some info about it.

I can post examples of what I mean when I get home from work.

Cheers

Correct you should use either all internal functions or all UDFs not mix them.

There is a field in the $tagTVITEMEX structure called Param (A value to associate with the item).

When using built-in create this Value is populated (controlID).

The latest UDFs also populate this field. Niether one knows about the other one.

What could be done with the UDF created item is use _GUICtrlTreeView_SetItemParam with _GUICtrlTreeView_GetCount and say add some number like 1000 this should give completely different (controlid/param) values (no guarantee).

Would have to think about where and what if anything needs to be added to the help about it.

Gary

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Thank you for the clarification Garry, it's appreciated along with the excellent work you've put into adding/converting/modifying the A3Library into current day AutoIt. When I look at my prior post I feel disrespectful for not complementing or saying thank you to you earlier.

I did try setting the the param for a udf added treeview item but it seems to have no effect.

For example I tried using the last internal item Control ID + 1000 as the param.

But it seems autoit's internal get msg doesn't use the param from an externally added udf treeview item in an internal GUICtrlCreateTreeView control.

As you've said , don't mix the internal and external and there's not a problem.

Cheers

Link to comment
Share on other sites

:"> Sincerely Sorry GaryFrost ... and Thank You

I swear ... It was a slip of a key Fred , I mean Garry..

Promise it won't happen again ..

I think the last time I said that to Zedna for the same reason.

And I thought I'd learnt to read and type since , well that blows that theory out the water.

Cheers

Edited by smashly
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...