LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scale Label gets out of place

Solved!
Go to solution

LV2013.1, Win7

 

I'm experimenting with panes and resizable UI features for the first time.

 

So, I'm resizing the panel, and the panes, quite a bit.

 

One on of the panes, I have a WAVEFORM GRAPH, set to scale with the pane.

 

I notice that the Y-axis SCALE LABEL, will creep out of place, after a while:

 

Yaxis.PNG

 

 

 

Even worse, I cannot find a property to set this position.  The lebel is set to center-justify, but the rectangle that it centers in, is offset from the real center.

 

Even worse than THAT, it appears to be saved with the VI.  

 

If I REPLACE the graph, the new label is in the center.  But start playing with resizing the panel or the pane itself, and it creeps off center.

 

It happens on the X-axis, too.  Here is a JING showing the labels in the center, and creeping up / right : <http://www.screencast.com/t/xnN1Wb8Ke>

 

My guess is that there is a bias in rounding when calculating the center, and every time it lands on an odd size, it calculates the center and throws away the remainder.

 

Is there a "don't be stupid" property that I can set to fix this?

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 1 of 7
(4,471 Views)
Solution
Accepted by topic author CoastalMaineBird

Have a look at this thread, the OP propose a workaround.

 

Ben64

 

Message 2 of 7
(4,447 Views)

Thanks, Ben. 

 

I believe that it is a LV bug.

I bet they're doing integer arithmetic, and rather than recalculating the center as that post suggests doing, they are moving it proportionally.

 

461 pixels div 2 = 230

230 pixels x 2 = 460 and you've lost one.

 

Do that enough times and you're off the map.

 

 

I have reported as a bug to Tech Support.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 7
(4,429 Views)

This bug has been around for so long I had forgotten it was a bug at all.

 

Only this week I've had to implement code to make sure the label is at the right position each time the size of the graph changes.  Kind of defeats the purpose of LV doing it for me but that's life I suppose.

0 Kudos
Message 4 of 7
(4,404 Views)

More fun: possibly related.

 

If you have a CHART set to scale with the pane, and the chart has two digital displays, then good luck predicting where those displays will be:

 

JING: <http://www.screencast.com/t/gQVOMgv6hOpA>

 

Looks like they tend to co-locate, which is not that helpful...

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 5 of 7
(4,389 Views)
0 Kudos
Message 6 of 7
(4,373 Views)

Thanks RavensFan.  I gorched the link: < http://www.screencast.com/t/gQVOMgv6hOpA >

 

For the record, there is a property of the pane called MIN PANE SIZE which will help avoid the second problem..

 

By default it is {1 | 1 }, but if you set it to something more reasonable, like { 300 | 150 }, then you cannot shrink the window, or move a splitter if it would shrink the pane below that limit.

 

That property is not available from the front panel editor, it seems to only be available via code.

 

Just choose the adjacent splitter and select UPPER PANE (or whichever) - CREATE - PROPERTY NODE

Choose MIN PANE SIZE on the property and set it to something reasonable.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 7 of 7
(4,363 Views)