Jump to content

How To: Enum Control With Drop-down Like Menu Ring?


lvb

Recommended Posts

I would like to create a control that has Enum data type, but looks like this (menu ring):

post-4274-1153940806.png?width=400

The Enum does not have a drop-down arrow for the user to realize more options are available, and I find the Menu Ring control more clear.

Is this possible?

Thanks!

Link to comment
I would like to create a control that has Enum data type, but looks like this (menu ring):

post-4274-1153940806.png?width=400

The Enum does not have a drop-down arrow for the user to realize more options are available, and I find the Menu Ring control more clear.

Is this possible?

Thanks!

Use enum under Controls->System->Enum. You can also select the enum control on a block diagram and then select customize control from the Edit menu and then press the wrench icon to be able to edit the look and feel of the control.

Link to comment

This could be a little tricky because the enum control doesn't have an equivalent selector object. It only has an increment decrement. The selector equivalent is the entire text field. Pasting a down arrow there will replace the text field and is messy.

I would suggest, instead to decouple the GUI requirements from the diagram data requirements as indicated in the image. This way you can use whatever you like as a control and still get the benefits of enum datatypes on the diagram.

post-2-1153947087.png?width=400

Link to comment
This could be a little tricky because the enum control doesn't have an equivalent selector object. It only has an increment decrement. The selector equivalent is the entire text field. Pasting a down arrow there will replace the text field and is messy.

I would suggest, instead to decouple the GUI requirements from the diagram data requirements as indicated in the image. This way you can use whatever you like as a control and still get the benefits of enum datatypes on the diagram.

Excellent! This actually solves a readability issue with all of the LabVIEW programs that I have inherited. Now I can go through all of the case structures and replace mystery numbers with descriptive text. Thank you for the great tip!

Link to comment
I would like to create a control that has Enum data type, but looks like this (menu ring):

post-4274-1153940806.png?width=400

The Enum does not have a drop-down arrow for the user to realize more options are available, and I find the Menu Ring control more clear.

Is this possible?

Thanks!

With a little graphics manipulation using the control editor it's not that hard.

First open the menu ring in the control editor and switch to the tweezer tool.

Copy the rounded back decoration to the clipboard.

post-584-1153972579.png?width=400

Close and open the Enum in the icon editor and switch to tweezer.

Make the text background transparent and replace the border with the clipboard Item.

post-584-1153972553.png?width=400

Download File:post-584-1153972571.vi

Now do the same steps with the little triangle and you have a custom enum.

post-584-1153972515.png?width=400

post-584-1153972544.png?width=400

post-584-1153972529.png?width=400

post-584-1153972563.png?width=400

Link to comment
  • 4 weeks later...
This could be a little tricky because the enum control doesn't have an equivalent selector object. It only has an increment decrement. The selector equivalent is the entire text field. Pasting a down arrow there will replace the text field and is messy.

I would suggest, instead to decouple the GUI requirements from the diagram data requirements as indicated in the image. This way you can use whatever you like as a control and still get the benefits of enum datatypes on the diagram.

post-2-1153947087.png?width=400

I recommend always using the Variant to Data function, in order to perform normal numeric coercion to and from the enum data type. If you use the Type Cast function and your numeric representations don't match, then you will not alway get what you expect.

post-17-1155879101.png?width=400

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
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.