×

Discussion Board

Results 1 to 15 of 15
  1. #1
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    131

    Exclamation how to change control pane buttons dynamically in same view?

    I am using 3rd FP2 and drag an drop style UI design development.

    I am stuck at place where I want to change control pane buttons (left, middle and right softkey) as my application state changes.

    like in idle view soft buttons are Options and Hide

    Now user selects options and selects call from Options menu, soft buttons should show blank@left softkey and EndCall@Right softkey.

    Once call rings need to show Options and Loudspeaker left and right soft key respectively.

    Now if Loudspeaker is pressed need to change it to Hendset.

    Again also want to change Options menubar dynamically or want to add and remove relevant menu items in existing menu bar...

    Please guide me how can i do it using drag and drop UI design or what can be the simplest way to it???

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

    Re: how to change control pane buttons dynamically in same view?


  3. #3
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    131

    Re: how to change control pane buttons dynamically in same view?

    Quote Originally Posted by symbianyucca View Post
    I am sorry Yucca...Actually by putting this query I searche3d again in wiki and i got the same and also implemented the control button dynamically in my application successfully..still in process to create dynamic menu bar.

    Anyway Thanks a lot for your kind co-operation..

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

    Re: how to change control pane buttons dynamically in same view?

    So are you still having problems with the dynamic menu, or did the link help ?

  5. #5
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    131

    Exclamation Re: how to change control pane buttons dynamically in same view?

    Quote Originally Posted by symbianyucca View Post
    So are you still having problems with the dynamic menu, or did the link help ?
    Thanks for your kind attention to my queries....

    Sorry to say that I am not able to change Options menubar dynamically using help link provided by you....

    See in my first view I want show
    blank@Left softkey and EndCall@Right softkey

    After 5 seconds I am changing soft buttons as below.
    Options@left soft key and Loudspeaker@right softkey Iam able to show softkeys successfully but not able to show Menubar once Options softkey is clicked...
    Here I have created MenuBar using UI design drag and drop and using that Ids to activate the same...

    I want to do all these operation in view class not in AppUI class

    I have gone through the help provided by but it panics.. iEikonEnv->AppUiFactory()->MenuBar()->SetMenuTitleResourceId(R_ADD_MENUBAR); is not working

    Again I got some suggestions from old forum that need to use
    MenuBar()->SetMenuTitleResourceId(R_ADD_MENUBAR); in view class but it is not working too....

    Please guide me with correct way to change menubar and how will I get events of the same in view calss.....

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

    Re: how to change control pane buttons dynamically in same view?

    How did you define the CBA resource for the Options-loudspeaker ?

    And what is the panic that you get with "iEikonEnv->AppUiFactory()->MenuBar()->SetMenuTitleResourceId(R_ADD_MENUBAR); " ?

    if "MenuBar()->SetMenuTitleResourceId(R_ADD_MENUBAR)" is not working, what actually happens ?

  7. #7
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    131

    Re: how to change control pane buttons dynamically in same view?

    Quote Originally Posted by symbianyucca View Post
    How did you define the CBA resource for the Options-loudspeaker ?

    And what is the panic that you get with "iEikonEnv->AppUiFactory()->MenuBar()->SetMenuTitleResourceId(R_ADD_MENUBAR); " ?

    if "MenuBar()->SetMenuTitleResourceId(R_ADD_MENUBAR)" is not working, what actually happens ?
    .rss file

    RESOURCE CBA r_custom_cba1
    {
    buttons =
    {
    CBA_BUTTON{ id = ECba1Button1; txt = "Options";},
    CBA_BUTTON{ id = ECba1Button2; txt = "Loudspeaker";}
    };
    }

    RESOURCE CBA r_custom_cba2
    {
    buttons =
    {
    CBA_BUTTON{ id = ECba2Button1; txt = "Options";},
    CBA_BUTTON{ id = ECba2Button2; txt = "Handset";}
    };
    }

    RESOURCE MENU_BAR r_mayapp_screen_menu_bar1
    {
    titles =
    {
    MENU_TITLE
    {
    menu_pane = r_myapp_screen_menu_pane1_menu_pane;
    }
    }
    }

    RESOURCE MENU_PANE r_myapp_screen_menu_pane1_menu_pane
    {
    items=
    {
    MENU_ITEM
    {
    command = EMyAppEnd_Current_CallMenuItemCommand;
    txt = "End Current Call";
    }
    MENU_ITEM
    {
    command = EMyAppLoudspeaker_MenuItemCommand;
    txt = "Loudspeaker";
    }
    }
    }

    .hrh
    enum CustomButton
    {
    ECba1Button1,
    ECba1Button2,
    ECba2Button1,
    ECba2Button2
    }


    now in view.cpp source file

    cba = CEikButtonGroupContainer::Current(); //cba object reference defined in respective .h file
    cba->SetCommandSetL(R_CUSTOM_CBA1);
    cba->DrawNow();
    //If this function is called
    MenuBar()->SetMenuTitleResourceId(R_MYAPP_SCREEN_MENU_BAR1); //Not able to get options menubar once clicked on Options softkey
    instead if I call below function here
    iEikonEnv->AppUiFactory()->MenuBar()->SetMenuTitleResourceId(R_MYAPP_SCREEN_MENU_BAR1); //Panics KERN-EXEC 3 seen while debugging in debug window..

    Ultimately this will look like
    Once view opend
    Leftsoftkey Rightsoftkey
    blank EndCall
    After 5 seconds
    Options Loudspeaker //Till here it works but when Options softkey pressed it is not going to show me the menubar created in resource file....


    Please tell me what mistake I am doing here...?

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

    Re: how to change control pane buttons dynamically in same view?

    try using the EAknSoftkeyOptions as a command id for the options instead, you can not just have your own id there, since system would not know about it.

  9. #9
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    131

    Re: how to change control pane buttons dynamically in same view?

    Quote Originally Posted by symbianyucca View Post
    try using the EAknSoftkeyOptions as a command id for the options instead, you can not just have your own id there, since system would not know about it.
    Thanks Yucca...this all is very amazing..it is working using EAknSoftKeyOptions....How to be expert like you??

    Again one more,

    How will I hide/show menupane items this is with reference to my code? I have got DynInitMenuPaneL method of AppUi class..Can I override the same in view class?? But still facing problem of CEikMenuPane* aMenuPane...from where I will get this reference? Because that all is be created in resource file...
    Is there any way of that reference or any other way for to hide/show menuItems in Menupane..???

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

    Re: how to change control pane buttons dynamically in same view?

    just check the : http://wiki.forum.nokia.com/index.php/Dynamic_menu , first you need to check the aResourceId, so you know which menu panel is in process, just have a in-else clauses there so each menu panel would have its own handling part.

    Then by default all menu items are visible, thus have your logic to determine which ones should be hidden and call aMenuPane->SetItemDimmed(ERegisterCmd, ETrue); in where the ERegisterCmd is your own command ID for the menu item.

    And indeed if you don't want to define the menu items in the resource, you could add them dynamically as shown for R_ADD_MENU menu panel in there. anyway, it is a lot easier to just declare all in resources and then just hide the ones you don't want to use.

  11. #11
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    131

    Re: how to change control pane buttons dynamically in same view?

    Quote Originally Posted by symbianyucca View Post
    just check the : http://wiki.forum.nokia.com/index.php/Dynamic_menu , first you need to check the aResourceId, so you know which menu panel is in process, just have a in-else clauses there so each menu panel would have its own handling part.

    Then by default all menu items are visible, thus have your logic to determine which ones should be hidden and call aMenuPane->SetItemDimmed(ERegisterCmd, ETrue); in where the ERegisterCmd is your own command ID for the menu item.

    And indeed if you don't want to define the menu items in the resource, you could add them dynamically as shown for R_ADD_MENU menu panel in there. anyway, it is a lot easier to just declare all in resources and then just hide the ones you don't want to use.
    You are very correct and that link is only I want to follow but
    1) As per that link i need to call AppUi's DynInitMenuPaneL method it requires aResourceId of manu pane that I have, but I do not have CEikMenuPane* aMenuPane reference...from where can I get the same to call DynInitMenuPaneL method?
    2) Again it is mentioned in that link "This function is called just before the menu pane is shown in the application, Calling SetItemDimmed() with " Is it mean that DynInitMenuPaneL function will be called by framework before showing menupane?

    Please clearout my confusion....

  12. #12
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: how to change control pane buttons dynamically in same view?

    Have you read the very first sentence of that article?
    Quote Originally Posted by Wiki page
    Dynamic menu handling is made quite easy with the S60 platform, basically all you need to do is to overwrite the DynInitMenuPaneL() method in your application user interface class and link application against eikcoctl.lib
    Does it really say anything about your need to call this method?

    In short: it is a callback, it is going to be invoked by the OS whenever the menu gets displayed.

  13. #13
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    131

    Re: how to change control pane buttons dynamically in same view?

    Thanks Wizard_hu....All my confusions are cleared out....

    I successfully done everything except following...

    I have one menubar having several items in it....from which one item is having sub items means cascaded...How can I hide that item....
    I tried to hide using its item Id but application panics...Can you tell me how to hide cascaded item in DynInitMenuPaneL() method???

  14. #14
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: how to change control pane buttons dynamically in same view?

    If you are asking about the cascading menu item, you can assing a command identifier to it, and hide as anything else.
    If you mean items from the sub-menu, note that you will get a separate DynInitMenuPaneL call when the user opens it. This is why the method gets aMenuPaneId (or aResourceId, I have not checked it now). You should always check which menu pane you are working on, and you should not try accessing items from other menu panes, since that causes a panic.

  15. #15
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    131

    Re: how to change control pane buttons dynamically in same view?

    Thanks Wizard...

    I have done it and all is working very fine...

    Thanks to Yucca too....

Similar Threads

  1. change status pane & control pane background color
    By rmanor in forum Symbian User Interface
    Replies: 4
    Last Post: 2010-05-04, 19:08
  2. How to add buttons to the control pane?
    By eyvind1 in forum Mobile Java General
    Replies: 1
    Last Post: 2005-02-02, 04:42
  3. How to change cba buttons dynamically
    By Nokia_Archive in forum Symbian User Interface
    Replies: 4
    Last Post: 2004-03-02, 09:27
  4. How to change the buttons of any view at runtime??
    By reshmasp in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-03-22, 06:50
  5. how to change the status pane display dynamically
    By varshajohn in forum Symbian User Interface
    Replies: 1
    Last Post: 2002-11-04, 05:02

Posting Permissions

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