Exemplo n.º 1
0
 protected override bool OnDragStart(DragStartEvent e)
 {
     changeHandler?.BeginChange();
     return(true);
 }
Exemplo n.º 2
0
 protected override bool OnDragStart(DragStartEvent e) => placementControlPoint != null;
Exemplo n.º 3
0
        public override bool OnToolDragStart(DragStartEvent e)
        {
            var mousePos          = ToSpaceOfOtherDrawable(ToLocalSpace(e.ScreenSpaceMouseDownPosition), Editor.NotesTimeline.NoteSelectionIndicators);
            var selectedNoteTime  = 0d;
            var selectedNoteCoord = Vector2.Zero;

            foreach (var noteAndTime in NotesTimeline.SelectedNoteToTime)
            {
                var note = noteAndTime.Key;
                var noteToTimelineNote = Editor.NotesTimeline.NoteToTimelineNote;
                if (noteToTimelineNote.TryGetValue(note, out var timelineNote) && IsMouseOnTimelineNote(mousePos, timelineNote))
                {
                    ToDrag     = SelectToolDragState.DragTimelineNote;
                    OldHitTime = selectedNoteTime = note.HitTime;
                    if (note is HoldNote holdNote && IsMouseOnEndOfHoldNote(mousePos, holdNote))
                    {
                        ToDrag              = SelectToolDragState.DragHoldNoteEndTime;
                        OldEndTime          = holdNote.EndTime;
                        OldFirstVisibleTick = NotesTimeline.FirstVisibleTick;
                    }
                    break;
                }
            }
            if (ToDrag == SelectToolDragState.None)
            {
                foreach (var note in GetVisibleStoryNotes())
                {
                    if (IsMouseOnNote(e.ScreenSpaceMousePosition, note))
                    {
                        if (note is HoldNote holdNote)
                        {
                            continue;
                        }                                            // Temp fix to stop dragging holdnote preview
                        ToDrag    = SelectToolDragState.DragNote;
                        OldCoords = selectedNoteCoord = note.Coordinates;
                        break;
                    }
                }
            }

            switch (ToDrag)
            {
            case SelectToolDragState.DragHoldNoteEndTime:
            case SelectToolDragState.DragTimelineNote:
                foreach (var noteAndTime in NotesTimeline.SelectedNoteToTime)
                {
                    var note = noteAndTime.Key;
                    TimelineNoteToDragPointDelta[note] = GetGameTimeAtMouse(e.ScreenSpaceMouseDownPosition) - selectedNoteTime;
                }
                break;

            case SelectToolDragState.DragNote:
                foreach (var noteAndTime in NotesTimeline.SelectedNoteToTime)
                {
                    var note = noteAndTime.Key;
                    NoteToDragPointDelta[note] = note.Coordinates - selectedNoteCoord;
                }
                break;

            case SelectToolDragState.None:
                break;
            }
            return(true);
        }
Exemplo n.º 4
0
 protected override bool OnDragStart(DragStartEvent e) => CurrentlyDragging = true;
 protected override bool OnDragStart(DragStartEvent e)
 {
     OperationStarted?.Invoke();
     return(true);
 }
Exemplo n.º 6
0
        protected override bool OnDragStart(DragStartEvent e)
        {
            Vector2 posDiff = e.MouseDownPosition - e.MousePosition;

            return(Math.Abs(posDiff.X) > Math.Abs(posDiff.Y));
        }
Exemplo n.º 7
0
 protected override bool OnDragStart(DragStartEvent e)
 {
     isDragging = true;
     return(base.OnDragStart(e));
 }
Exemplo n.º 8
0
 protected override bool OnDragStart(DragStartEvent e) => true;
Exemplo n.º 9
0
 protected override bool OnDragStart(DragStartEvent e)
 {
     nativeDragPosition = e.ScreenSpaceMousePosition;
     draggedItem        = items.FirstOrDefault(d => d.IsDraggable);
     return(draggedItem != null || base.OnDragStart(e));
 }
 protected override bool OnDragStart(DragStartEvent e)
 {
     handleMouseInput(e.ScreenSpaceMousePosition);
     return(true);
 }
Exemplo n.º 11
0
 protected override bool OnDragStart(DragStartEvent e) => e.Button == MouseButton.Left;
Exemplo n.º 12
0
 public override bool OnDragStart(DragStartEvent e)
 {
     return(onDragStart != null && onDragStart(e));
 }
Exemplo n.º 13
0
 protected override bool OnDragStart(DragStartEvent e)
 {
     this.FadeIn(250, Easing.OutQuint);
     return(true);
 }
Exemplo n.º 14
0
 protected override bool OnDragStart(DragStartEvent e)
 {
     return(true);
 }
 protected override bool OnDragStart(DragStartEvent e)
 {
     dragOffset = e.MousePosition[(int)ScrollDirection] - Position[(int)ScrollDirection];
     return(true);
 }
Exemplo n.º 16
0
 protected override bool OnDragStart(DragStartEvent e)
 {
     AddUserVertex(e.MousePosition);
     DrawText.Text = "Custom Smoothed Drawn: Smoothed=" + NumVertices + ", Raw=" + NumRaw;
     return(true);
 }
Exemplo n.º 17
0
 protected override bool OnDragStart(DragStartEvent e) => AllowDrag;
Exemplo n.º 18
0
 protected override bool OnDragStart(DragStartEvent e)
 {
     // This text box is intended to be "read only" without actually specifying that.
     // As such we don't want to allow the user to select its content with a drag.
     return(false);
 }
Exemplo n.º 19
0
 private void startArrangement(RearrangeableListItem <TModel> item, DragStartEvent e)
 {
     currentlyDraggedItem    = item;
     screenSpaceDragPosition = e.ScreenSpaceMousePosition;
 }