02-08-2011 04:20 AM
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
Solved! Go to Solution.
02-08-2011 05:16 AM
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.
02-08-2011 07:17 AM
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() ?
02-08-2011 09:09 AM
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.
02-08-2011 10:11 AM
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);
02-09-2011 07:06 AM
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
02-09-2011 08:40 AM
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....
02-09-2011 09:09 AM
I don't see the progress bar updates in the tab.
It's interesting , do i need to do some changes ?
02-09-2011 09:10 AM
I'll try to implenet it later and i'll send you the result....
02-09-2011 11:29 AM
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