LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the real panel size?

Solved!
Go to solution

Hello all!

I want to create a message popup with varying text. The text is in a transparent string indicator that line wraps the text and auto-stretches the height. This works so far.

But due to the auto-stretch, the vertical position of the string box changes. So I want to position it in the vertical center of the message window. Problem: I don't get the real size of the panel.

MaSta_1-1669198824272.png

 

 -> The FP grid is 10 pixels, the FP is approx. 80 pixels of height. The FP range height reads out as 73. The window height reads as 114, because it includes the title bar. With those values I cannot place the text box in correct vertical center. The only value that's correct here is the string box height. 

 

Ideas to solve this? Thanks in advance.

 

0 Kudos
Message 1 of 6
(291 Views)

Addition: I found out that "range height" is the height of the panel occupied by elements. 🙄

0 Kudos
Message 2 of 6
(275 Views)

You want to get the panes size, that is subclass of the VI, and a VI can have more than one pane (if you use splitters).

Rolf Kalbermatter
Averna BV
Message 3 of 6
(236 Views)
Solution
Accepted by MaSta

Found it. There is a property called "Areas" or so (german: Bereiche), which puts out an array of references. In my case it's only one. If I use that

to read the area height, I get the adjusted height of the visible panel area according to the grid:

 

MaSta_1-1669206009860.png  or 

MaSta_2-1669206032633.png -> Text is nicely vertically centered.

 

 

 

 

0 Kudos
Message 4 of 6
(222 Views)

@MaSta wrote:

Found it. There is a property called "Areas" or so (german: Bereiche), which puts out an array of references. In my case it's only one.


That are the panes. If you added a splitter to the front panel you would get two references.

Rolf Kalbermatter
Averna BV
Message 5 of 6
(217 Views)

@MaSta wrote:

Hello all!

I want to create a message popup with varying text. The text is in a transparent string indicator that line wraps the text and auto-stretches the height. This works so far.


As a side note, the build in Three Button Dialog does this.

 

If you give buttons empty labels, they're not shown. This gives you a one button dialog with resizable text.

 

You could simply use this dialog, or study this dialog as inspiration.

Message 6 of 6
(191 Views)