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


C++ UICheckBox::setPosition方法代码示例

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


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

示例1: PolycodeEditor

PolycodeProjectEditor::PolycodeProjectEditor(PolycodeProjectManager *projectManager) : PolycodeEditor(true){

	this->projectManager = projectManager;


	Config *conf = CoreServices::getInstance()->getConfig();	
	String fontName = conf->getStringValue("Polycode", "uiDefaultFontName");
	int fontSize = conf->getNumericValue("Polycode", "uiDefaultFontSize");	
	Number padding = conf->getNumericValue("Polycode", "uiWindowSkinPadding");	
		

	headerBg = new ScreenShape(ScreenShape::SHAPE_RECT,10,10);
	addChild(headerBg);
	headerBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
	headerBg->setColor(0.1, 0.1, 0.1, 1.0);
	
	ScreenLabel *label = new ScreenLabel("PROJECT SETTINGS", 22, "section", Label::ANTIALIAS_FULL);
	label->color.a = 0.4;
	addChild(label);
	label->setPosition(10, 0);



	moduleSettingsWindow = new UIElement();
	moduleSettingsWindow->setPosition(350,10);
	addChild(moduleSettingsWindow);
	
	
	Number lastYPos = 40;

	label = new ScreenLabel("PROJECT MODULES", 22, "section", Label::ANTIALIAS_FULL);
	label->color.a = 0.4;
	moduleSettingsWindow->addChild(label);
	label->setPosition(0, lastYPos);

	lastYPos += 40;
	
	String polycodeBasePath = CoreServices::getInstance()->getCore()->getDefaultWorkingDirectory();
		
	std::vector<OSFileEntry> moduleFolders = OSBasics::parseFolder(polycodeBasePath+"/Standalone/Modules", false);
	for(int i=0; i < moduleFolders.size(); i++) {
		OSFileEntry entry = moduleFolders[i];
		if(entry.type == OSFileEntry::TYPE_FOLDER) {
			UICheckBox *moduleCheckBox = new UICheckBox(entry.name, false);
			moduleCheckBox->setPosition(0, lastYPos);
			lastYPos += moduleCheckBox->getHeight() + 5;
			moduleSettingsWindow->addChild(moduleCheckBox);
			moduleCheckboxes.push_back(moduleCheckBox);
		}
	}
	
	lastYPos += 20;

	label = new ScreenLabel("PROJECT FONTS", 22, "section", Label::ANTIALIAS_FULL);
	label->color.a = 0.4;
	moduleSettingsWindow->addChild(label);
	label->setPosition(0, lastYPos);
	
	lastYPos += 30;
	
	fontEntryBase = new UIElement();
	moduleSettingsWindow->addChild(fontEntryBase);	
	fontEntryBase->setPosition(0, lastYPos);
			
	addFontButton = new UIButton("Add Font", 100);
	fontEntryBase->addChild(addFontButton);
	addFontButton->addEventListener(this, UIEvent::CLICK_EVENT);

	mainSettingsWindow = new UIElement();
	mainSettingsWindow->setPosition(0,10);
	addChild(mainSettingsWindow);
	
	ScreenLabel *label2 = new ScreenLabel(L"DEFAULT VIDEO OPTIONS", 22, "section", Label::ANTIALIAS_FULL);	
	label2->setColor(1.0, 1.0, 1.0, 0.4);
	mainSettingsWindow->addChild(label2);
	label2->setPosition(padding, 40);		

		
	label2 = new ScreenLabel(L"Width:", fontSize, fontName, Label::ANTIALIAS_FULL);
	mainSettingsWindow->addChild(label2);
	label2->setPosition(padding, 80);		
	
	defaultWidthInput = new UITextInput(false, 60, 12);	
	mainSettingsWindow->addChild(defaultWidthInput);
	defaultWidthInput->setPosition(label2->getPosition().x, label2->getPosition().y+18);
	defaultWidthInput->setNumberOnly(true);

	label2 = new ScreenLabel(L"Height:", fontSize, fontName, Label::ANTIALIAS_FULL);
	mainSettingsWindow->addChild(label2);
	label2->setPosition(padding + 80, 80);		
	
	defaultHeightInput = new UITextInput(false, 60, 12);	
	mainSettingsWindow->addChild(defaultHeightInput);
	defaultHeightInput->setPosition(label2->getPosition().x, label2->getPosition().y+18);
	defaultHeightInput->setNumberOnly(true);
	
	label2 = new ScreenLabel(L"Anti-aliasing:", fontSize, fontName, Label::ANTIALIAS_FULL);
	mainSettingsWindow->addChild(label2);
	label2->setPosition(padding + 160, 80);		
	
//.........这里部分代码省略.........
开发者ID:baumicon,项目名称:Polycode,代码行数:101,代码来源:PolycodeProjectEditor.cpp


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