×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    27

    CAknDialog Multipage forms -- programamatically managing pages

    I have a multipage form defined using a DIALOG resource structure and a resource array of FORM structures. The form loads and display properly, and allows navigation using the keys. The problem is that I want to be able to specify different pages to be displayed initially when the form is loaded and displayed. I've tried several ways of doing this but I have not yet figure this out. Does anybody have a solution?

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: CAknDialog Multipage forms -- programamatically managing pages

    Can you please elaborate little bit more on what exactly is your requirement..as i am slightly confused..are u not able to switch to different pages or what exactly is the issue u r facing?

    Cheers

  3. #3
    Registered User
    Join Date
    Jun 2006
    Posts
    27

    Re: CAknDialog Multipage forms -- programamatically managing pages

    Yes. The default behavior is working fine. I can switch pages with the navigation buttons with no problem. What I want to do that I can not figure out is to load a form and have the second or third page displayed by default instead of the first page. I also want to be able to switch to specific pages of the dialog in response to selecting a menu item. The CAknDialog class contains functions to get the active page id and to activate the first page but no functions to switch to different pages.

  4. #4
    Regular Contributor
    Join Date
    Mar 2005
    Posts
    60

    Re: CAknDialog Multipage forms -- programamatically managing pages

    I have some code that seems to work. It gets the CAknTabGroup from the navi pane but has to rely on the tab group being the top most control. The tab group does not seem to have been created when PostLayoutDynInitL is called (Top() returns NULL), which is why I've put this code in SetInitialCurrentLine(). I tell the dialog which page to show before calling ExecuteLD, storing it in the iPreferredPage member.

    I think there are two possible failure modes - it fails to find the tab group, in which case the page does not get changed. Or it gets the wrong tab group and changes the wrong dialog's page, so I would be cautious about using this code when swapping from one tabbed dialog to another.

    If I've done anything obviously wrong please post, as though this method seems to work it is more contorted than I would like.

    void CSettingItemListDlg::SetInitialCurrentLine()
    {
    CAknDialog::SetInitialCurrentLine();

    TUid naviPaneUid;
    naviPaneUid.iUid = EEikStatusPaneUidNavi;
    CEikStatusPane* statusPane = app_ui.StatusPane();
    CEikStatusPaneBase::TPaneCapabilities subPane = statusPane->PaneCapabilities (naviPaneUid);
    if (subPane.IsPresent() && subPane.IsAppOwned())
    {
    CAknNavigationControlContainer* naviPane = (CAknNavigationControlContainer *) statusPane->ControlL(naviPaneUid);
    if (naviPane)
    {
    CAknNavigationDecorator * top = naviPane->Top();
    if (top && top->ControlType() == CAknNavigationDecorator::ETabGroup)
    {
    CAknTabGroup* tabGroup = (CAknTabGroup*) top->DecoratedControl();
    if (tabGroup) tabGroup->SetActiveTabById (iPreferredPage);

    }
    }
    }
    }

Posting Permissions

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