05-06-2019 04:37 AM
Hello All,
I am using a 1D array of clusters to act as an user editable front panel table and found a handy community VI that helps me determine which row in the array that the user clicked on here. I added buttons to add/delete row but need some help with some specific event logic.
Here is a quick mock up of what I am doing:
I want a case in which when the user clicks on a row then clicks away anywhere else on the front panel the row selection is forgotten, so when I go hit the delete button it will delete the last row instead of the selected row. This logic seems straight forward but I can't seem to figure out how to get it to work. I tried to do an mouse down event on the pane to reset the row selection, but that event gets triggered event if I click on a front panel buttons, so will end up making every delete a delete last row action.
Is there a way to get the delete button to be dual purpose, delete last row and delete based on user selection, or do I need to make 2 delete buttons to make this work?
Regards,
Mike
Solved! Go to Solution.
05-06-2019 04:50 AM - edited 05-06-2019 04:51 AM
Hi Mikejj,
I want a case in which when the user clicks on a row then clicks away anywhere else on the front panel the row selection is forgotten, so when I go hit the delete button it will delete the last row instead of the selected row.
05-06-2019 09:02 AM
Hi GerdW:
From you suggestions I have 2 questions:
1.) If I use a table, can I still have a mixture of datatypes as I currently have with an array of clusters?
2.) As I mentioned, if I handle a mouse-down even on pane, it hi-jacks all my front panel mouse down clicks, even on my add and delete row buttons. So when I actually do want to delete a selected row by clicking on a cell and moving the mouse to click on my delete button, it won't work because it will set the row value to "delete last row".
Regards,
Mike
05-06-2019 09:16 AM
Hi Mikejj,
1. A table (or listbox) only takes strings as input (or displayed data). You would need to convert between your internal data storage and the UI display…
2. Another approach: create a large button and place it in the background of all other UI controls. Now you can detect mouse events on your UI controls in the front and differ from the button in the background… (Unfortunately there still is no LostFocus event…)