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


C++ Window::getProperty方法代码示例

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


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

示例1: SetLabel

void PromptBox::SetLabel(const CEGUI::String& text)
{
	OC_CEGUI_TRY;
	{
		CEGUI::Window* messageText = mPromptBox->getChild(mPromptBox->getName() + "/MessageText");
		CEGUI::Window* editbox = mPromptBox->getChild(mPromptBox->getName() + "/Editbox");
		const float32 offset = 10;
		float32 buttonHeight = mPromptBox->getChild(mPromptBox->getName() + "/ButtonOK")->getPixelSize().d_height;
		float32 editboxHeight = editbox->getPixelSize().d_height;
	
		messageText->setText(text);
		float32 textWidth = StringConverter::FromString<float32>(messageText->getProperty("HorzExtent").c_str());
		float32 textHeight = StringConverter::FromString<float32>(messageText->getProperty("VertExtent").c_str());

		editbox->subscribeEvent(CEGUI::Editbox::EventKeyDown, CEGUI::Event::Subscriber(&PromptBox::OnEditboxKeyDown, this));

		messageText->setArea(CEGUI::UDim(0,offset), CEGUI::UDim(0,0), CEGUI::UDim(1, -2.0f*offset), CEGUI::UDim(1, -buttonHeight-editboxHeight - offset));
		mPromptBox->setWidth(CEGUI::UDim(0, textWidth + 2.0f*offset + INNER_FRAME_OFFSET));
		mPromptBox->setHeight(CEGUI::UDim(0, textHeight + buttonHeight + editboxHeight + offset + INNER_FRAME_OFFSET));
		mPromptBox->setXPosition(CEGUI::UDim(0.5f, -0.5f*mPromptBox->getPixelSize().d_width));
		mPromptBox->setYPosition(CEGUI::UDim(0.5f, -0.5f*mPromptBox->getPixelSize().d_height));

		EnsureWindowIsWideEnough();
	}
	OC_CEGUI_CATCH;
}
开发者ID:Ocerus,项目名称:Ocerus,代码行数:26,代码来源:PromptBox.cpp

示例2: SetText

void MessageBox::SetText(const CEGUI::String& text)
{
	CEGUI::Window* messageText = mMessageBox->getChild(mMessageBox->getName() + "/MessageText");
	const float32 offset = 10;
	float32 buttonHeight = mMessageBox->getChild(mMessageBox->getName() + "/ButtonOK")->getPixelSize().d_height;
	messageText->setText(text);
	float32 textWidth = StringConverter::FromString<float32>(messageText->getProperty("HorzExtent").c_str());
	float32 textHeight = StringConverter::FromString<float32>(messageText->getProperty("VertExtent").c_str());

	messageText->setArea(CEGUI::UDim(0,offset), CEGUI::UDim(0,0), CEGUI::UDim(1, -2.0f*offset), CEGUI::UDim(1, -buttonHeight-offset));
	mMessageBox->setWidth(CEGUI::UDim(0, textWidth + 2.0f*offset + INNER_FRAME_OFFSET));
	mMessageBox->setHeight(CEGUI::UDim(0, textHeight + buttonHeight + offset + INNER_FRAME_OFFSET));
	mMessageBox->setXPosition(CEGUI::UDim(0.5f, -0.5f*mMessageBox->getPixelSize().d_width));
	mMessageBox->setYPosition(CEGUI::UDim(0.5f, -0.5f*mMessageBox->getPixelSize().d_height));

	EnsureWindowIsWideEnough();
}
开发者ID:Ocerus,项目名称:Ocerus,代码行数:17,代码来源:MessageBox.cpp

示例3: OnEventKeyDown

