×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor
    Join Date
    Mar 2009
    Location
    Delhi
    Posts
    223

    probelm in custom tab.. need help

    hi i have to create a custom tab for which i am using below link:
    http://wiki.forum.nokia.com/index.php/Custom_tabs

    i have used CreateAndShowTabsL() in appui class and called this method from ConstructL()
    but it didnot work out :( nothing displayed as tab.
    Thanx
    Pooja

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: probelm in custom tab.. need help

    have you put the icons properly ?

  3. #3
    Regular Contributor
    Join Date
    Mar 2009
    Location
    Delhi
    Posts
    223

    Re: probelm in custom tab.. need help

    yes i have put all the icons properly ... is it ok that i have used everything in Appui class.
    Thanx
    Pooja

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: probelm in custom tab.. need help

    Are you also having some other containers constructed in your appUi class ?, could it be that they are actually drawn on top of the tab container ?, anyway, Depending on how you would want to use the Tabs, it also might be a good idea to actually have the tab-control as an control in the container that you are showing the items according to the Tab, it might make it a bit easier to actually handle the area where each controls are..

    Anyway, I would suggest also debugging it in a emulator to see that all icons are loaded correctly, and that the areas set for different containers are ok.

  5. #5
    Regular Contributor
    Join Date
    Mar 2009
    Location
    Delhi
    Posts
    223

    Re: probelm in custom tab.. need help

    sorry for the late replying as i was busy in other things.
    yes i have used other containers too. i have created 4 tabs but only the one tab is showing while i am running it. and attached is the screen-shot how it looks like.
    this time i have commented the images in custom tab.
    below is the Appui file:
    Code:
    #include "CustomTabControl.h";
    
    
    
    void CCustomTabTestingAppUi::CreateAndShowTabsL()
    	{
    	 ///// custom tab construction
    	 TRect tabRect(ClientRect());
    	 //tabRect.iTl.iY+=40;
    	 tabRect.iBr.iY=tabRect.iTl.iY+55;
    	 iTabGroup=CCustomTabControl::NewL(tabRect,NULL);
    	 //iTabGroup->SetContainerWindowL(*this);
    	 iTabGroup->MakeVisible(ETrue); 
    	 iTabGroup->SetFocus(ETrue); 
    	 
    //	 CFbsBitmap* bitmap = iEikonEnv->CreateBitmapL( KTabBackgroundFileName, EMbmTabgroupGlobalnav_active );
    //	 iTabGroup->SetFocusedBackgroundImage(bitmap);
    	 
    //	 CFbsBitmap* bitmap1 = iEikonEnv->CreateBitmapL( KTabBackgroundFileName, EMbmTabgroupGlobalnav_inactive );
    //	 iTabGroup->SetDeFocusedBackgroundImage(bitmap1);
    	 
    	 
    /*	 CArrayPtr<CGulIcon>* tabiconArray = new( ELeave ) CAknIconArray(40); 
    	 CleanupStack::PushL( tabiconArray ); 
    	 tabiconArray->AppendL( iEikonEnv->CreateIconL( KTabsFileName,EMbmTabsGlobalnav_contacts) );
    	 tabiconArray->AppendL( iEikonEnv->CreateIconL( KTabsFileName,EMbmTabsGlobalnav_settings) );
    	 tabiconArray->AppendL( iEikonEnv->CreateIconL( KTabsFileName,EMbmTabsGlobalnav_home)) ;
    	 tabiconArray->AppendL( iEikonEnv->CreateIconL( KTabsFileName,EMbmTabsGlobalnav_communicate));
    	 tabiconArray->AppendL( iEikonEnv->CreateIconL( KTabsFileName,EMbmTabsGlobalnav_convos)); 
    	 
    	 CleanupStack::Pop();
    	 */
    	 // Transfers the ownership
    //	 iTabGroup->SetIconArray(tabiconArray);
    	 
    	 
    	 CDesCArrayFlat* array = new (ELeave) CDesCArrayFlat(4);
    	 CleanupStack::PushL(array);
    	 array->AppendL(_L("First"));
    	 array->AppendL(_L("Second"));
    	 array->AppendL(_L("Third"));
    	 array->AppendL(_L("Fourth"));
    
    	 CleanupStack::Pop();
    	 // Transfers the ownership 
    	 iTabGroup->SetTabTitleArray(array);
    	 iTabGroup->SetDefaultTabByIndex(0); 
    	 AddToStackL(iTabGroup); 
    	 
    	 iTabGroup->DrawNow(); 
    	 
    	      
    	}
    
    
    void CCustomTabTestingAppUi::InitializeContainersL()
    	{
    	CEikStatusPane *sp = ((CAknAppUi*)iEikonEnv->EikAppUi())->StatusPane();      
    	     sp->MakeVisible(EFalse);
    	CreateAndShowTabsL();
    	
    				
    	     
    	iIRHomeScreenView = CIRHomeScreenView::NewL();
    	AddViewL( iIRHomeScreenView );
    	SetDefaultViewL( *iIRHomeScreenView );
    	
    	iFirstScreenContainerView = CFirstScreenContainerView::NewL();
    	CleanupStack::PushL( iFirstScreenContainerView );
     	AddViewL( iFirstScreenContainerView );
    	CleanupStack::Pop( iFirstScreenContainerView );
    	iFirstId = iFirstScreenContainerView->Id();
    	
    //	  SetActiveTabByViewId( iFirstScreenContainerView->Id() );
    	iSecondScreenContainerView = CSecondScreenContainerView::NewL();
    	CleanupStack::PushL( iSecondScreenContainerView );
    	AddViewL( iSecondScreenContainerView );
    	CleanupStack::Pop( iSecondScreenContainerView );
    	iSecondId = iSecondScreenContainerView->Id();
    	
    	iThirdScreenContainerView = CThirdScreenContainerView::NewL();
    	CleanupStack::PushL( iThirdScreenContainerView );
    	AddViewL( iThirdScreenContainerView );
    	CleanupStack::Pop( iThirdScreenContainerView );
    	iThirdId = iThirdScreenContainerView->Id();
    	
    	iFourthScreenContainerView = CFourthScreenContainerView::NewL();
    	CleanupStack::PushL( iFourthScreenContainerView );
    	AddViewL( iFourthScreenContainerView );
    	CleanupStack::Pop( iFourthScreenContainerView );
    	iFourthId = iFourthScreenContainerView->Id();
    
    	}
    
    void CCustomTabTestingAppUi::HandleResourceChangeL( TInt aType )
        {
        CAknViewAppUi::HandleResourceChangeL( aType );
    
      if ( aType==KEikDynamicLayoutVariantSwitch )
            {
    		((CFirstScreenContainerView*) View( iFirstId))->HandleClientRectChange(  );
    		((CSecondScreenContainerView*) View( iSecondId) )->HandleClientRectChange(  );
    		((CFourthScreenContainerView*) View( iFourthId) )->HandleClientRectChange(  );
    		((CThirdScreenContainerView*) View( iThirdId) )->HandleClientRectChange(  );
    		}
      }
    
    TKeyResponse CCustomTabTestingAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType )
    	{
    	
    	 if ( iTabGroup == NULL )
    	 {
    	 	return EKeyWasNotConsumed;
    	 }
    	 
    	 if(iTabGroup->IsFocused())
    	 {
    	 	TInt active = iTabGroup->ActiveTabIndex();
    	 	TInt count = iTabGroup->TabCount();
    	 
    	 
    	 	switch ( aKeyEvent.iCode )
    	 	{
    	 	case EKeyLeftArrow:
    	 		if ( active > 0 )
    	 		{
    	 		active--;
    	 		ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)+1));
    	 		}
    	 		else
    	 		{
    	 		active=count-1;
    	 		ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)+1));
    	 		}
    	 	return EKeyWasConsumed;
    	 	case EKeyRightArrow:
    	 		if( (active + 1) < count )
    	 		{
    	 		active++;
    	 		ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)+1));
    	 		}
    	 		else
    	 		{
    	 		active=0;
    	 		ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)+1));
    	 		} 
    	 		return EKeyWasConsumed;
    	 	default:
    	 		return EKeyWasNotConsumed;
    	 	}
    	 }
    	 
    	 return EKeyWasNotConsumed;
    	}
    
    void CCustomTabTestingAppUi::HandleViewDeactivation( const TVwsViewId& aViewIdToBeDeactivated,const TVwsViewId& aNewlyActivatedViewId )
    	{
    	CAknViewAppUi::HandleViewDeactivation(aViewIdToBeDeactivated,aNewlyActivatedViewId );
    	// [[[ begin generated region: do not modify [Generated Contents]
    	if ( aNewlyActivatedViewId.iAppUid == KUidMultiThreaded_SplashScreenApplication )
    		{
    		SetActiveTabByViewId( aNewlyActivatedViewId.iViewUid );
    		}
    	}


    sshot.JPG
    Thanx
    Pooja

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,671

    Re: probelm in custom tab.. need help

    It is a custom control with complete source code, you could simply scatter some breakpoints and check its control flow.

  7. #7
    Regular Contributor
    Join Date
    Mar 2009
    Location
    Delhi
    Posts
    223

    Re: probelm in custom tab.. need help

    i tried it :( but it only shows 0 index's text on the top of the screen
    Thanx
    Pooja

  8. #8
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: probelm in custom tab.. need help

    Then you just need to debug it a bit more and try understanding what it is doing. As it is custom control that you have source codes for, you basically can check excatly what it does as well as you can modify it as you wish.

  9. #9
    Regular Contributor
    Join Date
    Mar 2009
    Location
    Delhi
    Posts
    223

    Re: probelm in custom tab.. need help

    n 1 more error is there
    undefined identifier 'KN_UI_LOG_TYPE_DEBUG'
    in line

    KN_UI_LOG((KN_UI_LOG_TYPE_DEBUG,"CCustomTabControl::OfferKeyEventL\n"));
    Thanx
    Pooja

  10. #10
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: probelm in custom tab.. need help

    that sounds some custom definition, so check the source where you got the example, and if you can not find that one, then try commenting the whole line out.

  11. #11
    Nokia Developer Champion
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572

    Re: probelm in custom tab.. need help

    well it looks like to be used for LOG... you can comment it .... were u able to complete your implementation ....
    Amit Kankani
    Nokia Developer Champion

Similar Threads

  1. Custom Tab Control
    By murthy.pramod in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-11-05, 09:47
  2. How to create a custom tab control
    By murthy.pramod in forum Symbian User Interface
    Replies: 5
    Last Post: 2008-09-23, 08:14
  3. Replies: 0
    Last Post: 2008-09-23, 07:49
  4. How can I change an Icon in my custom MTM's tab
    By jaggernod in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2007-09-14, 13:39
  5. Custom tab component for j2ME ?
    By tanc08 in forum Mobile Java Tools & SDKs
    Replies: 5
    Last Post: 2006-08-15, 01:01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×