本文整理汇总了C++中core::Element::ProcessEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ Element::ProcessEvent方法的具体用法?C++ Element::ProcessEvent怎么用?C++ Element::ProcessEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core::Element
的用法示例。
在下文中一共展示了Element::ProcessEvent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessEvent
void ElementLabel::ProcessEvent(Core::Event& event)
{
// Detect click events
if (event.GetTargetElement() == this && (event == "click"))
{
if (this->HasAttribute("for"))
{
Core::Element* forElement = this->GetOwnerDocument()->GetElementById(this->GetAttribute<Core::String>("for", ""));
if (forElement != NULL)
{
forElement->ProcessEvent(event);
}
}
else
{
//Note that we have to loop since the ElementFormControlInput class does not pass its OnChildAdded to the superclass.
//We don't want to modify things too much, so we will just loop when clicked searching for the child input, not really
//a big deal.
int childCount = this->GetNumChildren();
Core::Element* child;
for (int i = 0; i < childCount; ++i)
{
child = this->GetChild(i);
if (child->GetTagName() == "input")
{
child->ProcessEvent(event);
i = childCount; //break loop
}
}
}
}
Element::ProcessEvent(event);
}