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


C++ ListBox::setSkin方法代码示例

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


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

示例1: mHttp

NewMenuScreen::NewMenuScreen(Feed *feed) : mHttp(this), screenType(screenType) {
	lprintfln("NewMenuScreen::Memory Heap %d, Free Heap %d", heapTotalMemory(), heapFreeMemory());
	this->feed = feed;

	int itemCount = sizeof(menuItems)/sizeof(item);

	c=0;
	versionChecked=0;
	next = NULL;
	first = 1;

	mainLayout = new Layout(0, 0, scrWidth, scrHeight, NULL, 1, 2);

	MAExtent imgSize = maGetImageSize(RES_IMAGE);
	int imgHeight = EXTENT_Y(imgSize);

	ListBox *listBox = new ListBox(0, 0, scrWidth, scrHeight, mainLayout, ListBox::LBO_VERTICAL, ListBox::LBA_LINEAR, true);
	listBox->setSkin(Util::getSkinBack());
	/*listBox->setSkin(Util::getSkinHeader());*/
	/*listBox->setDrawBackground(false);*/


	/*Layout *header = new Layout(0,0,scrWidth, imgHeight, NULL, 1, 1);
	header->setSkin(Util::getSkinHeader());*/

	ListBox *header = new ListBox(0, 0, scrWidth, imgHeight, NULL, ListBox::LBO_VERTICAL, ListBox::LBA_LINEAR, true);
	header->setSkin(Util::getSkinHeader());

	Image *image = new Image(0, 0, scrWidth,  imgHeight, NULL, true, true, RES_IMAGE);
	header->add(image);

	listBox->add(header);

	label = new Label(0,0,scrWidth,36,NULL,"",0,Util::getDefaultSelected());
	label->setMultiLine(true);
	label->setAutoSizeY();
	label->setMultiLine(true);
	label->setDrawBackground(false);
	listBox->add(label);

	menu = new GCMenu(menuItems, itemCount, 0, 0, scrWidth, listBox->getHeight() - imgHeight, false, false, listBox);

	setMain(mainLayout);

	origMenu = this;
}
开发者ID:AirBayCreative,项目名称:GameCards,代码行数:46,代码来源:NewMenuScreen.cpp

示例2: createMainLayout

// first child is listbox
Layout* createMainLayout(const char *left, const char *right) {
	Layout *mainLayout = new Layout(0, 0, scrWidth, scrHeight, NULL, 1, 2);

	Widget *softKeys = createSoftKeyBar(30, left, right);
	ListBox* listBox = new ListBox(0, 0, scrWidth, scrHeight-softKeys->getHeight(), mainLayout, ListBox::LBO_VERTICAL, ListBox::LBA_LINEAR, true);
	listBox->setSkin(gSkin);
	listBox->setPaddingLeft(5);
	listBox->setPaddingRight(5);
	listBox->setPaddingTop(15);
	listBox->setPaddingBottom(15);

	mainLayout->add(softKeys);

	mainLayout->setSkin(NULL);
	mainLayout->setDrawBackground(true);
	mainLayout->setBackgroundColor(0);

	return mainLayout;
}
开发者ID:bjornlalin,项目名称:MoSync,代码行数:20,代码来源:Util.cpp

示例3: items

