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


C++ Element::SetInnerRML方法代码示例

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


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

示例1: AddOption

// Adds a new option to the select control.
int WidgetDropDown::AddOption(const Rocket::Core::String& rml, const Rocket::Core::String& value, int before, bool select, bool selectable)
{
	// Instance a new element for the option.
	Core::Element* element = Core::Factory::InstanceElement(selection_element, "*", "option", Rocket::Core::XMLAttributes());

	// Force to block display and inject the RML. Register a click handler so we can be notified of selection.
	element->SetProperty("display", "block");
	element->SetProperty("clip", "auto");
	element->SetInnerRML(rml);
	element->AddEventListener("click", this);

	int option_index;
	if (before < 0 ||
		before >= (int) options.size())
	{
		selection_element->AppendChild(element);
		options.push_back(SelectOption(element, value, selectable));
		option_index = (int) options.size() - 1;
	}
	else
	{
		selection_element->InsertBefore(element, selection_element->GetChild(before));
		options.insert(options.begin() + before, SelectOption(element, value, selectable));
		option_index = before;
	}

	element->RemoveReference();

	// Select the option if appropriate.
	if (select)
		SetSelection(option_index);

	box_layout_dirty = true;
	return option_index;
}
开发者ID:MatiasNAmendola,项目名称:libRocket,代码行数:36,代码来源:WidgetDropDown.cpp

示例2: DoAppendText

void LoadingScreen::DoAppendText(const std::string& str)
{
  Wait();
  {
    Core::Element* input = root->GetElementById("content");
    Core::String   content;

    input->GetInnerRML(content);
    content = Core::String(content + "<br />" + str.c_str());
    input->SetInnerRML(content);
  }
  Post();
  Refresh();
}
开发者ID:655473,项目名称:fallout-equestria,代码行数:14,代码来源:loading_screen.cpp

示例3: RecursiveTranslate

void UiBase::RecursiveTranslate(Core::Element* root)
{
  unsigned short it;
  Core::Element* child;

  if (!root)
    return ;
  for (it = 0 ; (child = root->GetChild(it)) ; ++it)
  {
    Core::Variant* attr = child->GetAttribute("i18n");

    if (attr)
    {
      string key = attr->Get<Core::String>().CString();

      child->SetInnerRML(i18n::T(key).c_str());
    }
    else
      RecursiveTranslate(child);
  }
}
开发者ID:655473,项目名称:fallout-equestria,代码行数:21,代码来源:ui_base.cpp


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