02-12-2009 12:21 PM - edited 02-12-2009 12:23 PM
I have a problem with child panels failing to be painted under the following circumstances:
I have created a very simple application to illustrate the problem (attached). It consists of two panels in a .UIR file. I have generated the default code from this and simply added the loading of the second panel as a child of the main panel and the displaying of that child panel.
If I maximise the main panel, then minimise it using the '_' button in the title bar, when the application is subsequently reselected (by clicking its taskbar button or by Alt-Tab), the child window is not repainted correctly (I see my desktop through a hole in the main window where the child window should be). It only did this after I put a control on the child panel; if the child panel had no controls it paints OK.
This seems pretty fundamental, but I have been unable to influence this behaviour with any of the more obvious panel attributes (floating / sizable / movable / titlebar style / etc.) and there does not appear to be a panel event into which I can hook a fix as no event appears to be generated when the panel is re-maximised. Curiously if I minimise the application by clicking on its taskbar button when it already has the focus, or by using 'show desktop' it paints correctly when re-maximised.
I am using LabWindows/CVi version 8.5.1 (356) - which I note is also the version of cvirte.dll
and MS Windows XP version 2002 Service pack 2.
Is there a patch available for this, as it has all the hallmarks of the run time engine missing Window's paint event for the child panel or getting confused over clipping regions - that reminds me; dragging another application's window over the child causes it to be repainted and clicking on the child panel's invisible controls (if lucky enough to hit them) does operate the panel in its normal manner.
Any ideas anyone?
(Edit = forgot the attachment!)
Solved! Go to Solution.
02-13-2009 08:49 AM
Hi,
I have just attempted running your example code and don't seem to have been able to recreate the issue on my system. I am however running CVI 9.0 so I shall find a system with 8.5.1 and try it on this but just to let you know that I am looking into this for you.
Regards,
02-13-2009 09:57 AM
Thanks James, both for your time and trouble as well as for letting me know. My biggest fear was/is that you will be unable to reproduce it, as I appreciate this is always the first step.
I have just tried running the executable on an old Windows 2000 machine with cvirte.dll version 8.5.0.279 installed and the behaviour is the same.
Just to emphasise the point, the sequence is important; the application must have been minimised directly from its maximised state by using the title-bar button (or system menu 'Minimise').
Thanks & regards, Brian
02-13-2009 11:45 AM
James & Brian,
This is probably the same issue that was discussed here. If so, it was fixed in CVI 9.0. (Bug ID: 112287)
It's still not clear to us why it only happens in some PCs, but not others. At one point, it seemed clear that the bug only happened with Vista Aero enabled, but we now have 3 instances of cases where Vista was not the culprit. So we're back to not knowing.
In any case, the 9.0 fix should have taken care of the problem. To confirm this, you can download the CVI 9.0 runtime and try it out.
Luis
02-16-2009 05:26 AM
Many thanks Luis,
I think you are right it was the same issue as the other discussion. Why all my searching before posting my question didn't throw up that thread, I don't know.
I normally use the "Windows Classic" style with which this problem occurs. Prompted by that other thread I tried "Windows XP" style (before updating the RTE) and that didn't show the problem.
Updating the RTE to V9.0 has fixed it - thanks.
Regards, Brian