06-04-2013 07:51 AM
I am using a 2D array of strings to display a memory map.
One of the things I was interested in doing was highlighting individual cells that might be changing values (in this case, in general the values should remain constant). So, for instance, if a value is changing, highlight it in red.
Is there a way to programatically do something like this to a single cell? In playing around with the formatting features, it appears that any change made to a single cell effects the entire array. Even for instance when I justify-centered an element.
06-04-2013 08:11 AM - edited 06-04-2013 08:12 AM
Yes, if you change the properties of the array element, it will change the rest of the elements in the array. You can use a table or listbox and control the color of the cell. If you don't want to use a listbox or table, you can create a cluster of color box and text control. Make both controls the same size and put the text control in the front. Set the background color of the text control to transparent. The color box will be the background. See attached example.
06-04-2013 08:24 AM - edited 06-04-2013 08:24 AM
hi bmishoe,
could you use a table instead of an array? Via property nodes you can manipulate the background color of the active cell:
alsdo see:
labview\examples\general\controls\Table Enhancements.vi
-------
EDIT: Ok, someone else was quicker ...
Alex
06-04-2013 08:26 AM
I have not used tables before, I will look into them.
To give a little more detail...this memory map will be constantly updating. What I'm hoping to do is programatically determine what values are changing between updates, and highlight the text or the background of that cell in a different color...
06-04-2013 08:27 AM
You will have to use a table. Using a property node, you can set the background color of the "active cell". You also set the active cell and therefore only color the cells you want to.
06-04-2013 08:29 AM
thank you for the help...I'll give it a try!
06-04-2013 09:28 AM
Changing the background or font color of individual table cells is quite simple and I have posted many examples in the past. If the table is large and you change many cells, you should defer panel updates to make things more efficient.
Here is an example changing the font color (includes defer panel updates). (original thread)
Here is an example changing the background color. (original thread, run VI, press "update" button))