bool TabNavigation::OnEventKeyDown(const CEGUI::EventArgs& e)
{
	const CEGUI::KeyEventArgs& args = static_cast<const CEGUI::KeyEventArgs&>(e);
	if (args.scancode == CEGUI::Key::Tab) // Tab or Shift+Tab
	{
		WidgetList::iterator itCurrent = Containers::find(mTabOrder.begin(), mTabOrder.end(), args.window);
		OC_ASSERT(itCurrent != mTabOrder.end());
		WidgetList::iterator itFocus = itCurrent;
		CEGUI::Window* newWidget = 0;
		do
		{
			if (args.sysKeys & CEGUI::Shift)
			{
				// Set previous
				if (itFocus == mTabOrder.begin())
					itFocus = mTabOrder.end();
				--itFocus;
			}
			else
			{
				// Set next
				++itFocus;
				if (itFocus == mTabOrder.end())
					itFocus = mTabOrder.begin();
			}
			newWidget = *itFocus;
		}
		while ((!newWidget->isVisible() || newWidget->isDisabled() || newWidget->getProperty("ReadOnly") == "True" ) && itFocus != itCurrent);
		newWidget->activate();

		// Make sure active widget will be visible
		if (mScrollablePane)
		{
			CEGUI::Window* w = newWidget;
			CEGUI::Vector2 widgetOffset(0, 0);
			do
			{
				widgetOffset += w->getPosition().asAbsolute(w->getParentPixelSize());
				w = w->getParent();
			}
			while (w != mScrollablePane && w != 0);

			float32 scrollViewTop = mScrollablePane->getContentPaneArea().getSize().d_height * mScrollablePane->getVerticalScrollPosition();
			float32 scrollViewBottom = scrollViewTop + mScrollablePane->getClipRect().getHeight();
			
			if (widgetOffset.d_y < scrollViewTop || widgetOffset.d_y + newWidget->getPixelSize().d_height > scrollViewBottom)
			{
				// We need to scroll
				mScrollablePane->setVerticalScrollPosition(widgetOffset.d_y / mScrollablePane->getContentPaneArea().getSize().d_height);
			}
		}

		return true;
	}
	return false;
}
开发者ID:Ocerus,项目名称:Ocerus,代码行数:56,代码来源:TabNavigation.cpp

示例4: handleOptionsVisibility

bool GUIManager::handleOptionsVisibility ( CEGUI::EventArgs const & )
{
  CEGUI::Window *dsFrame = CEGUI::WindowManager::getSingleton().getWindow(
      "Sheet/DatasetFrame");
  std::string prop = dsFrame->getProperty("Visible").c_str();
  if (prop == "False")
    dsFrame->show();
  else
    dsFrame->hide();
  return true;
}
开发者ID:Nvveen,项目名称:Revolution,代码行数:11,代码来源:GUIManager.cpp

示例5: HandleInventoryEnter

/***********************************************************
handle windows enter event
***********************************************************/
bool ContainerBox::HandleInventoryEnter (const CEGUI::EventArgs& e)
{
	const CEGUI::MouseEventArgs& dd_args = static_cast<const CEGUI::MouseEventArgs&>(e);

	unsigned int id = dd_args.window->getID();

	CEGUI::Window* tmp = dd_args.window;
	std::string ttip = tmp->getProperty("Tooltip").c_str();
	if(ttip == "")
	{
		CEGUI::String tmpstr((const unsigned char *)InventoryHandler::getInstance()->GetItemDescription(id).c_str());
		tmp->setProperty("Tooltip", tmpstr);
	}

	return true;
}
开发者ID:leloulight,项目名称:lbanet,代码行数:19,代码来源:ContainerBox.cpp

示例6: getPoints

int GamePlate::getPoints()
{
    CEGUI::Window* window = d_window->getChild("ImageWindowObject");

    CEGUI::String objectImage = window->getProperty("Image");

    if(objectImage.compare(HUDDemo::s_imageNameBread) == 0)
        return 2;
    else if(objectImage.compare(HUDDemo::s_imageNamePoo) == 0)
        return -6;
    else if(objectImage.compare(HUDDemo::s_imageNameSteak) == 0)
        return -13;
    else if(objectImage.compare(HUDDemo::s_imageNamePrizza) == 0)
        return 3;
    else if(objectImage.compare(HUDDemo::s_imageNameVegPeople) == 0)
        return 1;
    else if(objectImage.compare(HUDDemo::s_imageNameVegFruits) == 0)
        return 88;

    return 0;
}
开发者ID:scw000000,项目名称:Engine,代码行数:21,代码来源:HUDemo.cpp


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