LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

position of control, label and caption

Hello everybody,

I have a problem: How to set the positions of a control (checkmark in my case) along with positions of label and caption?

I tried it using property nodes. My problem: when I wire negative values to the caption (or label) the control moves around on the front panel. If I call the property nodes several times the control moves further... And the property nodes clearly give bad results back... (See attachment).

Is there an easy way to set the position of label/control relatively to the control? Or using absolute coordinates?
It's a mess to set 60 controls evenly spaced with label and caption in a circular manner 😞

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 1 of 8
(4,754 Views)
Ok, the issue here is how the control position works.  Imagine a rectangle that encompasses your entire control including captions and labels.  Now when you move a caption or label, you change your rectangle, thus when you move the control.....All positions move the absolute coordinate domain for the front panel.
Since I am not sure what your end game is here, so I put together a simple example, but to solve this you.  You can figure out the relative position of your label, caption and control make appropriate offsets and then move your control either before or after you play with your label/caption.  You should be able to make this a subVI using a generic ctl refnum.  You can use the master bounds property to give you the precise coordinates of the control itself.
Remember that 0,0 is not the top left corner of a front panel.  You can go negative in both directions.  Positive numbers are right and down. 
See attached...not pretty but functional.  You should be able to drop it in your example (LV7.1.1).

Message Edited by Pana-man on 11-22-2005 06:49 AM


Paul
Message 2 of 8
(4,743 Views)
Thanks Paul,

for your example. I made something similar for my program, but had the described problems.

But: were did you got those 'MastRect' and 'TotalRect' properties from? I don't find them in the properties selection list (right-click on property-> Properties: they are not in the list!).
And LabView help doesn't provide any information on them (right-click on property, help on... -> "The page cannot be displayed"). Are they new for LV7.1.1? I only use LV7.1.

Message Edited by GerdW on 11-22-2005 01:18 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 8
(4,736 Views)

😉  Can't say... but I suggest you check out forums.lavausergroup.org and do a search for "supersecret and superprivate".

Just be aware that there are reasons why you can't see everything....


Paul
0 Kudos
Message 4 of 8
(4,731 Views)
The problem is that the bounding box reference point is in the upper left hand corner. If a label is above or to the left of the control then it sets the reference point and the control moves. The easy answer is to hide the label and caption before moving the control. Play around with the attached vi and you'll see the issue more clearly.
0 Kudos
Message 5 of 8
(4,724 Views)
0 Kudos
Message 6 of 8
(4,722 Views)
Thanks Paul,

now it looks like it should...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 8
(4,714 Views)

glad I could help.  In LV8, properties and methods that are accessed the way I got to them are in a different colour.  I have no way to know without flipping switches which are hidden and not in LV7.  Your panel looks great.  Glad it works.

Paul


Paul
0 Kudos
Message 8 of 8
(4,710 Views)