×

Discussion Board

Results 1 to 15 of 15

Thread: Tab Navigation

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Tab Navigation

    Hello all,

    I have made a two tabs application using the Example given at
    Tabs_example in wiki

    Now I made the application successfully I can open the tabbed view.
    But I can't navigate from First view to Second.

    I have implemented all the methods including OfferKeyEventL() given in the Examples till there is no navigation.
    I can't change the tabbed vies.

    Please give me details what I have to do for navigation.

    Regards,
    Kavit.

  2. #2
    Regular Contributor
    Join Date
    Feb 2006
    Location
    India,Pune
    Posts
    311

    Re: Tab Navigation

    It is working properly.
    can you please paste your code here ....
    or
    put a break point and debugg when your are pressing the key for changing the Tab View ...you will get your mistake ...


    Regards,
    Parag Purkar

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: Tab Navigation

    Hi Parag,

    Thanks for reply.

    My cpp and headers are same as in Example for the CTabsContainer class.

    I am calling this from my main view's open menu as follow:

    iTabsContainer = CTabsContainer::NewL(iCba);
    AppUi()->AddToStackL( *this, iTabsContainer );

    // I have set this iCba to nothing just declared it as CEikButtonGroupContainer* iCba; in header.

    Ok now in CTabsContainer.cpp I defined iFirstControl and iSecondControl as : (in CTabsContainer.cpp - ConstructL() )

    // construct iFirstControl & iSecondControl in here..

    iFirstControl = CMyShareViewContainer::NewL(CEikonEnv::Static()->EikAppUi()->ClientRect());
    iSecondControl = CMainViewContainer::NewL(CEikonEnv::Static()->EikAppUi()->ClientRect());

    // CMyShareViewContainer and CMainViewContainer contains two list boxes.

    Now when I run the application , and open the Tabs Container View I can see the List box in CMyShareViewContainer and two tabs.
    When I am pressing the Left or Right arrow key Tabs are changed accordingly but views not.
    Means I can see only first view on first tab whether I pressed Left or Right arrow key (Tabs are changed)

    Please Let me know what I have to do.

    Thanks & Regards,
    Kavit.

  4. #4
    Registered User
    Join Date
    Apr 2006
    Location
    Beijing, China
    Posts
    1,175

    Re: Tab Navigation

    Hi,

    The problem is that all input keys are consumed in OfferKeyEventL function.

    EKeyWasNotConsumed should be returned in that function when left or right key is pressed.

    Some code snippet:
    Code:
    case EKeyLeftArrow:
    case EKeyRightArrow:
    	{
    	return (EKeyWasNotConsumed);
    	}
    Way of Simplicity

  5. #5
    Regular Contributor
    Join Date
    Feb 2006
    Location
    India,Pune
    Posts
    311

    Re: Tab Navigation

    please make sure the

    SetActiveTabByIndex(IndexNum);

    TabIndex number is correct it will surely work ...debug and check that is the the IndexNum is different ..It should be different ...

    It is working fine for me !!!!


    Regards
    Parag Purkar

  6. #6
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: Tab Navigation

    Thanks again Parag,

    Thanks dougcn,

    My OfferKeyEventL() method is :
    Code:
    TKeyResponse CTabsContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,
    TEventCode aEventCode)
    {
    	TKeyResponse Ret = EKeyWasNotConsumed;	
    	
    	switch ( aKeyEvent.iCode )
    	{
    	case EKeyRightArrow:
    		if(iTabGroup)
    		{
    			TInt IndexNum = iTabGroup->ActiveTabIndex();
    			IndexNum = IndexNum + 1;
    			
    			if(IndexNum > 1) 
    				IndexNum = 1;
    			
    			iTabGroup->SetActiveTabByIndex(IndexNum);
    			
    			SetMenuL();
    			DrawNow();
    		}
    		break;
     
    	case EKeyLeftArrow:
    		if(iTabGroup)
    		{    
    			TInt IndexNum = iTabGroup->ActiveTabIndex();
    			IndexNum = IndexNum - 1;
    			
    			if(IndexNum < 0)
    				IndexNum = 0;
    			
    			iTabGroup->SetActiveTabByIndex(IndexNum);
    			
    			SetMenuL();
    			DrawNow();
    		}
    		break;
     
    	default:
    		if(iTabGroup)
    		{
    			switch(iTabGroup->ActiveTabIndex())
    			{
    			case 1:
    				if(iSecondControl)
    				{
    					Ret = iSecondControl->OfferKeyEventL(aKeyEvent,aEventCode);
    				}
    				break;
    			default:
    				if(iFirstControl)
    				{
    					Ret = iFirstControl->OfferKeyEventL(aKeyEvent,aEventCode);
    				}
    				break;
    			}	
    		}
    		break;
    	}
    	
    	return Ret;
    }
    Parag can you give me your sample code.

    Regards,
    Kavit.

  7. #7
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: Tab Navigation

    Hi Parag ,

    Could you please just paste your CTabsContainer::ConstructL() ?
    Including iFirstControl and iSecondControl defination.
    It will be your great help to me.

    Regards,
    Kavit.

  8. #8
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: Tab Navigation

    Hi Parag,

    Till I can't solve the problem could you please paste your ConstructL() of CTabsContainer class I want to check for FirstControl and SecondControl , Please.


    Thanks in Advance.

    Regards,
    Kavit.

  9. #9
    Regular Contributor
    Join Date
    Feb 2006
    Location
    India,Pune
    Posts
    311

    Re: Tab Navigation

    Paste ur construcL() code here..

  10. #10
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: Tab Navigation

    Hi Parag,

    Thanks for reply.

    My CTabsContainer 's ConstructL() is as follow:

    Code:
    void CTabsContainer::ConstructL(void)
    {
    	CreateWindowL();
    	
    	const TRect &aRect = CEikonEnv::Static()->EikAppUi()->ClientRect();
    	SetRect(aRect);
    	
    	MakeNavipanelL();		
    	
    	// construct iFirstControl & iSecondControl in here..
    	
    	iFirstControl = CMyShareViewContainer::NewL(aRect);
    	iSecondControl = CMainViewContainer::NewL(aRect);
    	
    	ActivateL();
    	SetMenuL();
    	DrawNow();
    }
    Regards,
    Kavit.

  11. #11
    Regular Contributor
    Join Date
    Feb 2006
    Location
    India,Pune
    Posts
    311

    Re: Tab Navigation

    Hi Kavit ,
    It may be a requirement that the tabs should not be shown when in a particular view. In such case in the views DoDeactivateL do the following

    void CMyView:oDeactivate()
    {
    iContainer->HideTabs();
    iContainer->SetTitle(1,1);
    }

    Regards,
    Parag Purkar

  12. #12
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: Tab Navigation

    Thanks Parag,

    But my problem(question) is that , have I to pass any CAknTabGroup to my iFirstControl and iSecondControl.

    Let me know you that this iFirstControl and iSecondCotrol are the containers of my two views that I want to display on the Tab navigation.

    If I have to pass CAknTabGroup then any initialization for it should there or not.

    Also how it will identifies the TabId of this two views as we have assigned nothing till.

    Please if possible put your code snippet.

    Regards,
    Kavit.

  13. #13
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: Tab Navigation

    Hi Parag,

    Now I have changed iFirstControl and iSecondControl by the two labels.

    See my ConstructL().

    Code:
    void CTabsContainer::ConstructL(const TRect & aRect)
    {
            CreateWindowL();
    	
    	MakeNavipanelL();		
    	
    	// construct iFirstControl & iSecondControl in here..
    	
    	iFirstControl = new (ELeave) CEikLabel;
    	iFirstControl->SetContainerWindowL( *this );
    	iFirstControl->SetTextL( _L("Shares View"));
    	
    	iSecondControl = new (ELeave) CEikLabel;
    	iSecondControl->SetContainerWindowL( *this );
    	iSecondControl->SetTextL( _L("Details View"));
    	
    	SetRect(aRect);
    	ActivateL();
    }
    Now I can navigate through Tab , tabs are changed but the labels are not changed all time I can see the "Shares View" (iFirstControl) on the screen.
    Sure tabs are changed.
    Please explain me what I have to do.

    Regards,
    Kavit.

  14. #14
    Regular Contributor
    Join Date
    Feb 2006
    Location
    India,Pune
    Posts
    311

    Re: Tab Navigation

    HTML Code:
    SetTitle(TInt aTabid, TInt aView)
    {
        CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
        iTitlePane = ( CAknTitlePane*)
        sp->ControlL(TUid::Uid(EEikStatusPaneUidTitle ));
     
        TBuf<10> temp;
     
        if( aView == 2)
    	temp.Format(_L("Buddy %d"),aTabid+1);
        else
    	temp.Copy(_L("MyView"));
     
        iTitlePane->SetTextL(temp);
    }]
    check with above ..call this where u r adding the new Tab ...

    Regards,
    Parag Purkar

  15. #15
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: Tab Navigation

    Thanks Parag,

    I will use that.

    Regards,
    Kavit.

Similar Threads

  1. Navigation tabs corrupted
    By nadav70 in forum Symbian User Interface
    Replies: 5
    Last Post: 2009-03-11, 06:59
  2. CONE 44 panic when deleting tab group
    By guderian1 in forum Symbian User Interface
    Replies: 2
    Last Post: 2007-05-22, 11:13
  3. Navigation in Dialog with Tab key
    By pgivy in forum Symbian User Interface
    Replies: 2
    Last Post: 2007-02-01, 09:27
  4. Navigation Panes for Series 60
    By rguia in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-02-24, 15:19
  5. 7650 SetDefaultViewL() doesn't set right navigation tab
    By 4sure in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-09-25, 09:16

Posting Permissions

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