LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Centered Text on Ring Menu Button

This question is embarrassingly simple for someone who had been using Labview for as long as I have.

 

While I found this troublesome in the past I have decided I need to use "scale all object on the front panel as the window resizes" setting in the "windows size" menu in "vi properties" - using this in conjunction with maximizing during running to try to adjust to different screen resolutions the customers may need to use.  The "boolean" switches, like the "STOP" button have a nice setting under properties - appearance for "lock text in center" so when the button scales it looks nice. On the other hand for buttons like the menu ring (and others) which inexplicably don't have the "lock text in center" (possibly there is some deep reason I can't figure out) when the buttons scale the text ends up at the top of the button. Since I'm at the "anal retentive, want everything perfect" stage of the development of the GUI this has stuck in my craw.  I'd like to the text to be in the center of the button, same as for "boolean" switches.

 

I've tried a bunch of things, including messing around with the property nodes (there is one called "lock" but that isn't the same), and googling this one like crazy.  Anyone know how to do this, and if it is impossible, does anyone have some alternate suggestions.

 

0 Kudos
Message 1 of 10
(3,698 Views)

Hi,

 

If you want to centered text in ring control there are 2 ways to do this.

1.

 ring.jpg

 

2. Use the property node and select the property text justify to decide the text position.

 

Thanks and Regards

Himanshu Goyal

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
0 Kudos
Message 2 of 10
(3,687 Views)

There is no way to vertically center text in a text control without prepending \n.  You can "fake it" by changing the font size of the empty line to make up for partial lines since font size is setable on a line by line basis 


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 10
(3,683 Views)

Thanks for your reply Himanshu . However that is not the problem I am having.  It is the *vertical* centeredness that is the issue.  The text in all my buttons is already set on the horizintally centered setting

0 Kudos
Message 4 of 10
(3,678 Views)

Jeff,

 

I was afraid that was the case.  I suppose could just use an invisible button bar, but I don't like that look much better. Maybe if I grouped the invisible button to different graphic. (Note: nope, same problem - guess font scaling is the only solution. How do the boolean buttons do it?)

0 Kudos
Message 5 of 10
(3,669 Views)

They don't. 

 

If  you customize one and look at the text block with the parts tool you'll see the text block itself is fit to text.  and does not size with the boolean at all.  So LabVIEW just centers the text block rather than the text itself.


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 10
(3,660 Views)

Any fixes for this?  This is quite annoying.

0 Kudos
Message 7 of 10
(3,482 Views)

Pretty old thread this but you can try creating a type def from your menu ring and then

edit it by dragging down the top of the text box as shown. Smiley Wink

 

menu.jpg

 

Message 8 of 10
(3,471 Views)

Nice example Neil!

 

This is an old thread, but the same issue.  I don't use ring menu's too oftem, but normally I can get by with font sizes.  If you have 1 line of text instead of 3, just add a CR.  But if you end up with 2 lines of text instead, then it looks bad.

0 Kudos
Message 9 of 10
(3,464 Views)

 

Yes it's something that NI really should look at.

 

Thanks for the kudo ! Smiley Happy

 

0 Kudos
Message 10 of 10
(3,461 Views)