Beispiel #1
0
bool UKUISimpleClickWidget::OnMouseButtonUp( const FKUIInterfaceContainerMouseButtonEvent& stEventInfo )
{
	if ( stEventInfo.bHandled )
		return true;

	if ( !CanReceieveMouseEvents() )
		return Super::OnMouseButtonUp( stEventInfo );

	if ( stEventInfo.eButton != EMouseButtons::Left )
		return Super::OnMouseButtonUp( stEventInfo );

	if ( !bDown )
		return Super::OnMouseButtonUp( stEventInfo );

	bool bTriggerClick = ( IsVisibleRecursive() && !IsDisabledRecursive() );

	if ( bTriggerClick && bMouseOver )
	{
		FKUIInterfaceWidgetClickEvent stClickEventInfo( EKUIInterfaceWidgetEventList::E_Click, v2ClickOffset );
		SendEvent( stClickEventInfo );
	}

	bDown = false;
	FKUIInterfaceEvent stStateEventInfo( EKUIInterfaceWidgetEventList::E_StateChange );
	SendEvent( stStateEventInfo );

	if ( bTriggerClick )
		return bMouseOver;

	return Super::OnMouseButtonUp( stEventInfo );
}
Beispiel #2
0
bool UKUISimpleClickWidget::OnMouseButtonDown( const FKUIInterfaceContainerMouseButtonEvent& stEventInfo )
{
	if ( stEventInfo.bHandled )
		return true;

	if ( !CanReceieveMouseEvents() )
		return Super::OnMouseButtonDown( stEventInfo );

	if ( stEventInfo.eButton != EMouseButtons::Left )
		return Super::OnMouseButtonDown( stEventInfo );

	bDown = false;

	if ( !bMouseOver )
		return Super::OnMouseButtonDown( stEventInfo );

	if ( !IsVisibleRecursive() )
		return Super::OnMouseButtonDown( stEventInfo );

	if ( IsDisabledRecursive() )
		return Super::OnMouseButtonDown( stEventInfo );

	bDown = true;
	v2ClickOffset = stEventInfo.v2Location - GetScreenLocation();
	KUISendSubEvent( FKUIInterfaceEvent, EKUIInterfaceWidgetEventList::E_StateChange );

	return true;
}
Beispiel #3
0
bool UKUISliderWidget::OnMouseButtonDown( const FKUIInterfaceContainerMouseButtonEvent& stEventInfo )
{
	if ( !CanReceieveMouseEvents() )
		return Super::OnMouseButtonDown( stEventInfo );

	if ( stEventInfo.eButton != EMouseButtons::Left )
		return Super::OnMouseButtonDown( stEventInfo );

	if ( !IsVisibleRecursive() )
		return Super::OnMouseButtonDown( stEventInfo );

	if ( IsDisabledRecursive() )
		return Super::OnMouseButtonDown( stEventInfo );

	if ( !IsMouseOver() )
		return Super::OnMouseButtonDown( stEventInfo );

	if ( oHandle.IsValid() && oHandle->IsMouseOver() )
	{
		if ( bHorizontal )
			fMouseDownOffset = stEventInfo.v2Location.X - oHandle->GetScreenLocation().X - oHandle->GetSize().X / 2.f;

		else
			fMouseDownOffset = stEventInfo.v2Location.Y - oHandle->GetScreenLocation().Y - oHandle->GetSize().Y / 2.f;
	}

	else
		fMouseDownOffset = 0.f;

	bDragging = true;
	OnDrag( bHorizontal ? stEventInfo.v2Location.X : stEventInfo.v2Location.Y );
	KUISendSubEvent( FKUIInterfaceEvent, EKUIInterfaceWidgetEventList::E_StateChange );

	return true;
}
Beispiel #4
0
void UKUISimpleClickWidget::OnMouseMove( const FKUIInterfaceContainerMouseLocationEvent& stEventInfo )
{
	Super::OnMouseMove( stEventInfo );

	if ( !CanReceieveMouseEvents() )
		return;

	bool bMouseOver = IsMouseOver();

	if ( this->bMouseOver == bMouseOver )
		return;

	this->bMouseOver = bMouseOver;
	KUISendSubEvent( FKUIInterfaceEvent, EKUIInterfaceWidgetEventList::E_StateChange );
}
Beispiel #5
0
void UKUISliderWidget::OnMouseMove( const FKUIInterfaceContainerMouseLocationEvent& stEventInfo )
{
	Super::OnMouseMove( stEventInfo );

	if ( !CanReceieveMouseEvents() )
		return;

	if ( !bDragging )
		return;

	if ( IsDisabledRecursive() )
		return;

	OnDrag( bHorizontal ? stEventInfo.v2NewLocation.X : stEventInfo.v2NewLocation.Y );
}
Beispiel #6
0
bool UKUISliderWidget::OnMouseButtonUp( const FKUIInterfaceContainerMouseButtonEvent& stEventInfo )
{
	if ( !CanReceieveMouseEvents() )
		return Super::OnMouseButtonUp( stEventInfo );

	if ( stEventInfo.eButton != EMouseButtons::Left )
		return Super::OnMouseButtonUp( stEventInfo );

	if ( !IsVisibleRecursive() )
		return Super::OnMouseButtonUp( stEventInfo );

	if ( IsDisabledRecursive() )
		return Super::OnMouseButtonUp( stEventInfo );

	if ( !bDragging )
		return Super::OnMouseButtonUp( stEventInfo );

	bDragging = false;
	KUISendSubEvent( FKUIInterfaceEvent, EKUIInterfaceWidgetEventList::E_StateChange );

	return true;
}