How to add and remove tabs dynamically?
hi I need to randomly add and remove tabs in status pane's tab group dynamically. Say I have 3 tabs with tab ids (0,1,2) now i need to remove tab id 0.
[CODE]
void ChangeTabGroupState(TInt aDeleteId, TInt aNewActiveId)
{
iTabGroup->DeleteTabL(aDeleteId);
iTabGroup->SetActiveTabByIndex(aNewActiveId);
}
[/CODE]
how tab ids has to be reorganized for the purpose? if 0 is removed, will tab ids(1,2) be shifted to (0,1)? how to determine
the active tab id after deletion of a tab? thanks
Re: How to add and remove tabs dynamically?
Tabs have both index and id. Id stays whatever you set, index changes.
Re: How to add and remove tabs dynamically?
[QUOTE=wizard_hu_;905700]Tabs have both index and id. Id stays whatever you set, index changes.[/QUOTE]
Thanks wizard_hu_. So if a tab with index 0 is removed from tab group indexes (0,1,2) , will remaining index (1,2) be reset to (0,1)? or how to manipluate index of tab group with frequent addition and remove? thanks
Re: How to add and remove tabs dynamically?
[QUOTE=slinx;905702]Thanks wizard_hu_. So if a tab with index 0 is removed from tab group indexes (0,1,2) , will remaining index (1,2) be reset to (0,1)?[/QUOTE]Yes, it behaves as an array, because it is backed by array. If you check CAknTabGroup in the header, it has a CArrayPtr<CAknTab>* iTabArray member.
Re: How to add and remove tabs dynamically?