×

Discussion Board

Results 1 to 7 of 7

Thread: Custom List box

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    8

    Custom List box

    Hi,
    How do I create a listbox with a custom draw functionality ? Specifically I want to create a listbox which has more than 1 icon at the starting of each line .

    Thanks in Advance,
    Raj.

  2. #2
    Super Contributor
    Join Date
    Jul 2004
    Location
    Romania
    Posts
    560
    Extend the existing listbox class.

    Lucian

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    8

    custom listbox

    Hi,
    If I have to extend the existing listbox then I have to override certain functions to gety my functionality. I want to know which functions I should override in my derived class and what I should do in each function.

    Thanks,
    Raj.

  4. #4
    Super Contributor
    Join Date
    Jul 2004
    Location
    Romania
    Posts
    560
    For this please let me know all custom operation/functionality you want to have there and what is the targeted platform.

    Lucian

  5. #5
    Super Contributor
    Join Date
    Apr 2003
    Location
    Czech Republic
    Posts
    915
    if you want just a small tampering with the appearence then you can use something like this:
    Code:
    CColumnListBoxItemDrawer *drawer = iTextListBox->ItemDrawer(); 
    CColumnListBoxData *coldata = drawer->ColumnData(); 
    coldata->SetColumnWidthPixelL(0, 20);
    coldata->SetColumnWidthPixelL(2, 20);
    coldata->SetGraphicsColumnL(0,ETrue);
    coldata->SetGraphicsColumnL(2,ETrue);
    coldata->SetIconArray(iconList);
    coldata->SetColumnFontL( 1, iEikonEnv->DenseFont());
    and of course you have to have a right formating string: number_of_icon \t number_of_icon \t text

  6. #6
    Super Contributor
    Join Date
    Apr 2003
    Location
    Czech Republic
    Posts
    915
    well, there is one more way how to do some more complicated drawing...
    You have to create an object inherited from CTextListItemDrawer with implemented virtual void DrawActualItem();
    method. This object you must give to listbox, for example during construction:
    Code:
    iTextListBox = new (ELeave) CEikListBox;
    iTextListBox -> ConstructL(iModel,iListDrawer,this,CEikListBox::EKeepModel);
    And then you can do whatever drawing you want from for every item in listbox separately.

  7. #7
    Regular Contributor
    Join Date
    May 2004
    Location
    NRW/ Germany
    Posts
    188
    Hi sopta007,

    can you tell me a possibility to change the EAknSinglePopupMenuStyleListBox so that I get two lines of text per item?

    Would be very helpfull.

    Thanks

    Arne

Posting Permissions

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