This commit is contained in:
SchreiberM
2016-10-05 17:00:35 +02:00
parent e16e64a77c
commit fedad4b50d
11 changed files with 124 additions and 48 deletions

View File

@@ -5174,34 +5174,43 @@ Public Class frmConstructor_Main
End If
End Sub
Private Sub grvwGrid_MouseDown(sender As Object, e As MouseEventArgs) Handles grvwGrid.MouseDown, grvwTiles.MouseDown, grvwCarousel.MouseDown
Dim view As GridView = CType(sender, GridView)
If e.Button = Windows.Forms.MouseButtons.Right Then
GRIDRightMouse_Clicked = True
Else
GRIDRightMouse_Clicked = False
End If
Dim hitInfo As GridHitInfo = View.CalcHitInfo(New Point(e.X, e.Y))
If e.Button = Windows.Forms.MouseButtons.Left AndAlso hitInfo.InRow AndAlso hitInfo.HitTest <> GridHitTest.RowIndicator Then
GRIDdownHitInfo = hitInfo
End If
Try
Dim view As GridView = CType(sender, GridView)
If e.Button = Windows.Forms.MouseButtons.Right Then
GRIDRightMouse_Clicked = True
Else
GRIDRightMouse_Clicked = False
End If
Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y))
If e.Button = Windows.Forms.MouseButtons.Left AndAlso hitInfo.InRow AndAlso hitInfo.HitTest <> GridHitTest.RowIndicator Then
GRIDdownHitInfo = hitInfo
End If
Catch ex As Exception
Exit Sub
End Try
End Sub
Private Sub grvwGrid_MouseMove(sender As Object, e As MouseEventArgs) Handles grvwGrid.MouseMove, grvwTiles.MouseMove, grvwCarousel.MouseMove
Dim view As GridView = CType(sender, GridView)
Try
Dim view As GridView = CType(sender, GridView)
If e.Button = MouseButtons.Left And Not GRIDdownHitInfo Is Nothing Then
Dim dragSize As Size = SystemInformation.DragSize
If e.Button = MouseButtons.Left And Not GRIDdownHitInfo Is Nothing Then
Dim dragSize As Size = SystemInformation.DragSize
Dim dragRect As Rectangle = New Rectangle(New Point(GRIDdownHitInfo.HitPoint.X - dragSize.Width / 2, GRIDdownHitInfo.HitPoint.Y - dragSize.Height / 2), dragSize)
Dim dragRect As Rectangle = New Rectangle(New Point(GRIDdownHitInfo.HitPoint.X - dragSize.Width / 2, GRIDdownHitInfo.HitPoint.Y - dragSize.Height / 2), dragSize)
If Not dragRect.Contains(New Point(e.X, e.Y)) Then
If Not dragRect.Contains(New Point(e.X, e.Y)) Then
view.GridControl.DoDragDrop(GetDragData(view), DragDropEffects.All)
GRIDdownHitInfo = Nothing
view.GridControl.DoDragDrop(GetDragData(view), DragDropEffects.All)
GRIDdownHitInfo = Nothing
End If
End If
Catch ex As Exception
Exit Sub
End Try
End If
End Sub
Private Function GetDragData(ByVal view As GridView) As String()
Dim selection() As Integer = view.GetSelectedRows()