02-28-2008 12:29 PM
02-28-2008 02:19 PM
Hi Gustavo,
Before I make any assumptions of what's going on, could you please post a snapshot of the original panel, the panel after resizing, and then the panel after you programmatically set the font size back? Also, if you could post a snippet of CVI code as well that would be helpful.
Thanks
Best Regards,
02-28-2008 02:32 PM
02-29-2008 11:58 AM
Gustavo,
There are two separate issues:
1. You say that when you restore the panel to its original size, the control does not go back to its original proportions. But is that really true? In the screenshot that you submitted, the third panel isn't really the same size as the first. Can you confirm that if you really make the third panel the same size as the first the control doesn't go back to its original size?
2. You've probably noticed that as you resize the panel, you start seeing overlapping between the gauge and the digital display, as well as ovelapping of the numeric labels inside the gauge. The reason for this is because the gauge must always be circular. So, imagine that you're resizing your panel such that the width grows by a factor of 4, and the height grows by a factor of 3. What CVI does in that case is that it repositions and grows every part of every control by a factor of 4, widthwise, and a factor of 3x, heightwise. This works just fine for most controls that can be sized independenly in both directions. However, gauges cannot be sized independently in both directions. They must always be circular. Therefore, what CVI does instead is that it sizes its radius by a factor of 3.5 (halfway between 3 and 4). So, since the digital display is moving down by a factor of 3, but the gauge is moving down by a factor of 3, but growing down by a factor of 3.5, an overlap occurs. There really is no good solution to this. If instead you were to grow the height more than the width, you'd be left with a gap that is too large, rather than an overlap. The same phenomenon causes the labels to be overlapped: the font grows horizontally more than the gauge does.
This is a limitation of this feature, and is something you have to be aware of. If you enable "scale contents on resize", and you have knobs, gauges and meters in your panel, you're going to end up with some loss of proportionality whenever you grow your panel in a non-proportional fashion. If you want to avoid overlaps, you'll have to leave a large enough gap in the original panel layout. But it should be the case that as you go back to the original panel size, the controls also go back to their original sizes.
Luis