本文整理汇总了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;
}
示例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();
}
示例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);
}
}