This commit is contained in:
Digital Data - Marlon Schreiber
2017-07-26 11:09:53 +02:00
8 changed files with 63 additions and 25 deletions

View File

@@ -1380,9 +1380,6 @@ Public Class ClassControlBuilder
Try
Dim control As Label = New Label
Dim defaultSize As Size = New Size(200, 27)
If id = 735 Then
Dim i = "Obacht"
End If
Dim metadata As New ClassControlMetadata()
metadata.Id = id
metadata.Name = name
@@ -1468,6 +1465,7 @@ Public Class ClassControlBuilder
read_only As Boolean,
required As Boolean,
format As String,
autoSuggest As Boolean,
_new As Boolean,
Optional parent As GroupBox = Nothing,
Optional _designMode As Boolean = False)
@@ -1495,6 +1493,20 @@ Public Class ClassControlBuilder
'Console.WriteLine("setting tabindex of control " & name & " to " & tabindex)
If autoSuggest = True Then
control.AutoCompleteMode = AutoCompleteMode.Suggest
control.AutoCompleteSource = AutoCompleteSource.CustomSource
Dim suggestSource As New AutoCompleteStringCollection()
Dim dt As DataTable = ClassDatabase.Return_Datatable($"SELECT DISTINCT VALUE FROM VWPMO_VALUES WHERE CONTROL_ID = {id}")
For Each row As DataRow In dt.Rows
suggestSource.Add(row.Item("VALUE"))
Next
control.AutoCompleteCustomSource = suggestSource
End If
If multiline = True Then
control.Multiline = True
control.AcceptsReturn = True

View File

@@ -208,7 +208,7 @@
Dim CHANGED_WHO As String = USER_USERNAME
Dim COL_NAME As String
Dim SQLCommand As String
Dim EnabledWhen As String
Dim SQL_ENABLED_WHEN As String
Dim MULTILINE As Integer
Dim MASTER_DATA_ID As Integer
Dim DEFAULTVALUE As String
@@ -217,6 +217,8 @@
Dim STATIC_LIST As String
Dim VISIBLE As Integer
Dim TREE_VIEW As Integer
Dim AUTO_SUGGEST As Integer
' So sollte diese Funktion später mal aussehen :(
'Select Case type
@@ -242,6 +244,12 @@
MULTILINE = 0
End If
If propExists(properties, "AutoSuggest") Then
AUTO_SUGGEST = BoolToInt(properties.AutoSuggest)
Else
AUTO_SUGGEST = 0
End If
If propExists(properties, "ColumnTitle") Then
COL_NAME = properties.ColumnTitle
Else
@@ -307,12 +315,12 @@
If propExists(properties, "EnabledWhen") Then
Dim value As SQLValue = DirectCast(properties.EnabledWhen, SQLValue)
EnabledWhen = value.Value
If EnabledWhen.Contains("'") Then
EnabledWhen = EnabledWhen.Replace("'", "''")
SQL_ENABLED_WHEN = value.Value
If SQL_ENABLED_WHEN.Contains("'") Then
SQL_ENABLED_WHEN = SQL_ENABLED_WHEN.Replace("'", "''")
End If
Else
EnabledWhen = String.Empty
SQL_ENABLED_WHEN = String.Empty
End If
If propExists(properties, "StaticList") Then
@@ -333,22 +341,10 @@
CURRENT_CONTROL_ID = properties.ID
End If
SQL = String.Format(
"UPDATE TBPMO_CONTROL SET REQUIRED = {0}, READ_ONLY = {1}, SHOW_COLUMN = {2}, FORMAT_TYPE = '{3}', DEFAULT_VALUE = '{4}', " &
"NAME = '{5}', SQL_COMMAND_1 = '{6}', CHANGED_WHO = '{7}', COL_NAME = '{8}', MULTILINE = {9}, MASTER_DATA_ID = {10}, " &
"STATIC_LIST = '{11}', SQL_COMMAND_2 = '{12}', VISIBLE = {13}, TREE_VIEW = {14}, SELECT_ONLY = {15} " &
"WHERE GUID = {16}",
REQUIRED, READ_ONLY, SHOW_COLUMN, FORMAT_TYPE, DEFAULTVALUE,
NAME, SQLCommand, CHANGED_WHO, COL_NAME, MULTILINE, MASTER_DATA_ID,
STATIC_LIST, EnabledWhen, VISIBLE, TREE_VIEW, SELECT_ONLY,
CURRENT_CONTROL_ID
)
'SQL = "UPDATE TBPMO_CONTROL SET REQUIRED = " & REQUIRED & ", READ_ONLY = " & READ_ONLY & ", SHOW_COLUMN = " & SHOW_COLUMN & _
' ", FORMAT_TYPE = '" & FORMAT_TYPE & "', DEFAULT_VALUE = '" & DEFAULTVALUE & "', NAME = '" & NAME & "', SQL_COMMAND_1 = '" & SQLCommand & _
' "', CHANGED_WHO = '" & CHANGED_WHO & "', COL_NAME = '" & COL_NAME & "', MULTILINE = " & MULTILINE & ", MASTER_DATA_ID = " & MASTER_DATA_ID & _
' ", STATIC_LIST = '" & STATIC_LIST & "', SQL_COMMAND_2 = '" & EnabledWhen & "', VISIBLE = " & VISIBLE & ", TREE_VIEW = " & TREE_VIEW & _
' " WHERE GUID = " & CURRENT_CONTROL_ID
SQL = $"UPDATE TBPMO_CONTROL SET REQUIRED = {REQUIRED}, READ_ONLY = {READ_ONLY}, SHOW_COLUMN = {SHOW_COLUMN}, FORMAT_TYPE = '{FORMAT_TYPE}', DEFAULT_VALUE = '{DEFAULTVALUE}',
NAME = '{NAME}', SQL_COMMAND_1 = '{SQLCommand}', CHANGED_WHO = '{CHANGED_WHO}', COL_NAME = '{COL_NAME}', MULTILINE = {MULTILINE}, MASTER_DATA_ID = {MASTER_DATA_ID},
STATIC_LIST = '{STATIC_LIST}', SQL_COMMAND_2 = '{SQL_ENABLED_WHEN}', VISIBLE = {VISIBLE}, TREE_VIEW = {TREE_VIEW}, SELECT_ONLY = {SELECT_ONLY}, AUTO_SUGGEST = {AUTO_SUGGEST}
WHERE GUID = {CURRENT_CONTROL_ID}"
If ClassDatabase.Execute_non_Query(SQL) = True Then
Return UpdateControlScreen(control, properties)

