10-30-2008 03:55 AM
Hi everyone,
I have some more questions (regarding the same subject) and this time i have pictures to help clearify things.
In "src1" you can see the Parent item "PAAC1" with several child items beneath it. In the previous replies it was suggested to disable the child items so that i cant select them, but then they all appear grayed out, and that's something i dont want. Another thing is that the content of the Tree is not fixed, you can load different files so enabling/disabling the items via front panel is not an option. What i want to do is be able to select PAAC1 (parent tag) and none of the hild items below it without graying them out.
The second problem i have is that when i select an item in the tree, then clear the tree, and load the same file agian, the same item i selected earlier lights up, even though the active item property of the tree indicates that nothing is selected. How can i fix this? If i load a different file with different parent tag en child items, no item lights up. Probably because they are different variables from the first time?
Thanx in advance.
Greetz ynse.
10-30-2008 03:58 AM
Hi,
you can forget about the disable, grayed out problem, wiebe already answerd this in prevoius reply. (i overlooked it)
Apparently it isnt possible to disable a tree item without graying it?
greetz.
10-30-2008 05:10 AM
10-30-2008 06:03 AM - edited 10-30-2008 06:05 AM
Hi all,
as Wiebe posted I made an example which illustrates this (in fact, I made it for my own exercise). My solution has a drawback since Key- navigation is not satisfying. To illustrate this, enable the code in the "Key down?"- even, run, click on "Parent 1" and press the Down- key on keyboard. Now "Parent 2" ist selected (or highlighted or whatever). If you then press the Left- key, all child- items under "Parent 2" should be hidden, but the indended items under "Paren 1" are. Why??? There is the little grey frame around "Parent 1", But how to move this?
With the disabled while- loop on block diagram I tried to explore the sense behind active cell but failed.Who has an idea?
greets, Dave
10-30-2008 09:10 AM
10-30-2008 09:17 AM
I didn't really look at your code untill now...
It is way to complicated! Why catch keys? You can easilly see if you're going up or down. Also, you get the old value, so why put it in a shift register?
See attachment. you only need to use the value change event. The code for this sort of stuff gets ugly very fast, so all of it (everything in the value change event) should be put in a sub VI (also so you can reuse it).
In the example, I use a regular expression to disable items. If there is a "1" in the tag, it is disabled. Everything can be used...
10-30-2008 09:40 AM