×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    15

    How to change the options resource

    Hi

    I am building a simple application which loads a container. The options come from the resource file. After selecting one of the options in the application, I have to load another container. At this point I want to load a different resource in order to display different options, but dont know how to do that. My second container also shows the same options.

    Any help is appreciated.

    Sunil

    Here is the construter of AppUI which loads a container:

    void CDirectionsAppUi::ConstructL()
    {
    BaseConstructL();
    iAppWelcomeContainer = new (ELeave) CDirectionsWelcomeContainer;
    iAppWelcomeContainer->SetMopParent(this);
    iAppWelcomeContainer->ConstructL( ClientRect() );
    AddToStackL( iAppWelcomeContainer );
    iPrevCoe = iAppWelcomeContainer;
    }

    This function handles the command and load the another container after receiving EDirectionsCmdApp command

    void CDirectionsAppUi::HandleCommandL(TInt aCommand)
    {
    switch ( aCommand )
    {
    case EAknSoftkeyBack:
    case EEikCmdExit:
    {
    Exit();
    break;
    }
    case EDirectionsCmdApp:
    {
    iAppContainer = new (ELeave) CDirectionsContainer;
    iAppContainer->SetMopParent(this);
    iAppContainer->ConstructL( ClientRect() );
    RemoveFromStack(iPrevCoe);
    delete iPrevCoe;
    iPrevCoe = iAppContainer;
    AddToStackL( iAppContainer );
    break;
    }
    default:
    break;
    }
    }


    This is the resource MENU_PANE used in OPTIONS

    RESOURCE MENU_PANE r_directions_menu
    {
    items=
    {
    MENU_ITEM { command=EDirectionsCmdApp; txt="Find Address"; },
    MENU_ITEM { command=EAknCmdExit; txt="Exit"; }
    };
    }

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165
    Hi

    You mean how to change the menu. Simplest way would be to use following line of code:

    CEikonEnv::Static()->AppUiFactory()->MenuBar()->SetMenuTitleResourceId(R_MY_MENUBAR);

    where R_MY_MENUBAR is your menubar resource definition.

    yucca

Posting Permissions

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