×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    46

    Carbide.c++ How to show menu in an application

    Hi,

    I've just started using Carbide.c++ 2.3 a few days ago and i'm trying to get some familiarity with it making some easy S60 GUI Application with UI Designer projects.
    I tried making a menu in my application using the menu bar in the UI Design Editor.
    I didn't set any event to handle yet, i just wanted to "draw" the menu to get started.
    When i run the application in the emulator the menu i created is not displayed though.
    Can anyone tell me what to do to make the menu visible in the application?

    Thanks

  2. #2
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,080

    Re: Carbide.c++ How to show menu in an application

    well you need to add menu items for a view in the rss file of the project, present inside data folder of the project.

    e,g.:

    RESOURCE AVKON_VIEW r_xyz_container_xyz_container_view
    {
    cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
    menubar = r_xyz_container_options_menu;
    toolbar = 0;
    }
    RESOURCE MENU_BAR r_xyz_container_options_menu
    {
    titles =
    {
    MENU_TITLE
    {
    menu_pane = r_xyz_menu1;
    }
    };
    }

    RESOURCE MENU_PANE r_xyz_menu1
    {
    items =
    {
    MENU_ITEM
    {
    command = EmenuItem1; // add this enumeration to .hrh file
    txt = "item1";
    },
    MENU_ITEM
    {
    command = EmenuItem2; add this enumeration to .hrh file
    txt = "item2";
    }
    .
    .
    .
    .

    .
    };
    }

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    46

    Re: Carbide.c++ How to show menu in an application

    Thank you for your help. I'm not sure i got it though.Menu is not displayed yet

    This is my code.hrh

    /*
    ========================================================================
    Name : blackContainer.hrh
    Author :
    Copyright : Your copyright notice
    Description :
    ========================================================================
    */
    enum TBlackContainerViewCommands
    {
    EBlackContainerView_1MenuItemCommand = 0x6000,
    EBlackContainerView_2MenuItemCommand,
    EBlackContainerView_3MenuItemCommand,
    EBlackContainerView_4MenuItemCommand
    };


    and this is my code.rss:

    #include "blackContainer.hrh"
    #include "blackContainer.loc"

    RESOURCE AVKON_VIEW r_black_container_black_container_view
    {
    cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
    menubar = r_black_container_options_menu;
    toolbar = 0;
    }
    RESOURCE MENU_BAR r_black_container_options_menu
    {
    }
    RESOURCE STATUS_PANE_APP_MODEL r_black_container_status_pane
    {
    panes =
    {
    SPANE_PANE
    {
    id = EEikStatusPaneUidTitle;
    type = EAknCtTitlePane;
    resource = r_black_container_title_resource;
    }
    };
    }
    RESOURCE TITLE_PANE r_black_container_title_resource
    {
    txt = STR_blackContainerView_3;
    }
    RESOURCE MENU_BAR r_black_container_menu_bar1
    {
    titles =
    {
    MENU_TITLE
    {
    menu_pane = r_black_container_menu_pane1_menu_pane;
    }
    };
    }
    RESOURCE MENU_PANE r_black_container_menu_pane1_menu_pane
    {
    items =
    {
    MENU_ITEM
    {
    command = EBlackContainerView_1MenuItemCommand;
    txt = STR_blackContainerView_4;
    },
    MENU_ITEM
    {
    command = EBlackContainerView_2MenuItemCommand;
    txt = STR_blackContainerView_5;
    },
    MENU_ITEM
    {
    command = EBlackContainerView_3MenuItemCommand;
    txt = STR_blackContainerView_6;
    },
    MENU_ITEM
    {
    command = EBlackContainerView_4MenuItemCommand;
    txt = STR_blackContainerView_7;
    }
    };
    }

  4. #4
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,080

    Re: Carbide.c++ How to show menu in an application

    RESOURCE MENU_BAR r_black_container_options_menu
    {
    r_black_container_menu_bar1
    }

    Give it a try..

  5. #5
    Registered User
    Join Date
    Oct 2010
    Posts
    46

    Re: Carbide.c++ How to show menu in an application

    Quote Originally Posted by vineet.jain View Post
    RESOURCE MENU_BAR r_black_container_options_menu
    {
    r_black_container_menu_bar1
    }

    Give it a try..
    It didn't work. I tried modifying the code as follows, but menu doesn't show yet:

    RESOURCE MENU_BAR r_black_container_menu_bar1
    {
    titles =
    {
    MENU_TITLE
    {
    menu_pane = r_black_container_menu_bar1;
    }
    };

  6. #6
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,080

    Re: Carbide.c++ How to show menu in an application

    Nops, you did not followed what i metioned in the post:

    RESOURCE AVKON_VIEW r_black_container_black_container_view
    {
    cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
    menubar = r_black_container_options_menu;
    toolbar = 0;
    }
    RESOURCE MENU_BAR r_black_container_options_menu
    {
    r_black_container_menu_bar1 /////////////// currently you have left its definition empty, so add this bold inside this resource.
    }

  7. #7
    Registered User
    Join Date
    Oct 2010
    Posts
    46

    Unhappy Re: Carbide.c++ How to show menu in an application

    Quote Originally Posted by vineet.jain View Post
    Nops, you did not followed what i metioned in the post:

    RESOURCE AVKON_VIEW r_black_container_black_container_view
    {
    cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
    menubar = r_black_container_options_menu;
    Actually i followed what you suggested, the point is when i add this code:

    "RESOURCE MENU_BAR r_black_container_options_menu
    {
    r_black_container_menu_bar1 /////////////// currently you have left its definition empty, so add this bold inside this resource.
    } "

    the compiler gives some errors:Creation Time Description Resource Path Location Type
    1290281656687 undefined member 'r_black_container_menu_bar1' for struct 'MENU_BAR' blackContainer.rssi /black/data line 20 Carbide.c++ UI Designer Message Marker


    toolbar = 0;
    }
    RESOURCE MENU_BAR r_black_container_options_menu
    {
    r_black_container_menu_bar1 /////////////// currently you have left its definition empty, so add this bold inside this resource.
    ]
    }
    That's why then i modified the code again.
    I cannot see the menu displayed yet.


    Thanxfor your help.
    Last edited by lukin4that; 2010-11-20 at 21:57.

  8. #8
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,080

    Re: Carbide.c++ How to show menu in an application

    oops i did not looked at it,write the bold line in the following code:

    RESOURCE AVKON_VIEW r_black_container_black_container_view
    {
    cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
    menubar =r_black_container_menu_bar1 ;
    toolbar = 0;
    }

    & rest keep all same as in the original code.

  9. #9
    Registered User
    Join Date
    Oct 2010
    Posts
    46

    Re: Carbide.c++ How to show menu in an application

    It is finally working this way.
    The only problem is i can access my menu only using the options softkey, while i would like to have my menu shown in the main screen as i start the application.
    Furthermore by changing menubar = r_black_container_options_menu; with menubar =r_black_container_menu_bar1 ; the options menu is no longer available.

    Thank you very much.
    Last edited by lukin4that; 2010-11-21 at 10:05.

  10. #10
    Registered User
    Join Date
    Oct 2010
    Posts
    46

    Re: Carbide.c++ How to show menu in an application

    One more thing, when i try installing this application on my cell phone (nokia 6220 classic symbian s60 3rd Ed ) it says:"Unable to install.The component is built-in".P

    This problem has been fixed:

    I was using a too common name for my application so there were conflicts when trying to install.
    Solution: Use a less common name.
    Last edited by lukin4that; 2010-11-21 at 10:45. Reason: Problem fixed

  11. #11
    Registered User
    Join Date
    Oct 2010
    Posts
    46

    Re: Carbide.c++ How to show menu in an application

    Quote Originally Posted by lukin4that View Post
    It is finally working this way.
    The only problem is i can access my menu only using the options softkey, while i would like to have my menu shown in the main screen as i start the application.
    Furthermore by changing menubar = r_black_container_options_menu; with menubar =r_black_container_menu_bar1 ; the options menu is no longer available.

    Thank you very much.

    My bad : I should have used the List Box Component rather than a Menu bar componentto create what was in my mind.

Similar Threads

  1. Replies: 2
    Last Post: 2009-05-29, 11:20
  2. Menu in Form fails to show up...
    By bjorn.rudolfsson in forum Symbian User Interface
    Replies: 14
    Last Post: 2007-04-05, 20:24
  3. Application doesn't show up in menu on phone
    By gijsbert in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2005-02-08, 21:48
  4. How to manually show the menu?
    By jarjak in forum Symbian User Interface
    Replies: 3
    Last Post: 2003-10-03, 14:52
  5. menu bar doesn't show up
    By smallfish_ntu in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-05-21, 07:04

Posting Permissions

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