本文整理汇总了C++中FReply类的典型用法代码示例。如果您正苦于以下问题:C++ FReply类的具体用法?C++ FReply怎么用?C++ FReply使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FReply类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnRightMouseButtonUp
FReply STableViewBase::OnMouseButtonUp( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent )
{
if ( MouseEvent.GetEffectingButton() == EKeys::RightMouseButton )
{
OnRightMouseButtonUp( MouseEvent );
FReply Reply = FReply::Handled().ReleaseMouseCapture();
bShowSoftwareCursor = false;
// If we have mouse capture, snap the mouse back to the closest location that is within the list's bounds
if ( HasMouseCapture() )
{
FSlateRect ListScreenSpaceRect = MyGeometry.GetClippingRect();
FVector2D CursorPosition = MyGeometry.LocalToAbsolute( SoftwareCursorPosition );
FIntPoint BestPositionInList(
FMath::RoundToInt( FMath::Clamp( CursorPosition.X, ListScreenSpaceRect.Left, ListScreenSpaceRect.Right ) ),
FMath::RoundToInt( FMath::Clamp( CursorPosition.Y, ListScreenSpaceRect.Top, ListScreenSpaceRect.Bottom ) )
);
Reply.SetMousePos(BestPositionInList);
}
return Reply;
}
return FReply::Unhandled();
}
示例2: Press
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;
}
示例3: BestPositionInPanel
FReply FScrollyZoomy::OnMouseButtonUp( const TSharedRef<SWidget> MyWidget, const FGeometry& MyGeometry, const FPointerEvent& MouseEvent )
{
if (MouseEvent.GetEffectingButton() == EKeys::RightMouseButton)
{
AmountScrolledWhileRightMouseDown = 0;
FReply Reply = FReply::Handled().ReleaseMouseCapture();
bShowSoftwareCursor = false;
// If we have mouse capture, snap the mouse back to the closest location that is within the panel's bounds
if (MyWidget->HasMouseCapture())
{
FSlateRect PanelScreenSpaceRect = MyGeometry.GetClippingRect();
FVector2D CursorPosition = MyGeometry.LocalToAbsolute( SoftwareCursorPosition );
FIntPoint BestPositionInPanel(
FMath::RoundToInt( FMath::Clamp( CursorPosition.X, PanelScreenSpaceRect.Left, PanelScreenSpaceRect.Right ) ),
FMath::RoundToInt( FMath::Clamp( CursorPosition.Y, PanelScreenSpaceRect.Top, PanelScreenSpaceRect.Bottom ) )
);
Reply.SetMousePos( BestPositionInPanel );
}
if (!bUseIntertialScrolling)
{
HorizontalIntertia.ClearScrollVelocity();
VerticalIntertia.ClearScrollVelocity();
}
return Reply;
}
return FReply::Unhandled();
}
示例4: Release
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;
}
示例5: if
FReply FSequencerEditTool_Movement::OnMouseMove(SWidget& OwnerWidget, const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
if (DelayedDrag.IsSet())
{
const FVirtualTrackArea VirtualTrackArea = SequencerWidget.Pin()->GetVirtualTrackArea();
FReply Reply = FReply::Handled();
if (DelayedDrag->IsDragging())
{
// If we're already dragging, just update the drag op if it exists
if (DragOperation.IsValid())
{
DragOperation->OnDrag(MouseEvent, MyGeometry.AbsoluteToLocal(MouseEvent.GetScreenSpacePosition()), VirtualTrackArea);
}
}
// Otherwise we can attempt a new drag
else if (DelayedDrag->AttemptDragStart(MouseEvent))
{
DragOperation = CreateDrag();
if (DragOperation.IsValid())
{
DragOperation->OnBeginDrag(MouseEvent, DelayedDrag->GetInitialPosition(), VirtualTrackArea);
// Steal the capture, as we're now the authoritative widget in charge of a mouse-drag operation
Reply.CaptureMouse(OwnerWidget.AsShared());
}
}
return Reply;
}
return FReply::Unhandled();
}
示例6: SharedThis
FReply SPaperEditorViewport::OnMouseButtonDown(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
TotalMouseDelta = 0;
if (MouseEvent.GetEffectingButton() == EKeys::RightMouseButton)
{
// RIGHT BUTTON is for dragging and Context Menu.
FReply ReplyState = FReply::Handled();
ReplyState.CaptureMouse( SharedThis(this) );
ReplyState.UseHighPrecisionMouseMovement( SharedThis(this) );
SoftwareCursorPosition = PanelCoordToGraphCoord( MyGeometry.AbsoluteToLocal( MouseEvent.GetScreenSpacePosition() ) );
// clear any interpolation when you manually pan
//DeferredMovementTargetObject = nullptr;
return ReplyState;
}
else if (MouseEvent.GetEffectingButton() == EKeys::LeftMouseButton)
{
// START MARQUEE SELECTION.
const FVector2D GraphMousePos = PanelCoordToGraphCoord( MyGeometry.AbsoluteToLocal( MouseEvent.GetScreenSpacePosition() ) );
Marquee.Start( GraphMousePos, FMarqueeOperation::OperationTypeFromMouseEvent(MouseEvent) );
// Trigger a selection update now so that single-clicks without a drag still select something
OnSelectionChanged.ExecuteIfBound(Marquee, true);
PaperViewportClient->Invalidate();
return FReply::Handled().CaptureMouse( SharedThis(this) );
}
else
{
return FReply::Unhandled();
}
}
示例7: py_ue_is_fgeometry
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;
}
示例8: 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;
}
示例9: if
FReply FTextEditHelper::OnMouseButtonUp( const FGeometry& MyGeometry, const FPointerEvent& InMouseEvent, const TSharedRef< ITextEditorWidget >& TextEditor )
{
FReply Reply = FReply::Unhandled();
// The mouse must have been captured by either left or right button down before we'll process mouse ups
if( TextEditor->GetWidget()->HasMouseCapture() )
{
if( InMouseEvent.GetEffectingButton() == EKeys::LeftMouseButton &&
TextEditor->IsDragSelecting() )
{
// No longer drag-selecting
TextEditor->EndDragSelection();
// If we received keyboard focus on this click, then we'll want to select all of the text
// when the user releases the mouse button, unless the user actually dragged the mouse
// while holding the button down, in which case they've already selected some text and
// we'll leave things alone!
if( TextEditor->WasFocusedByLastMouseDown() )
{
if( !TextEditor->HasDragSelectedSinceFocused() )
{
if( TextEditor->SelectAllTextWhenFocused() )
{
// Move the cursor to the end of the string
TextEditor->JumpTo(ETextLocation::EndOfDocument, ECursorAction::MoveCursor);
// User wasn't dragging the mouse, so go ahead and select all of the text now
// that we've become focused
TextEditor->SelectAllText();
// @todo Slate: In this state, the caret should actually stay hidden (until the user interacts again), and we should not move the caret
}
}
TextEditor->SetWasFocusedByLastMouseDown( false );
}
// Release mouse capture
Reply = FReply::Handled();
Reply.ReleaseMouseCapture();
}
else if( InMouseEvent.GetEffectingButton() == EKeys::RightMouseButton )
{
if ( MyGeometry.IsUnderLocation( InMouseEvent.GetScreenSpacePosition() ) )
{
// Right clicked, so summon a context menu if the cursor is within the widget
TextEditor->SummonContextMenu( InMouseEvent.GetScreenSpacePosition() );
}
// Release mouse capture
Reply = FReply::Handled();
Reply.ReleaseMouseCapture();
}
}
return Reply;
}
示例10: OnMouseButtonUp
FReply FWebBrowserViewport::OnMouseButtonUp(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
// Release mouse capture when left button released
FReply Reply = WebBrowserWindow->OnMouseButtonUp(MyGeometry, MouseEvent);
if (MouseEvent.GetEffectingButton() == EKeys::LeftMouseButton)
{
return Reply.ReleaseMouseCapture();
}
return Reply;
}
示例11: OnMouseButtonDown
FReply FWebBrowserViewport::OnMouseButtonDown(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
// Capture mouse on left button down so that you can drag out of the viewport
FReply Reply = WebBrowserWindow->OnMouseButtonDown(MyGeometry, MouseEvent);
if (MouseEvent.GetEffectingButton() == EKeys::LeftMouseButton && ViewportWidget.IsValid())
{
return Reply.CaptureMouse(ViewportWidget.Pin().ToSharedRef());
}
return Reply;
}
示例12: OnFocusReceived
FReply SDetailsViewBase::OnFocusReceived(const FGeometry& MyGeometry, const FFocusEvent& InFocusEvent)
{
FReply Reply = FReply::Handled();
if (InFocusEvent.GetCause() != EFocusCause::Cleared)
{
Reply.SetUserFocus(SearchBox.ToSharedRef(), InFocusEvent.GetCause());
}
return Reply;
}
示例13: 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 );
}
示例14: 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();
}
示例15: 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();
}