ZooFlow: switch to Checkedit, small changes in frmIndex

This commit is contained in:
Jonathan Jenne
2021-12-15 13:53:30 +01:00
parent df2eed96e8
commit 3820c1a611
8 changed files with 106 additions and 78 deletions

View File

@@ -18,6 +18,7 @@ Public Class ControlCreator
Private Const TYPE_BOOLEAN = "BOOLEAN"
Private Const TYPE_DATE = "DATE"
Private Const TYPE_INTEGER = "INTEGER"
Private Const TYPE_VARCHAR = "VARCHAR"
Private Const PLACEHOLDER_NULL = "$NULL"
Private Const VECTORSEPARATOR = ""
@@ -34,11 +35,14 @@ Public Class ControlCreator
''' </summary>
''' <returns>The Datatable which contains the Control's Data</returns>
Public Property OnLookupData As Func(Of Control, String, Integer, DataTable)
Public Class ControlMeta
Public Property IndexName As String
Public Property IndexType As String
Public Property ControlType As String
Public Property MultipleValues As Boolean = False
End Class
Public Sub New(LogConfig As LogConfig, Panel As Panel, Form As Form)
Me.Form = Form
Me.Panel = Panel
@@ -46,6 +50,17 @@ Public Class ControlCreator
Me.Logger = LogConfig.GetLogger
End Sub
Function AddLabel(pIndexName As String, hinweis As String, ylbl As Integer, anz As String) As Label
Dim lbl As New Label With {
.Name = "lbl" & pIndexName,
.AutoSize = True,
.Text = hinweis,
.Location = New Point(11, ylbl)
}
Return lbl
End Function
Public Function AddDateTimePicker(pIndexname As String, pY As Integer, pDefaultValue As String) As DateEdit
Dim oPicker As New DateEdit With {
.Name = "dtp" & pIndexname,
@@ -53,7 +68,8 @@ Public Class ControlCreator
.Location = New Point(DEFAULT_POSITION_X, pY),
.Tag = New ControlMeta() With {
.IndexName = pIndexname,
.IndexType = TYPE_DATE
.IndexType = TYPE_DATE,
.ControlType = "dtp"
}
}
@@ -73,9 +89,10 @@ Public Class ControlCreator
.Name = "txt" & pIndexname,
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT),
.Location = New Point(DEFAULT_POSITION_X, pY),
.Tag = New ControlMeta() With {
.Tag = New ControlMeta() With {
.IndexName = pIndexname,
.IndexType = pDataType
.IndexType = pDataType,
.ControlType = "txt"
}
}
@@ -98,12 +115,12 @@ Public Class ControlCreator
Return oEdit
End Function
Public Sub OnTextBoxFocus(sender As TextEdit, e As EventArgs)
Private Sub OnTextBoxFocus(sender As TextEdit, e As EventArgs)
sender.BackColor = HightlightColor
sender.SelectAll()
End Sub
Public Sub OnTextBoxTextChanged(sender As TextEdit, e As System.EventArgs)
Private Sub OnTextBoxTextChanged(sender As TextEdit, e As System.EventArgs)
Using oGraphics As Graphics = sender.CreateGraphics()
Dim oNewWidth = oGraphics.MeasureString(sender.Text, sender.Font).Width + 15
If oNewWidth >= DEFAULT_WIDTH Then
@@ -112,11 +129,11 @@ Public Class ControlCreator
End Using
End Sub
Public Sub OnTextBoxLostFocus(sender As TextEdit, e As EventArgs)
Private Sub OnTextBoxLostFocus(sender As TextEdit, e As EventArgs)
sender.BackColor = Color.White
End Sub
Public Sub OnTextBoxKeyUp(sender As TextEdit, e As KeyEventArgs)
Private Sub OnTextBoxKeyUp(sender As TextEdit, e As KeyEventArgs)
If sender.Text = String.Empty Then
Exit Sub
End If
@@ -130,17 +147,18 @@ Public Class ControlCreator
End If
End Sub
Public Function AddCheckBox(pIndexname As String, pY As Integer, pDefaultValue As String, pCaption As String)
Public Function AddCheckBox(pIndexname As String, pY As Integer, pDefaultValue As String, pCaption As String) As CheckEdit
Try
Dim oValue As Boolean = False
Dim oCheckBox As New CheckBox With {
Dim oCheckBox As New CheckEdit With {
.Name = "chk" & pIndexname,
.AutoSize = False,
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT),
.Location = New Point(DEFAULT_POSITION_X, pY),
.Tag = New ControlMeta() With {
.IndexName = pIndexname,
.IndexType = TYPE_BOOLEAN
.IndexType = TYPE_BOOLEAN,
.ControlType = "chk"
}
}
@@ -178,7 +196,8 @@ Public Class ControlCreator
.Name = "cmbMulti" & pIndexname,
.Tag = New ControlMeta() With {
.IndexName = pIndexname,
.IndexType = pDataType
.IndexType = pDataType,
.ControlType = "cmbMulti"
}
}