LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

EasyTab control duplication

In the Easy tab library a function called easytab_RemovePanel has been added, but the help says
that it only sets the panel to invisible. I need to change the controls (duplicate) on a panel that is
part of an easy tab control. Can I remvove the panel from the easy tab control, duplicate the
required controls on the panel and then add it back into the easy tab control.
If not then what is the best method to get around this problem?
0 Kudos
Message 1 of 4
(3,169 Views)
Hello KentMartin,
 
As you mentioned, the documentation for the RemovePanel function states that the visibility of the selected panel is disabled.  Also, the documentation notes that the panel corresponding to the removed tab is no longer owned by the Tab control.  Since this is the case, if you remove a panel, add a control to the panel, and want to redisplay the panel, you have to reload that panel on the EasyTab control.  In order to do this, you would have to call EasyTab_LoadPanels with the correct panel ID (as saved in the UIR header file).
 
For example, the following code would remove a panel, add a control to it, and then redisplay the panel on the easytab.
  EasyTab_RemovePanel (panel, tabCtrl, panelToUpdate);   
  NewCtrl (panelToUpdate, CTRL_CHECK_BOX, "new", 50, 50);
  EasyTab_LoadPanels (panel, tabCtrl, 1,"simpdemo.uir",__CVIUserHInst, PANEL_2, &panelToUpdate, 0);
 
Hope that helps.
 
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 2 of 4
(3,150 Views)
Wendy thanks,
But do I need to use EasyTab_LoadPanels ? Can I not use easytab_addpanels
 
 
as in:->
  // remove panel from tab menu
  EasyTab_RemovePanel(MainTabHandle,TabControl,panel);
  // remove existing duplicate control
  DiscardCtrl (panel, DisplayControl);
  // add a dupiclate back in it's place
  DisplayControl = DuplicateCtrl (panel, CTRL_CHECK_BOX, panel,"duplicate control", 50, 50);
  // add the panel back in as it has not been unloaded
  EasyTab_AddPanels (MainTabHandle, TabControl, 1, panel,0);
Kent
0 Kudos
Message 3 of 4
(3,148 Views)

Hello Kent,

You can also use AddPanels, as you suggested.

Thanks

Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 4 of 4
(3,123 Views)