当前位置: 首页>>代码示例>>C++>>正文


C++ ListView::SetBounds方法代码示例

本文整理汇总了C++中ListView::SetBounds方法的典型用法代码示例。如果您正苦于以下问题:C++ ListView::SetBounds方法的具体用法?C++ ListView::SetBounds怎么用?C++ ListView::SetBounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ListView的用法示例。


在下文中一共展示了ListView::SetBounds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: rect

result
EnrichedTextForm::OnInitializing(void)
{
	BaseForm::OnInitializing();
	result r = E_SUCCESS;

	ButtonItem buttonLeftItem;
	buttonLeftItem.Construct(BUTTON_ITEM_STYLE_TEXT, ID_EXIT);
	buttonLeftItem.SetText(L"Back");

	Rectangle rect(20, 200, 680, 360);
	__pEnrichedText = new (std::nothrow) EnrichedText();
	__pEnrichedText->Construct(Dimension(rect.width, rect.height));
	__pEnrichedText->SetVerticalAlignment(TEXT_ALIGNMENT_TOP);
	__pEnrichedText->SetHorizontalAlignment(TEXT_ALIGNMENT_LEFT);
	__pEnrichedText->SetTextWrapStyle(TEXT_WRAP_NONE);
	__pEnrichedText->SetTextAbbreviationEnabled(true);

	Font* pFont = new (std::nothrow) Font();
	pFont->Construct(FONT_STYLE_PLAIN, 35);

	Font* pFontItalic = new (std::nothrow) Font();
	pFontItalic->Construct(FONT_STYLE_ITALIC, 30);

	Bitmap* pBitmap = App::GetInstance()->GetAppResource()->GetBitmapN(L"home_type3.png");
	if (pBitmap)
	{
		pBitmap->Scale(Dimension(50, 50));
	}

	__pTextElement1 = new (std::nothrow) TextElement();
	__pTextElement2 = new (std::nothrow) TextElement();
	__pTextElement3 = new (std::nothrow) TextElement();

	__pTextElement1->Construct(L"Tizen is a new open platform that enables richer user experience");
	__pTextElement2->Construct(L"in applications on mobile devices.");
	__pTextElement3->Construct(L"Tizen API Reference provides of all the powerful features. Tizen is a new open platform that enables richer user experience in applications on mobile devices");

	__pTextElement1->SetTextColor(Color::GetColor(COLOR_ID_YELLOW));

	__pTextElement2->SetTextColor(Color::GetColor(COLOR_ID_BLUE));
	__pTextElement2->SetFont(*pFont);

	__pTextElement3->SetTextColor(Color::GetColor(COLOR_ID_VIOLET));
	__pTextElement3->SetFont(*pFontItalic);

	__pEnrichedText->Add(*__pTextElement1);
	__pEnrichedText->Add(*__pTextElement2);
	__pEnrichedText->Add(*pBitmap);
	__pEnrichedText->Add(*__pTextElement3);

	__pEnrichedText->Refresh();

	ListView* pListview = static_cast<ListView*>(GetControl("IDC_LISTVIEW", true));
	if(pListview)
	{
		pListview->SetBounds(0, GetClientAreaBounds().height/2, GetClientAreaBounds().width, GetClientAreaBounds().height/2);
		pListview->AddListViewItemEventListener(*this);
		pListview->SetItemProvider(*this);
	}

	delete pFont;
	delete pFontItalic;
	delete pBitmap;

	return r;
}
开发者ID:justinkchen,项目名称:giraffe,代码行数:67,代码来源:EnrichedTextForm.cpp


注:本文中的ListView::SetBounds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。