LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

resizing problem in custom controls

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.

0 Kudos
Message 1 of 7
(4,839 Views)

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.


___________________
Try to take over the world!
0 Kudos
Message 2 of 7
(4,817 Views)

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.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 7
(4,792 Views)

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.

0 Kudos
Message 4 of 7
(4,772 Views)

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.


___________________
Try to take over the world!
0 Kudos
Message 5 of 7
(4,764 Views)

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.

 

0 Kudos
Message 6 of 7
(4,748 Views)

Two options:

 

  1. LVOOP with inheritance (although I wouldn't recommend that if you're not familiar with OOP).
  2. If you're using the TCP functions, ditch them and move to VISA, which can support both TCP and serial. I believe there are some differences in functionality between the two, but I think the basic functionality is the same, so if you have the VISA code you basically just need to change the VISA resource name to work with TCP. I'll leave it you to do the research.

___________________
Try to take over the world!
0 Kudos
Message 7 of 7
(4,736 Views)