LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Icon text placement behaving erratically in Icon Templates since upgrade from LV 2015 to LV 2020

Solved!
Go to solution

Hi all,

 

Yesterday I upgraded from LV 2015 SP1 to LV 2020.

 

I have a set of standard icon templates (boxed banner with title and boxed body with colour based on VI category) that in 2015 worked perfectly. After updating to 2020 most of them no longer constrain the icon text which I write in the Icon Text tab of the Icon Editor. This means that instead of appearing in the body of the icon, the text appears in a single blob at the top, obscuring the banner text and generally being completely unusable!

 

I attach here an image showing a template that works fine, one that is broken and the process I used to make all the templates.

 

I urgently need a fix for this / a recipe for making a new set of these templates because I am about to make a whole lot of new VIs and the idea of having to manually position the text in each icon body is horrifying. 

 

I found a post from 2009 where someone else had what sounds like the same problem, but having read the "solution" I am no wiser as to how to fix this for myself. The original post is here: https://forums.ni.com/t5/Enhanced-Icon-Editor/Bug-Icon-Text-Moves-unlawfully-to-Banner/gpm-p/3405678

 

Many thanks for any suggestions or help!

Loren

0 Kudos
Message 1 of 4
(2,596 Views)
Solution
Accepted by LorenPicco

This happened between 2015 and 2018 I believe, as when I changed versions back in late 2018 a lot of my icons had similar behavior.  

 

As far as I could tell it had to do with the method it used to determine where the horizontal lines on the icon occurred as it tried to figure out where to put the icon text upper and lower bounds.  

 

If you go here:

https://forums.ni.com/t5/Enhanced-Icon-Editor/Icon-Editor-Source-Files-for-LabVIEW-2020/gpm-p/404242... 

You will find the source code for the 2020 icon editor and can see how it works internally and even alter if you follow the instructions to replace it.

 

In my particular case in 2018 I found that if I replaced one of the horizontal black lines (the middle or bottom, depending) with one that was RGB 0/50/255 (a slightly light-colored blue) it would put the text in the area I wanted it to be.  Not sure if this would work in 2020, I haven't migrated.

Message 2 of 4
(2,580 Views)

Oh, no!!  Four years ago, I "stole" an idea from Stephen Loftus-Mercer (of Channel Wire and LVOOP fame) and created a LabVIEW icon that had a boundary that looked like a While Loop (meant to suggest "This is an asynchronous loop, running in parallel with whatever other code is around it").  Here's how I wanted it to look:

LOOP icon.png, a double-thick rounded border with a While-loop-like arrow in the lower right corner.  Looks nice, doesn't it?  So I tried to make an Icon Editor Template out of it, and found when I did so, all of the text I put in the Icon Text section ended up "squished" along the bottom double-line of the Template.  Experimenting, I found that the Icon Editor allows a double line at the top, with no problem, and uses the lower space as the space for Icon Text, but if you move the middle line in the Template from the top to the bottom, it just squeezes the available space to be the "lower" space, no matter how small.

 

I contacted several NI Gurus (at NI Week) and demonstrated this to them, including some whom I knew had Icon Editor experience.  "Interesting, we'll look into that".  Nothing.  So I did a work-around -- I created Templates with double-lines everywhere except along the bottom, where only the lower of the double lines is present.  I drop the Template, manually add the second line, and quicker than you can say "Bob's Your Uncle", I've got a nice blank Icon with double-thick lines on all four sides that will accept anything I type into Icon Text in the big space in the middle.

 

I decided that was an easy enough solution.  I didn't want to mess with the Icon Editor code, as I think NI should maintain and enhance it.  I suggested to the Developers that they should change the algorithm of where to put Icon Text to be "Put it in the largest (by vertical dimension) Blank Area".  This would be "agnostic" to the thickness of the (horizontal) lines, just looking for the largest (measured vertically) horizontal "band" in the Template.  I still think this is a good idea (I don't remember if I filed an Idea Exchange for this, but mine regularly get rejected, even if they have garnered Kudos over the years …) ...

 

Bob Schor

Message 3 of 4
(2,531 Views)

Thank you Kyle!

 

Combining the access to the Icon Editor source code with Bob's follow-on observations on his double-line thickness icon helped me zero in on the issue.

 

Basically, the Icon Editor has a clever little VI "Find Start and Endpoint Body Text.vi" that searches from the bottom up for solid horizontal lines. After it finds the first it looks for a second and once found decides that the vertical height between the two is the body space.

 

In my case the issue springs from some change (I speculate) to the search algorithm between LV 2015 and LV 2018 - my use of a colour background in the body section was causing the search algorithm to fail on occasions where the body colour was darker than some value (I think 127 in each / some of RGB). As a result for some of my templates it was not detecting the body box but instead using the header box as the body box.

 

Rather than modify the search algorithm I will reverse my colour scheme so that the header boxes contain the category colour and the body box stays white for consistent size detection. 

 

Thank you for the swift help!

Loren

0 Kudos
Message 4 of 4
(2,496 Views)