Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5417

MDI in CVI applications?

$
0
0

Hi,

 

I'm trying to make an application using MDI in CVI.  I've run across a few old threads from people attempting to do the same thing.  It seems that the general way of doing it is to:

 

1.  Load the 'child' panel as a top level panel.

2.  Use the SetParent(...) function in the Windows API to make the top level panel a child window in my application.

3.  Call DisplayPanel(...) to show the child window.

 

At first glance, this seems to work.  Except, it doesn't really.  The main one is that CVI doesn't see these child windows as children of the top level panel.  As such, function calls like

GetPanelAttribute(parent, ATTR_FIRST_CHILD, &child)

Don't seem to work.  However, since I know what child panels I've loaded I can manually track this myself in my application so it's a bit more work but doable.

 

However, where I've really run into a problem is that I would like to have scroll bars in my parent window..  Since CVI doesn't "see" the child windows, when I drag a child window off the side of the parent, the parent window doesn't realize that something is out there and the scroll bars won't activate.  To make matters even worse, the child window is drawn on top of the scroll bars which is undesirable.  I tried a few tricks such as a transparent control that I can set at the bottom right of the parent window to make the scroll bars activate (works, but the children are still drawn on top of the scroll bars). I also tried creating a larger 'inner' CVI child panel inside the parent (also gets the scroll bars to work), and loading the child windows into it (doesn't work).  This didn't work as CVI child panels aren't real 'windows' so the trick above doesn't work on them.

 

So what I'm getting at, is there a better way of doing MDI in CVI now?  Or is there a way of getting close/maximize/minimize controls in the titlebar of native CVI child panels, which is really what I'm after?  Thanks.

 


Viewing all articles
Browse latest Browse all 5417

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>