×

Discussion Board

Results 1 to 3 of 3

Thread: ListBox Icon

  1. #1
    Registered User
    Join Date
    Jun 2004
    Posts
    19

    ListBox Icon

    Hi I am trying to put two image in a listbox .

    Here is my code to show a single image .

    But i am not able to view any image :

    Help Please ...

    Can any one provide some sample code for list box showing two image per column ,

    Here is my code:
    ===========

    void CPhotoListContainer::ShowListBox()
    {

    CreateWindowL();

    iListBox = new (ELeave) CAknColumnListBox;

    iListBox->SetContainerWindowL( *this );
    iListBox->ConstructL( this, EAknListBoxSelectionList);

    CColumnListBoxItemDrawer* drawer = iListBox->ItemDrawer();
    CColumnListBoxData* colData = drawer->ColumnData();
    //iListBox->ConstructL( this );
    iListBox->SetMopParent(this);

    // Create the scroll indicator
    iListBox->CreateScrollBarFrameL(ETrue);
    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);

    iconList = new(ELeave) CArrayPtrFlat<CGulIcon>(2);

    CleanupStack::PushL(iconList);

    //CGulIcon *img = CGulIcon::NewLC();
    //img->SetBitmap(iBitmap);

    //iconList->AppendL(img);
    iconList->AppendL(iEikonEnv->CreateIconL(_L("Z:\\system\\data\\avkon.mbm"), EMbmAvkonQgn_indi_marked_add, EMbmAvkonQgn_indi_marked_add_mask));
    colData->SetIconArray(iconList);

    // delete img;

    CleanupStack::Pop();

    colData->SetGraphicsColumnL(0, ETrue);
    colData->SetOptionalColumnL(0,EFalse);
    colData->SetColumnWidthPixelL(0,21);
    colData->SetColumnAlignmentL(0, CGraphicsContext::ECenter);
    /*
    colData->SetGraphicsColumnL(1, ETrue);
    colData->SetOptionalColumnL(1,EFalse);
    colData->SetColumnWidthPixelL(1,100);
    colData->SetColumnAlignmentL(1, CGraphicsContext::ECenter);
    */
    //iListBox->Model()->SetOwnershipType( ELbmOwnsItemArray );

    //SetFileList();
    //colData->SetIconArray(iconList);

    iListBox->ActivateL();
    iListBox->SetFocus(ETrue, EDrawNow);
    iListBox->DrawNow();
    iListBox->UpdateScrollBarsL();

    TRect ListWindow(TPoint(0,44),TPoint(176,188));
    SetRect(ListWindow);
    ActivateL();

    }

  2. #2
    Registered User
    Join Date
    Jun 2004
    Posts
    19

    Problem with Icon only

    Hi With the same code base i am able to print TEXT
    So problem with icon view only .

    Any Idea ?? Please help...

    ==========

    Hi Thanks for your reply

    I could slove the problme ,


    Can any one help me how to Mark / unmark the list

    Here is the code i am using
    ===

    CListBoxView::CSelectionIndexArray* newSelection = new (ELeave) CListBoxView::CSelectionIndexArray((TBufRep)CBufFlat::NewL, 5);
    newSelection->AppendL(1);
    newSelection->AppendL(3);
    iListBox->SetSelectionIndexesL(newSelection);
    iListBox->HandleItemAdditionL();
    delete newSelection;
    =======

    I am not able to see the mark sign in the list ..

    can Anyone help me
    Last edited by apu_rath; 2004-06-23 at 12:52.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Location
    Linköping, Sweden
    Posts
    11
    Hi,
    I'm not sure about this, but shouldn't you use another list instead of CAknColumnListBox. Have you tried to use the CAknSingleGraphicStyleListBox for instance ?

    /Hans

Posting Permissions

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