×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    38

    Problem in CAknSingleGraphicStyleListBox?

    I want to create a listbox which contain a iconarray and a text column. I have used CAknSingleGraphicStyleListBox type listbox. I have used to resize the icon by using

    AknIconUtils::SetSize(iBitmap,iSize,EAspectRatioPreserved);

    But it still unchanged. How can i solve this problem. If do u have any way to create listbox with icon, please send me the sample code? Or please correct my code that is under below--

    iList = new (ELeave) CAknSingleGraphicStyleListBox;
    iList->ConstructL(this);
    iList->SetContainerWindowL(*this);
    iList->CreateScrollBarFrameL(ETrue);
    iList->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto );
    _LIT(KListItemFormat,"%d\t%S\t%d\t%d\t%S\t%S");

    TBuf<30> aFirstArg;
    aFirstArg.Append(_L("FirstArg"));

    TBuf<30> aSecArg;
    aSecArg.Append(_L("SecondArg"));

    TBuf<300> Item;
    itemList = new (ELeave) CDesCArrayFlat(3);
    Item.Format(KListItemFormat,0,&(_L("head1")),1,0,&aFirstArg,&aSecArg);
    itemList->AppendL(Item);
    Item.Format(KListItemFormat,0,&( _L("head2")),0,1,&aFirstArg,&aSecArg);
    itemList->AppendL(Item);
    Item.Format(KListItemFormat,0,&(_L("head3")),1,0,&aFirstArg,&aSecArg);
    itemList->AppendL(Item);
    iList->Model()->SetItemTextArray(itemList);
    iList->Model()->SetOwnershipType(ELbmOwnsItemArray);
    CArrayPtr<CGulIcon>* iconList = new (ELeave) CAknIconArray(3);
    CleanupStack::PushL(iconList);
    TSize iSize;
    iSize.iHeight=50;
    iSize.iWidth=50;

    AknIconUtils::CreateIconL( iBitmap,
    iMask,
    KIconFile,
    EMbmListbox_modelQgn_listbox_model,
    EMbmListbox_modelQgn_listbox_model_mask);

    AknIconUtils::SetSize(iBitmap,iSize,EAspectRatioPreserved);
    iconList->AppendL( CGulIcon::NewL( iBitmap, iMask ) );
    AknIconUtils::CreateIconL( iBitmap,
    iMask,
    KIconName,
    EMbmListbox_modelQgn_listbox_model,
    EMbmListbox_modelQgn_listbox_model_mask);


    iconList->AppendL( CGulIcon::NewL( iBitmap, iMask ) );

    iList->ItemDrawer()->ColumnData()->SetIconArray( iconList );
    CleanupStack::Pop();
    iList->HandleItemAdditionL();

    BR,
    Sazzad

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,671

    Re: Problem in CAknSingleGraphicStyleListBox?

    CAknXyListBox-es maintain the size of the icons themselves. They invoke AknIconUtils::SetSize and override whatever you have set.
    Why do you think that your icon has to be resized?

Similar Threads

  1. Problem with CAknDoubleStyleListBox with a CAknSearchField
    By jjig in forum Symbian User Interface
    Replies: 2
    Last Post: 2009-09-17, 00:58
  2. SyncML link problem
    By samuel_ in forum Symbian
    Replies: 4
    Last Post: 2009-03-27, 08:02
  3. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  4. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  5. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36

Posting Permissions

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