10-26-2011 04:11 PM
The shape of a control depends on the shape of the graphics in the controls parts. you'll need something just a bit petter than MS Paint yo be able to save shapes that are not rectangulat. Tim mentions a few in his nugget
10-26-2011 06:12 PM
I can't do free shape, but here is triangle.
It's quite possibly the ugliest control I've ever made but it demonstrates the concept.
You can change the images for prettier ones later.
10-26-2011 10:37 PM - edited 10-26-2011 10:38 PM
It turns out changing the images is harder than it seems!
The images I used in the example were the LabVIEW triangular shaped decorations.
Using them you CAN make triangular buttons. But if you replace the images, they go rectangular again.
In this version of the triangle buttons example I've have to make the original control invisible and line it up over picture rings.
Hovering over and clicking on the original control (even though you can't see it) triggers changes to the picture rings underneath.
So it looks like it works the way you expect it to.
Lots of event handling though. Quite inconvenient to implement.
10-26-2011 11:34 PM - edited 10-26-2011 11:42 PM
Does it have to be perfect?
Why don't you use some round controls and a little customization?
Here some ideas.
10-27-2011 02:43 AM
10-27-2011 08:04 AM
adding fule to the fire and tossing about thoughts.
I have done similar and yes it requires a lot of code to support it.
1) You can use transparent decorations to cover areas where you don't wna the click to be active. So use them to cover the trnasparent parts.
2) A rectangular sweet spot requires ony tow "In range" checks to see if the click was over a sweet spot. Non-rectangular shapres require knowlege of the function that defines the boundry so we need four sets of "m"s and "b"s and to evaluate if the click was a sweet spot.
In my rescent version I implemented the control as an object that was capable of evaluating if it was clicked. I think that app required about 1200-1500 VIs to realize the GUI.
So yes the Picture control can do it but if you can get away with native controls and hacks go for it.
Ben
10-27-2011 08:34 AM
Toine,
I think you should post an idea in the LabVIEW Idea Exchange on this. I think it's long overdue that LabVIEW have the capability of creating such controls. I can have a button be of an arbitrary shape in a Visual Studio app, and as LabVIEW is a GUI-intensive environment, it should be easy to do it, rather than having to jump through so many hoops.
While anyone can post this idea, since you brough up the issue, you should get the post (and the Kudos).
10-28-2011 07:37 AM
Thanks every body,
I can use the triangle shape.
Troy, I looked everywhere to make/find this shape.
How did you make/find it. Because it looks like a rectangle but the selection is only in the triangle.
With kind regards,
Toine
10-30-2011 08:04 AM
@Troy K wrote:
"The images I used in the example were the LabVIEW triangular shaped decorations."
In the Front Panel controls 'Decorations' menu.
10-31-2011 03:39 AM
it looks like a rectangle but the selection is only in the triangle.
this works only with the shapes provided in decoration palatte.
but the problem remains in place if you customized through any other picture or shape.