本文整理汇总了C++中PointerEvent::target方法的典型用法代码示例。如果您正苦于以下问题:C++ PointerEvent::target方法的具体用法?C++ PointerEvent::target怎么用?C++ PointerEvent::target使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointerEvent
的用法示例。
在下文中一共展示了PointerEvent::target方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_pointer_track_press
void SliderViewImpl::on_pointer_track_press(PointerEvent &e)
{
if (_state_disabled)
return;
if (e.target() == thumb) // Thumb control handled elsewhere
return;
float mouse_pos;
Rectf thumb_geometry(thumb->geometry().content_box());
float thumb_position;
if (slider->horizontal())
{
mouse_pos = e.pos(track.get()).x;
thumb_position = thumb_geometry.left + thumb_geometry.get_width() / 2.0f;
timer_target_position = _min_position + mouse_pos * ((_max_position - _min_position)) / (track->geometry().content_box().get_width());
}
else
{
mouse_pos = e.pos(track.get()).y;
thumb_position = thumb_geometry.top + thumb_geometry.get_height() / 2.0f;
timer_target_position = _min_position + mouse_pos * ((_max_position - _min_position)) / (track->geometry().content_box().get_height());
}
if (mouse_pos < thumb_position)
{
mouse_down_mode = mouse_down_track_decr;
timer_step_size = -_page_step;
}
else
{
mouse_down_mode = mouse_down_track_incr;
timer_step_size = _page_step;
}
scroll_timer_expired();
}