Zooflow/SQLEditor: include clipboard ,small fixes

This commit is contained in:
Jonathan Jenne 2022-05-09 16:33:19 +02:00
parent 77a7cb4d75
commit 61b2b25f7e
4 changed files with 46 additions and 16 deletions

View File

@ -2,7 +2,7 @@
Imports DevExpress.XtraBars.Ribbon Imports DevExpress.XtraBars.Ribbon
Public Class Placeholders Public Class Placeholders
Public Function GetInternalGroup() As GalleryItemGroup Public Function GetInternalPlaceholders() As GalleryItemGroup
Dim oModule = "INT" Dim oModule = "INT"
Dim oImage = My.Resources.electronics_desktopmac Dim oImage = My.Resources.electronics_desktopmac
@ -18,6 +18,19 @@ Public Class Placeholders
Return oGroup1 Return oGroup1
End Function End Function
Public Function GetClipboardPlaceholder() As GalleryItemGroup
Dim oModule = "CLIP"
Dim oImage = My.Resources.electronics_desktopmac
Dim oItems As New List(Of GalleryItem)() From {
GetGalleryItem(New Placeholder("BOARD", "Zwischenablage", oModule, "BOARD"), oImage)
}
Dim oGroup1 = New GalleryItemGroup() With {.Caption = "Zwischenablage"}
oGroup1.Items.AddRange(oItems.ToArray)
Return oGroup1
End Function
Public Function GetManualPlaceholders() As GalleryItemGroup Public Function GetManualPlaceholders() As GalleryItemGroup
Return GetManualPlaceholders(New List(Of String)) Return GetManualPlaceholders(New List(Of String))
End Function End Function
@ -30,10 +43,7 @@ Public Class Placeholders
For Each oManualPlaceholder In pPlaceholders For Each oManualPlaceholder In pPlaceholders
oItems.Add(GetGalleryItem(New Placeholder(oManualPlaceholder, "Manuelles Attribut", "ATTR_M", oManualPlaceholder), oImage)) oItems.Add(GetGalleryItem(New Placeholder(oManualPlaceholder, "Manuelles Attribut", "ATTR_M", oManualPlaceholder), oImage))
Next Next
Else Return Nothing
Else
oItems.Add(GetGalleryItem(New Placeholder("Attribut", "Manuelles Attribut", "ATTR_M", "ATTRIBUTE"), oImage))
End If End If
Dim oGroup1 = New GalleryItemGroup() With {.Caption = "Manuelle Attribute"} Dim oGroup1 = New GalleryItemGroup() With {.Caption = "Manuelle Attribute"}
@ -54,9 +64,7 @@ Public Class Placeholders
oItems.Add(GetGalleryItem(New Placeholder(oManualPlaceholder, "Automatisches Attribut", "ATTR_A", oManualPlaceholder), oImage)) oItems.Add(GetGalleryItem(New Placeholder(oManualPlaceholder, "Automatisches Attribut", "ATTR_A", oManualPlaceholder), oImage))
Next Next
Else Else Return Nothing
oItems.Add(GetGalleryItem(New Placeholder("Attribut", "Automatisches Attribut", "ATTR_A", "ATTRIBUTE"), oImage))
End If End If
Dim oGroup1 = New GalleryItemGroup() With {.Caption = "Automatisches Attribut"} Dim oGroup1 = New GalleryItemGroup() With {.Caption = "Automatisches Attribut"}

View File

@ -17,6 +17,7 @@ Public Class frmSQLEditor
Public Property SQLCommand As String = "" Public Property SQLCommand As String = ""
Public Property SQLConnection As Integer = 0 Public Property SQLConnection As Integer = 0
Public Property LoadClipboardPlaceholders As Boolean = False
Public Property PlaceholdersManual As List(Of String) Public Property PlaceholdersManual As List(Of String)
Public Property PlaceholdersAutomatic As List(Of String) Public Property PlaceholdersAutomatic As List(Of String)
@ -87,12 +88,26 @@ Public Class frmSQLEditor
End Sub End Sub
Private Function LoadPlaceholders() As List(Of GalleryItemGroup) Private Function LoadPlaceholders() As List(Of GalleryItemGroup)
Return New List(Of GalleryItemGroup)() From { Dim oPlaceholders = New List(Of GalleryItemGroup)() From {
Placeholders.GetInternalGroup(), Placeholders.GetInternalPlaceholders(),
Placeholders.GetUserGroup(), Placeholders.GetUserGroup()
Placeholders.GetAutomaticPlaceholders(PlaceholdersAutomatic),
Placeholders.GetManualPlaceholders(PlaceholdersManual)
} }
Dim oAutomaticAttributes = Placeholders.GetAutomaticPlaceholders(PlaceholdersAutomatic)
If oAutomaticAttributes IsNot Nothing Then
oPlaceholders.Add(oAutomaticAttributes)
End If
Dim oManualPlaceholders = Placeholders.GetManualPlaceholders(PlaceholdersManual)
If oManualPlaceholders IsNot Nothing Then
oPlaceholders.Add(oManualPlaceholders)
End If
If LoadClipboardPlaceholders Then
oPlaceholders.Add(Placeholders.GetClipboardPlaceholder)
End If
Return oPlaceholders
End Function End Function
Private Function LoadConnections() As GalleryItemGroup Private Function LoadConnections() As GalleryItemGroup
@ -176,8 +191,9 @@ Public Class frmSQLEditor
Private Sub ExecuteSQL() Private Sub ExecuteSQL()
Try Try
Dim oSql = txtSQLCommand.Document.Text ViewPlaceholders.FocusInvalidRow()
Dim oSql = txtSQLCommand.Document.Text
Dim oPlaceholders As List(Of Placeholder) = GridPlaceholders.DataSource Dim oPlaceholders As List(Of Placeholder) = GridPlaceholders.DataSource
If oPlaceholders IsNot Nothing Then If oPlaceholders IsNot Nothing Then

View File

@ -1,5 +1,8 @@
Public Class frmSQLResult Imports DigitalData.GUIs.Common
Public Class frmSQLResult
Private ReadOnly Table As DataTable Private ReadOnly Table As DataTable
Private ReadOnly GridBuilder As GridBuilder
Public Sub New(pTable As DataTable) Public Sub New(pTable As DataTable)
' Dieser Aufruf ist für den Designer erforderlich. ' Dieser Aufruf ist für den Designer erforderlich.
@ -7,6 +10,8 @@
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu. ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
Table = pTable Table = pTable
GridBuilder = New GridBuilder(GridViewResult).
WithClipboardHandler()
End Sub End Sub
Private Sub frmSQLResult_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub frmSQLResult_Load(sender As Object, e As EventArgs) Handles MyBase.Load

View File

@ -354,7 +354,8 @@ Public Class frmAdmin_Globix
Dim oForm2 As New frmSQLEditor(My.LogConfig, My.DatabaseECM) With { Dim oForm2 As New frmSQLEditor(My.LogConfig, My.DatabaseECM) With {
.SQLCommand = SQL_RESULTTextBox.Text, .SQLCommand = SQL_RESULTTextBox.Text,
.SQLConnection = CONNECTION_IDTextBox.Text, .SQLConnection = CONNECTION_IDTextBox.Text,
.PlaceholdersManual = AttributesManual .PlaceholdersManual = AttributesManual,
.LoadClipboardPlaceholders = True
} }
oForm2.ShowDialog() oForm2.ShowDialog()