本文整理汇总了C++中FReply::IsEventHandled方法的典型用法代码示例。如果您正苦于以下问题:C++ FReply::IsEventHandled方法的具体用法?C++ FReply::IsEventHandled怎么用?C++ FReply::IsEventHandled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FReply
的用法示例。
在下文中一共展示了FReply::IsEventHandled方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnKeyUp
FReply SButton::OnKeyUp(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent)
{
FReply Reply = FReply::Unhandled();
if (IsEnabled() && (/* InKeyEvent.GetKey() == EKeys::Enter || InKeyEvent.GetKey() == EKeys::SpaceBar || */ InKeyEvent.GetKey() == EKeys::Gamepad_FaceButton_Bottom))
{
const bool bWasPressed = bIsPressed;
Release();
//@Todo Slate: This should check focus, however we don't have that API yet, will be easier when focus is unified.
if ( PressMethod == EButtonPressMethod::ButtonRelease || ( PressMethod == EButtonPressMethod::DownAndUp && bWasPressed ) )
{
//execute our "OnClicked" delegate, and get the reply
Reply = OnClicked.IsBound() ? OnClicked.Execute() : FReply::Handled();
//You should ALWAYS handle the OnClicked event.
ensure(Reply.IsEventHandled() == true);
}
else
{
Reply = FReply::Handled();
}
}
//return the constructed reply
return Reply;
}
示例2: OnMouseButtonDown
FReply SButton::OnMouseButtonDown( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent )
{
FReply Reply = FReply::Unhandled();
if (IsEnabled() && (MouseEvent.GetEffectingButton() == EKeys::LeftMouseButton || MouseEvent.IsTouchEvent()))
{
Press();
if( ClickMethod == EButtonClickMethod::MouseDown )
{
//get the reply from the execute function
Reply = OnClicked.IsBound() ? OnClicked.Execute() : FReply::Handled();
//You should ALWAYS handle the OnClicked event.
ensure(Reply.IsEventHandled() == true);
}
else if ( IsPreciseTapOrClick(MouseEvent) )
{
// do not capture the pointer for precise taps or clicks
//
}
else
{
//we need to capture the mouse for MouseUp events
Reply = FReply::Handled().CaptureMouse( AsShared() );
}
}
Invalidate(EInvalidateWidget::Layout);
//return the constructed reply
return Reply;
}
示例3: PyErr_Format
static PyObject *py_ue_swidget_on_mouse_button_up(ue_PySWidget *self, PyObject * args)
{
PyObject *py_geometry;
PyObject *py_pointer_event;
if (!PyArg_ParseTuple(args, "OO:on_mouse_button_up", &py_geometry, &py_pointer_event))
{
return nullptr;
}
ue_PyFGeometry *geometry = py_ue_is_fgeometry(py_geometry);
if (!geometry)
{
return PyErr_Format(PyExc_Exception, "argument is not a FGeomtry");
}
ue_PyFPointerEvent *pointer = py_ue_is_fpointer_event(py_pointer_event);
if (!pointer)
{
return PyErr_Format(PyExc_Exception, "argument is not a FPointerEvent");
}
FReply reply = self->Widget->OnMouseButtonUp(geometry->geometry, pointer->pointer);
if (reply.IsEventHandled())
{
Py_RETURN_TRUE;
}
Py_RETURN_FALSE;
}
示例4: OnKeyDown
FReply SButton::OnKeyDown( const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent )
{
FReply Reply = FReply::Unhandled();
if (IsEnabled() && (InKeyEvent.GetKey() == EKeys::Enter || InKeyEvent.GetKey() == EKeys::SpaceBar || InKeyEvent.GetKey() == EKeys::Gamepad_FaceButton_Bottom))
{
Press();
if (PressMethod == EButtonPressMethod::ButtonPress)
{
//execute our "OnClicked" delegate, and get the reply
Reply = OnClicked.IsBound() ? OnClicked.Execute() : FReply::Handled();
//You should ALWAYS handle the OnClicked event.
ensure(Reply.IsEventHandled() == true);
}
else
{
Reply = FReply::Handled();
}
}
else
{
Reply = SBorder::OnKeyDown(MyGeometry, InKeyEvent);
}
//return the constructed reply
return Reply;
}
示例5: OnMouseButtonUp
FReply SButton::OnMouseButtonUp( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent )
{
FReply Reply = FReply::Unhandled();
const bool bMustBePressed = ClickMethod == EButtonClickMethod::DownAndUp;
const bool bMeetsPressedRequirements = (!bMustBePressed || (bIsPressed && bMustBePressed));
if (bMeetsPressedRequirements && IsEnabled() && ( MouseEvent.GetEffectingButton() == EKeys::LeftMouseButton || MouseEvent.IsTouchEvent() ) )
{
Release();
if( ClickMethod == EButtonClickMethod::MouseDown )
{
// NOTE: If we're configured to click on mouse-down/precise-tap, then we never capture the mouse thus
// may never receive an OnMouseButtonUp() call. We make sure that our bIsPressed
// state is reset by overriding OnMouseLeave().
}
else
{
bool bEventOverButton = IsHovered();
if (!bEventOverButton && MouseEvent.IsTouchEvent())
{
bEventOverButton = MyGeometry.IsUnderLocation(MouseEvent.GetScreenSpacePosition());
}
if (bEventOverButton)
{
// If we asked for a precise tap, all we need is for the user to have not moved their pointer very far.
const bool bTriggerForTouchEvent = IsPreciseTapOrClick(MouseEvent);
// If we were asked to allow the button to be clicked on mouse up, regardless of whether the user
// pressed the button down first, then we'll allow the click to proceed without an active capture
const bool bTriggerForMouseEvent = ( ClickMethod == EButtonClickMethod::MouseUp || HasMouseCapture() );
if( (bTriggerForTouchEvent || bTriggerForMouseEvent) && OnClicked.IsBound() == true )
{
Reply = OnClicked.Execute();
}
}
}
//If the user of the button didn't handle this click, then the button's
//default behavior handles it.
if ( Reply.IsEventHandled() == false )
{
Reply = FReply::Handled();
}
//If the user hasn't requested a new mouse captor and the button still has mouse capture,
//then the default behavior of the button is to release mouse capture.
if (Reply.GetMouseCaptor().IsValid() == false && HasMouseCapture())
{
Reply.ReleaseMouseCapture();
}
}
Invalidate(EInvalidateWidget::Layout);
return Reply;
}
示例6: OnMouseButtonDown
virtual FReply OnMouseButtonDown(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override
{
FReply Reply = SSpinBox<T>::OnMouseButtonDown(MyGeometry, MouseEvent);
if (Reply.IsEventHandled())
{
Reply.PreventThrottling();
}
return Reply;
}
示例7: OnMouseButtonUp
FReply SSequencerTrackArea::OnMouseButtonUp( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent )
{
auto SequencerPin = SequencerWidget.Pin();
if (SequencerPin.IsValid())
{
FReply Reply = SequencerPin->GetEditTool().OnMouseButtonUp(*this, MyGeometry, MouseEvent);
if (Reply.IsEventHandled())
{
return Reply;
}
}
return TimeSliderController->OnMouseButtonUp( SharedThis(this), MyGeometry, MouseEvent );
}
示例8: OnMouseWheel
FReply SSequencerTrackArea::OnMouseWheel( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent )
{
// First try the edit tool
auto SequencerPin = SequencerWidget.Pin();
if (SequencerPin.IsValid())
{
FReply Reply = SequencerPin->GetEditTool().OnMouseWheel(*this, MyGeometry, MouseEvent);
if (Reply.IsEventHandled())
{
return Reply;
}
}
// Then the time slider
FReply Reply = TimeSliderController->OnMouseWheel( SharedThis(this), MyGeometry, MouseEvent );
if (Reply.IsEventHandled())
{
return Reply;
}
// Failing that, we'll just scroll vertically
TreeView.Pin()->ScrollByDelta(WheelScrollAmount * -MouseEvent.GetWheelDelta());
return FReply::Handled();
}
示例9: OnAnalogValueChanged
FReply SObjectWidget::OnAnalogValueChanged(const FGeometry& MyGeometry, const FAnalogInputEvent& InAnalogInputEvent)
{
if ( CanRouteEvent() )
{
FReply Result = WidgetObject->NativeOnAnalogValueChanged(MyGeometry, InAnalogInputEvent);
if ( !Result.IsEventHandled() )
{
return SCompoundWidget::OnAnalogValueChanged(MyGeometry, InAnalogInputEvent);
}
return Result;
}
return FReply::Unhandled();
}
示例10: OnKeyUp
FReply SObjectWidget::OnKeyUp(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent)
{
if ( CanRouteEvent() )
{
FReply Result = WidgetObject->NativeOnKeyUp(MyGeometry, InKeyEvent);
if ( !Result.IsEventHandled() )
{
return SCompoundWidget::OnKeyUp(MyGeometry, InKeyEvent);
}
return Result;
}
return FReply::Unhandled();
}
示例11: DroppedOnPanel
//------------------------------------------------------------------------------
FReply FKismetDragDropAction::DroppedOnPanel( const TSharedRef< SWidget >& Panel, FVector2D ScreenPosition, FVector2D GraphPosition, UEdGraph& Graph)
{
FReply Reply = FReply::Unhandled();
FText CannotDropReason = FText::GetEmpty();
if (!CanBeDroppedDelegate.IsBound() || CanBeDroppedDelegate.Execute(ActionNode, GetHoveredGraph(), CannotDropReason))
{
Reply = FGraphSchemaActionDragDropAction::DroppedOnPanel(Panel, ScreenPosition, GraphPosition, Graph);
}
if (Reply.IsEventHandled())
{
AnalyticCallback.ExecuteIfBound();
}
return Reply;
}
示例12: OnMouseMove
FReply SSequencerTrackArea::OnMouseMove( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent )
{
auto SequencerPin = SequencerWidget.Pin();
if (SequencerPin.IsValid())
{
FReply Reply = SequencerPin->GetEditTool().OnMouseMove(*this, MyGeometry, MouseEvent);
if (Reply.IsEventHandled())
{
return Reply;
}
}
if (MouseEvent.IsMouseButtonDown(EKeys::RightMouseButton) && HasMouseCapture())
{
TreeView.Pin()->ScrollByDelta( -MouseEvent.GetCursorDelta().Y );
}
return TimeSliderController->OnMouseMove( SharedThis(this), MyGeometry, MouseEvent );
}
示例13: OnMouseButtonDoubleClick
FReply SSection::OnMouseButtonDoubleClick( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent )
{
ResetState();
UMovieSceneSection* SectionObject = SectionInterface->GetSectionObject();
if( GetSequencer().IsSectionVisible( SectionObject ) )
{
FReply Reply = SectionInterface->OnSectionDoubleClicked( MyGeometry, MouseEvent );
if (Reply.IsEventHandled()) {return Reply;}
if( MouseEvent.GetEffectingButton() == EKeys::LeftMouseButton )
{
GetSequencer().ZoomToSelectedSections();
return FReply::Handled();
}
}
return FReply::Unhandled();
}