UI Interest Group Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

The "Missing" System Control Suite - Vector Buttons

Hi All,

I love this Control Suite, but I do like to resize my buttons so I've changed the buttons to Vector based.

This is my first stab at using the VI package manager to distribute tools so be gentle with me.

They are done in LV2009, the vipc file should install the new buttons straight into your tools palette.

As time allows I'll try and package them up for other versions etc if anyone wants it.

Regards

Steve Watts

www.ssdc.co.uk

Comments
Active Participant Thoric Active Participant
Active Participant

Nice to see vectorised controls that one can resize without loss

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Active Participant Olivier-JOURDAN Active Participant
Active Participant

Hi swatts,

could you explain me how you obtain your vectorised controls?

What is the picture file format you use? Which application do you use?

Thanks,

Olivier

Olivier JOURDAN

Wovalab | Certified LabVIEW Architect |
Active Participant Thoric Active Participant
Active Participant

LabVIEW accepts WMF format (and possible EMF too) for vectorised graphics. You can create these from within Powerpoint quite easily.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Active Participant Olivier-JOURDAN Active Participant
Active Participant

Thank you for the tip.

Olivier JOURDAN

Wovalab | Certified LabVIEW Architect |
DFGray
NI Employee

Open source applications, such as Dia and Inkscape will also produce WMF format.  Note that using WMF graphics will probably limit you to Windows platforms.

This account is no longer active. Contact ShadesOfGray for current posts and information.
Active Participant Christina_R
Active Participant

This is a neat trick! I didn't know LabVIEW would accept WMF images.

Can I ask why you chose to replace the entire button image instead of making decals on System buttons?


Christina Rogers
Product Owner, LabVIEW R&D
Active Participant Thoric Active Participant
Active Participant

Christina - I tried vectorised decals once and found they do not scale with the button, so using a vectorised or bitmapped decal makes no difference. However, forgoing decals and superimposing the decal into the button images gets around this. Although this does have the odd disadvantage too.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Active Participant Christina_R
Active Participant

Ah yes, I forgot that decals don't scale with the button by default. There's a little unpublished feature in LV 2011 that I think you will like.   I'll talk about it at my NIWeek 2011 session on customizing controls.

If anyone wants to give me a vectorized image that would work as a system button decal, I'll run a little experiment... I think I can get it to scale with the button, even in versions of LabVIEW before 2011...


Christina Rogers
Product Owner, LabVIEW R&D
Active Participant swatts Active Participant
Active Participant

Many programs produce wmfs, sadly not very many produce wmfs that paste into LabVIEW correctly.

In fact as a minor project it would be nice if the community would come up with a list of programs that do and don't.

Or maybe I'm doing something wrong when using programs like OpenOffice Impress or InkScape.

