BramJ Posted July 7, 2011 Report Share Posted July 7, 2011 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 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? Quote Link to comment
spaghetti_developer Posted July 13, 2011 Report Share Posted July 13, 2011 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. Quote Link to comment
BramJ Posted July 14, 2011 Author Report Share Posted July 14, 2011 (edited) 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 July 14, 2011 by BramJ Quote Link to comment
Francois Normandin Posted July 14, 2011 Report Share Posted July 14, 2011 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. Quote Link to comment
BramJ Posted July 15, 2011 Author Report Share Posted July 15, 2011 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.