LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Menu operation takes focus from child window in CVI7 but not CVI6.

Has anyone any ideas on how to get around the following behaviour of the cvi7 run-time engine.

The run the attached project. Click on the child panel and you will note that it's panel handle appears in the "current active panel" numeric. Now operate the menu of the parent panel. In CVI 6 the child panel remains the currently active panel but in CVI 7 focus is taken by the parent panel. N.B. this may not be easy to reproduce since it is the run-time engine that is important, not the compiling version of cvi. You may have cvi 6 and 7 installed but if you installed cvi 7 last it appears that the cvi 7 run time is then used by both 6 and 7.

This seems a small point but many applications have this "
multiple document interface" format with a single menu on the parent panel (see the new integrated enviroment of CVI7 for an example).

Can anyone from NI tell us what has happened?

Regards,
Paul Barber
Gray Cancer Institute, UK
0 Kudos
Message 1 of 3
(2,658 Views)
Paul,

I was able to reproduce what you described, and it does seem as if a bug was introduced in CVI 7. We will be investigating it shortly, and it will be fixed in the next version of CVI.

In the meanwhile, I found a workaround that, although a bit klunky, might be able to help you until this is fixed: it centers around using the menu's dimmer callback to override the change in panel focus. I made some slight modifications to your test program which should bring about the desired behavior, regardless of which version of the run-time engine you're using. The modified code is attached.

Luis
NI
Message 2 of 3
(2,658 Views)
Greetings, Paul

In all likelihood you no longer have great interest in this issue, but in case you do, I thought I'd give you an update.

I just now investigated this problem, and what I found is that it actually is working as intended. It is true that the behavior changed between version 6 and version 7. However, in this instance it was the behavior in version 6 that was buggy. All versions prior to version 6 had the same behavior as the current version has.

The underlying cause for the change had to do with a quirk in the way the tracking of menubars was implemented in version 6. (The change we made was related to how menubars behave when one "hovers" over them with the mouse). Because this quirk had caused other problems in version 6, we rewrote it for versi
on 7, and as a result, the de-activation of child panels was reintroduced whenever the user clicks anywhere on the parent panel -- including the menubar.

As to the merits of the current behavior, I understand your point that in an MDI application, operating the menubar of the parent panel should not deactivate the top-level MDI window. However, there are many ways in which child panels do not behave like MDI windows. Every now and then we receive requests that we offer MDI behavior in our child panels (such as max/min/restore buttons, for example). If we do decide to offer this in the future, then we will have to address this issue.

I apologise for the inconvenience. I hope the workaround I had suggested in my earlier response is not too cumbersome.

Luis
NI
0 Kudos
Message 3 of 3
(2,658 Views)