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


C++ VerticalLayout::addBanner方法代码示例

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


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

示例1: createMainLayout

/**
 * Creates and adds main layout to the screen.
 */
void MainScreen::createMainLayout() {
	// Create and add the main layout to the screen.
	VerticalLayout* mainLayout = new VerticalLayout();
	Screen::setMainWidget(mainLayout);

	int platformType = getPlatform();
	if (platformType == ANDROID || platformType == IOS)
	{
		// ID required for the android platform (the IOS platform will ignore it)
		mBanner = new Banner("a14dbba084368db");
	}
	else if (getPlatform() == WINDOWSPHONE7)
	{
		// we need to send the APP ID and the AD ID to the mosync banner constructor
		// for the windows phone 7 platform (we'll use APP ID = 'test_client' and
		// AD ID = 'Image480_80' to enable the test mode)
		mBanner = new Banner("test_client|Image480_80");
	}

	mBanner->requestContent(true);
	mainLayout->addBanner(mBanner);

	Label* label;

	// Add banner status to list item
	mBannerMessage = new Label();
	mBannerMessage->setText("before loading Ad");
	mBannerMessage->setFontColor(0xFF0000);
	mainLayout->addChild(mBannerMessage);

	// Add "Enable/Disable banner" list item
	label = new Label();
	label->setText("Enable click on banner");
	mEnableCheckBox = new CheckBox();
	mEnableCheckBox->setState(true);
	mainLayout->addChild(createRow(mEnableCheckBox, label));

	// Add "Is banner enabled/disabled status" into a list item
	mRefreshEnableButton = new Button();
	mRefreshEnableButton->setText("Is Enabled");
	mRefreshEnableButton->wrapContentHorizontally();
	mIsBannerEnabled = new Label();
	mIsBannerEnabled->setText("Banner is enabled");
	mainLayout->addChild(createRow(mRefreshEnableButton, mIsBannerEnabled));

	// Add "Show/Hide banner" list item
	label = new Label();
	label->setText("Show banner");
	mShowBannerCheckBox = new CheckBox();
	mShowBannerCheckBox->setState(true);
	mainLayout->addChild(createRow(mShowBannerCheckBox, label));

	// Add "Is banner visible status" into a list item
	mRefreshVisibleButton = new Button();
	mRefreshVisibleButton->setText("Is Visible");
	mRefreshVisibleButton->wrapContentHorizontally();
	mIsBannerVisible = new Label();
	mIsBannerVisible->setText("Banner is visible");
	mainLayout->addChild(createRow(mRefreshVisibleButton, mIsBannerVisible));

	// Add "Get banner size" list item
	mGetSizeButton = new Button();
	mGetSizeButton->setText("Get size");
	mGetSizeButton->wrapContentHorizontally();
	mSizeLabel = new Label();
	mSizeLabel->setText("Banner size: 0 x 0 px");
	mainLayout->addChild(createRow(mGetSizeButton, mSizeLabel));
}
开发者ID:Felard,项目名称:MoSync,代码行数:71,代码来源:MainScreen.cpp


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