Jump to content

Custom buttons - how to customize behavior


Recommended Posts

Request: A button that has the "parts":

1) Boolean Button --> round shape with 6 part items

2) Boolean Glyph --> must also have 6 part items

 

For example, the standard LED is close to what I want, but it only has 4 item states, so there is no 5/6th states for hover-over value.

image.png.ed5be03ce0aaf843f020720268f7bcf5.png

 

Taking this a bit further:
The NxG buttons all have 6 item parts.  However, the NxG buttons don't have a "Boolean Glyph" item part.

So, naturally, I would like to understand: am I able to "import" the "boolean glyph" item part from the LED into a NxG button control?

 

All of the forum posts that I've found thus far only document how to add decorations, or how to modify existing item parts in a control.  There is no documentation on how to actually add item parts to a control... which I suspect is sorta getting into a layer of code not exposed to me.

Link to comment

The DMC GUI Suite has buttons that have:

1) "Boolean Button" --> 6 part items

2) "Boolean Light" --> 4 part items

I can't seem to figure out how they were able to make this combination, because I can't find any control on the native palette with these item parts.

image.png.38496159954190ffca46f847fbce7160.png

 

For what it's worth, I'm really hoping to be able to create a custom button that has a circular click-radius, but also allows for me to important custom pictures for all 6 boolean states.

Importing custom pictures into a NxG or System button control is easy to get work.

What's slightly more difficult is that I'm hoping to be able to use a transparent "Boolean glyph" item part as the thing that dictates the click-bounds.  That way the button doesn't appear as a circular image, with a square click bound.

I recognize that there are lots of workarounds here, but I'm sorta just hoping that maybe there is some way to create the control with the item parts that I desire.  This DMC button is sooooo close to being exactly what I need.

Link to comment

I seem to recall you do need to start with one of the controls that has 6 pictures. I played around with this years ago but cannot remember how I started. Will try and remember!

Did you try the System style controls? They have 6 pictures and are editable (I think).

Edit 2: Sorry I don't think I read your original post properly...

Edited by Neil Pate
Link to comment

Here, I made a demo illustrating what I'm trying to accomplish.  It's kinda cool:

image.png.2166fc8e75c0aa4aa7f62550477ffaa9.png

Note how I've been able to create a button using custom (rectangular) images, but I still have an oval click area.  That way, clicking the corners does nothing.  Which is good!

The only thing missing: This demo button only has 4 item-parts.  I really wish I could get a control with this behavior, but also with 6 item parts.  (So that I can import custom images for the mouse over states.)

demo round custom button.vi

Link to comment

You can import boolean glyph as Decal to any button.

For other controls, you can add images as long as you can set it to "slave to frame".  Only LabVIEW decorations (vector image) can resize without problem.

There is no way to change a 4 part items button to 6 part items button.

 

Link to comment
15 hours ago, bjustice said:

I can't seem to figure out how they were able to make this combination, because I can't find any control on the native palette with these item parts.

The System Button has the mouse over images.

You can't "import parts", only the images for the states. That includes if you simply want to change the mouseover colour (copy the image, paste it into an image editor, change the colour, then import it back again).

The mouseover also only works while the VI is running.

Edited by ShaunR
Link to comment

Oh wow, Zou is right, you can copy item parts to clipboard, and then paste these item parts over other item parts.  This seems to carry more than just a static image - this carries the item part type and properties.

I'll keep poking at it with this new information, thanks.

 I really wish LabVIEW had a more full-featured custom control editor.

Link to comment

This is also how Altenback was also able to create a round color box.  His instructions here:

https://forums.ni.com/t5/LabVIEW/How-to-Control-color-of-each-element-in-a-cluster/m-p/236274?view=by_date_ascending#M129209

He is also importing 1 item part into another item part.

It's weirdly unpredictable what importing some part types into other part types will accomplish.

Link to comment
On 1/31/2023 at 7:42 PM, bjustice said:

 I really wish LabVIEW had a more full-featured custom control editor.

That custom control editor is one of the more arcane parts of LabVIEW. It exists since at least LabVIEW 2 and has seen only small improvements since. And according to its original creator back at that time it is a pretty nasty piece of software code that would need a complete rewrite to be able to make more elaborate modifications to it. Chances for that to happen are about 0.0something % nowadays. Unless someone somewhere is willing to pour a few millions into this. 😎

Edited by Rolf Kalbermatter
  • Thanks 1
  • Sad 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.