本文整理汇总了C++中DomElement::setEventSignal方法的典型用法代码示例。如果您正苦于以下问题:C++ DomElement::setEventSignal方法的具体用法?C++ DomElement::setEventSignal怎么用?C++ DomElement::setEventSignal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DomElement
的用法示例。
在下文中一共展示了DomElement::setEventSignal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateSignalConnection
void WWebWidget::updateSignalConnection(DomElement& element,
const char *signal,
const std::string eventName,
const char *condition,
bool all, const char *argName)
{
WSignalInstance_ *s = getSignal(signal);
if (all
|| s->connectivityChanged()
|| s->staticCodeChanged()) {
if (isConnected(s))
element.setEventSignal(eventName, *s, argName, condition);
else
element.removeEventSignal(eventName);
s->connectivityOk();
}
}
示例2: updateDom
//.........这里部分代码省略.........
js <<
"}else{"
"""if (" WT_CLASS ".isIElt9 && document.createEventObject) "
"" "e = document.createEventObject(e);"
"""o.wtE1 = e;"
"""o.wtClickTimeout = setTimeout(function() {"
"" "o.wtClickTimeout = null; o.wtE1 = null;";
if (mouseClick) {
js << mouseClick->javaScript();
if (mouseClick->isExposedSignal()) {
js << app->javaScriptClass()
<< "._p_.update(o,'" << mouseClick->encodeCmd()
<< "',e,true);";
}
mouseClick->updateOk();
}
const Configuration& conf = app->environment().server()->configuration();
js << "}," << conf.doubleClickTimeout() << ");}";
} else {
if (mouseClick && mouseClick->needsUpdate(all)) {
js << mouseClick->javaScript();
if (mouseClick->isExposedSignal()) {
js << app->javaScriptClass()
<< "._p_.update(o,'" << mouseClick->encodeCmd()
<< "',e,true);";
}
mouseClick->updateOk();
}
}
element.setEvent(CLICK_SIGNAL, js.str(),
mouseClick ? mouseClick->encodeCmd() : "");
if (mouseDblClick) {
if (app->environment().agentIsIElt(9))
element.setEvent("dblclick", "this.onclick()");
}
}
/*
* -- mouseOver with delay
*/
EventSignal<WMouseEvent> *mouseOver
= mouseEventSignal(MOUSE_OVER_SIGNAL, false);
EventSignal<WMouseEvent> *mouseOut
= mouseEventSignal(MOUSE_OUT_SIGNAL, false);
bool updateMouseOver = mouseOver && mouseOver->needsUpdate(all);
if (mouseOverDelay_) {
if (updateMouseOver) {
WStringStream js;
js << "o.over=setTimeout(function() {"
<< "o.over = null;"
<< mouseOver->javaScript();
if (mouseOver->isExposedSignal()) {
js << app->javaScriptClass()
<< "._p_.update(o,'" << mouseOver->encodeCmd() << "',e,true);";
}
js << "}," << mouseOverDelay_ << ");";
element.setEvent("mouseover", js.str(), "");
mouseOver->updateOk();
if (!mouseOut)
mouseOut = mouseEventSignal(MOUSE_OUT_SIGNAL, true);
element.setEvent("mouseout",
"clearTimeout(o.over); o.over=null;"
+ mouseOut->javaScript(),
mouseOut->encodeCmd(), mouseOut->isExposedSignal());
mouseOut->updateOk();
}
} else {
if (updateMouseOver) {
element.setEventSignal("mouseover", *mouseOver);
mouseOver->updateOk();
}
bool updateMouseOut = mouseOut && mouseOut->needsUpdate(all);
if (updateMouseOut) {
element.setEventSignal("mouseout", *mouseOut);
mouseOut->updateOk();
}
}
updateEventSignals(element, all);
WWebWidget::updateDom(element, all);
}