关于在symbian listbox中添加svg图片的问题
2010-05-31 20:19:00 来源:WEB开发网*/
TKeyResponse CATestList2ListBox::OfferKeyEventL(
const TKeyEvent& aKeyEvent,
TEventCode aType )
{
// [[[ begin generated region: do not modify [Generated Contents]
if ( aKeyEvent.iCode == EKeyLeftArrow
|| aKeyEvent.iCode == EKeyRightArrow )
{
// Listbox takes all events even if it doesn't use them
return EKeyWasNotConsumed;
}
// ]]] end generated region [Generated Contents]
if ( iFocusControl != NULL
&& iFocusControl->OfferKeyEventL( aKeyEvent, aType ) == EKeyWasConsumed )
{
return EKeyWasConsumed;
}
return CCoeControl::OfferKeyEventL( aKeyEvent, aType );
}
// [[[ begin generated function: do not modify
/**
* Initialize each control upon creation.
*/
void CATestList2ListBox::InitializeControlsL()//这个就是初始化控件的方法
{
iListBox = new ( ELeave ) CAknDoubleLargeStyleListBox;//初始化listBox
iListBox->SetContainerWindowL( *this );//设置list的
{
TResourceReader reader;//一个资源解析器
iEikonEnv->CreateResourceReaderLC( reader, R_ATEST_LIST2_LIST_BOX_LIST_BOX );//读取资源
iListBox->ConstructFromResourceL( reader );//构造资源
CleanupStack::PopAndDestroy(); // reader internal state
}
// the listbox owns the items in the list and will free them
iListBox->Model()->SetOwnershipType( ELbmOwnsItemArray );//这个是说list拥有item并且负责处理他们
// setup the icon array so graphics-style boxes work//设置list的图标
SetupListBoxIconsL();
// add list items
AddListBoxResourceArrayItemL( R_ATEST_LIST2_LIST_BOX_LISTBOX_ITEM1,
EListBoxAtestlist2List_iconIndex );
AddListBoxResourceArrayItemL( R_ATEST_LIST2_LIST_BOX_LISTBOX_ITEM2,
更多精彩
赞助商链接