NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
toineroetman
Posts: 28

Triangle or free shape Boolean control

I like to make a Triangle or Free shape Boolean control.

Normally a control is rectangular.

Does anyone know how I can change this.

How do I get the shape points (Dots) like in a Push Button Control ?

 

I do not want to have overlapping rectangle area. See Vi.

 

With Kind Regards,

Toine

 

 

shape-control.JPG

Active Participant
ninlmartijn
Posts: 1,166
0 Kudos

Re: Triangle or free shape Boolean control

Dear Toine,

 

I only discovered round (push button was originally round) or rectangle shapes. I'm still figuring out how those are arranged.

 

Best regards,

Martijn S
Applications Engineer
NI Netherlands
Member
toineroetman
Posts: 28
0 Kudos

Re: Triangle or free shape Boolean control

Martijn S,

 

Thank for your reaction.

 

What a mean is i want to have a flexible shape like the oval button (last one from first message)

 

If possible 2 arc's and 2 Lines :

 

 

2-arcs-2-lines.JPG

 

but can also be 4 lines: (easier because only 4 movable points)

 

 

4-lines.JPG

 

 

If someone has this or knows how to make this please let me know.

 

Somewhere I read you need to have a vector based drawing program ?

 

 

With Kind regards,

Toine Roetman

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Member
patrickpollock
Posts: 18
0 Kudos

Re: Triangle or free shape Boolean control

I would check out the UI interest group, particularly this link:

 

https://decibel.ni.com/content/groups/ui/blog/2009/05/20/a-ui-challenge-and-a-labview-response

 

If you want a vector based drawing program, Inkscape is good (and free).

Member
toineroetman
Posts: 28
0 Kudos

Re: Triangle or free shape Boolean control

patrickpollock,

 

Thanks for your reaction.

 

I looked at the UI interest group and opened the program. It looked very promising but could not find what i wanted.

 

Maybe I was not so clear.

 

I like to have the selection area (with the mouse) to be Triangle or free shape or 4 lines.

The rectangle selection area under the green picture gives me a overlap.

So when I push the button with the mouse it is not certain that I have Right or Up.

 

 

up-right-down-left.JPG

 

 

Maybe someone saw How I can make a selection area with 4 lines instead of a rectangle.

 

 

4-lines.JPG

 

 

 

With kind regards,

Toine Roetman

 

 

Active Participant
Thoric
Posts: 1,499
0 Kudos

Re: Triangle or free shape Boolean control

[ Edited ]

Hi Toine,


This idea of yours intrigues me, and until you mentioned it here I honestly thought you could already achieve what you need by using the alpha layer of an image. However, following some investigation, I now see that you cannot create a control with a non-rectangular detection zone.

 

I can easily see how you will encounter problems in your segmented control where their boundaries, although transparent, overlap. That which is highest in the z layer will receive the mouse click in those regions of collision.

 

I've been trying to create a control this morning that ignores mouse clicks over transparent areas, but have failed. I wonder if this is not at all possible. What I would hope for is the ability to set the control to ignore mouse clicks that occur on any transparent pixels of the embedded image. This would save you from having to define the 'detection zone' with a free shape.

Thoric (CLA, CLED and LabVIEW Champion)
Knight of NI
johnsold
Posts: 10,147

Re: Triangle or free shape Boolean control

With a Picture control use the Mouse Property node.  It will tell you when the mouse is clicked inside the picture control and will give the cursor coordinates.  You would need to keep track of the images you have drawn within the picture control to determine which "button" was pressed.

 

Lynn

Active Participant
Thoric
Posts: 1,499
0 Kudos

Re: Triangle or free shape Boolean control

Hi Lynn,
Yes, this is a useful workaround.
However, it doesn't quite provide the look and feel of a 6-state system Boolean.

I once created a similar control to the one described by the OP with highlight effects and shadowing for the different states, which would become quite difficult using a picture control that embeds multiple non-rectangular detection zones. However, there may be no alternative here?
Thoric (CLA, CLED and LabVIEW Champion)
Knight of NI
johnsold
Posts: 10,147
0 Kudos

Re: Triangle or free shape Boolean control

I agree that trying to fully emulate the performance or look of a standard boolean with a picture control will be a lot of work, if even completely possible.

 

Lynn

Trusted Enthusiast
Darin.K
Posts: 3,920

Re: Triangle or free shape Boolean control

Well I gave myself a few minutes to test something and this is about as far as I could get.  I use a Picture Ring instead of a picture.  Not bad, it is fairly easy to expand to include mouse over effects.

 

PictRingButtons.png