LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable Editing on SOME tree columns

Solved!
Go to solution

LV2013

 

How can I disable cell editing on columns 1,2,3+ of a TREE control, while allowing editing on column 0?

 

I already intercept the TREE: EDIT CELL? event, and discard the event if COL > 0.

That prevents you from changing it, but still it LOOKS like you're changing it - you type and the text follows you, and then gets rejected - ugly.

 

I could put a "shield" over columns 1+, but I want to be able to click anywhere to select a line or multiple lines, and I want the user to stretch the columns as needed.

 

Do I have to map out the columns .... hmmmm.  This code is an improvement:Left Mouse.PNG

 

That lets right-clicks thru, and it disables editing. but it also disables click-selection, if you click on column 1+.

 

How can i turn off JUST the editing function?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 1 of 5
(3,248 Views)

Hello Steve,

This is tricky, so I wanted to ask a few clarifying questions, to make sure I understand correctly. You want to lock the editing of the contents of each column (except the first, Column 0) in the TREE control on the front panel, but still allow for someone to change the size of the boxes/columns. You also want to still select the contents, which is why shielding doesn't work.

Could you include some more screen shots or code snippets, especially what the control looks like and a larger picture of what the code does? That could help me better understand what you are trying to do and what you have done so far.

Thanks,

Zofia

ZK
Technical Support Engineer | NI | Not actually retired but I don't know how to change that
0 Kudos
Message 2 of 5
(3,185 Views)

You understand me correctly, but I want to emphasize that I want to avoid editing and the APPEARANCE of editing, in columns 1+.

If I intercept the CELL EDIT ? event, and discard it if COL > 0, it lets you click on the text and get an edit box.  You can then type the new text you want and it shows up. Then you click off, and the old text reappears.  That's a matter of bad UI - it's not obvious that your editing will be rejected.

 

The code I showed above is what I'm using, and it's tolerable.  But it doesn't let me click on column 1+ to select the row.  It's a minor inconvenience, at this point.

 

Here is the tree on the panel.  Forgive the garish colors - it was an experiment.

I want them to be able to click in column 0 to:

--- Select Row X

--- Drag row X to another position in the tree.

--- Right click to bring up a context menu for insertion, deletion, other operations.

--- Edit the "Step" name for row X.

 

I want them to click in column 1+ to

--- Select Row X

--- Drag row X to another position in the tree.

--- Right click to bring up a context menu for insertion, deletion, other operations.

BUT NOT to edit that "Target" information - that is attached elsewhere.

 

Script.PNG

 

With the above code in place, all of that works, EXCEPT for clicking in Col 1+ to select or drag.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 5
(3,182 Views)
Solution
Accepted by topic author CoastalMaineBird

Hi Steve,

 

What about this? 

 

Tree Test.png

 

This restricts editing to only column 0, without showing the edit popup for the others.

Regards,

Michael Whitten
Senior RF Applications Engineer
Message 4 of 5
(3,150 Views)

Perfect!  in the sea of available properties, I didn't see that one.

That works well - Thanks!

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 5 of 5
(3,140 Views)