01-13-2011 05:31 AM
I want to specify a N_MAX maximum length for the cell names of a tree, so that when the user press F2 key to rename it, he's not allowed to enter more than N_MAX characters.
For the items already existent in the uir file, I'm able to get this behaviour setting Edit Tree >> Edit Columns/Cells >>Edit Cell >> Max Entry Length to 5 (see attached img03.png).
When the user tries to rename this item, he's not allowed to enter more than 5 characters (see attached img02.png).
But how can I set this attribute for the items programmatically added (for example through InsertTreeItem( )).
I haven't been able to find the right attribute, because the cell attribute ATTR_LABEL_TEXT_LENGTH (that seems more or less what I'm looking for) is "not settable"
Solved! Go to Solution.
01-13-2011 07:47 AM
I suppose there is no way other then preprocess the item name and issue InsertTreeItem only if correct, passing the correct label to it.
You could for example have a small panel for the user to insert the name fro the new cell, with a string control limited to 5 characters or something like this.
01-13-2011 11:24 AM
You found an omission in the documentation. You can use ATTR_MAX_ENTRY_LENGTH and ATTR_MAX_ENTRY_CHARS with SetTreeCellAttribute and SetTreeItemAttribute to set the max entry for a tree cell.
Thanks for reporting this and sorry for the inconvenience.