×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    41

    is it possible to show icons for cascade menu items in the form.

    Hi,
    I have to show icons for some of the menu in the cascade menu items in the form. I have seen in this forum some people talking about icons for menu items. I am confused whether it is possible or not. If i use in the resource EEikMenuItemSymbolOn flag,how can i set the svg icon for the menu. Please let me know.


    Thanks in advance.
    Rajani

  2. #2
    Registered User
    Join Date
    Feb 2008
    Posts
    41

    (help needed !) Is it possible to show icons for cascade menu items in the form.

    Hi ,

    I tried to show icons for the cascade menu . Below is my code. There is no error but the icon is not displayed.. Can anybody please tell me what is the problem

    void CContactDetailsForm::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
    {
    CAknForm::DynInitMenuPaneL(aResourceId,aMenuPane);
    if (aResourceId == R_AVKON_FORM_MENUPANE)
    {
    // Add the menu from the resource defined in the .rss file
    // aMenuPane->AddMenuItemsL(R_CONTACTDETAILS_MENU,0,1);
    }

    if ( aResourceId == R_AVKON_FORM_MENUPANE )
    {
    BuildMenuItem (0, EEikMenuItemSymbolOn, EAddDetailsTELOTHER, aMenuPane);
    }
    }

    void CContactDetailsForm::BuildMenuItem(TInt aCascadeID, TInt aFlags, TInt aCommandID, CEikMenuPane* aMenuPane)
    {
    CEikMenuPaneItem::SData data;

    data.iCascadeId = R_ADDDETAILS_MENU;
    data.iFlags = aFlags;
    data.iCommandId = aCommandID;
    data.iText.Append(_L("0\tAddDetails" ));
    aMenuPane->AddMenuItemL(data);
    AddListboxIconsL(aMenuPane);
    }
    void CContactDetailsForm::AddListboxIconsL(CEikMenuPane* mPane)
    {

    CEikMenuPaneItem* menuItem;
    TInt position;
    menuItem = mPane->ItemAndPos(EAddDetailsTELOTHER, position);

    _LIT(KAvkonBitmapFile,"\\resource\\apps\\OpenHand2_0xECBF674D.mif") ;

    CFbsBitmap* arrowUpIcon = NULL;
    CFbsBitmap* arrowUpIconMask = NULL;

    AknIconUtils::CreateIconL(arrowUpIcon,arrowUpIconMask,KAvkonBitmapFile,EMbmOpenhand2Arrowup ,
    EMbmOpenhand2Arrowup_mask );

    CleanupStack::PushL( arrowUpIcon );
    CleanupStack::PushL( arrowUpIconMask );

    CGulIcon* ArrowUpListIcon = CGulIcon::NewL(arrowUpIcon, arrowUpIconMask );

    CleanupStack::Pop(arrowUpIconMask); // now owned by ArrowUpListIcon
    CleanupStack::Pop( arrowUpIcon );

    CleanupStack::PushL( ArrowUpListIcon );

    menuItem->SetIcon(ArrowUpListIcon);
    // now pop transferred icons which now are owned by lbox NotApplicableListIcon
    // NoChangeListIcon, ArrowDownListIcon & ArrowUpListIcon
    // and Pop iconArray
    CleanupStack::Pop(1);
    }

  3. #3
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Re: is it possible to show icons for cascade menu items in the form.

    Regards,
    Shilpa Kulkarni

  4. #4
    Registered User
    Join Date
    Feb 2008
    Posts
    41

    Re: is it possible to show icons for cascade menu items in the form.

    Shilpa, Thanks for your reply.
    I have already seen all the threads related to this topic. But my requirement isthat i need to display an icon for a cascade menu item.Is this possible? This is similar to the native contacts appliacation where in if you select Add details menu, cascacaded menu with some menu with icons shown. Eg for a menu "Telephone(Home)", i need to display a phone icon on the left of the menu text. Can you tell me how can i do this..

    Thanks
    Rajani

  5. #5
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Re: is it possible to show icons for cascade menu items in the form.

    Shilpa, Thanks for your reply.
    I have already seen all the threads related to this topic. But my requirement isthat i need to display an icon for a cascade menu item.Is this possible? This is similar to the native contacts appliacation where in if you select Add details menu, cascacaded menu with some menu with icons shown. Eg for a menu "Telephone(Home)", i need to display a phone icon on the left of the menu text. Can you tell me how can i do this..

    Thanks
    Rajani
    The thing which u r talking about "Add details" of native contacts app.. its popup list..CAknPopupList its a different control.

    Search in sdk for more details..
    Regards,
    Shilpa Kulkarni

  6. #6
    Registered User
    Join Date
    Feb 2008
    Posts
    41

    Re: is it possible to show icons for cascade menu items in the form.

    Hi shilpa,

    Thanks , I used now popuplist.

    I have another problem with adding control to the form.
    I am using this function.

    void CContactDetailsForm::AddItemL()
    {
    // _LIT( caption, "New Control" );
    TBuf<50> caption ;
    TInt pageId = ActivePageId();
    TInt id = ++iTotalControls;
    TInt type = EEikCtEdwin;
    TAny* unused=0;
    CTextListBoxModel* model = list->Model();
    TInt index = list->CurrentItemIndex();
    caption.Copy(model->ItemText(index));
    caption.TrimAll();
    SetEditableL(ETrue ) ;
    CEikEdwin* edwin = (CEikEdwin*)CreateLineByTypeL( caption, pageId, id, type, unused );
    edwin->ConstructL
    ( EEikEdwinResizable, 10, 100, 1 );
    UpdatePageL( ETrue );
    (Line(id))->ActivateL();
    SetEditableL( IsEditable() ) ;
    DrawNow();
    }

    The added control appears with the caption in the edit mode. But
    not taking the keyboad input and nor able to scroll after adding the new control with the above function. Can anybody tell me why is this so.

    Regards
    Rajani

Similar Threads

  1. Menu in Form fails to show up...
    By bjorn.rudolfsson in forum Symbian User Interface
    Replies: 14
    Last Post: 2007-04-05, 20:24
  2. Create a new menu in a form
    By miriamgs in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-04-28, 09:26
  3. How to get User defined menu items in a form?
    By sridhar_ratna in forum Symbian
    Replies: 1
    Last Post: 2003-03-25, 09:41
  4. Where to handle the user defined menu items in a form?
    By varshajohn in forum Symbian User Interface
    Replies: 2
    Last Post: 2002-11-18, 07:08
  5. How to get User defined menu items in a form?
    By varshajohn in forum Symbian User Interface
    Replies: 3
    Last Post: 2002-11-11, 14:50

Posting Permissions

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