03-12-2015 10:14 AM
@Thys wrote:
Hmmm... asking for my grade school fees back -- clearly I have learned nothing.
Please look at the following VI. I'm not selecting the row correctly for the alternate colouring. Please rub my nose in my error!
The property you need is Active Cell. And you need to set the Active Cell before you set the color.
03-12-2015 11:58 AM
Yup I discovered that. Active Cell can take a column number or -2 for all the columns. Trouble is "all the columns" means all the columns visible on the table widget, not the number of columns prepared for when creating the table. I create a 3x5 table for instance, but on the front panel the table drawn is 10x10. I'd love to create a table and display it exactly the size the user calls for.
Ultimately I need to allow the user to create the table, throw some data at it, export the data, perhaps clear the table and collect more data.
03-12-2015 12:22 PM
Whatcha think?
Picked orange stripes because of corporate colours. Just going to live with colours going off the end of the active page.
Thanks so much for your comments -- you steered me toward the solution attached. Aren't you glad you can't be held responsible for you programming style? 😉
03-12-2015 01:32 PM
Back save for 2013 and I'll happilly give you a 5th grade math refresher
03-12-2015 02:40 PM
Improved further and made my first subVI -- tadaa!
The ideas is that the user clicks on a cell with the mouse, highlighting the cell. When he is ready to take a readhing he taps a key, the meter sends a reading to the cell, the meter is reset, the cursor skips to the next cell along, un-highlighting the old cell and highlighting the new cell. As you can see, I need the true extents of the table as set, not as is visible in the control.
At least the table looks pretty even if it is still useless!
--Thys
03-12-2015 05:13 PM
Updated. I wasn't sitting still. ...but now there are teeth marks on the keyboard.
1. The refresh button needs two clicks if the event is smouse-up. If I change the event to vaule change, it executes twice.
2. The highlight trick works when the light-bulb mode is on, but only works in the top row when the lightbulb mode is off.
3. I am refreshing the entire paint job to remove the highlight because I cannot track the last cell. There are some scratchings on the event OldCell but it's been torn up pretty badly with testing ideas.
Once I can grab a cell and highlight it, I want to press the space bar to move the active cell one cell at a time down to the end of the row. The user then selects his next starting point.
Thanks for taking a look at this. Losing my mind here (not that I can afford to do much of that!)
--Thys
03-13-2015 04:25 PM
Ok just bragging. This looks like a pretty decent solution and I believe the code is nicer. Feedback would be welcomed.
Otherwise, this VI creates a table, highlights alternate rows, places bold column and row headers, initializes the table, highlights a cell when it is clicked on, reinstates the condition in the previous cell when a new cell is clicked on.
I do appreciate the help I received and access to the examples all you fabulous people created.
--Thys