LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Child panel -how to put him at specific place in Parent panel

Solved!
Go to solution

Hello I created program with main panel which other panels as tabs.

I need to put child panel on on of the tab panels .

How can i do that and obtain view of the child panel only

on the right panel?

I'm attach a picture to describe.

 

Thank you for your comments

Meir

 

0 Kudos
Message 1 of 13
(4,017 Views)
Solution
Accepted by topic author Meir

Hi Meir,

it seems to me that you are missinig a very basic concept about the tab control: each tab actually IS a child panel! That is, all the controls you have on your test panel can be simply loaded on the tab page you want, leaving other pages unchanged.

You may be missing the scroll bar on the right, which effectively is not present on tab controls, but as far as I can see your interface could be reduced to a single table control put on a tab page with appropriate row and colunm headers.

 

In any case, if you don't want to heavily modify your existing code you can use InsertPanelAsTabPage () command to add a panel you have previously loaded to the tab control: in this case an existing scroll bar is maintained. Keep in mind that this instruction actually make a copy of the original panel, so you will need to retrieve the correct tab page handle to address control on the added page. The original panel can be discarded immediately after adding it to the tab control.



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 13
(4,008 Views)

Thank you for your fast respond.

I know thos panels are Child, i need this panel due to using scrol bar.

can you expand about InsertPanelAsTabPage()  ?

 

0 Kudos
Message 3 of 13
(4,001 Views)

Hi Meir

 

int InsertPanelAsTabPage (int panelHandle, int controlID, int index, int panelToInsert);

 

panelHandle - your main panel handle

 

controlID - the tab control id

 

index - the tab index 0....n

 

panelToInsert - the panel handle of your panel

 

A good advice is simply to copy the function to your CVI code right click with the mouse > Recall function Panel , there you can find the explanation for this function.

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 4 of 13
(3,988 Views)

Some few additions to Kobi Kalif explanations:

 

1. Handle = LoadPanel (.. your panel ...);

2. InsertPanelAsTabPage (..., ..., -1, Handle);   // Adds at end of pages. Otherwise specify proper index

3. DiscardPanel (Handle);



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 5 of 13
(3,980 Views)

Thank you all for your answers, i learned something new to me.

When using InsertPanelAsTabPage() if there is a dynamic control in the panel 'is the control in tab us dynamic to ?

For example is progress bar should be work as it work in the panel ?

Thank you again

Meir

 

0 Kudos
Message 6 of 13
(3,944 Views)

Based on what Roberto said that each tab is basiclly a chiled panel i think it should work... but i don't work with tabs that much so i can't be sure....

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 7 of 13
(3,934 Views)

I don't see the progress bar updates in the tab.

It's interesting , do i need to do some changes ?

0 Kudos
Message 8 of 13
(3,929 Views)

I'll try to implenet it later and i'll send you the result....

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 9 of 13
(3,926 Views)

Meir,

 

The progress bar is a custom control that is built on top of an underlying UI control (a numeric slide). The implementation for the progressbar (in progressbar.fp) lies outside of the UI library. This means that the UI library knowns nothing about the progressbar control. It "thinks" of it simply as a numeric slide. Therefore, when you copy a panel that includes a progressbar control by using a UIL function to perform the copy (for example, DuplicatePanel or InsertPanelAsTabPage) the function will copy the slide, but will not transform it into a new progressbar control. To do that, you'll have to call the ProgressBar_ConvertFromSlide function and pass it the copy of the slide control that was created. And if you had customized the original progressbar control, you'll have to perform the same customizations on the copy.

 

Luis

0 Kudos
Message 10 of 13
(3,912 Views)