Hi David,
    I answered your first question first and placed the reduced tree operations 
I used inside of it.
    As I mentioned in the previous posting, use a dictionary, place the 
dictionary key in the ID, or Data field, of the tree item. That data will come 
back when the item is selected when looking at the data property.

    The only thing is having that dictionary always loaded to be looked at. Or 
that data value is a key into a data base...

    Simple thing to do, I think you are ready to go. Just use a dictionary and 
keys for the entire project.
        Bruce

Sent: Thursday, April 11, 2013 9:21 PM
Subject: Re: Treeview Questions - Still attempting to learn :)


Thanks, Chip.
The Checked property, was the one I was looking for. I might just have 
overlooked it. Was really reading that much back and forth in the Reference, 
and then it is easy to overlook something, or not grasp the full meaning of 
each detail. Thanks again. And, as I have shown in another message, I did 
solve the Iteration problem. So, we are getting there, slowly but steadily. 
:)

Now, if someone could just give me one tiny bit of help extra, I would be 
set for some more experimenting.

Imagine, that I find an item that is checked. It happens to be the 5th item 
on level 3, found under the 2nd item of level 2, and the 7th item on level 
1. But, when I find it, I might not know all of that.

I guess, I somehow could follow the Parent properties, and reverse my way up 
the tree, from the found item. But, what would be the exact instruction to 
use, if I have the item (called MyItem), and I want to get the Text field of 
its parent? Hope that one made sense. It is late in the day, and my brain 
doesn't work smoothly any longer. HAHA.

Thanks again,


----- Original Message ----- 
From: "Chip Orange" <[email protected]>
To: <[email protected]>
Sent: Friday, April 12, 2013 2:19 AM
Subject: RE: Treeview Questions - Still attempting to learn :)


> Hi David,
>
>
>
> I'm sorry I didn't go into the advanced treeview issues when I was doing 
> the
> scripting tutorials; looks like I only covered the basics.  I'll try to 
> put
> together another tutorial to cover all the advanced treeview issues, and
> answer your questions as best as I can for now:
>
>
>
>
>
>> 1. What is the exact benefit of the Text, as compared to the Data, field
> in a treeview item.
>
>
>
> As you suspect, the data property is only there for your convenience.
> Sometimes, when creating the text, there is some record in a dictionary
> associated with the text, and sometimes you could store the key to it in 
> the
> data property, thus saving you the trouble of having to look up the text 
> to
> figure that out.  If some of your items are one type of thing, and some 
> the
> other, then the data property is also quick and easy to use for enabling 
> or
> disabling other controls as various treeview items are highlighted (it's a
> lot quicker to just examine the data item when a treeview item is
> highlighted than it is to look up the text somewhere to figure that out).
>
>
>
>> 2. The treeview I am building, has checkboxes, which the user can check
> for each item on the tree. I have searched the Reference manual, but not
> sure if I have overlooked anything. From what I can see, there is no way 
> in
>> >determining whether a treeview Item has been checked or not. I see the
> Selected feature, but from what my testing leads me to understand, this
> simply let's me know when an item has focus (that is, when the cursor is 
> [>]
>>placed on the item, the Selected feature will be set).
>
> Actually, the  treeview control object itself does have a selected 
> property
> which does what you say: it returns the treeviewItem object which is
> currently highlighted.  The treeviewItem object however however has a
> checked property (if you're using checkboxes), or a selected property if
> not, and they return an indication as to whether that particular item is
> either checked or selected.
>
>
>
>>
>
>> >Is it correct, that there is no build-in feature, that would "fire", 
>> >when
> a treeview item has been checked or unchecked?
>
> I'm sure some event happens; it looks to me like it is the treeviewClicked
> event which would happen, but there's also a  treeviewSelectionChange 
> event
> which could be it (it's not always clear when they speak of selection
> whether they mean a multi-selection control is having one of its items
> selected or unselected, or if they mean the focused/highlighted item is
> changing).
>
>
>
>
>
> [>] >3. Does anyone have a simple quick iteration routine, for "rushing"
> through a whole treeview, including all its branches and leaves. My
> treeview, might hold as much as 9 sublevels, in addition to the root. And 
> it
> might hold [>] >different amounts of entries on each branch or sublevel. I
> guess the best would be to use some For...Next loops, and somehow retrieve
> the Count property for each branch. But I have run my head into the wall, 
> as
> to how to get [>] >through absolutely all the possible items on the tree. 
> I
> guess, that is the one way to go, when iterating the different items, or 
> am
> I totally lost in such an approach? Say for instance, the user would have
> been given the chance [>] >of searching for a given text, which would be 
> the
> Text property of an item on the tree. I then guess, I will have to iterate
> all the current items on the tree, looking out for that particular text.
> And, that is why, I wondered if there [>] >was a simple routine, that 
> would
> perform such a "run-through", with relatively few lines of coding.
>
>
>
> I don't have one handy, and you're right that you will have to do this for 
> a
> search.  It is possible to go to app central (the web version), go to the
> appGet app, and get an older version (there's a link to let you see 
> earlier
> versions of an app).  Before they began encrypting it, appGet was 
> available
> in the clear, and it uses a treeview control, and it has a "find" feature,
> so it must work through the treeview as you are wanting to do.
>
> [>]
>
> When you download it, to save you from having to install it to get to the
> source code, you can change the file extension from .wepm to .cab, then 
> you
> can use some unpack utility (such as winRar), which will unpack it into a
> directory.
>
>
>
>
>
>
>
> 

Reply via email to