Tree control indenting
I created a tree control and am trying to follow the Help on how to indent, but when I select an item, say "Signal Generator" and right-click, the "Indent Item" option is greyed out. Is there something else I need to do?
Attachments:
Tree of Tests.vi 6 KB
Hello mrbean,
Your tree control has the row headers set to visible. These headers are just a type of label not the actual data inside the control. Since it is not the actual data they cannot be indented. Try putting the actual data values beside the row headers and notice that you can select items and right click to see that indent is no longer greyed out.
Steven T.
Similar Messages
-
LV 7.1.1
I have a tree control that I want the user to be able to select an active entry, but I prefer that they not be able edit the entries in any way, including indenting/outdenting items. The (.) and (,) keys indent and outdent during runtime, and I can't find a way to disable this and still be able to select an active item on the tree.You can do it this way. Use the Event structure Key Down? Event and discard it if a comma or period is pressed.
Attachments:
tree.vi 26 KB -
Tree Control - Design Mode - Indent Level
Hi!
In edit mode tree control has indent / outdent level right - click menu. I need this functionality. Indenting and outdenting items. I've implemented, but the in/out Denting does not works well, it the tag has children.
I am wondering, is it possible to call indent/outdent level right-click menu in run mode?
+++ In God we believe, in Trance we Trust +++
[Hungary]Interesting challenge! The key involves creating your own custom run-time menu items and defining the actions of those items. Consider the following code, attached as an image and LV2010 VI:
a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"] {color: black;} a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"]:after {content: '';} .jrd-sig {height: 80px; overflow: visible;} .jrd-sig-deploy {float:left; opacity:0.2;} .jrd-sig-img {float:right; opacity:0.2;} .jrd-sig-img:hover {opacity:0.8;} .jrd-sig-deploy:hover {opacity:0.8;}
Attachments:
TreeIndentOutdent.vi 17 KB -
How can I save the all the values of a tree control ?
I have a problem, in run time, I adds new items on a tree control, but i don´t know how I can save the values of the child text of each item in a file.
Thanks.I'm no expert on the tree control, but I made a small example to save all items to a textfile, including item tag, item string, and indent level. One drawback of this method is that it fully expands the tree regardless how the user left it. To go the other direction, you'd have to write a routine to go through the text file and programmatically build the tree.
To master the tree control, I think you have to resort to creating a control reference for it and using the Invoke Node to do some operations. For another approach to traversing and operating on a tree, check out the "Traversing Tree Controls and Setting Custom Symbols" (search the NI Developer Zone site).
Best of luck,
John
Attachments:
Save Tree Structure to Textfile.vi 32 KB -
i working on Arabic project in which we use a tree control and i want it to display its branches from right to left .
i tried to rotate it but it doesn't work because the disclosure triangle still appear on the left .
i ask if there is any thing to mirror the tree control ,and ask if this mirroing will work or not?You'll need to modify the layout logic of your renderer.
Here's a simple example that extends the default tree renderer and overrides the updateDisplayList method(). It will probably need more work. Set textAlign="right" on your Tree control when you use this renderer. You'll also need to supply a disclosure icon that points in the opposite direction.
package
import mx.controls.treeClasses.TreeItemRenderer;
import mx.controls.treeClasses.TreeListData;
public class RightToLeftTreeItemRenderer extends TreeItemRenderer
override protected function updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void
super.updateDisplayList(unscaledWidth, unscaledHeight);
var startx : Number = data ? TreeListData( listData ).indent : 0;
startx = unscaledWidth - startx;
if ( disclosureIcon )
disclosureIcon.x = startx - disclosureIcon.width;
startx = disclosureIcon.x;
if ( icon )
icon.x = startx - icon.width;
if ( label )
label.x = 0; -
Tree Control Property Node for Accessing "Child Text" String Array
When adding items to a tree control using the EditTreeItems invoke nodes, the inputs include "Child Tag", "Item Indent", "Child Only?", "Glyph Index", "Child Text", and "Left Cell String" as can be seen in this screenshot.
There are property nodes for the tree control for accessing each of these elements, except for the "Child Text", which is an array of strings. It is possible to access this data as outlined in this forum post, but this method is somewhat involved and round about.
I suggest that a property for the Tree class be created to access the Child Text array directly.The work around only works if you do not have an empty string element some where in the middle.
At lest could the "Active Celltring Property" read return an error when you have gone beyond the end of the array. -
Save Labview tree Control to file and Load from file
I want to save all of the information from my Labview (8.2) tree control to a file and be able to read it back from a file and re-populate the tree control. I am using different symbols as well as multiple columns and level of children in my control. Does anyone have any suggestions on how to do this?
Thanks
Steve M.
Attachments:
tree pic.jpg 60 KBHi Steve,
I found a DF that talks about saving the tree to a spreadsheet file and have included it in this message. To get items from the tree control, you have to use open up the tree and remove all of the items off of that tree, while still preserving the heirarchy of the tree. The indent level property node will preserve the heirarchy of the tree and from there you can get the item tag and cell string.
To transfer the file to a tree, you will then need to read the file and insert items into the tree corresponding to the heirarchy. I have also found a tutorial on how to traverse tree controls.
I hope this helps.
Regards,
Nadim
Applications Engineering
National Instruments -
How can I display and change built-in symbols of a tree control programmatically?
I want to set the built-in symbols of a tree control during runtime.
I only found an example to assign custom pictures but not how to select one of the 40 built-in symbol.
Many Thanks
Solved!
Go to Solution.The ActiveItem.SymbolIndex will allow you to select the symbol for the active item. You can use the ListBox Symbol Ring Constant (Dialog and User Interface palette) to select a symbol (or you can just enter the number directly if you know what it is).
Message Edited by smercurio_fc on 07-10-2008 09:36 AM
Attachments:
Example_VI_BD6.png 2 KB -
Not able to get the database data into the Tree Control
Hi Everybody,
I have to populate the tree control with nodes and items, which is to be populated from the database, and the tree control is <b>dynamic</b>. I mean, there is a <b>toolbar</b>, whenever a <b>pushbutton is clicked</b>, depending on that the tree contents has to be changed.
If anybody had worked with <b>CL_GUI_COLUMN_TREE</b> control to get the data from database, depending upon the <b>pushbutton selected in Toolbar</b>, please paste the seudocode for it.
Regards,
Abdul,
Intelligroup.
P.S: Helpful answers will be rewarded.have you seen this demo program
SAPCOLUMN_TREE_CONTROL_DEMO
Regards
Raja -
How to get all items under a parent item in a tree control
Hello,
I have 2 questions regarding a tree control:
1) Is there any way to specify a parent item tag and get an array of ALL its sub item tags? For example, in the attached vi, specify the Parent#2 parent tag and get an array containing Item#P21 and Item#P22
2) Is there a way to specify a range to the ActiveCell property. For example, all items from line#1 to line number#3
Any ideas?
Attachments:
Tree example.vi 6 KBMentos wrote:
1) Is there any way to specify a parent item tag and get an array of ALL its sub item tags? For example, in the attached vi, specify the Parent#2 parent tag and get an array containing Item#P21 and Item#P22
Did you try a search? There's no direct way of doing this. You have to navigate the tree and build up an array. You can find an example here: http://forums.ni.com/t5/LabVIEW/get-all-children-of-a-parent-in-tree/td-p/729548
2) Is there a way to specify a range to the ActiveCell property. For example, all items from line#1 to line number#3
No. (It's called ActiveCell, not ActiveCells) Presumably you are trying to perform an operation on multiple items. Unfortunately, you need to use a loop. You should defer panel updates if you're doing this a lot. -
How to binding incoming xml node list to the tree control as dataProvider
Recently, I faced into one issue: I want to binding incoming xml node (it's not avaliable at start) list to the tree control as a dataProvider.
Since the incoming xml node list is not avaliable at beginning but I needs to bind it to the tree, so I create one virtual one in the xml, and prepare to remove it before the tree is shown. (ready for the actual node adding). But It did not work.
Please see the presudo-code here:
1. Model layer(CsModel.as)
public class CsModel
[Bindable]
public var treeXML:XML=<nodes><car label="virtualOne" id="1">
</car></nodes>;
(Here, I want to build binding relationship on the <car/> node,
one 'virtual/stub' node is set here with lable="virtualOne".
But this node will be deleted after IdTree
control is created completely.)
[Bindable]
public var treeData:XMLList =new XMLListCollection(treeXML.car);
2. view layer(treePage.mxml)
private var _model:CsModel = new CsModel();
private function addNode():void
var newNode:XML=<car/>;
newNode.@label="newOne";
newNode.@id=1;
_model.treeXML.appendChild(newNode);
private function cleanData():void
delete _model.treeXML.car;
<mx:VBox height="100%" width="100%">
<mx:Button label="AddNode" click="addNode()" />
<mx:Tree id="IdTree" labelField="@label"
creationComplete="cleanData()"
dataProvider="{_model}"/>
</mx:VBox>
3. Top view layer (App.Mxml)
<mx:application>
<treePage />
</mx:application>
For method: cleanData(),It's expected that when the treePage is shown, we first delete the virutalOne to provide one 'clear' tree since we don't want show virtualOne to the user. The virutalOne node just for building the relationship between treeData and treeXML at beginning. But the side effect of this method, I found, is that the relationship between treeXML and treeData was cut off. And this leads to that when I added new node (by click the 'addNode' button) to the xmlXML, the xmlData was not affected at all !
So Is there any other way to solve this issue or bind the incoming xml node list to the xmlListCollection which will be used as Tree control's dataProvider ?If u want to display the name : value then u can do like this
<xsl:eval>this.selectSingleNode("name").nodeName</xsl:eval> : <xsl:value-of select="name" /> -
How can I drag and drop an item from one Tree control to another in LabVIEW 7.1?
You can use the mouse up and down event on the two tree controls but the problem is making the correct selection in the second tree control. I want to be able to switch over to the selection bar of the second tree control so that I can place my item in the correct position. I know all possible workarounds with double-clicks and so on... but I really want a windows drag and drop.
This is what I have for the moment. Please check the library below. I need to activate the selection bar of the second tree control somehow to get the position in the control. The VI below is written in LV 7.1
Attachments:
Drag&Drop.llb 65 KBHi Jones,
As far as I know this feature is currently not supported by the Tree control. A workaround, would be to use the vertical position of the mouse in the button up event to determine what line you�re dropping the item.
If you would like the Tree control to include the drag and drop feature, please submit this as a Product Suggestion under the feedback at www.ni.com/contact.
Good luck!
Best regards,
Philip C.
Applications Engineer
National Instruments
www.ni.com/ask
- Philip Courtois, Thinkbot Solutions -
How to use the drop event of the tree control in LabVIEW 8.20?
Hi,
I am using the two tree controls in my application to provide a option for the user to drag and drop item from one tree to the other. I have to validate the user selection. I tried to capture the user drop event using the event structure. The problem I am facing is, I am not able to drop the item even though i have wired a constant true to the filter(Accepted?) in the event case. I have enable the property(Allow droping) in the right menu of the tree control also.
While configuring an event case for (drop, drag entered and some thing like this) only I am getting the problem otherwise it is working fine.
What do i need to do to caprture the drop event ?
Is there any way to avoid the item duplication while droping a new item in the tree control ?
or how can i do this?
Thanks,
Pandiarajan RHi Pandiarajan,
I hope you are doing well today! There is a lengthy discussion on the Tree Control Drag & Drop feature at this forums post including contributions from the developer of the Drag & Drop feature:
Tree Control Drag & Drop in LabVIEW 8
By avoiding item duplication, do you mean that you don't want the same item to be in the old tree control or do you not want more than one item in the new tree control?
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies -
How to get position of a ring in a tree control?
Ok, this is probably a stupid question, but how does one get the position of a ring inside of a tree control? I have a tree with two columns, with rings in the second column. I can set the position using SetTreeCellRingValueFromIndex(), but how does one get the position after the user has modified the control? I found the functions GetTreeCellRingIndexFromValue() and GetTreeCellRingValueFromIndex() but I haven't found a way to get either the Index or the Value of the ring (what I'm looking for is the index, but if I can obtain the value I can go from there). Thanks in advance!
Solved!
Go to Solution.Hi,
You can use GetTableCellVal function to get the value of the ring.
There is not special "ring" function for that. Maybe that's what you were searching for
From the value you can get to the index using the functions you are already aware of.
Hope this helps,
S. Eren BALCI
www.aselsan.com.tr -
How do I get the tag of a selected line in a tree control ?
I am running LabVIEW 7.1.
I want to be able to add a parent or sibling to a tree to a selected item in a tree.The tag of the selected item is actually the output of the tree control itself. If you create an indicator from the tree control, you will get a duplicate tree control (indicator), but if you wire the output into a string indicator, the tag of the selected item will show up. You can an item to the tree by wiring the tree reference into an invoke node, calling the method "Edit Tree Items: Add Item", and wiring the output of the tree control (which will be the tag of the selected item) into the "Parent Tag" terminal. This method will only let you add a child to an item, you cannot add a parent or sibling. Items cannot have multiple parents, so it wouldn't make sense to add a parent; and to add a sibling for the selected item, you could call the method "Navigate Tree: Get Parent" and pass the tag of the parent into the "Edit Tree Items: Add Item" method.
Robert Mortensen
Software Engineer
National Instruments
Maybe you are looking for
-
I HAVE A PROBLEM WHEN SYNC CONTACTS IN MY COMPUTER TO IPHONE 4S after update to iOS6. The message are " waiting for change to be applied". PLAESE advise how to solve this problem.
-
Ms access 2007 between query for date
Dear All, I am using the below query to fetch records from a table between two dates select * from tablename where Format([VisitDate],"Short Date") >=Format(#01/10/2014#,"Short Date") and Format([VisitDate],"Short Date") <=Format(#31/10/2014#,"Short
-
Microsoft Windows Intel Itanium(64bit) 10.2.0.4
Please give me the link of Microsoft Windows Intel Itanium(64bit) version 10.2.0.4 . o/s is windows 2003 Best Regards Junaid Thanks in advance
-
Hi, I am using log4j and this is a fragment from my log4j.properties file: log4j.appender.gen.file=${catalina.home}/logs/foo.logWhen the container is up, ${catalina.home} is interpreted to the correct path. How about when running unit tests though? I
-
Soundtrack clip pushing video clips out of place
What am I doing wrong? I've added mp3 sound clips ok until now, when I'm finding the track I insert on the soundtrack bar pushes all the video clips to the right for the distance of the sound clip. If I put track at the end, I've tried right clicking