09-22-2013 06:45 PM
Hi everybody,
I'm trying to create some custom controls to extend the range of silver controls which have the family look of the background and the frame.
In particular I'm trying to make a horizontal progress bar look like a tank, and a rectangular boolean indicator with a frame like the numeric indicator.
I have managed to isolate the parts I want, save them as PNG files with GIMP and then import them back into the new control.
But whenever the control is resized, they also resize (ie the "pixel size" changes)
In other words, when you increase the size of a normal silver numeric indicator the frame doesn't get fatter,
but if I increase the size of my custom one, it does get fatter.
Am I doing something wrong or is this just the way things are?
Also I've noticed that with my tank control, once I've saved it and then placed one on
my front panel, the extra part (ie the new background plate) is not locked to the rest of the control,
but can be moved around separately. Is this normal?
I'm using labview 2011.
Jonathan.
09-23-2013 01:31 AM - edited 09-23-2013 01:32 AM
Personally, I don't really like the silver controls. I'm not a huge fan of their look and they eat up a ton of real estate if you try to put them into a cluster or an array.
That said, if that's what you want, then yes, you are doing something wrong - you're going through PNG. The parts you want are vector images saved in a particular format. If you want them to resize properly, they need to still be vector images. The most practical way, in this case, is to open the customize mode, copy the relevant part (the background of the numeric) to the clipboard and then edit another control and replace one of the parts with the one in the clipboard. This is what I quickly did in the attached VI (I had to rename it because of a problem with uploading VIs) and it seems to resize decently well.
You can see other examples of customization in the UI interest group in the NI communities.
09-23-2013 02:14 PM
Also, some Microsoft programs will allow editing of the graphic, if painfully, and still retain them as vector type. I have used PowerPoint, for instance, a painful "graphic editting" program.
09-23-2013 11:51 PM
Thank you gentlemen for your replies.
The two controls look very interesting, especially the boolean as it's very like what I am trying to produce!
Thanks Knight of NI for taking the trouble, especially as you don't like the silver theme!
I knew that PNG files aren't vector ones, just had a forgetful moment!
What vector file formats can LV import? I've tried creating a couple using Inkscape but no luck.
I'm still experimenting, and am trying to figure out a few strange things.
Is there any way of deleting an unwanted part from a control?
Or any way of seeing the layer order of parts?
Jonathan.
09-24-2013 06:01 AM
The control editor is pretty old and doesn't support many features which would be really nice to have (like supporting SVG), but everything you can do can found in there, including resizing the various parts (so that they are effectively invisible) or maybe even using the reorder button to move them on the Z axis (don't know if that's possible).
The relevant formats are EMF and WMF, but even that won't help you entirely, as LV's actual vector format is something called PICC, which you can't import directly. This has relevance when you try to draw line types. Like I said, in general, the control editor is pretty old and shaky, so keep in mind that there are many things which you just can't do. Playing around with it is a good way to find out what it can do.
09-24-2013 03:20 PM
Never thought to resize something to zero! I suppose I can also make every pixel transparent.
I did try importing SVG and WMF but LV spat them both out!
The reorder button gives four options, but they're not much use if you can't see what the order actually is!
(although "Move to Front" and "Move to Back" obviously work!)
I hoped that the order in the parts window would change with this but it doesn't.
To quote an old Britsih sitcom "How sad; too bad; never mind!" Hiopefully NI will revamp this aspect soon.
I've now got a real challenge ahead. I have done a project which was developed for serial comms and then had to produce a TCP version.
So I've got two projects which do exactly the same thing but with different comms protocols. Updates are a real pain, and both are in use.
I think I will have to figure out a way to combine them into one application with user selectable comms system.
Jonathan.
09-25-2013 03:16 AM
Two options: