关于在symbian listbox中添加svg图片的问题
2010-05-31 20:19:00 来源:WEB开发网RArray< TInt >* CATestList2ListBox::GetSelectedListBoxItemsLC( CEikTextListBox* aListBox )
{
CAknFilteredTextListBoxModel* model =
static_cast< CAknFilteredTextListBoxModel *> ( aListBox->Model() );
if ( model->NumberOfItems() == 0 )
return NULL;
// get currently selected indices
const CListBoxView::CSelectionIndexArray* selectionIndexes =
aListBox->SelectionIndexes();
TInt selectedIndexesCount = selectionIndexes->Count();
if ( selectedIndexesCount == 0 )
return NULL;
// copy the indices and sort numerically
RArray
new (ELeave) RArray< TInt >( selectedIndexesCount );
// push the allocated array
CleanupStack::PushL( orderedSelectedIndices );
// dispose the array resource
CleanupClosePushL( *orderedSelectedIndices );
// see if the search field is enabled
CAknListBoxFilterItems* filter = model->Filter();
if ( filter != NULL )
{
// when filtering enabled, translate indices back to underlying model
for ( TInt idx = 0; idx < selectedIndexesCount; idx++ )
{
TInt filteredItem = ( *selectionIndexes ) [ idx ];
TInt actualItem = filter->FilteredItemIndex ( filteredItem );
orderedSelectedIndices->InsertInOrder( actualItem );
}
}
else
{
// the selection indices refer directly to the model
for ( TInt idx = 0; idx < selectedIndexesCount; idx++ )
orderedSelectedIndices->InsertInOrder( ( *selectionIndexes ) [ idx ] );
}
return orderedSelectedIndices;
}
// ]]] end generated function
// [[[ begin generated function: do not modify
更多精彩
赞助商链接