LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Child Panels - cannot FOCUS events are lost?

Hi all,

 

I am working with some legacy code that my boss would like updated.  We have a background (parent) panel with many child panels that can come and go.  Typically, we have two panels - one with controls and one with a graph - visible almost all the time.  I have been trying to use FOCUS events to do some things, but one child panel (the control) appears to constantly get and lose focus.  I'm seeing this in debug mode with the breakpoints at the event code for the panel callback.  I'm careful to move the code windows away from this panel so the mouse isn't over it, but that seems to make no difference.  Do child panels get the events of the parent panels?  Also, the child panels do not appear to have max/min or close buttons in the title bar like standard windows.  Is there some way to put them there without taking the child panel out of the parent panel?

 

Other things:

1.  The boss would like to be able to resize a panel down to the point where clipping occurs, then automatically rearrange the controls so they line up vertically on one side of the panel and stop the resizing when they begin to be clipped.  I have seen this done in Java with the Layout Manager, but never in C. Any suggestions?  I know we can set a minimum resize value for a panel, but are there any easy ways to move the controls the way he wants? 

 

2.  An alternative is to make a toolbar with the controls inside, but he likes the windows icon tool buttons which I don't believe we have access to in CVI.  I know we can make a command button and import an image to it, but is there a package that has the standard windows tool buttons that we can use?

 

Thank you for any and all help.

 

Judy Harrigan

0 Kudos
Message 1 of 3
(3,575 Views)

I cannot say I have understood exactly what you have described: which type of panel events are you trying to handle in the parent and child panels? Which of them are you missing as per the topic subject? Can you post some sample code that can clarify your situation?

 

Regarding the other questions in your post:

- child panels in CVI are completely diffferent from MDI mechanism in Windows; I don't remember whether a child panel can have min/max buttons or not but it can be easily tested: look at panels.prj located in samples\userint directory where several top level and child panels are handled

- I do not know how to access standard Windows icons, but some similar images can be found in the example program for the toolbar control (it should be in toolslib\toolbox\custctrl or something like that). Additionally, NI distributes a huge collection of icons that can be used to customize your own toolbar



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(3,568 Views)

Hi Roberto Bozzolo

     For the parent panels and the children panels,I have some questiones to ask you ,could you tell me how I should do? Monthes ago ,I have asked the same question in NI.COM ,you  cansee the uir:http://forums.ni.com/t5/LabWindows-CVI/menubar-and-toolbar-enveloped-by-the-childpanel/m-p/1112563,

 

I use :GetPanelAttribute (mainPanel, ATTR_SYSTEM_WINDOW_HANDLE, &parent);

          GetPanelAttribute (mlsPanel, ATTR_SYSTEM_WINDOW_HANDLE, &child);

          oldparent = SetParent((HWND)child, (HWND)parent); to create an mainPanel and a childPanel.

 

For the mainPanel ,it contain the menubar and the toolbar,when I load the childPanel and move it,or

 

click the maximize,the menubar and toolbar for mainPanel enveloped by the childpanel.I want the

 

menubar and toolbar on top of the childPanel,can you tell  me  what I shoud do?

 

444.JPG

333.JPG

 

    you can see ,when I maximize the child panel,the menubar and the toolbar for the parent panel are enveloped by the child panel,also the title for child panel display under the parent title,this are very inaesthetic.and how I should do to make the child panel and the parent panel works as the windows style like the under-side example? 

 

    When click the maximize button for the child panel,the title for child panel disappeared and the "minimize button","renert button",and "close button" for the child panel display on the top right of the parent menubar.To all of this,how I should do,could you please help me?

 

19709i3F24643C8EC1BDDD

 

0 Kudos
Message 3 of 3
(3,497 Views)