本文整理汇总了C++中WheelEvent类的典型用法代码示例。如果您正苦于以下问题:C++ WheelEvent类的具体用法?C++ WheelEvent怎么用?C++ WheelEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WheelEvent类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: if
void MediaControlsAppleEventListener::handleEvent(ScriptExecutionContext*, Event* event)
{
if (event->type() == eventNames().clickEvent)
m_mediaControls->handleClickEvent(event);
else if ((event->type() == eventNames().wheelEvent || event->type() == eventNames().mousewheelEvent) && event->eventInterface() == WheelEventInterfaceType) {
WheelEvent* wheelEvent = static_cast<WheelEvent*>(event);
if (m_mediaControls->shouldClosedCaptionsContainerPreventPageScrolling(wheelEvent->wheelDeltaY()))
event->preventDefault();
}
}
开发者ID:kodybrown,项目名称:webkit,代码行数:10,代码来源:MediaControlsApple.cpp
示例2: updateWebMouseEventFromCoreMouseEvent
WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const Widget* widget, const LayoutObject* layoutObject, const WheelEvent& event)
{
if (event.type() != EventTypeNames::wheel && event.type() != EventTypeNames::mousewheel)
return;
type = WebInputEvent::MouseWheel;
updateWebMouseEventFromCoreMouseEvent(event, widget, *layoutObject, *this);
deltaX = -event.deltaX();
deltaY = -event.deltaY();
wheelTicksX = event.ticksX();
wheelTicksY = event.ticksY();
scrollByPage = event.deltaMode() == WheelEvent::DOM_DELTA_PAGE;
canScroll = event.canScroll();
resendingPluginId = event.resendingPluginId();
railsMode = static_cast<RailsMode>(event.railsMode());
}
开发者ID:howardroark2018,项目名称:chromium,代码行数:15,代码来源:WebInputEventConversion.cpp
示例3: updateWebMouseEventFromWebCoreMouseEvent
WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const Widget* widget, const WebCore::RenderObject* renderObject, const WheelEvent& event)
{
if (event.type() != EventTypeNames::wheel && event.type() != EventTypeNames::mousewheel)
return;
type = WebInputEvent::MouseWheel;
updateWebMouseEventFromWebCoreMouseEvent(event, *widget, *renderObject, *this);
deltaX = -event.deltaX();
deltaY = -event.deltaY();
wheelTicksX = event.ticksX();
wheelTicksY = event.ticksY();
scrollByPage = event.deltaMode() == WheelEvent::DOM_DELTA_PAGE;
}
开发者ID:,项目名称:,代码行数:12,代码来源:
示例4: updateWebMouseEventFromWebCoreMouseEvent
WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const Widget* widget, const WebCore::RenderObject* renderObject, const WheelEvent& event)
{
if (event.type() != eventNames().mousewheelEvent)
return;
type = WebInputEvent::MouseWheel;
updateWebMouseEventFromWebCoreMouseEvent(event, *widget, *renderObject, *this);
deltaX = static_cast<float>(event.rawDeltaX());
deltaY = static_cast<float>(event.rawDeltaY());
// The 120 is from WheelEvent::initWheelEvent().
wheelTicksX = static_cast<float>(event.wheelDeltaX()) / 120;
wheelTicksY = static_cast<float>(event.wheelDeltaY()) / 120;
scrollByPage = event.deltaMode() == WheelEvent::DOM_DELTA_PAGE;
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:13,代码来源:WebInputEventConversion.cpp
示例5: getTargetByPos
void MouseController::handleWheel(WheelEvent & e)
{//滚动是忽略capture
View * target = e.target();
if (target == root_)
target = getTargetByPos(e.getLoc(), true);
if (!target)
return;
WheelEvent we(e.type(), target, e.dx(), e.dy(),
target->mapToLocal(e.getLoc()), e.getLoc(),
e.getFlags());
EventDispatcher::Push(we);
//暂时先这么处理 因为滚动的时候可能离开控件所以 需要改变鼠标样式之类
MouseEvent me(kET_MOUSE_MOVE, kMB_NONE, root_, root_->mapToLocal(last_mouse_point_), last_mouse_point_, 0);
handleEvent(me);
//if (!capture_)
//{//如果没有capture 可能滚动到新的view里 需要shiftOver
// shiftIfNecessary();
//}
}
开发者ID:91yuan,项目名称:bones,代码行数:21,代码来源:mouse_controller.cpp
示例6: switch
JSValue* JSWheelEvent::getValueProperty(ExecState* exec, int token) const
{
switch (token) {
case ScreenXAttrNum: {
WheelEvent* imp = static_cast<WheelEvent*>(impl());
return jsNumber(exec, imp->screenX());
}
case ScreenYAttrNum: {
WheelEvent* imp = static_cast<WheelEvent*>(impl());
return jsNumber(exec, imp->screenY());
}
case ClientXAttrNum: {
WheelEvent* imp = static_cast<WheelEvent*>(impl());
return jsNumber(exec, imp->clientX());
}
case ClientYAttrNum: {
WheelEvent* imp = static_cast<WheelEvent*>(impl());
return jsNumber(exec, imp->clientY());
}
case CtrlKeyAttrNum: {
WheelEvent* imp = static_cast<WheelEvent*>(impl());
return jsBoolean(imp->ctrlKey());
}
case ShiftKeyAttrNum: {
WheelEvent* imp = static_cast<WheelEvent*>(impl());
return jsBoolean(imp->shiftKey());
}
case AltKeyAttrNum: {
WheelEvent* imp = static_cast<WheelEvent*>(impl());
return jsBoolean(imp->altKey());
}
case MetaKeyAttrNum: {
WheelEvent* imp = static_cast<WheelEvent*>(impl());
return jsBoolean(imp->metaKey());
}
case WheelDeltaAttrNum: {
WheelEvent* imp = static_cast<WheelEvent*>(impl());
return jsNumber(exec, imp->wheelDelta());
}
case WheelDeltaXAttrNum: {
WheelEvent* imp = static_cast<WheelEvent*>(impl());
return jsNumber(exec, imp->wheelDeltaX());
}
case WheelDeltaYAttrNum: {
WheelEvent* imp = static_cast<WheelEvent*>(impl());
return jsNumber(exec, imp->wheelDeltaY());
}
case OffsetXAttrNum: {
WheelEvent* imp = static_cast<WheelEvent*>(impl());
return jsNumber(exec, imp->offsetX());
}
case OffsetYAttrNum: {
WheelEvent* imp = static_cast<WheelEvent*>(impl());
return jsNumber(exec, imp->offsetY());
}
case XAttrNum: {
WheelEvent* imp = static_cast<WheelEvent*>(impl());
return jsNumber(exec, imp->x());
}
case YAttrNum: {
WheelEvent* imp = static_cast<WheelEvent*>(impl());
return jsNumber(exec, imp->y());
}
case ConstructorAttrNum:
return getConstructor(exec);
}
return 0;
}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:68,代码来源:JSWheelEvent.cpp
示例7: jsWheelEventY
JSValue jsWheelEventY(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
UNUSED_PARAM(exec);
WheelEvent* imp = static_cast<WheelEvent*>(static_cast<JSWheelEvent*>(asObject(slot.slotBase()))->impl());
return jsNumber(exec, imp->y());
}
开发者ID:,项目名称:,代码行数:6,代码来源:
示例8: getWebInputModifiers
WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const Widget* widget, const WheelEvent& event)
{
if (event.type() != eventNames().mousewheelEvent)
return;
type = WebInputEvent::MouseWheel;
timeStampSeconds = event.timeStamp() / millisPerSecond;
modifiers = getWebInputModifiers(event);
ScrollView* view = widget->parent();
IntPoint p = view->contentsToWindow(
IntPoint(event.absoluteLocation().x(), event.absoluteLocation().y()));
globalX = event.screenX();
globalY = event.screenY();
windowX = p.x();
windowY = p.y();
x = event.absoluteLocation().x() - widget->location().x();
y = event.absoluteLocation().y() - widget->location().y();
deltaX = static_cast<float>(event.rawDeltaX());
deltaY = static_cast<float>(event.rawDeltaY());
// The 120 is from WheelEvent::initWheelEvent().
wheelTicksX = static_cast<float>(event.wheelDeltaX()) / 120;
wheelTicksY = static_cast<float>(event.wheelDeltaY()) / 120;
scrollByPage = event.granularity() == WheelEvent::Page;
}
开发者ID:,项目名称:,代码行数:23,代码来源:
注:本文中的WheelEvent类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论