×

Discussion Board

Results 1 to 7 of 7

Thread: help with tabs

  1. #1
    Registered User
    Join Date
    Feb 2004
    Posts
    25

    help with tabs

    Hello,

    I've created a basic Symbian C++ application for S60 3rd MR. My eventual goal is to have an application with two tabs, one of which displays some small bitmaps and descriptive text, and another of which is basically a debug console with a lot of scrollable (no real need to edit, but like the possibility) text.

    I'm trying to incorporate tabs from an example I found in the Wiki:
    http://wiki.forum.nokia.com/index.php/Tab_operations
    For each of my tabs I'm using an editor also from an example in the wiki:
    http://wiki.forum.nokia.com/index.php/Editor_example

    My application starts and both tabs are visible (call them T1 and T2). I modified the editors to include some default content so they don't start blank. However, T1's editor shows only a fraction of the first letter of the editor's contents. Typing on the phone has no effect. If I switch tabs (implemented via detecting left and right arrow presses), T2 shows up similarly, with only part of its first letter visible. However, if I start to type on T2, suddenly the pre-existing content appears fully, and I can type and edit text as expected.

    When I switch back to T1, the contents of T2 are still visible, but I cannot make changes to them.

    I have done a fair amount of printf()-based debugging (I'm cheating a little and have a CEikConsoleScreen positioned over top of the app's title, so I can call Printf on it), and I believe I'm correctly handling the keypress events.

    I think the problem is probably related to not correctly specifying what Editor / Tab object is "on top" at any given time.

    From CTabsContainer::ConstructL():
    Code:
    	// construct iFirstControl & iSecondControl in here..
    	_LIT(Ked1, "Editor 1");
    	iFirstControl = new (ELeave) CEditorContainer;
    	iFirstControl->ConstructL(iConsole);
    	iFirstControl->SetEditorTextL(Ked1);
    
    	_LIT(Ked2, "Editor 2");
    	iSecondControl = new (ELeave) CEditorContainer;
    	iSecondControl->ConstructL(iConsole);
    	iSecondControl->SetEditorTextL(Ked2);
    Do I need to call something like AddViewL(), AddToStackL(), etc?

    When a keypress happens, in CTabsContainer::OfferKeyEventL():

    Code:
    iTabGroup->SetActiveTabByIndex(IndexNum);		
    			//SetMenuL(); // Commented out by me
    			DrawNow();
    I feel like this is inadequate, since nothing tells any of the CEditorContainer's to do anything.

    Advice is very much appreciated!

    Thanks,
    -Jon
    Last edited by ltomuta; 2008-06-24 at 05:01.

  2. #2
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: help with tabs

    Can you please clean this question a bit? What's the Tab navigator got to so with the editors placed in the views they're associated with?
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  3. #3
    Registered User
    Join Date
    Feb 2004
    Posts
    25

    Re: help with tabs

    Thanks for your reply.

    I suppose that's a fair restatement of my question. What is the correct way to think about tabs? Are they just another navigation element like a menu (i.e., they do not extend beyond the navigation pane), or do they actually contain the editors? I've been working as though the tabs contain the editors and will take care of making sure the correct editor is shown, but from your response I guess it's up to my code to make sure the right editor is shown?

    Right now I'm declaring my editors as members of CTabsContainer, which is itself a member of xxxAppView. It sounds like that's not what I actually want to do, and that I should be declaring the editors as members of my xxxAppUi (derived from CAknAppUi) or xxxAppView (derived from CCoeControl) classes.

    When I get this worked out I'll post a better message, if for no other reason than to help others who run into the same trouble.

    Thanks,
    -Jon

  4. #4
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: help with tabs

    The tabs are graphical elements owned by the Status Pane, as clearly can be seen from the resource exemplified in http://wiki.forum.nokia.com/index.php/Tab_operations.

    They go nicely with view based application so that they are keept in sync with the view currently active. The view will have a container for the UI components that you want to use and it is this CCoeControl based class that owns and manages those controls.

    If your are not using the view framework, but instead you have one or more containers such as CEditorContainer you have the extra task of ensuring that the proper container (and its content) it is visible at the right time, in sync with the tabs. But what is is done inside the container, the way the editors are displayed and handled, has nothing to do with the tabs.

    There are tabs examples in the SDK, just search for "CAknNavigationControlContainer" in the S[eries]60[Cpp]Ex[amples]. See also the Editor example in the SDK.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  5. #5
    Registered User
    Join Date
    Feb 2004
    Posts
    25

    Re: help with tabs

    One more novice question...

    Can I have more than one of the CEditorContainer instantiated at once with proper functioning of the GUI, if I do not use a view-based architecture? Currently, if I create two CEditorContainer's, only the second one ever shows. Likewise, if I create three of them, only the third one ever shows. Does proper operation without views require constant destruction and reconstruction?

    Thanks,
    -Jon

  6. #6
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: help with tabs

    My guess is that all three of them exist and are visible, only that the 3rd of them is on top.

    If you look at the view architecture you'll see that each view has its own container but unlike in your scenario each view creates its container when it gets activated and then deletes it when the view is deactivated. This makes a lot of sense from the perspective of consuming phone's resources.

    If for you holding the three containers in memory all the times makes sense then make sure that you control their visibility.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  7. #7
    Registered User
    Join Date
    Feb 2004
    Posts
    25

    Re: help with tabs

    Thanks for all the suggestions.

    MakeVisible() has the desired effect.

Similar Threads

  1. Tabs in carbide.c++ ui designer
    By Niko545 in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2007-04-10, 14:10
  2. Navigation Tabs (or Tabs Pane) in J2ME/Series 60
    By shadisky in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-05-05, 19:48
  3. Navigation Tabs (or Tabs Pane) in J2ME/Series 60
    By shadisky in forum Mobile Java General
    Replies: 0
    Last Post: 2005-05-05, 19:43
  4. Can't navigate tabs after adding list!!!
    By advocatee in forum Symbian
    Replies: 7
    Last Post: 2003-07-11, 09:13
  5. Re Display of Tabs
    By jimdeal in forum Symbian
    Replies: 1
    Last Post: 2003-06-20, 20:08

Posting Permissions

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