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


C++ PointerEvent类代码示例

本文整理汇总了C++中PointerEvent的典型用法代码示例。如果您正苦于以下问题:C++ PointerEvent类的具体用法?C++ PointerEvent怎么用?C++ PointerEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1:

	std::shared_ptr<View> WindowView_Impl::get_capture_view(PointerEvent &e, std::shared_ptr<View> &view_above_cursor)
	{
		if (e.type() == PointerEventType::press || e.type() == PointerEventType::double_click)
		{
			capture_down_counter++;
			if (capture_down_counter == 1)
			{
				captured_view = view_above_cursor;
				if (captured_view)
					window.capture_mouse(true);
			}
		}

		std::shared_ptr<View> view = captured_view;

		if (e.type() == PointerEventType::release)
		{
			if (capture_down_counter > 0)
			{
				capture_down_counter--;
				if (capture_down_counter == 0)
				{
					if (captured_view)
						release_capture();
				}
			}
		}
		return view;
	}
开发者ID:ARMCoderCHS,项目名称:ClanLib,代码行数:29,代码来源:window_view_impl.cpp

示例2: createAndCheckTouchCancel

PointerEvent* PointerEventFactoryTest::createAndCheckTouchCancel(
    WebPointerProperties::PointerType pointerType, int rawId,
    int uniqueId, bool isPrimary)
{
    PointerEvent* pointerEvent = m_pointerEventFactory.createPointerCancelEvent(
        uniqueId, pointerType);
    EXPECT_EQ(uniqueId, pointerEvent->pointerId());
    EXPECT_EQ(isPrimary, pointerEvent->isPrimary());
    return pointerEvent;
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例3: createAndCheckMouseEvent

PointerEvent* PointerEventFactoryTest::createAndCheckMouseEvent(
    WebPointerProperties::PointerType pointerType,
    int rawId, int uniqueId, bool isPrimary,
    PlatformEvent::Modifiers modifiers)
{
    PointerEvent* pointerEvent = m_pointerEventFactory.create(
        EventTypeNames::mousedown, PlatformMouseEventBuilder(pointerType, rawId, modifiers), nullptr, nullptr);
    EXPECT_EQ(uniqueId, pointerEvent->pointerId());
    EXPECT_EQ(isPrimary, pointerEvent->isPrimary());
    return pointerEvent;
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例4: createPointerTransitionEvent

void PointerEventFactoryTest::createAndCheckPointerTransitionEvent(
    PointerEvent* pointerEvent,
    const AtomicString& type)
{
    PointerEvent* clonePointerEvent = m_pointerEventFactory.
        createPointerTransitionEvent(pointerEvent, type, nullptr);
    EXPECT_EQ(clonePointerEvent->pointerType(), pointerEvent->pointerType());
    EXPECT_EQ(clonePointerEvent->pointerId(), pointerEvent->pointerId());
    EXPECT_EQ(clonePointerEvent->isPrimary(), pointerEvent->isPrimary());
    EXPECT_EQ(clonePointerEvent->type(), type);
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例5: FloatSize

PointerEvent* PointerEventFactoryTest::createAndCheckTouchEvent(
    WebPointerProperties::PointerType pointerType,
    int rawId, int uniqueId, bool isPrimary,
    PlatformTouchPoint::TouchState state)
{
    PointerEvent* pointerEvent = m_pointerEventFactory.create(
        EventTypeNames::pointerdown, PointerEventFactoryTest::PlatformTouchPointBuilder(pointerType, rawId, state), PlatformEvent::NoModifiers, FloatSize(), FloatPoint());
    EXPECT_EQ(uniqueId, pointerEvent->pointerId());
    EXPECT_EQ(isPrimary, pointerEvent->isPrimary());
    return pointerEvent;
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例6: get_capture_view

	void WindowView_Impl::window_pointer_event(PointerEvent &e)
	{
		std::shared_ptr<View> view_above_cursor = window_view->find_view_at(e.pos(window_view));
		auto view = get_capture_view(e, view_above_cursor);
		if (!view)
			view = view_above_cursor;

		dispatch_hot_event(view, e);

		if (e.type() == PointerEventType::enter || e.type() == PointerEventType::leave)		// Ignore window enter/leave events
			return;

		if (view)
			view->dispatch_event(&e);
		else
			window_view->dispatch_event(&e);
	}
开发者ID:ARMCoderCHS,项目名称:ClanLib,代码行数:17,代码来源:window_view_impl.cpp

示例7: onPointerPressed

	void ScriptEditorInput::onPointerPressed(const PointerEvent& ev)
	{
		MonoObject* screenPos = ScriptVector2I::box(ev.screenPos);
		MonoObject* delta = ScriptVector2I::box(ev.delta);

		MonoUtil::invokeThunk(OnPointerPressedThunk, screenPos, delta,
			ev.button, ev.shift, ev.control, ev.alt, ev.mouseWheelScrollAmount, ev.isUsed());
	}
开发者ID:MarcoROG,项目名称:BansheeEngine,代码行数:8,代码来源:BsScriptEditorInput.cpp

示例8: on_pointer_release

	void ListBoxViewImpl::on_pointer_release(PointerEvent &e)
	{
		if (e.phase() != EventUIPhase::bubbling || e.button() != PointerButton::left)
			return;

		int index = get_selection_index(e);

		// Only allow click when mouse released over component
		if (index == selected_item)
		{
			if (func_selection_changed)
				func_selection_changed();
		}
		else
		{
			listbox->set_selected_item(last_selected_item);
		}
	}
开发者ID:TeoTwawki,项目名称:ClanLib,代码行数:18,代码来源:listbox_view_impl.cpp

示例9: on_pointer_press

	void ListBoxViewImpl::on_pointer_press(PointerEvent &e)
	{
		if (e.button() != PointerButton::left)
			return;

		last_selected_item = selected_item;

		int index = get_selection_index(e);
		listbox->set_selected_item(index);
	}
开发者ID:TeoTwawki,项目名称:ClanLib,代码行数:10,代码来源:listbox_view_impl.cpp

示例10: on_pointer_thumb_press

	void SliderViewImpl::on_pointer_thumb_press(PointerEvent &e)
	{
		if (_state_disabled)
			return;

		_state_pressed = true;
		update_state();
		mouse_down_mode = mouse_down_thumb_drag;
		thumb_move_start_position = _position;
		mouse_drag_start_pos = e.pos(track.get());
	}
开发者ID:ARMCoderCHS,项目名称:ClanLib,代码行数:11,代码来源:slider_view_impl.cpp

示例11: onPointerDoubleClick

	void ScriptInput::onPointerDoubleClick(const PointerEvent& ev)
	{
		if (PlayInEditorManager::instance().getState() != PlayInEditorState::Playing)
			return;

		MonoObject* screenPos = ScriptVector2I::box(ev.screenPos);
		MonoObject* delta = ScriptVector2I::box(ev.delta);

		MonoUtil::invokeThunk(OnPointerDoubleClickThunk, screenPos, delta, 
			ev.button, ev.shift, ev.control, ev.alt, ev.mouseWheelScrollAmount, ev.isUsed());
	}
开发者ID:MXSteel,项目名称:BansheeEngine,代码行数:11,代码来源:BsScriptInput.cpp

示例12: get_selection_index

	int ListBoxViewImpl::get_selection_index(PointerEvent &e)
	{
		int index = 0;
		for (auto &view : listbox->content_view()->children())
		{
			if (view->geometry().border_box().contains(e.pos(listbox->content_view())))
				return index;
			index++;
		}
		return -1;
	}
开发者ID:TeoTwawki,项目名称:ClanLib,代码行数:11,代码来源:listbox_view_impl.cpp

示例13: on_pointer_release

	void ButtonViewImpl::on_pointer_release(PointerEvent &e)
	{
		_state_pressed = false;
		if (_state_disabled)
			return;
		update_state();
		if (_func_clicked)
		{
			if (button->geometry().border_box().contains(e.local_pos()))	// Only allow click when mouse released over component
				_func_clicked();
		}
	}
开发者ID:cosim,项目名称:ClanLib,代码行数:12,代码来源:button_view_impl.cpp

示例14: on_pointer_release

	void CheckBoxView_Impl::on_pointer_release(PointerEvent &e)
	{
		_state_pressed = false;
		if (_state_disabled)
			return;
		if (checkbox->geometry().border_box().contains(e.local_pos()))	// Only allow click when mouse released over component
		{
			_checked_state = !_checked_state;
			if (_func_state_changed)
				_func_state_changed();
		}
		update_state();
	}
开发者ID:cosim,项目名称:ClanLib,代码行数:13,代码来源:checkbox_view_impl.cpp

示例15: e_exit

	void WindowView_Impl::dispatch_hot_event(std::shared_ptr<View> &view, PointerEvent &e)
	{
		if (view != hot_view)
		{
			if (hot_view)
			{
				PointerEvent e_exit(PointerEventType::leave, PointerButton::none, e.pos(window_view->root_view()), e.alt_down(), e.shift_down(), e.ctrl_down(), e.cmd_down());
				hot_view->dispatch_event(&e_exit, true);
			}

			hot_view = view;

			if (hot_view)
			{
				PointerEvent e_enter(PointerEventType::enter, PointerButton::none, e.pos(window_view->root_view()), e.alt_down(), e.shift_down(), e.ctrl_down(), e.cmd_down());
				hot_view->dispatch_event(&e_enter, true);
			}
		}

		if (hot_view)
			hot_view->update_cursor(window);

	}
开发者ID:ARMCoderCHS,项目名称:ClanLib,代码行数:23,代码来源:window_view_impl.cpp


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