View File

@@ -93,6 +93,7 @@ Public Class ClassControlCommandsUI
dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
dr.Item("CONTROL_FORMAT_TYPE"),
dr.Item("CONTROL_AUTO_SUGGEST"),
False,
parent)
control = "Text - " & dr.Item("CONTROL_ID")

View File

@@ -332,6 +332,7 @@ Module ClassControlProperties
Inherits InputControlProperties
Private _multiline As Boolean
Private _autosuggest As Boolean
Private _format As String
<LocalizedCategoryAttribute("category_view")>
@@ -355,6 +356,17 @@ Module ClassControlProperties
_multiline = value
End Set
End Property
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescription("desc_autosuggest")>
Public Property AutoSuggest() As Boolean
Get
Return _autosuggest
End Get
Set(value As Boolean)
_autosuggest = value
End Set
End Property
End Class
Public Class ComboBoxProperties
Inherits InputControlProperties

View File

@@ -145,6 +145,15 @@ Namespace My.Resources
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Schlägt bereits eingegebene Einträge bei der der Eingabe vor. ähnelt.
'''</summary>
Friend Shared ReadOnly Property desc_autosuggest() As String
Get
Return ResourceManager.GetString("desc_autosuggest", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Gibt die Hintergrundfarbe des Elements an. ähnelt.
'''</summary>

View File

@@ -144,6 +144,9 @@
<data name="category_view" xml:space="preserve">
<value>View Configuration</value>
</data>
<data name="desc_autosuggest" xml:space="preserve">
<value>Suggests already entered entries</value>
</data>
<data name="desc_backcolor" xml:space="preserve">
<value>The element's background color.</value>
</data>

View File

@@ -144,6 +144,9 @@
<data name="category_view" xml:space="preserve">
<value>Ansichts Einstellungen</value>
</data>
<data name="desc_autosuggest" xml:space="preserve">
<value>Schlägt bereits eingegebene Einträge bei der der Eingabe vor.</value>
</data>
<data name="desc_backcolor" xml:space="preserve">
<value>Gibt die Hintergrundfarbe des Elements an.</value>
</data>

View File

@@ -51,7 +51,7 @@
' Aktuelles Control in die Datenbank speichern
ClassControlCommands.InsertControl(DesignerCtrlBuilder.CurrentControl)
Case "txt"
DesignerCtrlBuilder.AddTextBox(0, "txt" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, False, False, False, "String", True, Parent)
DesignerCtrlBuilder.AddTextBox(0, "txt" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, False, False, False, "String", False, True, Parent)
' Aktuelles Control in die Datenbank speichern
ClassControlCommands.InsertControl(DesignerCtrlBuilder.CurrentControl)
Case "cmb"
@@ -263,6 +263,7 @@
dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
dr.Item("CONTROL_FORMAT_TYPE"),
dr.Item("CONTROL_AUTO_SUGGEST"),
False,
parent,
True)
@@ -751,6 +752,7 @@
props.SQLCommand = New SQLValue(NotNull(r.Item("CONTROL_SQLCOMMAND_1"), ""))
props.EnabledWhen = New SQLValue(r.Item("CONTROL_SQLCOMMAND_2").ToString())
props.TreeView = CBool(r.Item("CONTROL_TREE_VIEW"))
props.AutoSuggest = CBool(r.Item("CONTROL_AUTO_SUGGEST"))
Case "Combobox"
props.ControlType = "ComboBox"