Osp::Ui::Controls::ListItemBase* Form1::CreateItem(int itemIndex, int itemWidth) { String text; text.Format(100, L"SimpleItem #%d", itemIndex); AppResource * res = Application::GetInstance()->GetAppResource(); Bitmap * pBitmap = res->GetBitmapN(L"itemicon.png", BITMAP_PIXEL_FORMAT_ARGB8888); SimpleItem * pItem = new SimpleItem(); pItem->Construct(Dimension(itemWidth, 100), LIST_ANNEX_STYLE_DETAILED); pItem->SetElement(text, pBitmap); ListContextItem* pItemContext = new ListContextItem(); pItemContext->Construct(); pItemContext->AddElement(0, "Call"); pItemContext->AddElement(1, "Send SMS"); pItemContext->AddElement(2, "Send e-mail"); pItem->SetContextItem(pItemContext); delete pBitmap; return pItem; }
Tizen::Ui::Controls::ListItemBase* ProfileListForm::CreateItem(int index, int itemWidth) { SimpleItem* pItem = new SimpleItem(); AppAssert(pItem); pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 100), LIST_ANNEX_STYLE_DETAILED); String *str = static_cast<String*>(__pTitleList.GetAt(index)); pItem->SetElement(*str, null); ListContextItem* pContextItem = new ListContextItem(); String getDelete; Application::GetInstance()->GetAppResource()->GetString(IDS_DELETE, getDelete); pContextItem->Construct(); pContextItem->AddElement(IDA_ITEM_DELETE, getDelete); pItem->SetContextItem(pContextItem); return pItem; }