JJ: BAUSTELLE FormDesigner
This commit is contained in:
@@ -5,7 +5,7 @@ Public Class ClassControlCreator
|
|||||||
''' <summary>
|
''' <summary>
|
||||||
''' Konstanten
|
''' Konstanten
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Private Const LABEL_TEXT = "Bezeichnung definieren"
|
Private Const DEFAULT_TEXT = "Bezeichnung definieren"
|
||||||
|
|
||||||
Private Const DEFAULT_FONT_SIZE As Integer = 10
|
Private Const DEFAULT_FONT_SIZE As Integer = 10
|
||||||
Private Const DEFAULT_FONT_FAMILY As String = "Arial"
|
Private Const DEFAULT_FONT_FAMILY As String = "Arial"
|
||||||
@@ -13,8 +13,15 @@ Public Class ClassControlCreator
|
|||||||
Private Const DEFAULT_COLOR As Integer = 0
|
Private Const DEFAULT_COLOR As Integer = 0
|
||||||
Private Const DEFAULT_WIDTH As Integer = 170
|
Private Const DEFAULT_WIDTH As Integer = 170
|
||||||
Private Const DEFAULT_HEIGHT As Integer = 20
|
Private Const DEFAULT_HEIGHT As Integer = 20
|
||||||
|
Private Const DEFAULT_HEIGHT_TABLE As Integer = 150
|
||||||
|
|
||||||
Private Const PREFIX_TEXTBOX = "TXT"
|
Private Const PREFIX_TEXTBOX = "TXT"
|
||||||
|
Private Const PREFIX_LABEL = "LBL"
|
||||||
|
Private Const PREFIX_CHECKBOX = "CHK"
|
||||||
|
Private Const PREFIX_COMBOBOX = "CMB"
|
||||||
|
Private Const PREFIX_DATETIMEPICKER = "DTP"
|
||||||
|
Private Const PREFIX_DATAGRIDVIEW = "DGV"
|
||||||
|
Private Const PREFIX_TABLE = "TB"
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Standard Eigenschaften für alle Controls
|
''' Standard Eigenschaften für alle Controls
|
||||||
@@ -75,7 +82,96 @@ Public Class ClassControlCreator
|
|||||||
}
|
}
|
||||||
|
|
||||||
Return control
|
Return control
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function CreateNewLabel(location As Point) As Label
|
||||||
|
Dim control As New Label With {
|
||||||
|
.Name = $"{PREFIX_LABEL}_{clsTools.ShortGUID}",
|
||||||
|
.Text = DEFAULT_TEXT,
|
||||||
|
.AutoSize = True,
|
||||||
|
.Location = location,
|
||||||
|
.Cursor = Cursors.Hand
|
||||||
|
}
|
||||||
|
|
||||||
|
Return control
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function CreateNewCheckbox(location As Point) As CheckBox
|
||||||
|
Dim control As New CheckBox With {
|
||||||
|
.Name = $"{PREFIX_CHECKBOX}_{clsTools.ShortGUID}",
|
||||||
|
.AutoSize = True,
|
||||||
|
.Text = DEFAULT_TEXT,
|
||||||
|
.Cursor = Cursors.Hand,
|
||||||
|
.Location = location
|
||||||
|
}
|
||||||
|
|
||||||
|
Return control
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function CreateNewCombobox(location As Point) As ComboBox
|
||||||
|
Dim control As New ComboBox With {
|
||||||
|
.Name = $"{PREFIX_COMBOBOX}_{clsTools.ShortGUID}",
|
||||||
|
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT),
|
||||||
|
.Cursor = Cursors.Hand,
|
||||||
|
.Location = location
|
||||||
|
}
|
||||||
|
|
||||||
|
Return control
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function CreateNewDatetimepicker(location As Point) As DateTimePicker
|
||||||
|
Dim control As New DateTimePicker With {
|
||||||
|
.Name = $"{PREFIX_DATETIMEPICKER}_{clsTools.ShortGUID}",
|
||||||
|
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT),
|
||||||
|
.Cursor = Cursors.Hand,
|
||||||
|
.Location = location,
|
||||||
|
.Format = DateTimePickerFormat.Short
|
||||||
|
}
|
||||||
|
|
||||||
|
Return control
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function CreateNewDatagridview(location As Point) As DataGridView
|
||||||
|
Dim control As New DataGridView With {
|
||||||
|
.Name = $"{PREFIX_DATAGRIDVIEW}_{clsTools.ShortGUID}",
|
||||||
|
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT_TABLE),
|
||||||
|
.Cursor = Cursors.Hand,
|
||||||
|
.AllowUserToAddRows = False,
|
||||||
|
.AllowUserToDeleteRows = False,
|
||||||
|
.AllowUserToResizeColumns = False,
|
||||||
|
.AllowUserToResizeRows = False
|
||||||
|
}
|
||||||
|
|
||||||
|
control.Columns.Add(New DataGridViewTextBoxColumn With {
|
||||||
|
.HeaderText = "",
|
||||||
|
.Name = "column1"
|
||||||
|
})
|
||||||
|
|
||||||
|
Return control
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function CreateNewTable(location As Point) As DataGridView
|
||||||
|
Dim control As New DataGridView With {
|
||||||
|
.Name = $"{PREFIX_TABLE}_{clsTools.ShortGUID}",
|
||||||
|
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT_TABLE),
|
||||||
|
.Cursor = Cursors.Hand,
|
||||||
|
.AllowUserToAddRows = False,
|
||||||
|
.AllowUserToDeleteRows = False,
|
||||||
|
.AllowUserToResizeColumns = False,
|
||||||
|
.AllowUserToResizeRows = False
|
||||||
|
}
|
||||||
|
|
||||||
|
control.Columns.Add(New DataGridViewTextBoxColumn With {
|
||||||
|
.HeaderText = "Column1",
|
||||||
|
.Name = "column1"
|
||||||
|
})
|
||||||
|
|
||||||
|
control.Columns.Add(New DataGridViewTextBoxColumn With {
|
||||||
|
.HeaderText = "Column2",
|
||||||
|
.Name = "column2"
|
||||||
|
})
|
||||||
|
|
||||||
|
Return control
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
' ----------------------- EXISITING CONTROLS -----------------------
|
' ----------------------- EXISITING CONTROLS -----------------------
|
||||||
|
|||||||
2
app/DD_PM_WINDREAM/frmFormDesigner.Designer.vb
generated
2
app/DD_PM_WINDREAM/frmFormDesigner.Designer.vb
generated
@@ -313,7 +313,6 @@ Partial Class frmFormDesigner
|
|||||||
Me.gbxControl.TabIndex = 4
|
Me.gbxControl.TabIndex = 4
|
||||||
Me.gbxControl.TabStop = False
|
Me.gbxControl.TabStop = False
|
||||||
Me.gbxControl.Text = "Controleigenschaften:"
|
Me.gbxControl.Text = "Controleigenschaften:"
|
||||||
Me.gbxControl.Visible = False
|
|
||||||
'
|
'
|
||||||
'TabControlEigenschaften
|
'TabControlEigenschaften
|
||||||
'
|
'
|
||||||
@@ -324,6 +323,7 @@ Partial Class frmFormDesigner
|
|||||||
Me.TabControlEigenschaften.Controls.Add(Me.pageFormat)
|
Me.TabControlEigenschaften.Controls.Add(Me.pageFormat)
|
||||||
Me.TabControlEigenschaften.Controls.Add(Me.pageSQL)
|
Me.TabControlEigenschaften.Controls.Add(Me.pageSQL)
|
||||||
Me.TabControlEigenschaften.Controls.Add(Me.pagePropertiesOld)
|
Me.TabControlEigenschaften.Controls.Add(Me.pagePropertiesOld)
|
||||||
|
Me.TabControlEigenschaften.Enabled = False
|
||||||
Me.TabControlEigenschaften.Location = New System.Drawing.Point(12, 22)
|
Me.TabControlEigenschaften.Location = New System.Drawing.Point(12, 22)
|
||||||
Me.TabControlEigenschaften.Name = "TabControlEigenschaften"
|
Me.TabControlEigenschaften.Name = "TabControlEigenschaften"
|
||||||
Me.TabControlEigenschaften.SelectedIndex = 0
|
Me.TabControlEigenschaften.SelectedIndex = 0
|
||||||
|
|||||||
@@ -137,9 +137,18 @@
|
|||||||
<metadata name="TBPM_PROFILE_CONTROLSBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="TBPM_PROFILE_CONTROLSBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>179, 17</value>
|
<value>179, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="TBPM_PROFILE_CONTROLSBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>179, 17</value>
|
||||||
|
</metadata>
|
||||||
<metadata name="DD_DMSLiteDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="DD_DMSLiteDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>17, 17</value>
|
<value>17, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="DD_DMSLiteDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="TBPM_CONNECTIONBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>1021, 17</value>
|
||||||
|
</metadata>
|
||||||
<metadata name="TBPM_CONNECTIONBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="TBPM_CONNECTIONBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>1021, 17</value>
|
<value>1021, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
@@ -149,6 +158,9 @@
|
|||||||
<metadata name="StatusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="StatusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>904, 17</value>
|
<value>904, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="ToolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>898, 56</value>
|
||||||
|
</metadata>
|
||||||
<metadata name="TBPM_PROFILE_CONTROLSTableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="TBPM_PROFILE_CONTROLSTableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>458, 17</value>
|
<value>458, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|||||||
@@ -14,9 +14,14 @@ Public Class frmFormDesigner
|
|||||||
Private CURRENT_CONTROL As Control
|
Private CURRENT_CONTROL As Control
|
||||||
|
|
||||||
' Movement Variables
|
' Movement Variables
|
||||||
Private MouseMoving As Boolean
|
Private Mouse_IsPressed As Boolean
|
||||||
Private BeginLocation As Point
|
Private Mouse_IsMoving As Boolean
|
||||||
Private EndLocation As Point
|
Private Mouse_BeginLocation As Point
|
||||||
|
Private Mouse_EndLocation As Point
|
||||||
|
|
||||||
|
' Windream List Data
|
||||||
|
Private Windream_ChoiceLists As List(Of String)
|
||||||
|
Private Windream_Indicies As List(Of String)
|
||||||
|
|
||||||
Private Sub frmFormDesigner_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
Private Sub frmFormDesigner_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
||||||
If CURRENT_ProfilGUID > 0 Then
|
If CURRENT_ProfilGUID > 0 Then
|
||||||
@@ -53,12 +58,18 @@ Public Class frmFormDesigner
|
|||||||
'löscht alle Controls
|
'löscht alle Controls
|
||||||
pnldesigner.Controls.Clear()
|
pnldesigner.Controls.Clear()
|
||||||
CURRENT_CONTROL = Nothing
|
CURRENT_CONTROL = Nothing
|
||||||
|
|
||||||
Try
|
Try
|
||||||
' Windream initialisieren
|
' Windream initialisieren
|
||||||
clsWindream.Create_Session()
|
clsWindream.Create_Session()
|
||||||
|
|
||||||
|
'Windream Abfragen, sollten einmal beim Start des Formulars geladen werden
|
||||||
|
Windream_Indicies = clsWD_GET.GetIndicesByObjecttype(CURRENT_OBJECTTYPE).ToList()
|
||||||
|
Windream_ChoiceLists = clsWD_GET.GetChoiceLists()
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MsgBox("Fehler bei Initialisieren von windream: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
|
MsgBox("Fehler bei Initialisieren von windream: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Try
|
Try
|
||||||
TBPM_PROFILE_CONTROLSTableAdapter.Connection.ConnectionString = MyConnectionString
|
TBPM_PROFILE_CONTROLSTableAdapter.Connection.ConnectionString = MyConnectionString
|
||||||
TBPM_CONNECTIONTableAdapter.Connection.ConnectionString = MyConnectionString
|
TBPM_CONNECTIONTableAdapter.Connection.ConnectionString = MyConnectionString
|
||||||
@@ -256,6 +267,8 @@ Public Class frmFormDesigner
|
|||||||
Select r).ToList()
|
Select r).ToList()
|
||||||
Dim table = ClassControlCreator.CreateExistingTable(row, columns, True)
|
Dim table = ClassControlCreator.CreateExistingTable(row, columns, True)
|
||||||
|
|
||||||
|
AddHandler table.ColumnHeaderMouseClick, AddressOf table_ColumnHeaderMouseClick
|
||||||
|
|
||||||
pnldesigner.Controls.Add(table)
|
pnldesigner.Controls.Add(table)
|
||||||
SetMovementHandlers(table)
|
SetMovementHandlers(table)
|
||||||
End Select
|
End Select
|
||||||
@@ -302,50 +315,103 @@ Public Class frmFormDesigner
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub btnlabel_MouseMove(sender As Object, e As MouseEventArgs) Handles btnlabel.MouseMove
|
Private Sub pnlDesigner_DragDrop(sender As Object, e As DragEventArgs) Handles pnldesigner.DragDrop
|
||||||
If MouseIsDown Then
|
Dim cursorPosition As Point = pnldesigner.PointToClient(Cursor.Position)
|
||||||
' Initiate dragging.
|
|
||||||
btnlabel.DoDragDrop("lbl", DragDropEffects.Copy)
|
|
||||||
End If
|
|
||||||
MouseIsDown = False
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub btntextbox_MouseMove(sender As Object, e As MouseEventArgs) Handles btntextbox.MouseMove
|
|
||||||
If MouseIsDown Then
|
|
||||||
' Initiate dragging.
|
|
||||||
btntextbox.DoDragDrop("txt", DragDropEffects.Copy)
|
|
||||||
End If
|
|
||||||
MouseIsDown = False
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub Panel2_DragDrop(sender As Object, e As System.Windows.Forms.DragEventArgs) Handles pnldesigner.DragDrop
|
|
||||||
Dim r As New Random()
|
|
||||||
Dim random As Integer = r.Next(8, 100)
|
|
||||||
Select Case e.Data.GetData(DataFormats.Text)
|
Select Case e.Data.GetData(DataFormats.Text)
|
||||||
Case "lbl"
|
Case "lbl"
|
||||||
'idxlbl += 1
|
Dim label = ClassControlCreator.CreateNewLabel(cursorPosition)
|
||||||
AddNewLabel("lbl" & random.ToString)
|
SetMovementHandlers(label)
|
||||||
|
|
||||||
|
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, label.Name, "LBL", label.Text, label.Location.X, label.Location.Y, Environment.UserName, label.Size.Height, label.Size.Width)
|
||||||
|
|
||||||
|
CURRENT_CONTROL = label
|
||||||
|
CURRENT_CONTROL.Tag = GetLastID()
|
||||||
|
|
||||||
|
pnldesigner.Controls.Add(label)
|
||||||
|
|
||||||
|
'AddNewLabel("lbl" & Random.ToString)
|
||||||
Case "txt"
|
Case "txt"
|
||||||
'idxtxt += 1
|
Dim txt = ClassControlCreator.CreateNewTextBox(cursorPosition)
|
||||||
AddNewTextbox("txt" & random)
|
SetMovementHandlers(txt)
|
||||||
|
|
||||||
|
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, txt.Name, "TXT", txt.Name, txt.Location.X, txt.Location.Y, Environment.UserName, txt.Size.Height, txt.Size.Width)
|
||||||
|
|
||||||
|
CURRENT_CONTROL = txt
|
||||||
|
CURRENT_CONTROL.Tag = GetLastID()
|
||||||
|
|
||||||
|
pnldesigner.Controls.Add(txt)
|
||||||
|
|
||||||
|
'AddNewTextbox("txt" & Random)
|
||||||
Case "cmb"
|
Case "cmb"
|
||||||
'idxcmb += 1
|
Dim cmb = ClassControlCreator.CreateNewCombobox(cursorPosition)
|
||||||
AddNewCombobox("cmb" & random)
|
SetMovementHandlers(cmb)
|
||||||
|
|
||||||
|
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, cmb.Name, "CMB", cmb.Name, cmb.Location.X, cmb.Location.Y, Environment.UserName, cmb.Size.Height, cmb.Size.Width)
|
||||||
|
|
||||||
|
CURRENT_CONTROL = cmb
|
||||||
|
CURRENT_CONTROL.Tag = GetLastID()
|
||||||
|
|
||||||
|
pnldesigner.Controls.Add(cmb)
|
||||||
|
|
||||||
|
'AddNewCombobox("cmb" & random)
|
||||||
Case "dtp"
|
Case "dtp"
|
||||||
'idxdtp += 1
|
Dim dtp = ClassControlCreator.CreateNewDatetimepicker(cursorPosition)
|
||||||
AddNewDatetimepicker("dtp" & random)
|
SetMovementHandlers(dtp)
|
||||||
Case "dgv"
|
|
||||||
'idxdgv += 1
|
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, dtp.Name, "DTP", dtp.Name, dtp.Location.X, dtp.Location.Y, Environment.UserName, dtp.Size.Height, dtp.Size.Width)
|
||||||
AddNewDGV("dgv" & random)
|
|
||||||
|
CURRENT_CONTROL = dtp
|
||||||
|
CURRENT_CONTROL.Tag = GetLastID()
|
||||||
|
|
||||||
|
pnldesigner.Controls.Add(dtp)
|
||||||
|
|
||||||
|
'AddNewDatetimepicker("dtp" & random)
|
||||||
Case "chk"
|
Case "chk"
|
||||||
' idxchk += 1
|
Dim chk = ClassControlCreator.CreateNewCheckbox(cursorPosition)
|
||||||
AddNewCheckbox("chk" & random)
|
SetMovementHandlers(chk)
|
||||||
|
|
||||||
|
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, chk.Name, "CHK", chk.Text, chk.Location.X, chk.Location.Y, Environment.UserName, chk.Size.Height, chk.Size.Width)
|
||||||
|
|
||||||
|
CURRENT_CONTROL = chk
|
||||||
|
CURRENT_CONTROL.Tag = GetLastID()
|
||||||
|
|
||||||
|
pnldesigner.Controls.Add(chk)
|
||||||
|
|
||||||
|
'AddNewCheckbox("chk" & random)
|
||||||
|
Case "dgv"
|
||||||
|
Dim dgv = ClassControlCreator.CreateNewDatagridview(cursorPosition)
|
||||||
|
SetMovementHandlers(dgv)
|
||||||
|
|
||||||
|
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, dgv.Name, "DGV", dgv.Name, dgv.Location.X, dgv.Location.Y, Environment.UserName, dgv.Size.Height, dgv.Size.Width)
|
||||||
|
|
||||||
|
CURRENT_CONTROL = dgv
|
||||||
|
CURRENT_CONTROL.Tag = GetLastID()
|
||||||
|
|
||||||
|
pnldesigner.Controls.Add(dgv)
|
||||||
|
|
||||||
|
'AddNewDGV("dgv" & random)
|
||||||
Case "tb"
|
Case "tb"
|
||||||
AddNewTable("tb" & random)
|
Dim tb = ClassControlCreator.CreateNewTable(cursorPosition)
|
||||||
|
|
||||||
|
SetMovementHandlers(tb)
|
||||||
|
AddHandler tb.ColumnHeaderMouseClick, AddressOf table_ColumnHeaderMouseClick
|
||||||
|
|
||||||
|
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, tb.Name, "TABLE", tb.Name, tb.Location.X, tb.Location.Y, Environment.UserName, tb.Size.Height, tb.Size.Width)
|
||||||
|
|
||||||
|
CURRENT_CONTROL = tb
|
||||||
|
CURRENT_CONTROL.Tag = GetLastID()
|
||||||
|
|
||||||
|
TBPM_CONTROL_TABLETableAdapter.Insert(CURRENT_CONTROL.Tag, "column1", "Column1", 95, Environment.UserName)
|
||||||
|
TBPM_CONTROL_TABLETableAdapter.Insert(CURRENT_CONTROL.Tag, "column2", "Column2", 95, Environment.UserName)
|
||||||
|
|
||||||
|
pnldesigner.Controls.Add(tb)
|
||||||
|
|
||||||
|
'AddNewTable("tb" & Random)
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub Panel2_DragEnter(sender As System.Object, e As System.Windows.Forms.DragEventArgs) Handles pnldesigner.DragEnter
|
Private Sub pnlDesigner_DragEnter(sender As System.Object, e As System.Windows.Forms.DragEventArgs) Handles pnldesigner.DragEnter
|
||||||
' Check the format of the data being dropped.
|
' Check the format of the data being dropped.
|
||||||
If (e.Data.GetDataPresent(DataFormats.Text)) Then
|
If (e.Data.GetDataPresent(DataFormats.Text)) Then
|
||||||
' Display the copy cursor.
|
' Display the copy cursor.
|
||||||
@@ -364,34 +430,34 @@ Public Class frmFormDesigner
|
|||||||
Return 0
|
Return 0
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
Function AddNewLabel(lblname As String)
|
'Function AddNewLabel(lblname As String)
|
||||||
Try
|
' Try
|
||||||
Dim lbl As New Label
|
' Dim lbl As New Label
|
||||||
lbl.Name = lblname
|
' lbl.Name = lblname
|
||||||
lbl.Text = "Bez. definieren"
|
' lbl.Text = "Bez. definieren"
|
||||||
lbl.AutoSize = True
|
' lbl.AutoSize = True
|
||||||
Dim clientPosition As Point = pnldesigner.PointToClient(Cursor.Position)
|
' Dim clientPosition As Point = pnldesigner.PointToClient(Cursor.Position)
|
||||||
lbl.Location = New Point(clientPosition)
|
' lbl.Location = New Point(clientPosition)
|
||||||
pnldesigner.Controls.Add(lbl)
|
' pnldesigner.Controls.Add(lbl)
|
||||||
CURRENT_CONTROL = lbl
|
' CURRENT_CONTROL = lbl
|
||||||
|
|
||||||
SetMovementHandlers(lbl)
|
' SetMovementHandlers(lbl)
|
||||||
|
|
||||||
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, lbl.Name, "LBL", lblname, lbl.Location.X, lbl.Location.Y, Environment.UserName, 16, 200)
|
' TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, lbl.Name, "LBL", lblname, lbl.Location.X, lbl.Location.Y, Environment.UserName, 16, 200)
|
||||||
CURRENT_CONTROL.Tag = GetLastID()
|
' CURRENT_CONTROL.Tag = GetLastID()
|
||||||
'Load_Control()
|
' 'Load_Control()
|
||||||
btnsave.Visible = True
|
' btnsave.Visible = True
|
||||||
Catch ex As Exception
|
' Catch ex As Exception
|
||||||
MsgBox("Fehler bei Anlegen Label: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
' MsgBox("Fehler bei Anlegen Label: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
End Try
|
' End Try
|
||||||
End Function
|
'End Function
|
||||||
Function AddExistingLabel(lbl As Label, text As String)
|
'Function AddExistingLabel(lbl As Label, text As String)
|
||||||
lbl.Text = text
|
' lbl.Text = text
|
||||||
lbl.AutoSize = True
|
' lbl.AutoSize = True
|
||||||
|
|
||||||
pnldesigner.Controls.Add(lbl)
|
' pnldesigner.Controls.Add(lbl)
|
||||||
SetMovementHandlers(lbl)
|
' SetMovementHandlers(lbl)
|
||||||
End Function
|
'End Function
|
||||||
|
|
||||||
Private Function GetLastID()
|
Private Function GetLastID()
|
||||||
Dim sql = String.Format("SELECT MAX(GUID) FROM TBPM_PROFILE_CONTROLS WHERE PROFIL_ID = {0}", CURRENT_ProfilGUID)
|
Dim sql = String.Format("SELECT MAX(GUID) FROM TBPM_PROFILE_CONTROLS WHERE PROFIL_ID = {0}", CURRENT_ProfilGUID)
|
||||||
@@ -902,6 +968,7 @@ Public Class frmFormDesigner
|
|||||||
Private Sub btndelete_Click(sender As System.Object, e As EventArgs) Handles btndelete.Click
|
Private Sub btndelete_Click(sender As System.Object, e As EventArgs) Handles btndelete.Click
|
||||||
If CURRENT_CONTROL Is Nothing = False Then
|
If CURRENT_CONTROL Is Nothing = False Then
|
||||||
delete_Control(CURRENT_CONTROL.Name)
|
delete_Control(CURRENT_CONTROL.Name)
|
||||||
|
TabControlEigenschaften.Enabled = False
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -1068,22 +1135,25 @@ Public Class frmFormDesigner
|
|||||||
Private Sub OnControl_MouseDown(sender As Control, e As MouseEventArgs)
|
Private Sub OnControl_MouseDown(sender As Control, e As MouseEventArgs)
|
||||||
If e.Button = MouseButtons.Left Then
|
If e.Button = MouseButtons.Left Then
|
||||||
CURRENT_CONTROL = sender
|
CURRENT_CONTROL = sender
|
||||||
BeginLocation = e.Location
|
Mouse_BeginLocation = e.Location
|
||||||
sender.BringToFront()
|
sender.BringToFront()
|
||||||
MouseMoving = True
|
|
||||||
|
Mouse_IsPressed = True
|
||||||
|
|
||||||
Console.WriteLine("CURRENT_CONTROL:" & CURRENT_CONTROL.Name)
|
Console.WriteLine("CURRENT_CONTROL:" & CURRENT_CONTROL.Name)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OnControl_MouseUp(sender As Control, e As MouseEventArgs)
|
Private Sub OnControl_MouseUp(sender As Control, e As MouseEventArgs)
|
||||||
If MouseMoving Then
|
Mouse_IsPressed = False
|
||||||
MouseMoving = False
|
|
||||||
EndLocation = e.Location
|
|
||||||
|
|
||||||
Dim CurrentPosition As Point = DirectCast(pgControls.SelectedObject, BaseProperties).Location
|
If Mouse_IsMoving Then
|
||||||
|
Mouse_IsMoving = False
|
||||||
|
|
||||||
If Point.op_Inequality(CurrentPosition, EndLocation) Then
|
Dim CurrentPosition = CURRENT_CONTROL.Location
|
||||||
|
Dim OldPosition As Point = DirectCast(pgControls.SelectedObject, BaseProperties).Location
|
||||||
|
|
||||||
|
If Point.op_Inequality(CurrentPosition, OldPosition) Then
|
||||||
DirectCast(pgControls.SelectedObject, BaseProperties).Location = CURRENT_CONTROL.Location
|
DirectCast(pgControls.SelectedObject, BaseProperties).Location = CURRENT_CONTROL.Location
|
||||||
|
|
||||||
UpdateSingleValue("X_LOC", CURRENT_CONTROL.Location.X)
|
UpdateSingleValue("X_LOC", CURRENT_CONTROL.Location.X)
|
||||||
@@ -1100,18 +1170,21 @@ Public Class frmFormDesigner
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If MouseMoving Then
|
Mouse_IsMoving = True
|
||||||
|
Console.WriteLine("Mouse Moving!")
|
||||||
|
|
||||||
|
If Mouse_IsPressed Then
|
||||||
Cursor = Cursors.Hand
|
Cursor = Cursors.Hand
|
||||||
Refresh()
|
Refresh()
|
||||||
|
|
||||||
Dim CurrentPosition As Point = GetCursorPosition()
|
Dim CurrentPosition As Point = GetCursorPosition()
|
||||||
|
|
||||||
If Point.op_Inequality(CurrentPosition, BeginLocation) Then
|
If Point.op_Inequality(CurrentPosition, Mouse_BeginLocation) Then
|
||||||
CURRENT_CONTROL.Location = New Point(CurrentPosition.X - BeginLocation.X, CurrentPosition.Y - BeginLocation.Y)
|
CURRENT_CONTROL.Location = New Point(CurrentPosition.X - Mouse_BeginLocation.X, CurrentPosition.Y - Mouse_BeginLocation.Y)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MouseMoving = False
|
Mouse_IsMoving = False
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -1165,9 +1238,17 @@ Public Class frmFormDesigner
|
|||||||
Private Sub OnControl_Click(sender As Control, e As MouseEventArgs)
|
Private Sub OnControl_Click(sender As Control, e As MouseEventArgs)
|
||||||
Dim props
|
Dim props
|
||||||
Dim dt As DataTable = DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS
|
Dim dt As DataTable = DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS
|
||||||
Dim row = dt.AsEnumerable().Where(Function(r As DataRow)
|
Dim row As DataRow
|
||||||
Return r.Item("GUID") = sender.Tag
|
|
||||||
End Function).Single()
|
TabControlEigenschaften.Enabled = True
|
||||||
|
|
||||||
|
' Beim Laden der Eigenschaften eines Controls muss die ganze Datatable neu geladen werden
|
||||||
|
' Nicht wirklich, aber gibt gerade keine bessere Möglichkeit, ohne alle SQL Abfragen selbst auszuführen
|
||||||
|
TBPM_PROFILE_CONTROLSTableAdapter.FillByProfil(DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS, CURRENT_ProfilGUID)
|
||||||
|
|
||||||
|
row = dt.AsEnumerable().Where(Function(r As DataRow)
|
||||||
|
Return r.Item("GUID") = sender.Tag
|
||||||
|
End Function).Single()
|
||||||
|
|
||||||
' Globale Variablen setzen
|
' Globale Variablen setzen
|
||||||
CURRENT_CONTROL = sender
|
CURRENT_CONTROL = sender
|
||||||
@@ -1321,12 +1402,12 @@ Public Class frmFormDesigner
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Try
|
Try
|
||||||
ClassDatabase.Execute_non_Query($"UPDATE TBPM_PROFILE_CONTROLS SET {columnName} = {escapedValue} WHERE GUID = {guid}")
|
ClassDatabase.Execute_non_Query($"UPDATE TBPM_PROFILE_CONTROLS SET {columnName} = {escapedValue}, CHANGED_WHO = '{Environment.UserName}' WHERE GUID = {guid}")
|
||||||
|
|
||||||
tslblAenderungen.Visible = True
|
tslblAenderungen.Visible = True
|
||||||
tslblAenderungen.Text = "Änderungen gespeichert - " & Now
|
tslblAenderungen.Text = "Änderungen gespeichert - " & Now
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Dim msg = $"Fehler beim Speichern von Control (Id: {guid}): {vbCrLf}{ex.Message}"
|
Dim msg = $"UpdateSingleValue - Fehler beim Speichern von Control (Id: {guid}): {vbCrLf}{ex.Message}"
|
||||||
MsgBox(msg)
|
MsgBox(msg)
|
||||||
ClassLogger.Add(msg)
|
ClassLogger.Add(msg)
|
||||||
End Try
|
End Try
|
||||||
|
|||||||
Reference in New Issue
Block a user