07-14-2010 04:23 AM
In CVI 2009, if you have the 'scale contents on resize' attribute set for a panel with a menu bar on it, the menu bar font resizes with the panel.
Unfortunately, there is a rather severe bug in this. If you do the following repeatedly:
(a) Load a panel with 'scale contents on resize' set and a menu bar
(b) Enlarge it
(c) Display it
(d) Hide it
(e) Discard it
then the menu bar font gets progressively bigger and bigger each time the panel is displayed. Below is an example from the test project attached to this posting (four successive display iterations). To say this is inconvenient is understating the truth: It actually breaks many of my applications. Is there any way to stop this behaviour?
07-14-2010 07:53 AM
Hey Martin -
I've reported this issue with bug ID 240139. For the time being, you should be able to return the panel to its original size before discarding the panel as a workaround.
NickB
National Instruments
07-14-2010 08:32 AM
Not so nice if I have to modify all the apps affected
It would be really good if there was an option not to resize the menu bar, so the behaviour was more like normal Windows apps.
07-14-2010 03:14 PM
Hello Martin -
I'm very sorry for the inconvenience this bug has caused. Another workaround that may be a little simpler would be to update the font of the menubar with a newly created metafont immediately before showing the panel (and after resizing). This also has the added benefit of the menu retaining it's original size instead of being scaled. You could accomplish this with code similar to the following:
I also just wanted to add why the behavior of scaling menus with "Scale Contents On Resize" changed in LabWindows/CVI 2009. The problem was that when using scale contents on resize, all fonts are supposed to scale proportionately to the scaling of the panel. However, menu fonts did not scale, and this led to the problems seen in this forum. Because of the inconsistenty and to fix the bug reported on that forum, bug report 134165 was created and then fixed in LabWindows/CVI 2009.
Once again, I'm sorry for the inconvenience this has caused,
NickB
National Instruments
07-15-2010 07:20 AM - edited 07-15-2010 07:21 AM
Nick:
I've had discussions before with Luis and others at NI about the serious consequences of changing the default CVI run-time behaviour for existing applications when releasing a new version. I do wish you wouldn't do it, it costs us a lot of money.