Jump to content

Tree Structure Edit Position


Recommended Posts

I am building a tool to make it easier to edit TestStand property loader files. (we have hundreds of diffirent property loader files for diffirent products)

I managed to turn the text into a tree structure, the property is put in the first column and the value is put in the second column. Now I need an easy way to edit the value. Normaly this can be done by clicking the cell, waiting a short period and then clicking again but this isn't very handy. If you click just a bit to fast or slow it won't work...

What I want is to be able to click once to edit a field. I did this by catching the "Mouse Down" event and turning the pixel coords into a col/row coordinate and setting the Edit Position with a property node

atu72a.png

All fine so far,

And now the problem: When setting the Edit Position this way the tree structure scrolls so that the value column (column 1) is at te left most position, so now I can edit, but I can't see what I am editing ;)

I tried using the "Top Left Visible Cell" Property but then the cell I want to edit loses focus...

Is there any way to make the tree structure scroll to the left again? so that both columns are visible

Or another way to easily edit a cell?

Link to post
Share on other sites

I'm sorry I know that can be a stupid question but, do you have enabled the editing with the "Allow editing cells" property?

I'm asking you this because enabling this property I don't have the behaviour you are having when you click on the cell you want to edit. With that property enabled when I click on the cell I want to edit I enter in editing mode immediately, and the tree control keeps the position.

Link to post
Share on other sites

offcourse I have tried that, but then I need to click twice on a cell (with a small pause in between) to edit it, its really counterintuitive

From the Labview help:

Short Name: Allow Editing Cells

Requires: Base Package

Class: TreeControl Properties

If TRUE, users can edit non-header cells in this control at run time by clicking the cell text and then clicking it a second time after a short pause. If FALSE, users cannot edit non-header cells.

So it works just as described in the labview help, but like I said, its really counterintuitive

Edited by BramJ
Link to post
Share on other sites

And now the problem: When setting the Edit Position this way the tree structure scrolls so that the value column (column 1) is at te left most position, so now I can edit, but I can't see what I am editing ;)

I tried using the "Top Left Visible Cell" Property but then the cell I want to edit loses focus...

Is there any way to make the tree structure scroll to the left again? so that both columns are visible

Or another way to easily edit a cell?

The way you code it is correct. However I only see the described behavior when the column I edit is larger than the control width.

I don't think you get what you want unless you set your column widths so that both your columns can be shown completely at the same time.

If the horizontal scrolling bar is shown, then it's a good bet that the cells will shift when you edit.

Link to post
Share on other sites

Thanks Francois

since I have some very long strings in the "value" field I need the scrollbar so its not going to work the way I originaly wanted it...

However, I now made it so that you get a popup when you doubleclick, its a bit like the Microsoft regedit program now.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.