×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Nov 2003
    Posts
    112

    how to get the filtered item in listbox?

    hi, knowing that the following :
    CAknFilteredTextListBoxModel* model = STATIC_CAST(CAknFilteredTextListBoxModel*,iBox->Model());
    and model->Filter() function i can get the class 'CAknListBoxFilterItems', i try to use CAknListBoxFilterItems::SelectionIndexes to get CArrayFix<TInt>*, the problem is if im' using FilteredNumberOfItems i can get the number of item filtered, if im using CArrayFix::Count(), i got 0, did any one knowing how to get the filter item in the listbox?

    the following is my code :

    //////////////////////////////////////////////////////////////////////
    if (formattedListBox==NULL) return;

    CDesCArray* array=static_cast<CDesCArray*>(formattedListBox->Model()->ItemTextArray());

    tLog log(_L("LogFile"),_L("FilterLog.txt"));
    TBuf <256>str;

    str.Format(_L("Number of Item : %d"),array->Count());
    log.WriteToLog(str);
    for (int i=0;i<array->Count();i++)
    {
    str.Format(_L("%d"),i);
    log.WriteToLog(str);
    }

    CAknFilteredTextListBoxModel* model=STATIC_CAST(CAknFilteredTextListBoxModel*,formattedListBox->Model());
    CDesCArray* array1=static_cast<CDesCArray*>(model->ItemTextArray());

    str.Format(_L("Number of Filter Item : %d"),array1->Count());
    log.WriteToLog(str);
    //////////////////////////////////////////////////////////////////////

    thanks

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,175
    hi

    you could get the index for the item array for the current item by using this:

    model->Filter()->FilteredItemIndex(iBox->CurrentItemIndex())

    yucca

  3. #3
    Regular Contributor
    Join Date
    Nov 2003
    Posts
    112
    thanks symbianyucca, i got it

Posting Permissions

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