GCMenu::GCMenu(item items[], int numItems, int x, int y, int width, int height,
		bool autosizeX, bool autosizeY, Widget* parent)
	:Widget(x, y, width, height, parent), items(items), numItems(numItems), enabled(false) {
	setEnabled(true);
	/*setDrawBackground(false);*/

	Layout *mainLayout = new Layout(0, 0, width, height, NULL, 1, 2);
	mainLayout->setDrawBackground(false);

	int imageHeight = height - ICON_HEIGHT - DOT_HEIGHT;

	ListBox *listBox = new ListBox(0, 0, mainLayout->getWidth(), mainLayout->getHeight(), mainLayout, ListBox::LBO_VERTICAL);
	listBox->setSkin(Util::getSkinBack());

	subLayout = new Layout(0, 0, width, imageHeight, listBox, 3, 1);
	subLayout->setPaddingLeft(5);
	subLayout->setPaddingRight(5);
	subLayout->setDrawBackground(false);
	/*subLayout->setSkin(Util::getSkinBack());*/

	leftArrow = new Image(0, 0, ARROW_WIDTH, imageHeight, subLayout, false, false, RES_LEFT_ARROW);
	leftArrow->setDrawBackground(false);

	mainImage = new TransitionImage(0, 0, width - (ARROW_WIDTH * 2) - 10, imageHeight, subLayout, false, false, NULL);
	mainImage->setDrawBackground(false);

	rightArrow = new Image(0, 0, ARROW_WIDTH, imageHeight, subLayout, false, false, RES_RIGHT_ARROW);
	rightArrow->setDrawBackground(false);

	ListBox *iconAndDotList = new ListBox(0, 0, width, ICON_HEIGHT + DOT_HEIGHT, listBox,
			ListBox::LBO_VERTICAL);
	iconAndDotList->setSkin(Util::getIconListBack());

	iconList = new ListBox(0, 0, width, ICON_HEIGHT, iconAndDotList,
		ListBox::LBO_HORIZONTAL);
	iconList->setDrawBackground(false);

	iconsPerList = iconList->getWidth() / (PADDING + MIN_MENU_ICON_WIDTH);
	int currentList = -1;
	ListBox *tempList = NULL;
	Image *tempImage = NULL;

	for (int i = 0; i < numItems; i++) {
		if (i % iconsPerList == 0) {
			tempList = new ListBox(0, 0, iconList->getWidth(), iconList->getHeight(), NULL);
			tempList->setOrientation(ListBox::LBO_HORIZONTAL);
			tempList->setDrawBackground(false);
			currentList++;
			iconLists.add(tempList);
		}

		tempImage = new Image(0, 0, MIN_MENU_ICON_WIDTH + PADDING + ((iconList->getWidth() % (PADDING + MIN_MENU_ICON_WIDTH)) / iconsPerList),
				ICON_HEIGHT, tempList, false, false, items[i].icon);
		//tempImage->setSkin(Util::getIconSelect());
		//tempImage->setDrawBackground(true);
	}
	dotList = new ListBox(0, 0, width, DOT_HEIGHT, iconAndDotList,
			ListBox::LBO_HORIZONTAL);
	dotList->setDrawBackground(false);
	int dotListPadding = (width - (iconLists.size() * (11 + PADDING))) / 2;
	dotList->setPaddingLeft(dotListPadding>0?dotListPadding:0);
	for (int j = 0; j < iconLists.size(); j++) {
		tempImage = new Image(0, 0, 11 + PADDING, DOT_HEIGHT, dotList, false, false, RES_DESELECTED_LIST_DOT);
	}

	if (numItems > 0) {
		emp = false;
		selectedList = 0;

		((Image*)dotList->getChildren()[selectedList])->setResource(RES_SELECTED_LIST_DOT);

		iconList->add(iconLists[selectedList]);
		iconLists[selectedList]->setSelectedIndex(0);
		iconLists[selectedList]->getChildren()[iconLists[0]->getSelectedIndex()]->setSelected(true);
		((Image*)iconLists[selectedList]->getChildren()[iconLists[selectedList]->getSelectedIndex()])->setResource(items[iconLists[selectedList]->getSelectedIndex()].iconSel);

		mainImage->setResource(items[iconLists[selectedList]->getSelectedIndex() + (selectedList * iconsPerList)].bigImage);
	}
	else {
		emp = true;
	}
	add(mainLayout);
}
开发者ID:AirBayCreative,项目名称:GameCards,代码行数:83,代码来源:GCMenu.cpp


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