LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to use multipanel?

I want place form1 and form2 on District1,district1 is part of form0,and form1 and form2 can adjust automatically,form1 and form2 can minmize,maxmize.Of cause they still are within the range of District1.
In addition,Can I use two or more .uir files in one project?
thanks for any help!
0 Kudos
Message 1 of 6
(3,362 Views)
If I'm not wrong, it seems to me that child panels are the answer to your first question. I suggest you look at panels.prj, a sample shipped with cvi, that shows you the behaviour of child panels.

As per your second question, the answer is yes. You can add to yur project many uir files, provided that you include the corresponding include files in your source code and that there are no duplicated panel names between the uir files (i.e.: while uir editor controls that all panels in a single uir have different names, you could give the same name to two panels in different uir files; this will result in compiling errors).

Hope this helps
Roberto


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?
Message 2 of 6
(3,362 Views)
dear Roberto Bozzolo :
After study your example,I know something,but this function is not I am desired for.here is a program that I want to realize my desired function .
PANLE is the parent of PANEL1,PANEL1 is the parent of
PANEL2,but i want to hide PANEL1's title,when I
SetPanelAttribute(child1Handle,ATTR_TITLEBAR_VISIBLE, 0);my desired funtion disppears.how can i do?or is there any methods to supersede?
0 Kudos
Message 3 of 6
(3,362 Views)
Hi,
I looked at your project, and after some little modifications it works. I modified the calling callback this way:

int CVICALLBACK Popup (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
int left, height,width;

if (event != EVENT_COMMIT) return 0;

child1Handle = LoadPanel (panel, "child.uir", PANEL1);
child2Handle = LoadPanel (child1Handle, "child.uir", PANEL2);

GetCtrlAttribute (panel, control, ATTR_LEFT, &left);
GetCtrlAttribute (panel, control, ATTR_WIDTH, &width);
SetPanelPos (child1Handle, 0, left + width + 20);
DisplayPanel(child1Handle);

SetPanelPos (child2Handle, 10, 10);
DisplayPanel(child2Handle);

return 0;
}

In my opinion your panels were loa
ded but were not visible 'cause outside the boundary of the parent panel.
In order to check the behaviour of the program, I modified the background color of the first child panel so to see if and were was it displayed, and looked at the return code for LoadPanel and DisplayPanel functions (that were both 0), next I put it in a 'good' position inside the parent panel.
The same with the second one.

Regards
Roberto


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 4 of 6
(3,362 Views)
I correct my program like you,but i can maxmize/minmize child2Handle within the range of child1Handle,what should I do?
thank you every much!
0 Kudos
Message 5 of 6
(3,362 Views)
Since using SetPanelAttribute with ATTR_WINDOW_ZOOM parameter has no effect on child panels, you'll have to calculate the desired dimension for the child panel and set it manually in a callback.
Try this function:

int CVICALLBACK Maximize (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
int parent, theight, pheight, pwidth;

if (event != EVENT_COMMIT) return 0;

GetPanelAttribute (panel, ATTR_PANEL_PARENT, &parent);
GetPanelAttribute (parent, ATTR_HEIGHT, &pheight);
GetPanelAttribute (parent, ATTR_WIDTH, &pwidth);
GetPanelAttribute (parent, ATTR_TITLEBAR_THICKNESS, &theight);

SetPanelPos (panel, 0 + theight, 0);
SetPanelAttribute (panel, ATTR_HEIGHT, phei
ght - theight);
SetPanelAttribute (panel, ATTR_WIDTH, pwidth);

return 0;
}

Regards.
Roberto


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 6 of 6
(3,362 Views)