-
Custom Tab Control
Hi,
I am trying to create custom tab control using this link [URL="http://wiki.forum.nokia.com/index.php/Custom_tabs"]http://wiki.forum.nokia.com/index.php/Custom_tabs[/URL]. After using the following code to create icon it gives "system error -1001".[HTML]CFbsBitmap* bitmap=NULL;
bitmap=iEikonEnv->CreateBitmapL(KAvkonBitmapFile, EMbmAvkonQgn_note_info_2 );
CFbsBitmap* bitmap=iEikonEnv->CreateBitmapL(KAvkonBitmapFile, EMbmAvkonQgn_note_info_2, EMbmAvkonQgn_note_info_2_mask );
iTabGroup->SetFocusedBackgroundImage(bitmap);[/HTML]. Instead of it i used the following way to crate icon.[HTML]CFbsBitmap* bitmap=NULL;
CFbsBitmap* bitmap_mask=NULL;
AknIconUtils::CreateIconL(bitmap, bitmap_mask, KAvkonBitmapFile, EMbmAvkonQgn_note_info_2, EMbmAvkonQgn_note_info_2_mask);
AknIconUtils:: SetSize( bitmap, TSize(40, 40),EAspectRatioPreserved );
iTabGroup->SetFocusedBackgroundImage(bitmap);
[/HTML]. The problem is that in this function "tabiconArray" is not visible while title of tabIcon change. Only title changing is visible. could anyone tell me whats wrong with this. If any one used the custom tab plz provide the way of using it. I also want to set the custom tabs in Navipane. How could i set them in navipane? Plz reply.
-
Re: Custom Tab Control
-1001 (KErrExtendedWithText, basched.h) often happens when loading of bitmap fails during application startup. What is your KAvkonBitmapFile?
-
Re: Custom Tab Control
I am able to show the icon in the custom tab and add them in the navipane by using the following code in [I]void CCustomTabAppUi::ConstructL()[/I]:[CODE]iTabGroup=CCustomTabControl::NewL(iNaviPane->Rect(),iNaviPane);
// iTabGroup=CCustomTabControl::NewL(tabRect,NULL);
iTabGroup->MakeVisible(ETrue);
iTabGroup->SetFocus(ETrue);
//iTabGroup->SetFocusedBackgroundImage(iMyIcon);
//iTabGroup->SetFocusedBackgroundImage(iMyIcon);
CArrayPtr<CGulIcon>* tabiconArray = new( ELeave ) CAknIconArray(40);
CleanupStack::PushL( tabiconArray );
CGulIcon* a=CGulIcon::NewL(iMyIcon,iMyIcon_mask);
CGulIcon* b=CGulIcon::NewL(iMyIcon1,iMyIcon_mask1);
tabiconArray->AppendL(a);
tabiconArray->AppendL(b);
tabiconArray->AppendL(a);
tabiconArray->AppendL(b);
tabiconArray->AppendL(a);
CleanupStack::Pop();
iTabGroup->SetIconArray(tabiconArray);
CDesCArrayFlat* array = new (ELeave) CDesCArrayFlat(10);
_LIT(Lasdf,"one");
CleanupStack::PushL(array);
array->AppendL(_L("one"));
array->AppendL(_L("two"));
array->AppendL(_L("three"));
array->AppendL(_L("four"));
array->AppendL(_L("five"));
CleanupStack::Pop();
// Transfers the ownership
iTabGroup->SetTabTitleArray(array);
iTabGroup->SetDefaultTabByIndex(2);
//AddToStackL(iTabGroup);
iTabGroup->DrawNow();
CleanupStack::PopAndDestroy(2); // outputFileStream, file
iNaviDecorator = CAknNavigationDecorator::NewL(iNaviPane, iTabGroup);
iNaviDecorator->SetNaviDecoratorObserver( this );
// //iTabGroup->RemoveFromParent();
// //iTabGroup->SetParent(iNaviDecorator);
iNaviPane->PushL(*iNaviDecorator);[/CODE]. But after adding the custom tab in the navipane by using the above way [I]TKeyResponse CCustomTabControl::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) [/I] function is not working. [I]MAknNaviDecoratorObserver[/I] also not working. Could anyone one help me in this regards.
Thanks in advance for replaying........