×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    43

    changing cba resource in popup list?plz reply again. answer is not working

    dear nokia people,
    i want to change the label of cba button in popup list . i am using my own cba resource to achieve the same.but when i click on any of the button ,executeLD doesnt return anything.that menas it doesnt go the line after executeLd().so cant we use custom cba instead of system defined resource. plz reply it asap. i have already posted same question earlier but no concrete answer has been received so far.so plz reply asap

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    91

    RE: changing cba resource in popup list

    Hey,

    U can use the following code to create ur own CBA buttons

    RESOURCE CBA r_cba_button1_button2
    {
    buttons =
    {
    CBA_BUTTON {id=EButton1;
    txt = "Button1";},
    CBA_BUTTON {id=EButton2;
    txt = "Button2"; }
    };
    }

    then in your view:-

    iAvkonAppUi->Cba()->SetCommandSetL(R_CBA_BUTTON1_BUTTON2);
    iAvkonAppUi->Cba()->DrawNow();

    Note remmember to create Enums for them in the .hrh file of ur application. Then handle those enums in the HandleCommandL() function of ur view class.

    Ashish

  3. #3
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    60

    RE: changing cba resource in popup list?plz reply again. answer is not working

    Two possibilities spring to mind:
    1) dirty hack:
    RESOURCE CBA r_popuplist_A_B
    {
    buttons =
    {
    CBA_BUTTON {
    id = EAknSoftkeySelect;
    txt = "Option A";
    },
    CBA_BUTTON {
    id = EAknSoftkeyBack;
    txt = "Option B"; }
    };
    }
    yuk! (but works!)
    or
    2)
    Derive from CAknPopupList and override the ProcessCommandL to handle your own commands. I'll elaborate...
    Create new class
    class CMyPopupList : public CAknPopupList
    ...
    in the definition
    void CMyPopupList::ConstructL(CEikListBox* aListBox, TInt aCbaResource, AknPopupLayouts::TAknPopupLayouts aType)
    {
    CAknPopupList::ConstructL(aListBox, aCbaResource, aType);
    }
    void CMyPopupList::ProcessCommandL(TInt aCommandId)
    {
    AttemptExitL(aCommandId==EPopupListOptionA ? ETrue : EFalse);
    }
    The constructL makes sure the base class is constructed correctly and the ProcessCommandL handles whatever commandIds you would like.
    Hope that helps
    Graeme
    PS Did you know that there is an R_AVKON_SOFTKEYS_SELECT_BACK. I noticed from your previous post that you had R_SOFTKEYS_SELECT_BACK

Posting Permissions

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