LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vertical Align

I found an example on the Internet about vertical alignment of the text. I tried to write code that would be more accurate for this functionality, but I'm running into math problems. I would be happy to help.

0 Kudos
Message 1 of 7
(157 Views)

A lot of people (most?) here don't have :V 2024.

Please save your VI as an earlier version.

0 Kudos
Message 2 of 7
(133 Views)

I don't understand the problem you are trying to solve.  I know that it involve "text" (so I presume that you are using String functions), but don't know what operations you are trying to do with Strings, except that in involves "Vertical Align" (whatever that is).

 

Are you trying to get LabVIEW to format a String so that it "fits nicely" into a String Indicator of a particular size?  And if so, why?  

 

Can you provide an example of the manipulation of a String that you would like LabVIEW to accomplish?

 

[You do know that LabVIEW is designed as an "Engineering Workbench" (the "EW" of "LabVIEW"), which have more to do with signals, controls of equipment, visualization of data from instruments, than with Word Processing.]

 

Bob Schor

0 Kudos
Message 3 of 7
(106 Views)

I'm looking for a property node that can perform the "Lock text in center" functionality. Using the property node called Justification I get horizontal alignment. In order to achieve vertical alignment (so that the text is somewhere in the middle of the string indicator) I need to perform certain actions.

The above code is an example I found online but it doesn't satisfy me. I'm interested in a more accurate way. So I tried (in the code below) to do something like this.

maxnoder1995_1-1730871545247.png



Finally I want to create a subVI that will perform this feature.

0 Kudos
Message 4 of 7
(95 Views)

Here are some options I would test if I wanted to do this:

  1. Use a picture control instead of a string. There you should be able to set the alignment for both axes, but I'm guessing the text might appear aliased.
  2. Use a .NET control which has this (even the standard textbox might).
  3. Use one element for the background and a second transparent string indicator for the actual text. Calculate the vertical text size, and then resize (I see that the String class has a Size to Text method, but I didn't test it) and position the transparent indicator appropriately so that it's centered on the background element..

None of these are ideal, but I think that's where I would start.


___________________
Try to take over the world!
0 Kudos
Message 5 of 7
(70 Views)

Thank you for your response. I'm interested to hear what do you think about the solution I proposed in the code I sent? Add end of line to the text at the beginning of the sentence, and define its size according to the container and the height of the text.

0 Kudos
Message 6 of 7
(39 Views)

"Lock Text in Center" is a property of boolean controls.

paul_a_cardinale_0-1730913307002.png  It doesn't affect justification within the text, it affects the position of the text in the boolean.

There is no text property for vertical justification.

 

Consider using the paul_a_cardinale_1-1730913809134.png method; then adjust the position accordingly paul_a_cardinale_2-1730913862411.png.

0 Kudos
Message 7 of 7
(25 Views)