Import Assistent
This commit is contained in:
@@ -69,11 +69,75 @@ Public Class frmSendungAnhangImport
|
||||
End Function
|
||||
|
||||
Sub initElement(USRCNTL As usrCntlSendungAnhangElement)
|
||||
AddHandler USRCNTL.ME_CLICK, Sub(STRG_PRESSED)
|
||||
AddHandler USRCNTL.ME_CLICK, Sub(STRG_PRESSED, SHIFT_PRESSED)
|
||||
' If BrowserLoaded Then
|
||||
|
||||
|
||||
If Not STRG_PRESSED Then
|
||||
If SHIFT_PRESSED Then
|
||||
'prüfen, ob genau 1 Elemnt markeirt ist, dann kein neues Laden nötig
|
||||
If USRCNTL.ACTIVE Then
|
||||
If checkIf1isSelected() Then Exit Sub 'Bereits aktiv, aber nur wenn 1 markiert
|
||||
End If
|
||||
' Hier Fehlt Code, der Shift abfängt
|
||||
' --- SHIFT-Bereichsauswahl (nur im gleichen Panel) ---
|
||||
' Anker = das (genau) eine bereits markierte Element suchen
|
||||
Dim anchor As usrCntlSendungAnhangElement = Nothing
|
||||
|
||||
For Each c As Control In flpnlAviso.Controls
|
||||
Dim u = TryCast(c, usrCntlSendungAnhangElement)
|
||||
If u IsNot Nothing AndAlso u.ACTIVE Then
|
||||
anchor = u
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If anchor Is Nothing Then
|
||||
For Each c As Control In flpnlSendungen.Controls
|
||||
Dim u = TryCast(c, usrCntlSendungAnhangElement)
|
||||
If u IsNot Nothing AndAlso u.ACTIVE Then
|
||||
anchor = u
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If anchor IsNot Nothing Then
|
||||
Dim pAnchor = TryCast(anchor.Parent, FlowLayoutPanel)
|
||||
Dim pClick = TryCast(USRCNTL.Parent, FlowLayoutPanel)
|
||||
|
||||
' Nur wenn beide im selben FlowLayoutPanel liegen:
|
||||
If pAnchor IsNot Nothing AndAlso pAnchor Is pClick Then
|
||||
Dim i1 As Integer = pAnchor.Controls.IndexOf(anchor)
|
||||
Dim i2 As Integer = pAnchor.Controls.IndexOf(USRCNTL)
|
||||
Dim fromIdx As Integer = Math.Min(i1, i2)
|
||||
Dim toIdx As Integer = Math.Max(i1, i2)
|
||||
|
||||
' Vorher alles deselektieren (beide Panels)
|
||||
For Each c As Control In flpnlAviso.Controls
|
||||
Dim u = TryCast(c, usrCntlSendungAnhangElement)
|
||||
If u IsNot Nothing Then u.ACTIVE = False
|
||||
Next
|
||||
For Each c As Control In flpnlSendungen.Controls
|
||||
Dim u = TryCast(c, usrCntlSendungAnhangElement)
|
||||
If u IsNot Nothing Then u.ACTIVE = False
|
||||
Next
|
||||
|
||||
' Bereich [fromIdx..toIdx] markieren (inklusive)
|
||||
For i As Integer = fromIdx To toIdx
|
||||
Dim u = TryCast(pAnchor.Controls(i), usrCntlSendungAnhangElement)
|
||||
If u IsNot Nothing Then u.ACTIVE = True
|
||||
Next
|
||||
|
||||
' Nichts weiter tun (kein neues Laden/Navigieren)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
' --- Ende SHIFT-Bereichsauswahl ---
|
||||
|
||||
ElseIf STRG_PRESSED Then
|
||||
If checkIfSamePanel(USRCNTL) Then
|
||||
USRCNTL.ACTIVE = Not USRCNTL.ACTIVE
|
||||
End If
|
||||
Else
|
||||
|
||||
'prüfen, ob genau 1 Elemnt markeirt ist, dann kein neues Laden nötig
|
||||
If USRCNTL.ACTIVE Then
|
||||
@@ -99,10 +163,6 @@ Public Class frmSendungAnhangImport
|
||||
|
||||
txtDateiname.Text = USRCNTL.FILE_NAME
|
||||
txtSeiten.Focus()
|
||||
Else
|
||||
If checkIfSamePanel(USRCNTL) Then
|
||||
USRCNTL.ACTIVE = Not USRCNTL.ACTIVE
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1286,6 +1346,7 @@ Public Class frmSendungAnhangImport
|
||||
If e.KeyCode = Keys.Return Then
|
||||
btnAnfuegen.PerformClick()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Sub initSendungen()
|
||||
cboSendungen.Items.Clear()
|
||||
@@ -1742,6 +1803,12 @@ Public Class frmSendungAnhangImport
|
||||
btnSndEdit.PerformClick()
|
||||
e.IsInputKey = True ' Damit Event abgefangen ist, sonst steht "+" im Feld
|
||||
End If
|
||||
' Prüfen, ob STRG + " " gedrückt wurde
|
||||
If e.Control AndAlso (e.KeyCode = Keys.Space) Then
|
||||
AddCurrentPage()
|
||||
e.IsInputKey = True ' Damit Event abgefangen ist, sonst steht " " im Feld
|
||||
End If
|
||||
|
||||
ElseIf e.Modifiers = Keys.Shift Then ' PDFs durchlaufen
|
||||
If e.KeyCode = Keys.PageDown Then
|
||||
nextART()
|
||||
@@ -2182,6 +2249,26 @@ Public Class frmSendungAnhangImport
|
||||
Private Sub flpnlSnd_DragEnter(sender As Object, e As DragEventArgs) Handles flpnlSendungen.DragEnter
|
||||
e.Effect = DragDropEffects.All
|
||||
End Sub
|
||||
|
||||
Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click
|
||||
AddCurrentPage()
|
||||
End Sub
|
||||
|
||||
Sub AddCurrentPage()
|
||||
Dim CurrentPageNumber = PdfViewer.CurrentPageNumber
|
||||
If CurrentPageNumber > 0 Then
|
||||
If txtSeiten.Text = "" Then
|
||||
txtSeiten.Text = CurrentPageNumber.ToString.Trim
|
||||
Else
|
||||
txtSeiten.Text &= "," & CurrentPageNumber.ToString.Trim
|
||||
End If
|
||||
txtSeiten.Focus()
|
||||
txtSeiten.SelectionStart = txtSeiten.TextLength
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
'Private Sub flpnlSendungen_Paint(sender As Object, e As PaintEventArgs) Handles flpnlSendungen.Paint
|
||||
' Dim files() As String = e.Data.GetData(DataFormats.FileDrop)
|
||||
' For Each path In files
|
||||
|
||||
Reference in New Issue
Block a user