I think that when the image is vectorized (if that's a word) and imported into a control it becomes a LabVIEW control image and is therefore platform independent.

As I only have Windows here I can't test my theory

Active Participant swatts Active Participant
Active Participant

Christina,

I'll add the powerpoint file with my images on it. I'd be interested in any results you get.

Active Participant Christina_R
Active Participant

I opened your VI on my Mac, and it almost works - the images show up, but the transparency doesn't work. (You get white backgrounds).


Christina Rogers
Product Owner, LabVIEW R&D
Active Participant swatts Active Participant
Active Participant

That's a shame

Active Participant swatts Active Participant
Active Participant

I've used Flash (very old version), Powerpoint and Pro-Engineer to produce wmfs that paste into LabVIEW correctly.

Active Participant Thoric Active Participant
Active Participant

ProE? Wow, didn't know that exported as WMF. I'd be interested in seeing what you created in that example if you're able to share it?

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Active Participant swatts Active Participant
Active Participant

oooh this was 10 years ago, I'll see if I can dig it out. It was an test system Interlock indicator, doors open, clamps shut. Looked very nice.

Active Participant crelf Active Participant
Active Participant

I designed the control elements for a UI in TurboCAD and exported them as WMFs (all the items on the UI move around to represent the actual machine's state) and it worked great.   I'd attach it to this post, but the "Insert Image" button isn't working right now for some reason...





Copyright © 2004-2018 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.
Active Participant Christina_R
Active Participant

I attached the results of my experiment, SystemStop1.ctl. It's not exactly what I'd hoped it would be.

If I add the image as a decal and use some secret tricks to have it resize with the button but restrict it to maintain its aspect ratio, it doesn't end up in the correct position after resizing the button.

So, the attached SystemStop1.ctl doesn't restrict the aspect ratio. If you grow the button in one direction, the image is squished.

What do you think? Useful or not good enough?


Christina Rogers
Product Owner, LabVIEW R&D
Active Participant Thoric Active Participant
Active Participant

Christina - Personally I think it's quite useful, but I agree it's a shame the decal can get distorted. Do you have to keep the tricks you used secret?

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Active Participant swatts Active Participant
Active Participant

Another question is that the system buttons should change button styles depending on the operating system. Is this why we should be changing the decal and not the button image?

Active Participant Christina_R
Active Participant

Thoric - After LabVIEW 2011 releases, the tricks will no longer be secret. (The key here is that LabVIEW already has ways of defining the resize behavior of control parts, but no UI for setting them. The unpublished feature in LV2011 lets you set them, but since only the UI is new, save-for-previous lets you get the resize behavior in older versions. Unfortunately, though, the resize-but-keep-aspect-ratio setting appears to always grow the part to the left, which moves the decal off of the button. I'll certainly try to think of how I can fix this in a future version).

swatts - Yes, using the decal would allow you to have a button that adapts to the OS.


Christina Rogers
Product Owner, LabVIEW R&D
Member normandinf
Member

This is really encouraging news. I can't wait to see what API is available in LV2011 to customize the controls.

Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast

Can anyone point me to the unpublished feature. I either know about it, and don't realize I do. Or, I can't find it.

Active Participant Christina_R
Active Participant

If you mean my unpublished feature, it's still unpublished. :-)

I talked about it at my NIWeek 2011 presentation, but the interface is very tedious and there are caveats about its (mis)use, so I don't want to give it out in general.


Christina Rogers
Product Owner, LabVIEW R&D
Active Participant David_Staab
Active Participant

With all due respect to Stephen and Allen, the exact same can be said of the Actor Framework, but they released it anyway because they recognized a gaping hole in the language's capabilities and knew how to fill it. AF is still a complex beast, even months after its online debut: there's a steep learning curve involved, and it's easy to shoot yourself in the foot. Creating large families of classes was also tedious until Allen published the Message Maker tool, and that's still imperfect. But for those who are capable of treating LV like a software engineering language and regularly wring every drop of capability out of it as integrators and product developers, AF is a blessing.

I hope you'll reconsider your stance and give the power users a chance to use your feature to enhance the capabilities of the language and provide feedback to you in an accelerated and direct interaction on the NI Community.

Active Participant Christina_R
Active Participant

I did give it out, to the "power users" who attended my NIWeek session. :-)

Seriously,though, I'll give it out privately if someone tells me they understand the risks and they want to use it anyway. I just don't want to publish it online so people can turn on these features without understanding that they're not ready for prime time.


Christina Rogers
Product Owner, LabVIEW R&D
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast

Unfortunately this "power user" was unable to get away from work for NI week . However, I will say I am going for my CLA next month and currently work for an alliance member so hopefully that gives you a bit of confidence that I won't botch stuff up too bad!. I do understand the risks but would really like to work with this to determine if it is something that will prove beneficial for our applications. My email is in my profile, and Christina, please let me know if you have any more questions or concerns.

Thanks!

Active Participant Christina_R
Active Participant

If you tell me you've looked over my session slides (https://decibel.ni.com/content/docs/DOC-17431), I'll e-mail you the key. :-)


Christina Rogers
Product Owner, LabVIEW R&D
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast

I'm all read up on it!

Member DavidZ.
Member

Hi Steve,

I installed your VectorMissingSystemButtons (two years later...). When resizing them (and also those of the VectorSystemButtons.vi) the contour/frame/border resizes also. Is this your expected behavior? If yes, then was your focus to have the gradient and icon resizing? Someone ever managed to keep the control's contour 1 pixel thick when resizing after he imported a customized (not LV-decoration) vectorgraphics image?

VectorSystemButtons - destorted.png

Active Participant swatts Active Participant
Active Participant

Hi David

It's expected if you use the full vector image, I've not played around with the decal stuff much..A job for the coming months I think.

I get round it by making the images near the size I'm going to use (unsatisfactory I know, but needs must)

Active Participant Matthew_Kelton
Active Participant

Unfortunately, LabVIEW does not use a 9-slice image for its images in controls.  You would need this in order to not have the border edges to scale with the image.  I would love to see the feature, but I suspect it's a pretty labor intensive feature to add.

Member DavidZ.
Member

Thanks for the info, swatts and Matthew. 9-slice image control would definitely be amazing! Or then to have more LV decorations available for customizing controls with vectorgraphics and their resizing capabilites.

David

Contributors