From f83d5aea45eb33fced4e6dcbaf3506e3796df9ef Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 3 Apr 2018 14:51:35 +0200 Subject: [PATCH] jj: Neues Control Linie, form Designer entschlacken --- app/DD_PM_WINDREAM/ClassControlCreator.vb | 80 +- app/DD_PM_WINDREAM/ModuleControlProperties.vb | 23 +- .../frmFormDesigner.Designer.vb | 556 +------- app/DD_PM_WINDREAM/frmFormDesigner.resx | 27 +- app/DD_PM_WINDREAM/frmFormDesigner.vb | 1116 ++++------------- app/DD_PM_WINDREAM/frmProfileDesigner.vb | 5 + app/DD_PM_WINDREAM/frmValidator.Designer.vb | 3 +- app/DD_PM_WINDREAM/frmValidator.vb | 6 +- 8 files changed, 372 insertions(+), 1444 deletions(-) diff --git a/app/DD_PM_WINDREAM/ClassControlCreator.vb b/app/DD_PM_WINDREAM/ClassControlCreator.vb index ecb081c..7b14251 100644 --- a/app/DD_PM_WINDREAM/ClassControlCreator.vb +++ b/app/DD_PM_WINDREAM/ClassControlCreator.vb @@ -15,13 +15,14 @@ Public Class ClassControlCreator Private Const DEFAULT_HEIGHT As Integer = 20 Private Const DEFAULT_HEIGHT_TABLE As Integer = 150 - 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" + Public Const PREFIX_TEXTBOX = "TXT" + Public Const PREFIX_LABEL = "LBL" + Public Const PREFIX_CHECKBOX = "CHK" + Public Const PREFIX_COMBOBOX = "CMB" + Public Const PREFIX_DATETIMEPICKER = "DTP" + Public Const PREFIX_DATAGRIDVIEW = "DGV" + Public Const PREFIX_TABLE = "TB" + Public Const PREFIX_LINE = "LINE" ''' ''' Standard Eigenschaften für alle Controls @@ -57,7 +58,7 @@ Public Class ClassControlCreator } End Function - Public Shared Function CreateBaseControl(ctrl As Control, row As DataRow) As Control + Public Shared Function CreateBaseControl(ctrl As Control, row As DataRow, designMode As Boolean) As Control Dim props As ControlDBProps = TransformDataRow(row) ctrl.Tag = props.Guid @@ -66,6 +67,10 @@ Public Class ClassControlCreator ctrl.Font = props.Font ctrl.ForeColor = props.Color + If designMode Then + ctrl.Cursor = Cursors.Hand + End If + Return ctrl End Function @@ -155,6 +160,7 @@ Public Class ClassControlCreator .Name = $"{PREFIX_TABLE}_{clsTools.ShortGUID}", .Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT_TABLE), .Cursor = Cursors.Hand, + .Location = location, .AllowUserToAddRows = False, .AllowUserToDeleteRows = False, .AllowUserToResizeColumns = False, @@ -174,13 +180,22 @@ Public Class ClassControlCreator Return control End Function + Public Shared Function CreateNewLine(location As Point) As LineLabel + Dim control As New LineLabel With { + .Name = $"{PREFIX_LINE}_{clsTools.ShortGUID}", + .Text = "---------------------------------", + .Location = location + } + + Return control + End Function + ' ----------------------- EXISITING CONTROLS ----------------------- Public Shared Function CreateExistingTextbox(row As DataRow, designMode As Boolean) As TextBox - Dim control As TextBox = CreateBaseControl(New TextBox(), row) + Dim control As TextBox = CreateBaseControl(New TextBox(), row, designMode) control.BackColor = Color.White - control.Cursor = Cursors.Hand If row.Item("HEIGHT") > 27 Then control.Multiline = True @@ -202,19 +217,17 @@ Public Class ClassControlCreator End Function Public Shared Function CreateExistingLabel(row As DataRow, designMode As Boolean) As Label - Dim control As Label = CreateBaseControl(New Label(), row) + Dim control As Label = CreateBaseControl(New Label(), row, designMode) control.Text = row.Item("CTRL_TEXT") control.AutoSize = True - control.Cursor = Cursors.Hand Return control End Function Public Shared Function CreateExistingCombobox(row As DataRow, designMode As Boolean) As ComboBox - Dim control As ComboBox = CreateBaseControl(New ComboBox(), row) + Dim control As ComboBox = CreateBaseControl(New ComboBox(), row, designMode) - control.Cursor = Cursors.Hand control.Size = New Size(row.Item("WIDTH"), row.Item("HEIGHT")) If Not designMode Then @@ -230,9 +243,8 @@ Public Class ClassControlCreator End Function Public Shared Function CreateExistingDatepicker(row As DataRow, designMode As Boolean) As DateTimePicker - Dim control As DateTimePicker = CreateBaseControl(New DateTimePicker(), row) + Dim control As DateTimePicker = CreateBaseControl(New DateTimePicker(), row, designMode) - control.Cursor = Cursors.Hand control.Size = New Size(row.Item("WIDTH"), row.Item("HEIGHT")) control.Format = DateTimePickerFormat.Short @@ -245,20 +257,18 @@ Public Class ClassControlCreator End Function Public Shared Function CreateExisingCheckbox(row As DataRow, designMode As Boolean) As CheckBox - Dim control As CheckBox = CreateBaseControl(New CheckBox(), row) + Dim control As CheckBox = CreateBaseControl(New CheckBox(), row, designMode) control.AutoSize = True control.Text = row.Item("CTRL_TEXT") - control.Cursor = Cursors.Hand Return control End Function Public Shared Function CreateExistingDataGridView(row As DataRow, designMode As Boolean) As DataGridView - Dim control As DataGridView = CreateBaseControl(New DataGridView(), row) + Dim control As DataGridView = CreateBaseControl(New DataGridView(), row, designMode) control.Size = New Size(row.Item("WIDTH"), row.Item("HEIGHT")) - control.Cursor = Cursors.Hand control.AllowUserToAddRows = False control.AllowUserToDeleteRows = False control.AllowUserToResizeColumns = False @@ -275,10 +285,9 @@ Public Class ClassControlCreator End Function Public Shared Function CreateExistingTable(row As DataRow, columns As List(Of DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow), designMode As Boolean) As DataGridView - Dim control As DataGridView = CreateBaseControl(New DataGridView(), row) + Dim control As DataGridView = CreateBaseControl(New DataGridView(), row, designMode) control.Size = New Size(row.Item("WIDTH"), row.Item("HEIGHT")) - control.Cursor = Cursors.Hand control.AllowUserToAddRows = False control.AllowUserToDeleteRows = False control.AllowUserToResizeColumns = False @@ -297,4 +306,31 @@ Public Class ClassControlCreator Return control End Function + Public Shared Function CreateExistingLine(row As DataRow, designMode As Boolean) As LineLabel + Dim control As LineLabel = CreateBaseControl(New LineLabel(), row, designMode) + control.Text = "------------------------------" + control.BorderStyle = BorderStyle.None + control.AutoSize = False + control.BackColor = IntToColor(NotNull(row.Item("FONT_COLOR"), DEFAULT_COLOR)) + control.Size = New Size(row.Item("WIDTH"), row.Item("HEIGHT")) + + Return control + End Function + + + ' ----------------------- CUSTOM LABEL/LINE CLASS ----------------------- + + Public Class LineLabel + Inherits Label + + Protected Overrides Sub OnPaint(e As PaintEventArgs) + 'MyBase.OnPaint(e) + + Dim size As New Size(e.ClipRectangle.Width, 2) + Dim rect As New Rectangle(New Point(0, 0), size) + + 'ControlPaint.DrawBorder(e.Graphics, rect, Me.ForeColor, ButtonBorderStyle.Solid) + e.Graphics.DrawLine(New Pen(ForeColor, 100), New Point(0, 0), New Point(e.ClipRectangle.Width, 2)) + End Sub + End Class End Class diff --git a/app/DD_PM_WINDREAM/ModuleControlProperties.vb b/app/DD_PM_WINDREAM/ModuleControlProperties.vb index 927efe9..61f51b2 100644 --- a/app/DD_PM_WINDREAM/ModuleControlProperties.vb +++ b/app/DD_PM_WINDREAM/ModuleControlProperties.vb @@ -77,13 +77,21 @@ Public Module ModuleControlProperties Return _size End Get Set(value As Size) + If (value.Height <= 0) Then + value.Height = 1 + End If + + If (value.Width <= 20) Then + value.Width = 20 + End If + _size = value End Set End Property - Public Property Font As Font + Public Overridable Property Font As Font Get Return _font End Get @@ -350,4 +358,17 @@ Public Module ModuleControlProperties Public Class GridViewProperties Inherits InputProperties End Class + + Public Class LineLabelProperties + Inherits BaseProperties + + + Public Overrides Property Font As Font + Get + Return Nothing + End Get + Set(value As Font) + End Set + End Property + End Class End Module diff --git a/app/DD_PM_WINDREAM/frmFormDesigner.Designer.vb b/app/DD_PM_WINDREAM/frmFormDesigner.Designer.vb index 4b16540..f62360b 100644 --- a/app/DD_PM_WINDREAM/frmFormDesigner.Designer.vb +++ b/app/DD_PM_WINDREAM/frmFormDesigner.Designer.vb @@ -1,9 +1,9 @@ - _ + Partial Class frmFormDesigner Inherits System.Windows.Forms.Form 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. - _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then @@ -20,15 +20,12 @@ Partial Class frmFormDesigner 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich. 'Das Bearbeiten ist mit dem Windows Form-Designer möglich. 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. - _ + Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() - Dim CHANGED_WHOLabel As System.Windows.Forms.Label - Dim CHANGED_WHENLabel As System.Windows.Forms.Label Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmFormDesigner)) - Me.Panel1 = New System.Windows.Forms.Panel() - Me.lblDesign = New System.Windows.Forms.Label() Me.GroupBox1 = New System.Windows.Forms.GroupBox() + Me.btnLine = New System.Windows.Forms.Button() Me.btnTabelle = New System.Windows.Forms.Button() Me.btnCheckbox = New System.Windows.Forms.Button() Me.btnVektor = New System.Windows.Forms.Button() @@ -39,7 +36,6 @@ Partial Class frmFormDesigner Me.pnldesigner = New System.Windows.Forms.Panel() Me.Label1 = New System.Windows.Forms.Label() Me.lblhintergrund = New System.Windows.Forms.Label() - Me.gbxControl = New System.Windows.Forms.GroupBox() Me.TabControlEigenschaften = New System.Windows.Forms.TabControl() Me.pageProperties = New System.Windows.Forms.TabPage() Me.pgControls = New System.Windows.Forms.PropertyGrid() @@ -50,40 +46,12 @@ Partial Class frmFormDesigner Me.Label2 = New System.Windows.Forms.Label() Me.btnwidth_minus = New System.Windows.Forms.Button() Me.btnwidth_plus = New System.Windows.Forms.Button() - Me.pageSQL = New System.Windows.Forms.TabPage() - Me.pnlAuswahlliste = New System.Windows.Forms.Panel() - Me.btnEditor = New System.Windows.Forms.Button() - Me.btnShowConnections = New System.Windows.Forms.Button() - Me.SQL_CommandTextBox = New System.Windows.Forms.TextBox() Me.TBPM_PROFILE_CONTROLSBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.DD_DMSLiteDataSet = New DD_PM_WINDREAM.DD_DMSLiteDataSet() - Me.Label5 = New System.Windows.Forms.Label() - Me.Label4 = New System.Windows.Forms.Label() - Me.cmbConnection = New System.Windows.Forms.ComboBox() Me.TBPM_CONNECTIONBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.pagePropertiesOld = New System.Windows.Forms.TabPage() - Me.LOAD_IDX_VALUECheckBox = New System.Windows.Forms.CheckBox() - Me.READ_ONLYCheckBox = New System.Windows.Forms.CheckBox() - Me.INDEX_NAME_VALUE = New System.Windows.Forms.TextBox() - Me.rbVektor = New System.Windows.Forms.RadioButton() - Me.rbIndex = New System.Windows.Forms.RadioButton() - Me.lblCtrlName = New System.Windows.Forms.Label() - Me.CHOICE_LISTTextBox = New System.Windows.Forms.TextBox() - Me.lblBeschriftung = New System.Windows.Forms.Label() - Me.VALIDATIONCheckBox = New System.Windows.Forms.CheckBox() - Me.lblIndex = New System.Windows.Forms.Label() - Me.CTRL_TEXTTextBox = New System.Windows.Forms.TextBox() - Me.cmbIndex = New System.Windows.Forms.ComboBox() - Me.NAMETextBox = New System.Windows.Forms.TextBox() - Me.CheckBoxAuswahlliste = New System.Windows.Forms.CheckBox() - Me.lblAuswahlliste = New System.Windows.Forms.Label() - Me.INDEX_NAMETextBox = New System.Windows.Forms.TextBox() Me.btndelete = New System.Windows.Forms.Button() - Me.btnsave = New System.Windows.Forms.Button() - Me.CHANGED_WHOTextBox = New System.Windows.Forms.TextBox() Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() Me.tslblAenderungen = New System.Windows.Forms.ToolStripStatusLabel() - Me.CHANGED_WHENTextBox = New System.Windows.Forms.TextBox() Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components) Me.btnrefresh = New System.Windows.Forms.Button() Me.TBPM_PROFILE_CONTROLSTableAdapter = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBPM_PROFILE_CONTROLSTableAdapter() @@ -93,70 +61,24 @@ Partial Class frmFormDesigner Me.TBWH_CHECK_PROFILE_CONTROLSTableAdapter = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBWH_CHECK_PROFILE_CONTROLSTableAdapter() Me.TBPM_CONTROL_TABLEBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.TBPM_CONTROL_TABLETableAdapter = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBPM_CONTROL_TABLETableAdapter() - CHANGED_WHOLabel = New System.Windows.Forms.Label() - CHANGED_WHENLabel = New System.Windows.Forms.Label() - Me.Panel1.SuspendLayout() Me.GroupBox1.SuspendLayout() Me.pnldesigner.SuspendLayout() - Me.gbxControl.SuspendLayout() Me.TabControlEigenschaften.SuspendLayout() Me.pageProperties.SuspendLayout() Me.pageFormat.SuspendLayout() - Me.pageSQL.SuspendLayout() - Me.pnlAuswahlliste.SuspendLayout() CType(Me.TBPM_PROFILE_CONTROLSBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.DD_DMSLiteDataSet, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TBPM_CONNECTIONBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - Me.pagePropertiesOld.SuspendLayout() Me.StatusStrip1.SuspendLayout() CType(Me.TBWH_CHECK_PROFILE_CONTROLSBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TBPM_CONTROL_TABLEBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' - 'CHANGED_WHOLabel - ' - CHANGED_WHOLabel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - CHANGED_WHOLabel.AutoSize = True - CHANGED_WHOLabel.Location = New System.Drawing.Point(12, 499) - CHANGED_WHOLabel.Name = "CHANGED_WHOLabel" - CHANGED_WHOLabel.Size = New System.Drawing.Size(91, 16) - CHANGED_WHOLabel.TabIndex = 18 - CHANGED_WHOLabel.Text = "Changed who:" - ' - 'CHANGED_WHENLabel - ' - CHANGED_WHENLabel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - CHANGED_WHENLabel.AutoSize = True - CHANGED_WHENLabel.Location = New System.Drawing.Point(250, 499) - CHANGED_WHENLabel.Name = "CHANGED_WHENLabel" - CHANGED_WHENLabel.Size = New System.Drawing.Size(98, 16) - CHANGED_WHENLabel.TabIndex = 20 - CHANGED_WHENLabel.Text = "Changed when:" - ' - 'Panel1 - ' - Me.Panel1.Controls.Add(Me.lblDesign) - Me.Panel1.Dock = System.Windows.Forms.DockStyle.Top - Me.Panel1.Location = New System.Drawing.Point(0, 0) - Me.Panel1.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) - Me.Panel1.Name = "Panel1" - Me.Panel1.Size = New System.Drawing.Size(995, 34) - Me.Panel1.TabIndex = 1 - ' - 'lblDesign - ' - Me.lblDesign.AutoSize = True - Me.lblDesign.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblDesign.Location = New System.Drawing.Point(12, 9) - Me.lblDesign.Name = "lblDesign" - Me.lblDesign.Size = New System.Drawing.Size(50, 16) - Me.lblDesign.TabIndex = 0 - Me.lblDesign.Text = "Label2" - ' 'GroupBox1 ' Me.GroupBox1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.GroupBox1.Controls.Add(Me.btnLine) Me.GroupBox1.Controls.Add(Me.btnTabelle) Me.GroupBox1.Controls.Add(Me.btnCheckbox) Me.GroupBox1.Controls.Add(Me.btnVektor) @@ -164,14 +86,27 @@ Partial Class frmFormDesigner Me.GroupBox1.Controls.Add(Me.btncmb) Me.GroupBox1.Controls.Add(Me.btntextbox) Me.GroupBox1.Controls.Add(Me.btnlabel) - Me.GroupBox1.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.GroupBox1.Location = New System.Drawing.Point(507, 70) + Me.GroupBox1.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.GroupBox1.Location = New System.Drawing.Point(507, 12) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(476, 129) Me.GroupBox1.TabIndex = 2 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Control-Typ (Drag and Drop)" ' + 'btnLine + ' + Me.btnLine.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.btnLine.Image = CType(resources.GetObject("btnLine.Image"), System.Drawing.Image) + Me.btnLine.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft + Me.btnLine.Location = New System.Drawing.Point(290, 90) + Me.btnLine.Name = "btnLine" + Me.btnLine.Size = New System.Drawing.Size(133, 27) + Me.btnLine.TabIndex = 7 + Me.btnLine.Text = "Linie" + Me.btnLine.TextAlign = System.Drawing.ContentAlignment.MiddleRight + Me.btnLine.UseVisualStyleBackColor = True + ' 'btnTabelle ' Me.btnTabelle.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) @@ -179,7 +114,7 @@ Partial Class frmFormDesigner Me.btnTabelle.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft Me.btnTabelle.Location = New System.Drawing.Point(290, 55) Me.btnTabelle.Name = "btnTabelle" - Me.btnTabelle.Size = New System.Drawing.Size(103, 29) + Me.btnTabelle.Size = New System.Drawing.Size(133, 27) Me.btnTabelle.TabIndex = 6 Me.btnTabelle.Text = "Tabelle" Me.btnTabelle.TextAlign = System.Drawing.ContentAlignment.MiddleRight @@ -192,7 +127,7 @@ Partial Class frmFormDesigner Me.btnCheckbox.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft Me.btnCheckbox.Location = New System.Drawing.Point(151, 90) Me.btnCheckbox.Name = "btnCheckbox" - Me.btnCheckbox.Size = New System.Drawing.Size(133, 31) + Me.btnCheckbox.Size = New System.Drawing.Size(133, 27) Me.btnCheckbox.TabIndex = 5 Me.btnCheckbox.Text = "Checkbox" Me.btnCheckbox.TextAlign = System.Drawing.ContentAlignment.MiddleRight @@ -205,7 +140,7 @@ Partial Class frmFormDesigner Me.btnVektor.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft Me.btnVektor.Location = New System.Drawing.Point(151, 55) Me.btnVektor.Name = "btnVektor" - Me.btnVektor.Size = New System.Drawing.Size(133, 29) + Me.btnVektor.Size = New System.Drawing.Size(133, 27) Me.btnVektor.TabIndex = 4 Me.btnVektor.Text = "Mehrfach-/Vektorfeld" Me.btnVektor.TextAlign = System.Drawing.ContentAlignment.MiddleRight @@ -231,7 +166,7 @@ Partial Class frmFormDesigner Me.btncmb.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft Me.btncmb.Location = New System.Drawing.Point(12, 90) Me.btncmb.Name = "btncmb" - Me.btncmb.Size = New System.Drawing.Size(133, 31) + Me.btncmb.Size = New System.Drawing.Size(133, 27) Me.btncmb.TabIndex = 2 Me.btncmb.Text = "Combobox" Me.btncmb.TextAlign = System.Drawing.ContentAlignment.MiddleRight @@ -244,7 +179,7 @@ Partial Class frmFormDesigner Me.btntextbox.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft Me.btntextbox.Location = New System.Drawing.Point(13, 55) Me.btntextbox.Name = "btntextbox" - Me.btntextbox.Size = New System.Drawing.Size(133, 29) + Me.btntextbox.Size = New System.Drawing.Size(133, 27) Me.btntextbox.TabIndex = 1 Me.btntextbox.Text = "Textbox" Me.btntextbox.TextAlign = System.Drawing.ContentAlignment.MiddleRight @@ -272,9 +207,9 @@ Partial Class frmFormDesigner Me.pnldesigner.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.pnldesigner.Controls.Add(Me.Label1) Me.pnldesigner.Controls.Add(Me.lblhintergrund) - Me.pnldesigner.Location = New System.Drawing.Point(15, 72) + Me.pnldesigner.Location = New System.Drawing.Point(15, 12) Me.pnldesigner.Name = "pnldesigner" - Me.pnldesigner.Size = New System.Drawing.Size(481, 337) + Me.pnldesigner.Size = New System.Drawing.Size(481, 525) Me.pnldesigner.TabIndex = 3 ' 'Label1 @@ -298,22 +233,6 @@ Partial Class frmFormDesigner Me.lblhintergrund.TabIndex = 1 Me.lblhintergrund.Text = "Validierungsbereich" ' - 'gbxControl - ' - Me.gbxControl.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ - Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.gbxControl.Controls.Add(Me.TabControlEigenschaften) - Me.gbxControl.Controls.Add(Me.btndelete) - Me.gbxControl.Controls.Add(Me.btnsave) - Me.gbxControl.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.gbxControl.Location = New System.Drawing.Point(507, 205) - Me.gbxControl.Name = "gbxControl" - Me.gbxControl.Size = New System.Drawing.Size(476, 332) - Me.gbxControl.TabIndex = 4 - Me.gbxControl.TabStop = False - Me.gbxControl.Text = "Controleigenschaften:" - ' 'TabControlEigenschaften ' Me.TabControlEigenschaften.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ @@ -321,13 +240,11 @@ Partial Class frmFormDesigner Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.TabControlEigenschaften.Controls.Add(Me.pageProperties) Me.TabControlEigenschaften.Controls.Add(Me.pageFormat) - Me.TabControlEigenschaften.Controls.Add(Me.pageSQL) - 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(507, 147) Me.TabControlEigenschaften.Name = "TabControlEigenschaften" Me.TabControlEigenschaften.SelectedIndex = 0 - Me.TabControlEigenschaften.Size = New System.Drawing.Size(455, 263) + Me.TabControlEigenschaften.Size = New System.Drawing.Size(476, 361) Me.TabControlEigenschaften.TabIndex = 22 ' 'pageProperties @@ -336,7 +253,7 @@ Partial Class frmFormDesigner Me.pageProperties.Location = New System.Drawing.Point(4, 25) Me.pageProperties.Name = "pageProperties" Me.pageProperties.Padding = New System.Windows.Forms.Padding(3) - Me.pageProperties.Size = New System.Drawing.Size(447, 234) + Me.pageProperties.Size = New System.Drawing.Size(468, 332) Me.pageProperties.TabIndex = 3 Me.pageProperties.Text = "Eigenschaften" Me.pageProperties.UseVisualStyleBackColor = True @@ -347,7 +264,7 @@ Partial Class frmFormDesigner Me.pgControls.HelpVisible = False Me.pgControls.Location = New System.Drawing.Point(3, 3) Me.pgControls.Name = "pgControls" - Me.pgControls.Size = New System.Drawing.Size(441, 228) + Me.pgControls.Size = New System.Drawing.Size(462, 326) Me.pgControls.TabIndex = 0 ' 'pageFormat @@ -362,7 +279,7 @@ Partial Class frmFormDesigner Me.pageFormat.Location = New System.Drawing.Point(4, 25) Me.pageFormat.Name = "pageFormat" Me.pageFormat.Padding = New System.Windows.Forms.Padding(3) - Me.pageFormat.Size = New System.Drawing.Size(447, 234) + Me.pageFormat.Size = New System.Drawing.Size(468, 332) Me.pageFormat.TabIndex = 1 Me.pageFormat.Text = "Format" Me.pageFormat.UseVisualStyleBackColor = True @@ -437,72 +354,6 @@ Partial Class frmFormDesigner Me.btnwidth_plus.TextAlign = System.Drawing.ContentAlignment.MiddleRight Me.btnwidth_plus.UseVisualStyleBackColor = True ' - 'pageSQL - ' - Me.pageSQL.Controls.Add(Me.pnlAuswahlliste) - Me.pageSQL.Location = New System.Drawing.Point(4, 25) - Me.pageSQL.Name = "pageSQL" - Me.pageSQL.Padding = New System.Windows.Forms.Padding(3) - Me.pageSQL.Size = New System.Drawing.Size(447, 234) - Me.pageSQL.TabIndex = 2 - Me.pageSQL.Text = "SQL-Liste" - Me.pageSQL.UseVisualStyleBackColor = True - ' - 'pnlAuswahlliste - ' - Me.pnlAuswahlliste.AutoScroll = True - Me.pnlAuswahlliste.Controls.Add(Me.btnEditor) - Me.pnlAuswahlliste.Controls.Add(Me.btnShowConnections) - Me.pnlAuswahlliste.Controls.Add(Me.SQL_CommandTextBox) - Me.pnlAuswahlliste.Controls.Add(Me.Label5) - Me.pnlAuswahlliste.Controls.Add(Me.Label4) - Me.pnlAuswahlliste.Controls.Add(Me.cmbConnection) - Me.pnlAuswahlliste.Dock = System.Windows.Forms.DockStyle.Fill - Me.pnlAuswahlliste.Location = New System.Drawing.Point(3, 3) - Me.pnlAuswahlliste.Name = "pnlAuswahlliste" - Me.pnlAuswahlliste.Size = New System.Drawing.Size(441, 228) - Me.pnlAuswahlliste.TabIndex = 2 - ' - 'btnEditor - ' - Me.btnEditor.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - Me.btnEditor.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.btnEditor.Image = CType(resources.GetObject("btnEditor.Image"), System.Drawing.Image) - Me.btnEditor.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.btnEditor.Location = New System.Drawing.Point(6, 197) - Me.btnEditor.Name = "btnEditor" - Me.btnEditor.Size = New System.Drawing.Size(114, 28) - Me.btnEditor.TabIndex = 81 - Me.btnEditor.Text = "Editor Detail" - Me.btnEditor.TextAlign = System.Drawing.ContentAlignment.MiddleRight - Me.btnEditor.UseVisualStyleBackColor = True - ' - 'btnShowConnections - ' - Me.btnShowConnections.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.btnShowConnections.Image = Global.DD_PM_WINDREAM.My.Resources.Resources.database_go1 - Me.btnShowConnections.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.btnShowConnections.Location = New System.Drawing.Point(271, 30) - Me.btnShowConnections.Name = "btnShowConnections" - Me.btnShowConnections.Size = New System.Drawing.Size(111, 24) - Me.btnShowConnections.TabIndex = 6 - Me.btnShowConnections.Text = "Connections" - Me.btnShowConnections.TextAlign = System.Drawing.ContentAlignment.MiddleRight - Me.btnShowConnections.UseVisualStyleBackColor = True - ' - 'SQL_CommandTextBox - ' - Me.SQL_CommandTextBox.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ - Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.SQL_CommandTextBox.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.TBPM_PROFILE_CONTROLSBindingSource, "SQL_UEBERPRUEFUNG", True)) - Me.SQL_CommandTextBox.Font = New System.Drawing.Font("Courier New", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.SQL_CommandTextBox.Location = New System.Drawing.Point(5, 76) - Me.SQL_CommandTextBox.Multiline = True - Me.SQL_CommandTextBox.Name = "SQL_CommandTextBox" - Me.SQL_CommandTextBox.Size = New System.Drawing.Size(433, 115) - Me.SQL_CommandTextBox.TabIndex = 5 - ' 'TBPM_PROFILE_CONTROLSBindingSource ' Me.TBPM_PROFILE_CONTROLSBindingSource.DataMember = "TBPM_PROFILE_CONTROLS" @@ -513,266 +364,17 @@ Partial Class frmFormDesigner Me.DD_DMSLiteDataSet.DataSetName = "DD_DMSLiteDataSet" Me.DD_DMSLiteDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label5.Location = New System.Drawing.Point(3, 57) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(76, 16) - Me.Label5.TabIndex = 2 - Me.Label5.Text = "SQL-Befehl:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label4.Location = New System.Drawing.Point(3, 11) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(76, 16) - Me.Label4.TabIndex = 1 - Me.Label4.Text = "Connection:" - ' - 'cmbConnection - ' - Me.cmbConnection.DataBindings.Add(New System.Windows.Forms.Binding("SelectedValue", Me.TBPM_PROFILE_CONTROLSBindingSource, "CONNECTION_ID", True)) - Me.cmbConnection.DataSource = Me.TBPM_CONNECTIONBindingSource - Me.cmbConnection.DisplayMember = "BEZEICHNUNG" - Me.cmbConnection.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.cmbConnection.FormattingEnabled = True - Me.cmbConnection.Location = New System.Drawing.Point(5, 30) - Me.cmbConnection.Name = "cmbConnection" - Me.cmbConnection.Size = New System.Drawing.Size(260, 24) - Me.cmbConnection.TabIndex = 0 - Me.cmbConnection.ValueMember = "GUID" - ' 'TBPM_CONNECTIONBindingSource ' Me.TBPM_CONNECTIONBindingSource.DataMember = "TBPM_CONNECTION" Me.TBPM_CONNECTIONBindingSource.DataSource = Me.DD_DMSLiteDataSet ' - 'pagePropertiesOld - ' - Me.pagePropertiesOld.AutoScroll = True - Me.pagePropertiesOld.BackColor = System.Drawing.Color.White - Me.pagePropertiesOld.Controls.Add(Me.LOAD_IDX_VALUECheckBox) - Me.pagePropertiesOld.Controls.Add(Me.READ_ONLYCheckBox) - Me.pagePropertiesOld.Controls.Add(Me.INDEX_NAME_VALUE) - Me.pagePropertiesOld.Controls.Add(Me.rbVektor) - Me.pagePropertiesOld.Controls.Add(Me.rbIndex) - Me.pagePropertiesOld.Controls.Add(Me.lblCtrlName) - Me.pagePropertiesOld.Controls.Add(Me.CHOICE_LISTTextBox) - Me.pagePropertiesOld.Controls.Add(Me.lblBeschriftung) - Me.pagePropertiesOld.Controls.Add(Me.VALIDATIONCheckBox) - Me.pagePropertiesOld.Controls.Add(Me.lblIndex) - Me.pagePropertiesOld.Controls.Add(Me.CTRL_TEXTTextBox) - Me.pagePropertiesOld.Controls.Add(Me.cmbIndex) - Me.pagePropertiesOld.Controls.Add(Me.NAMETextBox) - Me.pagePropertiesOld.Controls.Add(Me.CheckBoxAuswahlliste) - Me.pagePropertiesOld.Controls.Add(Me.lblAuswahlliste) - Me.pagePropertiesOld.Controls.Add(Me.INDEX_NAMETextBox) - Me.pagePropertiesOld.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.pagePropertiesOld.Location = New System.Drawing.Point(4, 25) - Me.pagePropertiesOld.Name = "pagePropertiesOld" - Me.pagePropertiesOld.Padding = New System.Windows.Forms.Padding(3) - Me.pagePropertiesOld.Size = New System.Drawing.Size(447, 234) - Me.pagePropertiesOld.TabIndex = 0 - Me.pagePropertiesOld.Text = "Allgemein (Alt)" - ' - 'LOAD_IDX_VALUECheckBox - ' - Me.LOAD_IDX_VALUECheckBox.DataBindings.Add(New System.Windows.Forms.Binding("CheckState", Me.TBPM_PROFILE_CONTROLSBindingSource, "LOAD_IDX_VALUE", True)) - Me.LOAD_IDX_VALUECheckBox.Enabled = False - Me.LOAD_IDX_VALUECheckBox.Location = New System.Drawing.Point(6, 185) - Me.LOAD_IDX_VALUECheckBox.Name = "LOAD_IDX_VALUECheckBox" - Me.LOAD_IDX_VALUECheckBox.Size = New System.Drawing.Size(121, 24) - Me.LOAD_IDX_VALUECheckBox.TabIndex = 19 - Me.LOAD_IDX_VALUECheckBox.Text = "Lade Indexdaten" - Me.ToolTip1.SetToolTip(Me.LOAD_IDX_VALUECheckBox, "Die im zugrundeliegenden Index gepeicherten" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Daten werden nicht angezeigt") - Me.LOAD_IDX_VALUECheckBox.UseVisualStyleBackColor = True - ' - 'READ_ONLYCheckBox - ' - Me.READ_ONLYCheckBox.DataBindings.Add(New System.Windows.Forms.Binding("CheckState", Me.TBPM_PROFILE_CONTROLSBindingSource, "READ_ONLY", True)) - Me.READ_ONLYCheckBox.Enabled = False - Me.READ_ONLYCheckBox.Location = New System.Drawing.Point(6, 164) - Me.READ_ONLYCheckBox.Name = "READ_ONLYCheckBox" - Me.READ_ONLYCheckBox.Size = New System.Drawing.Size(86, 24) - Me.READ_ONLYCheckBox.TabIndex = 18 - Me.READ_ONLYCheckBox.Text = "Read Only" - Me.ToolTip1.SetToolTip(Me.READ_ONLYCheckBox, "lässt keine Änderungen am Index zu") - Me.READ_ONLYCheckBox.UseVisualStyleBackColor = True - ' - 'INDEX_NAME_VALUE - ' - Me.INDEX_NAME_VALUE.BackColor = System.Drawing.Color.White - Me.INDEX_NAME_VALUE.BorderStyle = System.Windows.Forms.BorderStyle.None - Me.INDEX_NAME_VALUE.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.TBPM_PROFILE_CONTROLSBindingSource, "INDEX_NAME", True)) - Me.INDEX_NAME_VALUE.Enabled = False - Me.INDEX_NAME_VALUE.ForeColor = System.Drawing.Color.White - Me.INDEX_NAME_VALUE.Location = New System.Drawing.Point(334, 142) - Me.INDEX_NAME_VALUE.Name = "INDEX_NAME_VALUE" - Me.INDEX_NAME_VALUE.ReadOnly = True - Me.INDEX_NAME_VALUE.Size = New System.Drawing.Size(51, 16) - Me.INDEX_NAME_VALUE.TabIndex = 17 - Me.INDEX_NAME_VALUE.TabStop = False - ' - 'rbVektor - ' - Me.rbVektor.AutoSize = True - Me.rbVektor.Enabled = False - Me.rbVektor.Location = New System.Drawing.Point(174, 52) - Me.rbVektor.Name = "rbVektor" - Me.rbVektor.Size = New System.Drawing.Size(225, 20) - Me.rbVektor.TabIndex = 15 - Me.rbVektor.TabStop = True - Me.rbVektor.Text = "Benutze Vektor-Feld für Metadaten" - Me.rbVektor.UseVisualStyleBackColor = True - Me.rbVektor.Visible = False - ' - 'rbIndex - ' - Me.rbIndex.AutoSize = True - Me.rbIndex.Enabled = False - Me.rbIndex.Location = New System.Drawing.Point(9, 52) - Me.rbIndex.Name = "rbIndex" - Me.rbIndex.Size = New System.Drawing.Size(159, 20) - Me.rbIndex.TabIndex = 14 - Me.rbIndex.TabStop = True - Me.rbIndex.Text = "Beschreibe Index direkt" - Me.rbIndex.UseVisualStyleBackColor = True - Me.rbIndex.Visible = False - ' - 'lblCtrlName - ' - Me.lblCtrlName.AutoSize = True - Me.lblCtrlName.Enabled = False - Me.lblCtrlName.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblCtrlName.Location = New System.Drawing.Point(6, 3) - Me.lblCtrlName.Name = "lblCtrlName" - Me.lblCtrlName.Size = New System.Drawing.Size(46, 16) - Me.lblCtrlName.TabIndex = 0 - Me.lblCtrlName.Text = "Name:" - ' - 'CHOICE_LISTTextBox - ' - Me.CHOICE_LISTTextBox.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.TBPM_PROFILE_CONTROLSBindingSource, "CHOICE_LIST", True)) - Me.CHOICE_LISTTextBox.Enabled = False - Me.CHOICE_LISTTextBox.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.CHOICE_LISTTextBox.Location = New System.Drawing.Point(174, 185) - Me.CHOICE_LISTTextBox.Name = "CHOICE_LISTTextBox" - Me.CHOICE_LISTTextBox.Size = New System.Drawing.Size(178, 23) - Me.CHOICE_LISTTextBox.TabIndex = 13 - ' - 'lblBeschriftung - ' - Me.lblBeschriftung.AutoSize = True - Me.lblBeschriftung.Enabled = False - Me.lblBeschriftung.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblBeschriftung.Location = New System.Drawing.Point(132, 4) - Me.lblBeschriftung.Name = "lblBeschriftung" - Me.lblBeschriftung.Size = New System.Drawing.Size(83, 16) - Me.lblBeschriftung.TabIndex = 2 - Me.lblBeschriftung.Text = "Beschriftung:" - Me.lblBeschriftung.Visible = False - ' - 'VALIDATIONCheckBox - ' - Me.VALIDATIONCheckBox.DataBindings.Add(New System.Windows.Forms.Binding("CheckState", Me.TBPM_PROFILE_CONTROLSBindingSource, "VALIDATION", True)) - Me.VALIDATIONCheckBox.Enabled = False - Me.VALIDATIONCheckBox.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.VALIDATIONCheckBox.Location = New System.Drawing.Point(6, 143) - Me.VALIDATIONCheckBox.Name = "VALIDATIONCheckBox" - Me.VALIDATIONCheckBox.Size = New System.Drawing.Size(144, 24) - Me.VALIDATIONCheckBox.TabIndex = 12 - Me.VALIDATIONCheckBox.Text = "Eingabe zwingend" - Me.VALIDATIONCheckBox.UseVisualStyleBackColor = True - ' - 'lblIndex - ' - Me.lblIndex.AutoSize = True - Me.lblIndex.Enabled = False - Me.lblIndex.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblIndex.Location = New System.Drawing.Point(3, 84) - Me.lblIndex.Name = "lblIndex" - Me.lblIndex.Size = New System.Drawing.Size(124, 16) - Me.lblIndex.TabIndex = 4 - Me.lblIndex.Text = "zugeordneter Index:" - Me.lblIndex.Visible = False - ' - 'CTRL_TEXTTextBox - ' - Me.CTRL_TEXTTextBox.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.TBPM_PROFILE_CONTROLSBindingSource, "CTRL_TEXT", True)) - Me.CTRL_TEXTTextBox.Enabled = False - Me.CTRL_TEXTTextBox.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.CTRL_TEXTTextBox.Location = New System.Drawing.Point(135, 23) - Me.CTRL_TEXTTextBox.Multiline = True - Me.CTRL_TEXTTextBox.Name = "CTRL_TEXTTextBox" - Me.CTRL_TEXTTextBox.Size = New System.Drawing.Size(298, 23) - Me.CTRL_TEXTTextBox.TabIndex = 11 - ' - 'cmbIndex - ' - Me.cmbIndex.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.TBPM_PROFILE_CONTROLSBindingSource, "INDEX_NAME", True)) - Me.cmbIndex.Enabled = False - Me.cmbIndex.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.cmbIndex.FormattingEnabled = True - Me.cmbIndex.Location = New System.Drawing.Point(6, 103) - Me.cmbIndex.Name = "cmbIndex" - Me.cmbIndex.Size = New System.Drawing.Size(178, 24) - Me.cmbIndex.TabIndex = 5 - Me.cmbIndex.Visible = False - ' - 'NAMETextBox - ' - Me.NAMETextBox.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.TBPM_PROFILE_CONTROLSBindingSource, "NAME", True)) - Me.NAMETextBox.Enabled = False - Me.NAMETextBox.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.NAMETextBox.Location = New System.Drawing.Point(9, 23) - Me.NAMETextBox.Name = "NAMETextBox" - Me.NAMETextBox.Size = New System.Drawing.Size(121, 23) - Me.NAMETextBox.TabIndex = 10 - ' - 'CheckBoxAuswahlliste - ' - Me.CheckBoxAuswahlliste.AutoSize = True - Me.CheckBoxAuswahlliste.Enabled = False - Me.CheckBoxAuswahlliste.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.CheckBoxAuswahlliste.Location = New System.Drawing.Point(174, 145) - Me.CheckBoxAuswahlliste.Name = "CheckBoxAuswahlliste" - Me.CheckBoxAuswahlliste.Size = New System.Drawing.Size(98, 20) - Me.CheckBoxAuswahlliste.TabIndex = 6 - Me.CheckBoxAuswahlliste.Text = "Auswahlliste" - Me.CheckBoxAuswahlliste.UseVisualStyleBackColor = True - Me.CheckBoxAuswahlliste.Visible = False - ' - 'lblAuswahlliste - ' - Me.lblAuswahlliste.AutoSize = True - Me.lblAuswahlliste.Enabled = False - Me.lblAuswahlliste.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblAuswahlliste.Location = New System.Drawing.Point(171, 167) - Me.lblAuswahlliste.Name = "lblAuswahlliste" - Me.lblAuswahlliste.Size = New System.Drawing.Size(186, 16) - Me.lblAuswahlliste.TabIndex = 7 - Me.lblAuswahlliste.Text = "Auswahllistennamen eingeben:" - Me.lblAuswahlliste.Visible = False - ' - 'INDEX_NAMETextBox - ' - Me.INDEX_NAMETextBox.Enabled = False - Me.INDEX_NAMETextBox.Location = New System.Drawing.Point(6, 103) - Me.INDEX_NAMETextBox.Name = "INDEX_NAMETextBox" - Me.INDEX_NAMETextBox.Size = New System.Drawing.Size(319, 23) - Me.INDEX_NAMETextBox.TabIndex = 16 - Me.INDEX_NAMETextBox.Visible = False - ' 'btndelete ' Me.btndelete.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.btndelete.Image = Global.DD_PM_WINDREAM.My.Resources.Resources.delete_12x12 Me.btndelete.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.btndelete.Location = New System.Drawing.Point(13, 295) + Me.btndelete.Location = New System.Drawing.Point(507, 514) Me.btndelete.Name = "btndelete" Me.btndelete.Size = New System.Drawing.Size(178, 23) Me.btndelete.TabIndex = 1 @@ -780,29 +382,6 @@ Partial Class frmFormDesigner Me.btndelete.TextAlign = System.Drawing.ContentAlignment.MiddleRight Me.btndelete.UseVisualStyleBackColor = True ' - 'btnsave - ' - Me.btnsave.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.btnsave.Image = Global.DD_PM_WINDREAM.My.Resources.Resources.save - Me.btnsave.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.btnsave.Location = New System.Drawing.Point(279, 294) - Me.btnsave.Name = "btnsave" - Me.btnsave.Size = New System.Drawing.Size(188, 24) - Me.btnsave.TabIndex = 5 - Me.btnsave.Text = "Änderungen Speichern" - Me.btnsave.TextAlign = System.Drawing.ContentAlignment.MiddleRight - Me.btnsave.UseVisualStyleBackColor = True - Me.btnsave.Visible = False - ' - 'CHANGED_WHOTextBox - ' - Me.CHANGED_WHOTextBox.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - Me.CHANGED_WHOTextBox.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.TBPM_PROFILE_CONTROLSBindingSource, "CHANGED_WHO", True)) - Me.CHANGED_WHOTextBox.Location = New System.Drawing.Point(15, 518) - Me.CHANGED_WHOTextBox.Name = "CHANGED_WHOTextBox" - Me.CHANGED_WHOTextBox.Size = New System.Drawing.Size(222, 23) - Me.CHANGED_WHOTextBox.TabIndex = 19 - ' 'StatusStrip1 ' Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tslblAenderungen}) @@ -814,28 +393,19 @@ Partial Class frmFormDesigner ' 'tslblAenderungen ' - Me.tslblAenderungen.Image = Global.DD_PM_WINDREAM.My.Resources.Resources.flag_red + Me.tslblAenderungen.Image = Global.DD_PM_WINDREAM.My.Resources.Resources.database_save Me.tslblAenderungen.Name = "tslblAenderungen" - Me.tslblAenderungen.Size = New System.Drawing.Size(153, 17) - Me.tslblAenderungen.Text = "Änderungen gespeichert" - Me.tslblAenderungen.Visible = False - ' - 'CHANGED_WHENTextBox - ' - Me.CHANGED_WHENTextBox.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - Me.CHANGED_WHENTextBox.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.TBPM_PROFILE_CONTROLSBindingSource, "CHANGED_WHEN", True)) - Me.CHANGED_WHENTextBox.Location = New System.Drawing.Point(253, 518) - Me.CHANGED_WHENTextBox.Name = "CHANGED_WHENTextBox" - Me.CHANGED_WHENTextBox.Size = New System.Drawing.Size(159, 23) - Me.CHANGED_WHENTextBox.TabIndex = 21 + Me.tslblAenderungen.Size = New System.Drawing.Size(152, 17) + Me.tslblAenderungen.Text = "Noch keine Änderungen" ' 'btnrefresh ' + Me.btnrefresh.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.btnrefresh.Image = Global.DD_PM_WINDREAM.My.Resources.Resources.arrow_refresh Me.btnrefresh.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.btnrefresh.Location = New System.Drawing.Point(415, 41) + Me.btnrefresh.Location = New System.Drawing.Point(828, 514) Me.btnrefresh.Name = "btnrefresh" - Me.btnrefresh.Size = New System.Drawing.Size(81, 23) + Me.btnrefresh.Size = New System.Drawing.Size(155, 23) Me.btnrefresh.TabIndex = 24 Me.btnrefresh.Text = "Refresh" Me.btnrefresh.TextAlign = System.Drawing.ContentAlignment.MiddleRight @@ -889,13 +459,9 @@ Partial Class frmFormDesigner Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(995, 578) Me.Controls.Add(Me.btnrefresh) - Me.Controls.Add(CHANGED_WHENLabel) - Me.Controls.Add(Me.CHANGED_WHENTextBox) Me.Controls.Add(Me.StatusStrip1) - Me.Controls.Add(CHANGED_WHOLabel) - Me.Controls.Add(Me.CHANGED_WHOTextBox) - Me.Controls.Add(Me.gbxControl) - Me.Controls.Add(Me.Panel1) + Me.Controls.Add(Me.btndelete) + Me.Controls.Add(Me.TabControlEigenschaften) Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.pnldesigner) Me.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) @@ -905,24 +471,16 @@ Partial Class frmFormDesigner Me.MinimizeBox = False Me.Name = "frmFormDesigner" Me.Text = "Validation-Designer" - Me.Panel1.ResumeLayout(False) - Me.Panel1.PerformLayout() Me.GroupBox1.ResumeLayout(False) Me.pnldesigner.ResumeLayout(False) Me.pnldesigner.PerformLayout() - Me.gbxControl.ResumeLayout(False) Me.TabControlEigenschaften.ResumeLayout(False) Me.pageProperties.ResumeLayout(False) Me.pageFormat.ResumeLayout(False) Me.pageFormat.PerformLayout() - Me.pageSQL.ResumeLayout(False) - Me.pnlAuswahlliste.ResumeLayout(False) - Me.pnlAuswahlliste.PerformLayout() CType(Me.TBPM_PROFILE_CONTROLSBindingSource, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.DD_DMSLiteDataSet, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TBPM_CONNECTIONBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - Me.pagePropertiesOld.ResumeLayout(False) - Me.pagePropertiesOld.PerformLayout() Me.StatusStrip1.ResumeLayout(False) Me.StatusStrip1.PerformLayout() CType(Me.TBWH_CHECK_PROFILE_CONTROLSBindingSource, System.ComponentModel.ISupportInitialize).EndInit() @@ -935,35 +493,18 @@ Partial Class frmFormDesigner Friend WithEvents TBPM_PROFILE_CONTROLSBindingSource As System.Windows.Forms.BindingSource Friend WithEvents TBPM_PROFILE_CONTROLSTableAdapter As DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBPM_PROFILE_CONTROLSTableAdapter Friend WithEvents TableAdapterManager As DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TableAdapterManager - Friend WithEvents Panel1 As System.Windows.Forms.Panel - Friend WithEvents lblDesign As System.Windows.Forms.Label Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents btnlabel As System.Windows.Forms.Button Friend WithEvents btntextbox As System.Windows.Forms.Button Friend WithEvents pnldesigner As System.Windows.Forms.Panel Friend WithEvents btndtp As System.Windows.Forms.Button Friend WithEvents btncmb As System.Windows.Forms.Button - Friend WithEvents gbxControl As System.Windows.Forms.GroupBox - Friend WithEvents lblBeschriftung As System.Windows.Forms.Label - Friend WithEvents lblCtrlName As System.Windows.Forms.Label Friend WithEvents lblhintergrund As System.Windows.Forms.Label - Friend WithEvents lblIndex As System.Windows.Forms.Label - Friend WithEvents cmbIndex As System.Windows.Forms.ComboBox - Friend WithEvents btnsave As System.Windows.Forms.Button - Friend WithEvents lblAuswahlliste As System.Windows.Forms.Label - Friend WithEvents CheckBoxAuswahlliste As System.Windows.Forms.CheckBox Friend WithEvents btndelete As System.Windows.Forms.Button Friend WithEvents Label1 As System.Windows.Forms.Label - Friend WithEvents CHOICE_LISTTextBox As System.Windows.Forms.TextBox - Friend WithEvents VALIDATIONCheckBox As System.Windows.Forms.CheckBox - Friend WithEvents CTRL_TEXTTextBox As System.Windows.Forms.TextBox - Friend WithEvents NAMETextBox As System.Windows.Forms.TextBox - Friend WithEvents CHANGED_WHOTextBox As System.Windows.Forms.TextBox Friend WithEvents StatusStrip1 As System.Windows.Forms.StatusStrip Friend WithEvents tslblAenderungen As System.Windows.Forms.ToolStripStatusLabel - Friend WithEvents CHANGED_WHENTextBox As System.Windows.Forms.TextBox Friend WithEvents TabControlEigenschaften As System.Windows.Forms.TabControl - Friend WithEvents pagePropertiesOld As System.Windows.Forms.TabPage Friend WithEvents pageFormat As System.Windows.Forms.TabPage Friend WithEvents btnwidth_minus As System.Windows.Forms.Button Friend WithEvents btnwidth_plus As System.Windows.Forms.Button @@ -972,30 +513,17 @@ Partial Class frmFormDesigner Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents btnVektor As System.Windows.Forms.Button - Friend WithEvents pageSQL As System.Windows.Forms.TabPage Friend WithEvents TBPM_CONNECTIONBindingSource As System.Windows.Forms.BindingSource Friend WithEvents TBPM_CONNECTIONTableAdapter As DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBPM_CONNECTIONTableAdapter - Friend WithEvents pnlAuswahlliste As System.Windows.Forms.Panel - Friend WithEvents Label4 As System.Windows.Forms.Label - Friend WithEvents cmbConnection As System.Windows.Forms.ComboBox - Friend WithEvents Label5 As System.Windows.Forms.Label - Friend WithEvents SQL_CommandTextBox As System.Windows.Forms.TextBox Friend WithEvents btnCheckbox As System.Windows.Forms.Button - Friend WithEvents rbVektor As System.Windows.Forms.RadioButton - Friend WithEvents rbIndex As System.Windows.Forms.RadioButton - Friend WithEvents INDEX_NAMETextBox As System.Windows.Forms.TextBox - Friend WithEvents INDEX_NAME_VALUE As System.Windows.Forms.TextBox Friend WithEvents TBWH_CHECK_PROFILE_CONTROLSBindingSource As System.Windows.Forms.BindingSource Friend WithEvents TBWH_CHECK_PROFILE_CONTROLSTableAdapter As DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBWH_CHECK_PROFILE_CONTROLSTableAdapter - Friend WithEvents LOAD_IDX_VALUECheckBox As System.Windows.Forms.CheckBox - Friend WithEvents READ_ONLYCheckBox As System.Windows.Forms.CheckBox Friend WithEvents ToolTip1 As System.Windows.Forms.ToolTip Friend WithEvents btnTabelle As System.Windows.Forms.Button Friend WithEvents TBPM_CONTROL_TABLEBindingSource As System.Windows.Forms.BindingSource Friend WithEvents TBPM_CONTROL_TABLETableAdapter As DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBPM_CONTROL_TABLETableAdapter Friend WithEvents btnrefresh As System.Windows.Forms.Button - Friend WithEvents btnShowConnections As System.Windows.Forms.Button - Friend WithEvents btnEditor As Button Friend WithEvents pageProperties As TabPage Friend WithEvents pgControls As PropertyGrid + Friend WithEvents btnLine As Button End Class diff --git a/app/DD_PM_WINDREAM/frmFormDesigner.resx b/app/DD_PM_WINDREAM/frmFormDesigner.resx index 2d14d4f..a227075 100644 --- a/app/DD_PM_WINDREAM/frmFormDesigner.resx +++ b/app/DD_PM_WINDREAM/frmFormDesigner.resx @@ -117,29 +117,18 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - False - - - False - - + - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAANtJREFUOE+tkzsSgjAURbMEl+TQswDWg8M2LKSWggW4DrWhUBuKaAGUTw5DMASU - z5iZw0zeu/cmmRDljqqqtmVZJjW6Rhx0URR7NK38M7TWm7p5yrJMoiiSIAjE87we1OihQYuntStFIU1T - 8X1f4kMsl/NVnvrVgxo9NGjxNGaS8jxvGvfbY2B0QcOOONZ/AhhMKM49wteAJTQBfKYYMwO9yZVnB7jn - BSOyTTaDgOSYdM1VAVxPGO66uREZg8sggCsihJ2sCnAxIttk6H7lXyuA3R99TAgW4Dxnpd6OS61yelZ6 - QAAAAABJRU5ErkJggg== + iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAA0SURBVEhLYxgF + o2AUEAe8gDiICpgbiFHACyD+TwWsCMQoIA2IC6iA+YF4FIyCUTAAgIEBAJUPH6VVzyeQAAAAAElFTkSu + QmCC 179, 17 - - 179, 17 - 17, 17 @@ -149,12 +138,6 @@ 1021, 17 - - 1021, 17 - - - 898, 56 - 904, 17 diff --git a/app/DD_PM_WINDREAM/frmFormDesigner.vb b/app/DD_PM_WINDREAM/frmFormDesigner.vb index b9fa7b4..539bdd4 100644 --- a/app/DD_PM_WINDREAM/frmFormDesigner.vb +++ b/app/DD_PM_WINDREAM/frmFormDesigner.vb @@ -1,17 +1,12 @@ Imports DD_LIB_Standards Public Class frmFormDesigner - Private COLUMN_GUID - Private MouseIsDown As Boolean = False - Private idxlbl As Integer = 0 - Private idxtxt As Integer = 0 - Private idxcmb As Integer = 0 - Private idxdtp As Integer = 0 - Private idxdgv As Integer = 0 - Private idxchk As Integer = 0 - Private _loading As Boolean = False - Dim frmTableColumn As New frmControl_Detail - Private CURRENT_CONTROL As Control + Public ProfileId As Integer + Public ProfileName As String + Public ProfileObjectType As String + + ' Control Variables + Private CurrentControl As Control = Nothing ' Movement Variables Private Mouse_IsPressed As Boolean @@ -22,42 +17,13 @@ Public Class frmFormDesigner ' Windream List Data Private Windream_ChoiceLists As List(Of String) Private Windream_Indicies As List(Of String) + Private Windream_VectorIndicies As List(Of String) - Private Sub frmFormDesigner_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing - If CURRENT_ProfilGUID > 0 Then - Dim sql As String = $"SELECT NAME, INDEX_NAME FROM TBPM_PROFILE_CONTROLS WHERE PROFIL_ID = {CURRENT_ProfilGUID} AND CTRL_TYPE <> 'LBL'" - Dim dt As DataTable = ClassDatabase.Return_Datatable(sql) - - Dim missingIndexControls As New List(Of String) - - For Each row As DataRow In dt.Rows - If NotNull(row.Item("INDEX_NAME"), String.Empty) = String.Empty Then - missingIndexControls.Add(row.Item("NAME")) - - End If - Next - - If missingIndexControls.Count > 0 Then - e.Cancel = True - Dim missingControls As String = String.Join(vbCrLf, missingIndexControls.ToArray()) - MsgBox($"Für die folgenden Controls wurden noch keine Indexdefinitionen hinterlegt: {vbCrLf}{vbCrLf}{missingControls}") - End If - End If - - If Application.OpenForms().OfType(Of frmControl_Detail).Any Then - frmControl_Detail.Close() - End If - - End Sub - - - Private Sub frmFormDesigner_Load(sender As Object, e As System.EventArgs) Handles Me.Load + Private Sub frmFormDesigner_Load(sender As Object, e As EventArgs) Handles Me.Load Try - lblDesign.Text = "FormDesigner für Profil: " & CURRENT_ProfilName - 'löscht alle Controls - pnldesigner.Controls.Clear() - CURRENT_CONTROL = Nothing + ' Profil Name in Fenstertitel setzen + Text = $"{Text} - Profil: {ProfileName}" Try ' Windream initialisieren @@ -66,6 +32,7 @@ Public Class frmFormDesigner 'Windream Abfragen, sollten einmal beim Start des Formulars geladen werden Windream_Indicies = clsWD_GET.GetIndicesByObjecttype(CURRENT_OBJECTTYPE).ToList() Windream_ChoiceLists = clsWD_GET.GetChoiceLists() + Windream_VectorIndicies = Windream_Indicies.FindAll(AddressOf IsVectorIndex) Catch ex As Exception MsgBox("Fehler bei Initialisieren von windream: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try @@ -80,124 +47,51 @@ Public Class frmFormDesigner MsgBox("Fehler bei Laden der Connection-Strings und Grunddaten: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try - Load_indexe() - Controls_laden() - Catch ex As System.Exception - MsgBox(ex.Message, MsgBoxStyle.Critical, "error loading form:") - End Try - End Sub - Sub Load_indexe() - cmbIndex.Items.Clear() - Dim indexe = clsWD_GET.GetIndicesByObjecttype(CURRENT_OBJECTTYPE) - If indexe IsNot Nothing Then - cmbIndex.Items.Add("") - For Each index As String In indexe - cmbIndex.Items.Add(index) - Next - cmbIndex.Items.Add("DD PM-ONLY FOR DISPLAY") - cmbIndex.SelectedIndex = -1 - End If - End Sub - Sub Load_Indexe_Vektor() - Try - Me.cmbIndex.Items.Clear() - - Dim indexe = clsWD_GET.GetIndicesByObjecttype(CURRENT_OBJECTTYPE) - If indexe IsNot Nothing Then - Me.cmbIndex.Items.Add("") - For Each index As String In indexe - Dim _vektorString As Boolean = False - - Select Case clsWD_GET.GetTypeOfIndexAsIntByName(index) - Case 4107 'Vektor Zahl - _vektorString = True - Case 4097 - _vektorString = True - Case Else - _vektorString = False - End Select - If _vektorString = True Then - Me.cmbIndex.Items.Add(index) - End If - - Next - End If + LoadControls() Catch ex As Exception - MsgBox("Fehler bei Indexe Volltext eintragen: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") + MsgBox(ex.Message, MsgBoxStyle.Critical, "error loading form:") End Try End Sub - Sub Load_Control(Optional ID As Integer = 0) - _loading = True - Try - TabControlEigenschaften.SelectedIndex = 0 - cmbIndex.Visible = False - INDEX_NAMETextBox.Visible = False - If ID = 0 Then - If IsNothing(CURRENT_CONTROL.Tag) Then - Dim ID_CTRL = GetControlGUID(CURRENT_CONTROL.Name) - If ID_CTRL > 0 Then - CURRENT_CONTROL.Tag = ID_CTRL - End If - End If - CURRENT_CONTROL_ID = CURRENT_CONTROL.Tag - Else - CURRENT_CONTROL_ID = ID - End If - If CURRENT_CONTROL_ID <> 0 Then - gbxControl.Enabled = True - TBPM_PROFILE_CONTROLSTableAdapter.Fill(DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS, CURRENT_CONTROL_ID) - Dim dt As DataTable = DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS - Dim dr As DataRow = dt.Rows(0) - If dr Is Nothing = False Then - ' MsgBox(dr.Item("INDEX_NAME").ToString) - If dr.Item("INDEX_NAME").ToString.StartsWith("[%VKT") Then - Me.rbVektor.Checked = True - Me.rbIndex.Checked = False - Me.INDEX_NAMETextBox.Visible = True - Me.cmbIndex.Visible = False - Me.INDEX_NAMETextBox.Text = dr.Item("INDEX_NAME").ToString.Replace("[%VKT", "") - Else - Me.rbIndex.Checked = True - Me.rbVektor.Checked = False - Me.INDEX_NAMETextBox.Visible = False - Me.cmbIndex.Visible = True - IDX_CMB(CURRENT_CONTROL.Name) - End If - Try - If CheckBoxAuswahlliste.Visible = False Then - _loading = False - Exit Sub - End If - If dr.Item("CHOICE_LIST") <> "" Then - CheckBoxAuswahlliste.Checked = True - CHOICE_LISTTextBox.Text = dr.Item("CHOICE_LIST") - End If - Catch ex As Exception - CheckBoxAuswahlliste.Checked = False - End Try + Private Sub frmFormDesigner_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing + If ProfileId > 0 Then + Dim sql As String = $"SELECT NAME, INDEX_NAME FROM TBPM_PROFILE_CONTROLS WHERE PROFIL_ID = {ProfileId} AND CTRL_TYPE <> 'LBL' AND CTRL_TYPE <> 'LINE'" + Dim dt As DataTable = ClassDatabase.Return_Datatable(sql) + + Dim missingIndexControls As New List(Of String) + For Each row As DataRow In dt.Rows + If NotNull(row.Item("INDEX_NAME"), String.Empty) = String.Empty Then + missingIndexControls.Add(row.Item("NAME")) End If - Else - gbxControl.Enabled = False - tslblAenderungen.Visible = True - tslblAenderungen.Text = "Konte das aktuelle Control nicht wählen!!" - End If - btnsave.Visible = True - Catch ex As Exception - If Not ex.Message.Contains("Data Reader") Then - MsgBox("Fehler bei Laden des Controls: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") + Next + + If missingIndexControls.Count > 0 Then + e.Cancel = True + Dim missingControls As String = String.Join(vbCrLf, missingIndexControls.ToArray()) + MsgBox($"Für die folgenden Controls wurden noch keine Indexdefinitionen hinterlegt: {vbCrLf}{vbCrLf}{missingControls}") End If + End If + + If Application.OpenForms().OfType(Of frmControl_Detail).Any Then + frmControl_Detail.Close() + End If - End Try - _loading = False End Sub + ''' + ''' Filtert aus der Liste von Indexen die Vektor Indexe heraus + ''' + Private Function IsVectorIndex(index As String) As Boolean + Dim type As Integer = clsWD_GET.GetTypeOfIndexAsIntByName(index) + 'Vektor Zahl Oder Vektor String + Return (type = 4107 Or type = 4097) + End Function - Sub Controls_laden() + Sub LoadControls() Try - TBPM_PROFILE_CONTROLSTableAdapter.FillByProfil(DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS, CURRENT_ProfilGUID) + TBPM_PROFILE_CONTROLSTableAdapter.FillByProfil(DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS, ProfileId) TBPM_CONTROL_TABLETableAdapter.FillAll(DD_DMSLiteDataSet.TBPM_CONTROL_TABLE) ' löscht alle Controls @@ -224,194 +118,201 @@ Public Class frmFormDesigner pnldesigner.Controls.Add(txt) SetMovementHandlers(txt) - 'Dim ctrl = CreateBaseControl(New TextBox, guid, name, x, y, font, color) - 'AddExistingTextbox(ctrl, row.Item("WIDTH"), row.Item("HEIGHT")) Case "LBL" Dim lbl = ClassControlCreator.CreateExistingLabel(row, True) pnldesigner.Controls.Add(lbl) SetMovementHandlers(lbl) - 'Dim ctrl = CreateBaseControl(New Label, guid, name, x, y, font, color) - 'AddExistingLabel(ctrl, row.Item("CTRL_TEXT")) + Case "CMB" Dim cmb = ClassControlCreator.CreateExistingCombobox(row, True) pnldesigner.Controls.Add(cmb) SetMovementHandlers(cmb) - 'Dim ctrl = CreateBaseControl(New ComboBox, guid, name, x, y, font, color) - 'AddExistingCombobox(ctrl, row.Item("WIDTH"), row.Item("HEIGHT")) Case "DTP" Dim dtp = ClassControlCreator.CreateExistingDatepicker(row, True) pnldesigner.Controls.Add(dtp) SetMovementHandlers(dtp) - 'Dim ctrl = CreateBaseControl(New ComboBox, guid, name, x, y, font, color) - 'AddExistingDatetimepicker(ctrl, row.Item("WIDTH"), row.Item("HEIGHT")) Case "CHK" Dim chk = ClassControlCreator.CreateExisingCheckbox(row, True) pnldesigner.Controls.Add(chk) SetMovementHandlers(chk) - 'Dim ctrl = CreateBaseControl(New CheckBox, guid, name, x, y, font, color) - 'AddExistingCheckbox(ctrl, row.Item("CTRL_TEXT"), row.Item("WIDTH"), row.Item("HEIGHT")) Case "DGV" Dim dgv = ClassControlCreator.CreateExistingDataGridView(row, True) pnldesigner.Controls.Add(dgv) SetMovementHandlers(dgv) - 'Dim ctrl = CreateBaseControl(New DataGridView, guid, name, x, y, font, color) - 'AddExistingDatagridview(ctrl, row.Item("WIDTH"), row.Item("HEIGHT")) Case "TABLE" - Dim columns As List(Of DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow) = (From r As DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow In DD_DMSLiteDataSet.TBPM_CONTROL_TABLE - Where r.CONTROL_ID = guid - Select r).ToList() + Dim findControlColumnsQuery = (From r As DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow In DD_DMSLiteDataSet.TBPM_CONTROL_TABLE + Where r.CONTROL_ID = guid + Select r) + Dim columns As List(Of DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow) = findControlColumnsQuery.ToList() Dim table = ClassControlCreator.CreateExistingTable(row, columns, True) AddHandler table.ColumnHeaderMouseClick, AddressOf table_ColumnHeaderMouseClick pnldesigner.Controls.Add(table) SetMovementHandlers(table) + + Case "LINE" + Dim line = ClassControlCreator.CreateExistingLine(row, True) + pnldesigner.Controls.Add(line) + SetMovementHandlers(line) End Select Next Catch ex As Exception - MsgBox("Fehler bei Controls_laden: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") + MsgBox("Fehler bei LoadControls " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try End Sub - Private Sub DragDropButtons_MouseDown(sender As Object, e As MouseEventArgs) Handles btnlabel.MouseDown, btntextbox.MouseDown, btncmb.MouseDown, btndtp.MouseDown, btnVektor.MouseDown, - btnTabelle.MouseDown, btnCheckbox.MouseDown - MouseIsDown = True - CURRENT_CONTROL = Nothing + Private Sub DragDropButtons_MouseDown(sender As Object, e As MouseEventArgs) Handles btnlabel.MouseDown, btntextbox.MouseDown, btncmb.MouseDown, btndtp.MouseDown, btnVektor.MouseDown, btnTabelle.MouseDown, btnCheckbox.MouseDown, btnLine.MouseDown + Mouse_IsPressed = True + + CurrentControl = Nothing Try TBPM_PROFILE_CONTROLSBindingSource.Clear() Catch ex As Exception - End Try End Sub - Private Sub DragDropButtons_MouseMove(sender As Object, e As MouseEventArgs) Handles btnlabel.MouseMove, btntextbox.MouseMove, btncmb.MouseMove, btndtp.MouseMove, btnVektor.MouseMove, btnTabelle.MouseMove, btnCheckbox.MouseMove - If MouseIsDown Then + Private Sub DragDropButtons_MouseMove(sender As Object, e As MouseEventArgs) Handles btnlabel.MouseMove, btntextbox.MouseMove, btncmb.MouseMove, btndtp.MouseMove, btnVektor.MouseMove, btnTabelle.MouseMove, btnCheckbox.MouseMove, btnLine.MouseMove + If Mouse_IsPressed Then Dim btn As Button = sender Dim dragDropData As String Select Case btn.Name Case "btnlabel" - dragDropData = "lbl" + dragDropData = ClassControlCreator.PREFIX_LABEL Case "btntextbox" - dragDropData = "txt" + dragDropData = ClassControlCreator.PREFIX_TEXTBOX Case "btncmb" - dragDropData = "cmb" + dragDropData = ClassControlCreator.PREFIX_COMBOBOX Case "btndtp" - dragDropData = "dtp" + dragDropData = ClassControlCreator.PREFIX_DATETIMEPICKER Case "btnVektor" - dragDropData = "dgv" + dragDropData = ClassControlCreator.PREFIX_DATAGRIDVIEW Case "btnTabelle" - dragDropData = "tb" + dragDropData = ClassControlCreator.PREFIX_TABLE Case "btnCheckbox" - dragDropData = "chk" + dragDropData = ClassControlCreator.PREFIX_CHECKBOX + Case "btnLine" + dragDropData = ClassControlCreator.PREFIX_LINE End Select btn.DoDragDrop(dragDropData, DragDropEffects.Copy) End If End Sub + Private Sub DragDropButtons_MouseUp(sender As Object, e As MouseEventArgs) Handles btnlabel.MouseUp, btntextbox.MouseUp, btncmb.MouseUp, btndtp.MouseUp, btnVektor.MouseUp, btnTabelle.MouseUp, btnCheckbox.MouseUp, btnLine.MouseUp + Mouse_IsPressed = False + End Sub + Private Sub pnlDesigner_DragDrop(sender As Object, e As DragEventArgs) Handles pnldesigner.DragDrop Dim cursorPosition As Point = pnldesigner.PointToClient(Cursor.Position) + Mouse_IsPressed = False + Select Case e.Data.GetData(DataFormats.Text) - Case "lbl" + Case ClassControlCreator.PREFIX_LABEL Dim label = ClassControlCreator.CreateNewLabel(cursorPosition) 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) + TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, 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() + CurrentControl = label + CurrentControl.Tag = GetLastID() pnldesigner.Controls.Add(label) - 'AddNewLabel("lbl" & Random.ToString) - Case "txt" + Case ClassControlCreator.PREFIX_TEXTBOX Dim txt = ClassControlCreator.CreateNewTextBox(cursorPosition) 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) + TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, 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() + CurrentControl = txt + CurrentControl.Tag = GetLastID() pnldesigner.Controls.Add(txt) - 'AddNewTextbox("txt" & Random) - Case "cmb" + Case ClassControlCreator.PREFIX_COMBOBOX Dim cmb = ClassControlCreator.CreateNewCombobox(cursorPosition) 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) + TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, 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() + CurrentControl = cmb + CurrentControl.Tag = GetLastID() pnldesigner.Controls.Add(cmb) - 'AddNewCombobox("cmb" & random) - Case "dtp" + Case ClassControlCreator.PREFIX_DATETIMEPICKER Dim dtp = ClassControlCreator.CreateNewDatetimepicker(cursorPosition) SetMovementHandlers(dtp) - 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) + TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, dtp.Name, "DTP", dtp.Name, dtp.Location.X, dtp.Location.Y, Environment.UserName, dtp.Size.Height, dtp.Size.Width) - CURRENT_CONTROL = dtp - CURRENT_CONTROL.Tag = GetLastID() + CurrentControl = dtp + CurrentControl.Tag = GetLastID() pnldesigner.Controls.Add(dtp) - 'AddNewDatetimepicker("dtp" & random) - Case "chk" + Case ClassControlCreator.PREFIX_CHECKBOX Dim chk = ClassControlCreator.CreateNewCheckbox(cursorPosition) 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) + TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, 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() + CurrentControl = chk + CurrentControl.Tag = GetLastID() pnldesigner.Controls.Add(chk) - 'AddNewCheckbox("chk" & random) - Case "dgv" + Case ClassControlCreator.PREFIX_DATAGRIDVIEW 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) + TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, 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() + CurrentControl = dgv + CurrentControl.Tag = GetLastID() pnldesigner.Controls.Add(dgv) - 'AddNewDGV("dgv" & random) - Case "tb" + Case ClassControlCreator.PREFIX_TABLE 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) + TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, 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() + CurrentControl = tb + CurrentControl.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) + TBPM_CONTROL_TABLETableAdapter.Insert(CurrentControl.Tag, "column1", "Column1", 95, Environment.UserName) + TBPM_CONTROL_TABLETableAdapter.Insert(CurrentControl.Tag, "column2", "Column2", 95, Environment.UserName) pnldesigner.Controls.Add(tb) - 'AddNewTable("tb" & Random) + Case ClassControlCreator.PREFIX_LINE + Dim line = ClassControlCreator.CreateNewLine(cursorPosition) + + SetMovementHandlers(line) + + TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, line.Name, "LINE", line.Name, line.Location.X, line.Location.Y, Environment.UserName, line.Size.Height, line.Size.Width) + + CurrentControl = line + CurrentControl.Tag = GetLastID() + + + pnldesigner.Controls.Add(line) End Select End Sub - Private Sub pnlDesigner_DragEnter(sender As System.Object, e As System.Windows.Forms.DragEventArgs) Handles pnldesigner.DragEnter + Private Sub pnlDesigner_DragEnter(sender As System.Object, e As DragEventArgs) Handles pnldesigner.DragEnter ' Check the format of the data being dropped. If (e.Data.GetDataPresent(DataFormats.Text)) Then ' Display the copy cursor. @@ -421,307 +322,18 @@ Public Class frmFormDesigner e.Effect = DragDropEffects.None End If End Sub - Private Function GetControlGUID(control_name As String) - Try - CURRENT_CONTROL_ID = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(CURRENT_ProfilGUID, control_name) - Return CURRENT_CONTROL_ID - Catch ex As Exception - MsgBox("Fehler bei GetControlGUID: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") - Return 0 - End Try - End Function - 'Function AddNewLabel(lblname As String) - ' Try - ' Dim lbl As New Label - ' lbl.Name = lblname - ' lbl.Text = "Bez. definieren" - ' lbl.AutoSize = True - ' Dim clientPosition As Point = pnldesigner.PointToClient(Cursor.Position) - ' lbl.Location = New Point(clientPosition) - ' pnldesigner.Controls.Add(lbl) - ' CURRENT_CONTROL = lbl - - ' SetMovementHandlers(lbl) - - ' TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, lbl.Name, "LBL", lblname, lbl.Location.X, lbl.Location.Y, Environment.UserName, 16, 200) - ' CURRENT_CONTROL.Tag = GetLastID() - ' 'Load_Control() - ' btnsave.Visible = True - ' Catch ex As Exception - ' MsgBox("Fehler bei Anlegen Label: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) - ' End Try - 'End Function - 'Function AddExistingLabel(lbl As Label, text As String) - ' lbl.Text = text - ' lbl.AutoSize = True - - ' pnldesigner.Controls.Add(lbl) - ' SetMovementHandlers(lbl) - 'End Function 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}", ProfileId) Return ClassDatabase.Execute_Scalar(sql, MyConnectionString, True) End Function - Function AddNewTextbox(txtname As String) - Try - Dim txt As New TextBox - txt.Name = txtname - txt.Size = New Size(200, 27) - txt.Cursor = Cursors.Hand - txt.ReadOnly = True - Dim clientPosition As Point = pnldesigner.PointToClient(Cursor.Position) - txt.Location = New Point(clientPosition) - txt.BackColor = Color.White - pnldesigner.Controls.Add(txt) - CURRENT_CONTROL = txt - - SetMovementHandlers(txt) - - TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, txt.Name, "TXT", txtname, txt.Location.X, txt.Location.Y, Environment.UserName, 27, 200) - CURRENT_CONTROL.Tag = GetLastID() - - btnsave.Visible = True - Catch ex As Exception - MsgBox("Fehler bei Anlegen TextBox: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) - End Try - End Function - Function AddExistingTextbox(txt As TextBox, vwidth As Integer, vheight As Integer) - If vheight > 27 Then - txt.Multiline = True - Else - txt.Multiline = False - End If - txt.Size = New Size(vwidth, vheight) - - txt.Cursor = Cursors.Hand - txt.ReadOnly = True - txt.BackColor = Color.White - - pnldesigner.Controls.Add(txt) - SetMovementHandlers(txt) - - btnsave.Visible = True - End Function - Function AddNewCheckbox(chkname As String) - Try - - Dim chk As New CheckBox - chk.Name = chkname - 'chk.Size = New Size(200, 27) - chk.AutoSize = True - chk.Text = "Beschriftung def." - chk.Cursor = Cursors.Hand - Dim clientPosition As Point = pnldesigner.PointToClient(Cursor.Position) - chk.Location = New Point(clientPosition) - pnldesigner.Controls.Add(chk) - CURRENT_CONTROL = chk - - SetMovementHandlers(chk) - - TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, chk.Name, "CHK", chkname, chk.Location.X, chk.Location.Y, Environment.UserName, 27, 200) - CURRENT_CONTROL.Tag = GetLastID() - 'Load_Control() - btnsave.Visible = True - Catch ex As Exception - MsgBox("Fehler bei Anlegen Checkbox: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) - End Try - End Function - Function AddExistingCheckbox(chk As CheckBox, text As String, vwidth As Integer, vheight As Integer) - chk.AutoSize = True - chk.Text = text - chk.Cursor = Cursors.Hand - - pnldesigner.Controls.Add(chk) - SetMovementHandlers(chk) - btnsave.Visible = True - End Function - Function AddNewCombobox(cmbname As String) - Try - Dim cmb As New ComboBox - cmb.Name = cmbname - cmb.Size = New Size(180, 24) - cmb.Cursor = Cursors.Hand - Dim clientPosition As Point = Me.pnldesigner.PointToClient(Cursor.Position) - cmb.Location = New Point(clientPosition) - pnldesigner.Controls.Add(cmb) - CURRENT_CONTROL = cmb - - SetMovementHandlers(cmb) - - TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, cmb.Name, "CMB", cmbname, cmb.Location.X, cmb.Location.Y, Environment.UserName, 24, 180) - CURRENT_CONTROL.Tag = GetLastID() - 'Load_Control() - btnsave.Visible = True - Catch ex As Exception - MsgBox("Fehler bei Anlegen Combobox: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) - End Try - End Function - Function AddExistingCombobox(cmb As ComboBox, vwidth As Integer, vheight As Integer) - cmb.Size = New Size(vwidth, vheight) - cmb.Cursor = Cursors.Hand - - pnldesigner.Controls.Add(cmb) - SetMovementHandlers(cmb) - - btnsave.Visible = True - End Function - Function AddExistingDatetimepicker(dtp As DateTimePicker, vwidth As Integer, vheight As Integer) - dtp.Size = New Size(vwidth, vheight) - dtp.Cursor = Cursors.Hand - dtp.Format = DateTimePickerFormat.Short - pnldesigner.Controls.Add(dtp) - - SetMovementHandlers(dtp) - btnsave.Visible = True - End Function - Function AddNewDatetimepicker(dtpname As String) - Try - Dim dtp As New DateTimePicker - dtp.Name = dtpname - dtp.Size = New Size(180, 24) - dtp.Cursor = Cursors.Hand - dtp.Format = DateTimePickerFormat.Short - Dim clientPosition As Point = Me.pnldesigner.PointToClient(Cursor.Position) - dtp.Location = New Point(clientPosition) - pnldesigner.Controls.Add(dtp) - CURRENT_CONTROL = dtp - - SetMovementHandlers(dtp) - - TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, dtp.Name, "DTP", dtpname, dtp.Location.X, dtp.Location.Y, Environment.UserName, 24, 180) - CURRENT_CONTROL.Tag = GetLastID() - 'Load_Control() - - Catch ex As Exception - MsgBox("Fehler bei Anlegen DatetimePicker: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) - End Try - End Function - Function AddExistingDatagridview(dgv As DataGridView, vwidth As Integer, vheight As Integer) - dgv.Size = New Size(vwidth, vheight) - dgv.Cursor = Cursors.Hand - dgv.AllowUserToAddRows = False - dgv.AllowUserToDeleteRows = False - dgv.AllowUserToResizeColumns = False - dgv.AllowUserToResizeRows = False - - - Dim col As New DataGridViewTextBoxColumn - col.HeaderText = "" - col.Name = "column1" - dgv.Columns.Add(col) - - pnldesigner.Controls.Add(dgv) - - SetMovementHandlers(dgv) - - btnsave.Visible = True - End Function - Function AddNewDGV(dgvName As String) - Try - Dim dgv As New DataGridView - dgv.Name = dgvName - dgv.Size = New Size(130, 150) - dgv.Cursor = Cursors.Hand - Dim clientPosition As Point = Me.pnldesigner.PointToClient(System.Windows.Forms.Cursor.Position) - dgv.Location = New Point(clientPosition) - dgv.AllowUserToAddRows = False - dgv.AllowUserToDeleteRows = False - dgv.AllowUserToResizeColumns = False - dgv.AllowUserToResizeRows = False - - Dim col As New DataGridViewTextBoxColumn - col.HeaderText = "" - col.Name = "column1" - dgv.Columns.Add(col) - pnldesigner.Controls.Add(dgv) - CURRENT_CONTROL = dgv - - SetMovementHandlers(dgv) - - TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, dgv.Name, "DGV", dgvName, dgv.Location.X, dgv.Location.Y, Environment.UserName, 130, 150) - CURRENT_CONTROL.Tag = GetLastID() - 'Load_Control() - Catch ex As Exception - MsgBox("Fehler bei Anlegen DGV: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) - End Try - End Function - Function AddNewTable(tableName As String) - Try - Dim table As New DataGridView - table.Name = tableName - table.Size = New Size(200, 150) - table.Cursor = Cursors.Hand - Dim clientPosition As Point = Me.pnldesigner.PointToClient(System.Windows.Forms.Cursor.Position) - table.Location = New Point(clientPosition) - table.AllowUserToAddRows = False - table.AllowUserToDeleteRows = False - table.AllowUserToResizeColumns = True - table.AllowUserToResizeRows = False - - Dim col1 As New DataGridViewTextBoxColumn With { - .HeaderText = "Column1", - .Name = "column1" - } - - Dim col2 As New DataGridViewTextBoxColumn With { - .HeaderText = "Column2", - .Name = "column2" - } - - table.Columns.Add(col1) - table.Columns.Add(col2) - pnldesigner.Controls.Add(table) - CURRENT_CONTROL = table - - SetMovementHandlers(table) - - AddHandler table.ColumnHeaderMouseClick, AddressOf table_ColumnHeaderMouseClick - TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(CURRENT_ProfilGUID, table.Name, "TABLE", tableName, table.Location.X, table.Location.Y, Environment.UserName, 130, 150) - 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) - 'Load_Control() - Catch ex As Exception - MsgBox("Fehler bei Anlegen Tabelle: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) - End Try - End Function - Function AddExistingTable(table As DataGridView, vwidth As Integer, vheight As Integer) - table.Size = New Size(vwidth, vheight) - table.Cursor = Cursors.Hand - table.AllowUserToAddRows = False - table.AllowUserToDeleteRows = False - table.AllowUserToResizeColumns = True - table.AllowUserToResizeRows = False - CURRENT_CONTROL = table - 'Columns laden - TBPM_CONTROL_TABLETableAdapter.Fill(Me.DD_DMSLiteDataSet.TBPM_CONTROL_TABLE, table.Tag) - Dim DT As DataTable = Me.DD_DMSLiteDataSet.TBPM_CONTROL_TABLE - If DT.Rows.Count > 0 Then - For Each Row As DataRow In DT.Rows - Dim col As New DataGridViewTextBoxColumn - col.HeaderText = Row.Item("SPALTEN_HEADER") - col.Name = Row.Item("SPALTENNAME") - col.Width = Row.Item("SPALTENBREITE") - table.Columns.Add(col) - Next - End If - - pnldesigner.Controls.Add(table) - - SetMovementHandlers(table) - - AddHandler table.ColumnHeaderMouseClick, AddressOf table_ColumnHeaderMouseClick - - btnsave.Visible = True - End Function Sub SetActiveControlColor() - CURRENT_CONTROL.BackColor = Color.DarkOrange + CurrentControl.BackColor = Color.DarkOrange ' Reset Color of all other controls For Each inctrl As Control In Me.pnldesigner.Controls - If inctrl.Name <> CURRENT_CONTROL.Name Then + If inctrl.Name <> CurrentControl.Name Then Dim Type As String = inctrl.GetType.ToString Select Case Type Case "System.Windows.Forms.TextBox" @@ -732,397 +344,112 @@ Public Class frmFormDesigner inctrl.BackColor = Color.Transparent Case "System.Windows.Forms.CheckBox" inctrl.BackColor = Color.Transparent + Case "DD_PM_WINDREAM.ClassControlCreator+LineLabel" + inctrl.BackColor = inctrl.ForeColor End Select End If Next End Sub - 'Public Sub OndgvClick(sender As System.Object, e As System.EventArgs) - ' CURRENT_CONTROL = sender - ' Dim dgv As DataGridView = sender - - ' CURRENT_CONTROL = dgv - ' If dgv.ColumnCount > 1 Then - ' Me.rbVektor.Visible = False - ' Load_Indexe_Vektor() - ' Dim selectedColumnCount As Integer = dgv.Columns.GetColumnCount(DataGridViewElementStates.Selected) - ' If selectedColumnCount > 0 Then - ' COLUMN_GUID = TBPM_CONTROL_TABLETableAdapter.getColumnID(CURRENT_CONTROL_ID, dgv.SelectedColumns(selectedColumnCount).Name) - ' End If - ' Else - ' Load_indexe() - ' Me.rbVektor.Visible = True - ' COLUMN_GUID = Nothing - ' End If - - - ' 'Load_Control() - ' Me.lblBeschriftung.Visible = False - ' Me.CTRL_TEXTTextBox.Visible = False - ' Me.lblIndex.Visible = True - ' Me.cmbIndex.Visible = True - ' Me.rbIndex.Visible = True - - ' Me.CheckBoxAuswahlliste.Visible = False - ' Me.CHOICE_LISTTextBox.Visible = False - ' Me.lblAuswahlliste.Visible = False - - ' Me.VALIDATIONCheckBox.Visible = True - - ' gbxControl.Visible = True - ' CHOICE_LISTTextBox.Visible = False - ' 'Me.pnlAuswahlliste.Enabled = False - ' Me.READ_ONLYCheckBox.Visible = True - ' Me.LOAD_IDX_VALUECheckBox.Visible = True - 'End Sub Public Sub table_ColumnHeaderMouseClick(sender As System.Object, e As DataGridViewCellMouseEventArgs) - CURRENT_CONTROL = sender + CurrentControl = sender Dim dgv As DataGridView = sender - CURRENT_CONTROL = dgv - Me.rbVektor.Visible = False + CurrentControl = dgv Dim dgvColumn As DataGridViewColumn = dgv.Columns(e.ColumnIndex) - COLUMN_GUID = TBPM_CONTROL_TABLETableAdapter.getColumnID(CURRENT_CONTROL_ID, dgvColumn.Name) - If Application.OpenForms().OfType(Of frmControl_Detail).Any Then - ' MessageBox.Show("Opened") - Else - frmTableColumn = New frmControl_Detail - frmTableColumn.Show() - End If - frmTableColumn.FillData(COLUMN_GUID) - frmTableColumn.Text = "Konfiguration von Spalte: " & dgvColumn.Name - - 'Load_Control() - Me.lblBeschriftung.Visible = True - Me.CTRL_TEXTTextBox.Visible = True - Me.lblIndex.Visible = True - Me.cmbIndex.Visible = True - Me.rbIndex.Visible = True - - Me.CheckBoxAuswahlliste.Visible = False - Me.CHOICE_LISTTextBox.Visible = False - Me.lblAuswahlliste.Visible = False + Dim columnId = TBPM_CONTROL_TABLETableAdapter.getColumnID(CURRENT_CONTROL_ID, dgvColumn.Name) + Dim frmTableColumn = New frmControl_Detail() - Me.VALIDATIONCheckBox.Visible = True - - gbxControl.Visible = True - ' Me.pnlAuswahlliste.Enabled = False - Me.READ_ONLYCheckBox.Visible = True - Me.LOAD_IDX_VALUECheckBox.Visible = True + frmTableColumn.FillData(columnId) + frmTableColumn.Text = "Konfiguration von Spalte: " & dgvColumn.Name + frmTableColumn.Show() End Sub - Sub IDX_CMB(controlname As String) - Try - Dim guid As Integer = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(CURRENT_ProfilGUID, controlname) - Dim indexname As String = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetIndexname(guid) - 'If indexname.StartsWith("[%") Then - ' indexname = indexname.Replace("[%", "") - 'End If - cmbIndex.SelectedIndex = cmbIndex.FindStringExact(indexname) - Catch ex As Exception - MsgBox(ex.Message, MsgBoxStyle.Critical, "IDX_CMB:") - End Try - End Sub - Sub delete_Control(_ctrlname As String) + Sub DeleteControl(controlName As String) Try - Dim result As MsgBoxResult = MsgBox("Wollen Sie das Control: " & _ctrlname & " wirklich löschen?", MsgBoxStyle.YesNo, "Bestätigung:") + Dim result As MsgBoxResult = MsgBox("Wollen Sie das Control: " & controlName & " wirklich löschen?", MsgBoxStyle.YesNo, "Bestätigung:") ' wenn Speichern ja If result = MsgBoxResult.Yes Then - Dim guid As Integer = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(CURRENT_ProfilGUID, _ctrlname) - If guid > 0 Then - Me.TBPM_CONTROL_TABLETableAdapter.Delete(guid) - TBPM_PROFILE_CONTROLSTableAdapter.Delete(guid) - Controls_laden() + Dim controlId As Integer = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(ProfileId, controlName) + If controlId > 0 Then + Me.TBPM_CONTROL_TABLETableAdapter.Delete(controlId) + TBPM_PROFILE_CONTROLSTableAdapter.Delete(controlId) + LoadControls() End If End If Catch ex As Exception - MsgBox(ex.Message, MsgBoxStyle.Critical, "delete_Control:") + MsgBox(ex.Message, MsgBoxStyle.Critical, "DeleteControl:") End Try End Sub ' +++ Public Helper Methods +++ Public Function GetCursorPosition() As Point Return pnldesigner.PointToClient(Cursor.Position) End Function - Sub Clear_control_Details() - Try - CURRENT_CONTROL = Nothing - TBPM_PROFILE_CONTROLSBindingSource.Clear() - - Catch ex As Exception - - End Try - End Sub - - 'Private Sub MovableDGV_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown - ' ' Check to see if the correct button has been pressed - ' If e.Button = Windows.Forms.MouseButtons.Left And Cursor = Cursors.Default Then - ' Clear_control_Details() - ' Dim dgv As DataGridView = DirectCast(sender, DataGridView) - ' Dim relativeMousePosition As Point = dgv.PointToClient(Cursor.Position) - ' Dim hit As DataGridView.HitTestInfo = dgv.HitTest(relativeMousePosition.X, relativeMousePosition.Y) - ' If hit.Type.ToString = "ColumnHeader" Then - ' Exit Sub - ' End If - - ' CURRENT_CONTROL = sender - - ' BeginLocation = e.Location - ' CURRENT_CONTROL.Tag = New clsDragInfo(Form.MousePosition, sender.Location) - ' dgv.BringToFront() - ' ' Set the mode flag to signal the MouseMove event handler that it - ' ' needs to now calculate new positions for our control - ' MouseMoving = True - - ' CURRENT_CONTROL = sender - - ' 'Jetzt Controleigenschaften laden - ' SetActiveControlColor() - ' 'Load_Control() - - ' gbxControl.Visible = True - ' End If - 'End Sub - - 'Private Sub btnsave_Click(sender As System.Object, e As System.EventArgs) Handles btnsave.Click - ' Save_Control() - 'End Sub - Sub Save_Control() - Try - If rbVektor.Checked Then - If INDEX_NAMETextBox.Text = "" Then - MsgBox("Bitte definieren Sie den Bezeichner für dieses Processmanager-Item:", MsgBoxStyle.Exclamation) - Me.INDEX_NAMETextBox.BackColor = Color.Red - Exit Sub - Else - Me.INDEX_NAMETextBox.BackColor = Color.White - End If - ' INDEX_NAME_VALUE.Text = "[%VKT" & INDEX_NAMETextBox.Text - End If - TBPM_PROFILE_CONTROLSBindingSource.EndEdit() - If DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS.GetChanges Is Nothing = False Then - Me.CHANGED_WHOTextBox.Text = Environment.UserName - TBPM_PROFILE_CONTROLSBindingSource.EndEdit() - TBPM_PROFILE_CONTROLSTableAdapter.Update(DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS) - tslblAenderungen.Visible = True - tslblAenderungen.Text = "Änderungen gespeichert - " & Now - Else - tslblAenderungen.Visible = False - End If - 'Wenn Datagridview dann Speichern - Dim type As String = CURRENT_CONTROL.GetType.ToString - If type.Contains("DataGridView") Then - Dim dgv As DataGridView = DirectCast(CURRENT_CONTROL, DataGridView) - If dgv.ColumnCount > 1 Then - 'For Each col As DataColumn In dgv.Columns - ' MsgBox(col.ColumnName) - 'Next - End If - End If - Catch ex As Exception - If ex.Message.ToLower.Contains("interne datatable") = True Or ex.Message.ToLower.Contains("internal index is corrupted") = True Then - Save_Control() - ElseIf ex.Message.ToLower.Contains("geöffneter datareader") = True Then - Exit Sub - Else - MsgBox(ex.Message, MsgBoxStyle.Critical, "Save Control:") - End If - End Try - - End Sub - - 'Private Sub cmbIndex_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cmbIndex.SelectedIndexChanged - ' If cmbIndex.SelectedIndex <> -1 Then - ' If cmbIndex.Text = "DD PM-ONLY FOR DISPLAY" Then - ' LOAD_IDX_VALUECheckBox.Checked = False - ' LOAD_IDX_VALUECheckBox.Enabled = False - ' READ_ONLYCheckBox.Checked = True - ' VALIDATIONCheckBox.Checked = False - ' VALIDATIONCheckBox.Enabled = False - ' Else - ' LOAD_IDX_VALUECheckBox.Enabled = True - ' VALIDATIONCheckBox.Enabled = True - ' End If - ' If _loading = False Then - ' Save_Control() - ' End If - ' End If - 'End Sub - 'Private Sub btncmb_MouseMove(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles btncmb.MouseMove - ' If MouseIsDown Then - ' ' Initiate dragging. - ' btncmb.DoDragDrop("cmb", DragDropEffects.Copy) - ' End If - ' MouseIsDown = False - 'End Sub - - 'Private Sub CheckBox1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBoxAuswahlliste.CheckedChanged - ' If CheckBoxAuswahlliste.Checked Then - ' lblAuswahlliste.Visible = True - ' CHOICE_LISTTextBox.Visible = True - ' Else - ' lblAuswahlliste.Visible = False - ' CHOICE_LISTTextBox.Visible = False - ' End If - 'End Sub - Private Sub btndelete_Click(sender As System.Object, e As EventArgs) Handles btndelete.Click - If CURRENT_CONTROL Is Nothing = False Then - delete_Control(CURRENT_CONTROL.Name) + If CurrentControl Is Nothing = False Then + DeleteControl(CurrentControl.Name) TabControlEigenschaften.Enabled = False End If End Sub Private Sub btnwidth_plus_Click(sender As System.Object, e As EventArgs) Handles btnwidth_plus.Click - If CURRENT_CONTROL Is Nothing = False Then - CURRENT_CONTROL.Size = New Size(CURRENT_CONTROL.Width + 5, CURRENT_CONTROL.Height) - UpdateSingleValue("WIDTH", CURRENT_CONTROL.Size.Width) + If CurrentControl Is Nothing = False Then + CurrentControl.Size = New Size(CurrentControl.Width + 5, CurrentControl.Height) + UpdateSingleValue("WIDTH", CurrentControl.Size.Width) End If End Sub Private Sub btnwidth_minus_Click(sender As System.Object, e As EventArgs) Handles btnwidth_minus.Click - If CURRENT_CONTROL Is Nothing = False Then - CURRENT_CONTROL.Size = New Size(CURRENT_CONTROL.Width - 5, CURRENT_CONTROL.Height) - UpdateSingleValue("WIDTH", CURRENT_CONTROL.Size.Width) + If CurrentControl Is Nothing = False Then + Dim newWidth = CurrentControl.Width - 5 + + ' Verhindert, dass das Control unsichtbar wird + If newWidth > 1 Then + Exit Sub + End If + + CurrentControl.Size = New Size(newWidth, CurrentControl.Height) + UpdateSingleValue("WIDTH", CurrentControl.Size.Width) End If End Sub Private Sub btnheight_plus_Click(sender As System.Object, e As EventArgs) Handles btnheight_plus.Click - If CURRENT_CONTROL Is Nothing = False Then - Dim newHeight As Integer = CURRENT_CONTROL.Height + 5 + If CurrentControl Is Nothing = False Then + Dim newHeight As Integer = CurrentControl.Height + 5 - If newHeight > 21 And TypeOf CURRENT_CONTROL Is TextBox Then - DirectCast(CURRENT_CONTROL, TextBox).Multiline = True + If newHeight > 21 And TypeOf CurrentControl Is TextBox Then + DirectCast(CurrentControl, TextBox).Multiline = True End If - CURRENT_CONTROL.Size = New Size(CURRENT_CONTROL.Width, newHeight) + + CurrentControl.Size = New Size(CurrentControl.Width, newHeight) UpdateSingleValue("WIDTH", newHeight) End If End Sub Private Sub btnheight_minus_Click(sender As System.Object, e As EventArgs) Handles btnheight_minus.Click - If CURRENT_CONTROL Is Nothing = False Then - Dim newHeight As Integer = CURRENT_CONTROL.Height - 5 + If CurrentControl Is Nothing = False Then + Dim newHeight As Integer = CurrentControl.Height - 5 - If newHeight < 22 And TypeOf CURRENT_CONTROL Is TextBox Then - DirectCast(CURRENT_CONTROL, TextBox).Multiline = True + If newHeight < 22 And TypeOf CurrentControl Is TextBox Then + DirectCast(CurrentControl, TextBox).Multiline = True End If - CURRENT_CONTROL.Size = New Size(CURRENT_CONTROL.Width, newHeight) - UpdateSingleValue("WIDTH", newHeight) - End If - End Sub - - Private Sub Button2_MouseMove(sender As System.Object, e As MouseEventArgs) Handles btndtp.MouseMove - If MouseIsDown Then - 'Initiate dragging. - btndtp.DoDragDrop("dtp", DragDropEffects.Copy) - End If - MouseIsDown = False - End Sub - - - Private Sub btnVektor_MouseMove(sender As Object, e As MouseEventArgs) Handles btnVektor.MouseMove - If MouseIsDown Then - 'Initiate dragging. - btnVektor.DoDragDrop("dgv", DragDropEffects.Copy) - End If - MouseIsDown = False - End Sub - Private Sub btnTabelle_MouseMove(sender As Object, e As MouseEventArgs) Handles btnTabelle.MouseMove - If MouseIsDown Then - 'Initiate dragging. - btnVektor.DoDragDrop("tb", DragDropEffects.Copy) - End If - MouseIsDown = False - End Sub - Private Sub Button1_MouseMove(sender As Object, e As MouseEventArgs) Handles btnCheckbox.MouseMove - If MouseIsDown Then - 'Initiate dragging. - btnCheckbox.DoDragDrop("chk", DragDropEffects.Copy) - End If - MouseIsDown = False - End Sub + ' Verhindert, dass das Control unsichtbar wird + If newHeight > 1 Then + Exit Sub + End If - 'Private Sub rbIndex_CheckedChanged(sender As Object, e As EventArgs) Handles rbIndex.CheckedChanged - ' If rbIndex.Checked Then - ' cmbIndex.Visible = True - ' INDEX_NAMETextBox.Visible = False - ' lblIndex.Text = "Zugeordneter Index" - ' Else - ' cmbIndex.Visible = False - ' INDEX_NAMETextBox.Visible = True - ' lblIndex.Text = "Bezeichner und getätigte Eingabe werden in das Vektorfeld geschrieben" - ' End If - 'End Sub - - 'Private Sub rbVektor_CheckedChanged(sender As Object, e As EventArgs) Handles rbVektor.CheckedChanged - ' If rbVektor.Checked Then - ' Me.INDEX_NAMETextBox.Visible = True - ' Me.cmbIndex.Visible = False - ' Me.lblIndex.Text = "Bezeichner und getätigte Eingabe werden in das Vektorfeld geschrieben" - ' Else - ' Me.INDEX_NAMETextBox.Visible = False - ' Me.cmbIndex.Visible = True - ' Me.lblIndex.Text = "Zugeordneter Index" - ' End If - 'End Sub - - Private Sub INDEX_NAMETextBox_Leave(sender As Object, e As EventArgs) Handles INDEX_NAMETextBox.Leave - If INDEX_NAMETextBox.Text <> "" And CURRENT_CONTROL_ID <> 0 Then - TBPM_PROFILE_CONTROLSTableAdapter.cmdUpdateIndexname("[%VKT" & INDEX_NAMETextBox.Text, Environment.UserName, CURRENT_CONTROL_ID) + CurrentControl.Size = New Size(CurrentControl.Width, newHeight) + UpdateSingleValue("WIDTH", newHeight) End If End Sub - Private Sub READ_ONLYCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles READ_ONLYCheckBox.CheckedChanged - If READ_ONLYCheckBox.Checked Then - Me.VALIDATIONCheckBox.Checked = True - Me.LOAD_IDX_VALUECheckBox.Checked = True - End If - End Sub Private Sub btnrefresh_Click(sender As Object, e As EventArgs) Handles btnrefresh.Click - Controls_laden() + LoadControls() End Sub - Private Sub btnShowConnections_Click(sender As Object, e As EventArgs) Handles btnShowConnections.Click - frmConnection.ShowDialog() - Try - Me.TBPM_CONNECTIONTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBPM_CONNECTION) - Catch ex As Exception - ClassLogger.Add(ex.Message) - End Try - End Sub - - Private Sub btnEditor_Click(sender As Object, e As EventArgs) Handles btnEditor.Click - Dim CONID = 0 - If cmbConnection.SelectedValue > 0 Then - CONID = cmbConnection.SelectedValue - End If - TBPM_PROFILE_CONTROLSBindingSource.EndEdit() - If DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS.GetChanges Is Nothing = False Then - Me.CHANGED_WHOTextBox.Text = Environment.UserName - TBPM_PROFILE_CONTROLSBindingSource.EndEdit() - TBPM_PROFILE_CONTROLSTableAdapter.Update(DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS) - End If - If CURRENT_CONTROL_ID <> 0 Then - Dim sql = "SELECT T.CONNECTION_ID,T1.BEZEICHNUNG AS 'CON_STRING',ISNULL(T.SQL_UEBERPRUEFUNG,'') AS 'SQL_COMMAND' FROM TBPM_PROFILE_CONTROLS T, TBPM_CONNECTION T1 WHERE " & - "T.CONNECTION_ID = T1.GUID AND T.GUID = " & CURRENT_CONTROL_ID - CURRENT_DT_SQL_CONFIG_TABLE = ClassDatabase.Return_Datatable(sql, True) - CURRENT_INDEX_ID = CURRENT_CONTROL_ID - CURRENT_DESIGN_TYPE = "INPUT_INDEX" - CURRENT_SQL_COMAMND = SQL_CommandTextBox.Text - CURRENT_SQL_CON = CONID - frmSQL_DESIGNER.ShowDialog() - - 'Load_Control(CURRENT_CONTROL_ID) - TabControlEigenschaften.SelectedIndex = 2 - Else - MsgBox("Please choose a control!", MsgBoxStyle.Information) - End If - - End Sub - -#Region "Rewrite" ''' ''' Setzt die Eventhandler für ein Control, die für die Bewegung via Drag & Drop und das Laden der Eigentschaften verantwortlich sind ''' @@ -1135,13 +462,13 @@ Public Class frmFormDesigner Private Sub OnControl_MouseDown(sender As Control, e As MouseEventArgs) If e.Button = MouseButtons.Left Then - CURRENT_CONTROL = sender + CurrentControl = sender Mouse_BeginLocation = e.Location sender.BringToFront() Mouse_IsPressed = True - Console.WriteLine("CURRENT_CONTROL:" & CURRENT_CONTROL.Name) + Console.WriteLine("CURRENT_CONTROL:" & CurrentControl.Name) End If End Sub @@ -1154,26 +481,51 @@ Public Class frmFormDesigner ' Control Eigenschaften laden LoadControlProperties(sender) - If Mouse_IsMoving Then - Mouse_IsMoving = False + If Mouse_IsMoving = False Then + MyBase.Cursor = Cursors.Default + Exit Sub + End If - Dim CurrentPosition = CURRENT_CONTROL.Location - Dim OldPosition As Point = DirectCast(pgControls.SelectedObject, BaseProperties).Location + Mouse_IsMoving = False - If Point.op_Inequality(CurrentPosition, OldPosition) Then - DirectCast(pgControls.SelectedObject, BaseProperties).Location = CURRENT_CONTROL.Location + Dim CurrentPosition = CurrentControl.Location + Dim OldPosition As Point = DirectCast(pgControls.SelectedObject, BaseProperties).Location - UpdateSingleValue("X_LOC", CURRENT_CONTROL.Location.X) - UpdateSingleValue("Y_LOC", CURRENT_CONTROL.Location.Y) - End If + If Not Point.op_Inequality(CurrentPosition, OldPosition) Then + MyBase.Cursor = Cursors.Default + Exit Sub End If + ' Das Control sollte nicht außerhalb des Panels geschoben werden (Koordinaten kleiner 0) + If CurrentPosition.X < 0 Then + CurrentControl.Location = New Point(0, CurrentControl.Location.Y) + End If + + If CurrentPosition.Y < 0 Then + CurrentControl.Location = New Point(CurrentControl.Location.X, 0) + End If + + ' Ebenso nicht über die Größe des Panels (X-Achse) + If CurrentPosition.X > pnldesigner.Width Then + CurrentControl.Location = New Point(pnldesigner.Width - CurrentControl.Width, CurrentControl.Location.Y) + End If + + ' Ebenso nicht über die Größe des Panels (Y-Achse) + If CurrentPosition.Y > pnldesigner.Height Then + CurrentControl.Location = New Point(CurrentControl.Location.X, pnldesigner.Height - CurrentControl.Height) + End If + + DirectCast(pgControls.SelectedObject, BaseProperties).Location = CurrentControl.Location + + UpdateSingleValue("X_LOC", CurrentControl.Location.X) + UpdateSingleValue("Y_LOC", CurrentControl.Location.Y) + MyBase.Cursor = Cursors.Default End Sub Private Sub OnControl_MouseMove(sender As Control, e As MouseEventArgs) Try - If CURRENT_CONTROL Is Nothing Then + If CurrentControl Is Nothing Then Exit Sub End If @@ -1186,7 +538,7 @@ Public Class frmFormDesigner Dim CurrentPosition As Point = GetCursorPosition() If Point.op_Inequality(CurrentPosition, Mouse_BeginLocation) Then - CURRENT_CONTROL.Location = New Point(CurrentPosition.X - Mouse_BeginLocation.X, CurrentPosition.Y - Mouse_BeginLocation.Y) + CurrentControl.Location = New Point(CurrentPosition.X - Mouse_BeginLocation.X, CurrentPosition.Y - Mouse_BeginLocation.Y) End If End If Catch ex As Exception @@ -1250,27 +602,26 @@ Public Class frmFormDesigner ' 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) + TBPM_PROFILE_CONTROLSTableAdapter.FillByProfil(DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS, ProfileId) row = dt.AsEnumerable().Where(Function(r As DataRow) Return r.Item("GUID") = sender.Tag End Function).Single() ' Globale Variablen setzen - CURRENT_CONTROL = sender + CurrentControl = sender CURRENT_CONTROL_ID = sender.Tag SetActiveControlColor() - gbxControl.Visible = True - - 'Windream Abfragen, sollten einmal beim Start des Formulars geladen werden - Dim indicies As List(Of String) = clsWD_GET.GetIndicesByObjecttype(CURRENT_OBJECTTYPE).ToList() - Dim choiceLists As List(Of String) = clsWD_GET.GetChoiceLists() - ' Mithilfe von CreatePropsObject(WithIndicies) wird ein Basis Objekt mit grundlegenden ' Eigenschaften angelegt. Danach können für jeden Control Typ spezifische Eigenschaften festgelegt werden. - If TypeOf sender Is Label Then + If TypeOf sender Is ClassControlCreator.LineLabel Then + Dim line As ClassControlCreator.LineLabel = sender + Dim lineProps As LineLabelProperties = CreatePropsObject(New LineLabelProperties, row) + + props = lineProps + ElseIf TypeOf sender Is Label Then Dim label As Label = sender Dim labelProps As LabelProperties = CreatePropsObject(New LabelProperties, row) labelProps.Text = label.Text @@ -1278,32 +629,32 @@ Public Class frmFormDesigner props = labelProps ElseIf TypeOf sender Is CheckBox Then Dim check As CheckBox = sender - Dim checkProps As CheckboxProperties = CreatePropsObjectWithIndicies(New CheckboxProperties, row, indicies) + Dim checkProps As CheckboxProperties = CreatePropsObjectWithIndicies(New CheckboxProperties, row, Windream_Indicies) checkProps.Text = check.Text props = checkProps ElseIf TypeOf sender Is TextBox Then Dim txt As TextBox = sender - Dim txtProps As TextboxProperties = CreatePropsObjectWithIndicies(New TextboxProperties, row, indicies) + Dim txtProps As TextboxProperties = CreatePropsObjectWithIndicies(New TextboxProperties, row, Windream_Indicies) props = txtProps ElseIf TypeOf sender Is ComboBox Then Dim cmb As ComboBox = sender - Dim cmbProps As ComboboxProperties = CreatePropsObjectWithIndicies(New ComboboxProperties, row, indicies) - cmbProps.ChoiceLists = choiceLists + Dim cmbProps As ComboboxProperties = CreatePropsObjectWithIndicies(New ComboboxProperties, row, Windream_Indicies) + cmbProps.ChoiceLists = Windream_ChoiceLists cmbProps.ChoiceList = NotNull(row.Item("CHOICE_LIST"), "") props = cmbProps ElseIf TypeOf sender Is DateTimePicker Then Dim dtp As DateTimePicker = sender - Dim dtpProps As DatepickerProperties = CreatePropsObjectWithIndicies(New DatepickerProperties, row, indicies) + Dim dtpProps As DatepickerProperties = CreatePropsObjectWithIndicies(New DatepickerProperties, row, Windream_Indicies) props = dtpProps ElseIf TypeOf sender Is DataGridView Then Dim grid As DataGridView = sender - Dim gridProps As GridViewProperties = CreatePropsObjectWithIndicies(New GridViewProperties, row, indicies) + Dim gridProps As GridViewProperties = CreatePropsObjectWithIndicies(New GridViewProperties, row, Windream_VectorIndicies) props = gridProps Else @@ -1325,38 +676,38 @@ Public Class frmFormDesigner UpdateSingleValue("X_LOC", DirectCast(newValue, Point).X) UpdateSingleValue("Y_LOC", DirectCast(newValue, Point).Y) - CURRENT_CONTROL.Location = newValue + CurrentControl.Location = newValue Case "X" UpdateSingleValue("X_LOC", CInt(newValue)) - CURRENT_CONTROL.Location = New Point(newValue, CURRENT_CONTROL.Location.Y) + CurrentControl.Location = New Point(newValue, CurrentControl.Location.Y) Case "Y" UpdateSingleValue("Y_LOC", CInt(newValue)) - CURRENT_CONTROL.Location = New Point(CURRENT_CONTROL.Location.X, newValue) + CurrentControl.Location = New Point(CurrentControl.Location.X, newValue) Case "Size" UpdateSingleValue("WIDTH", DirectCast(newValue, Size).Width) UpdateSingleValue("HEIGHT", DirectCast(newValue, Size).Height) - CURRENT_CONTROL.Size = newValue + CurrentControl.Size = newValue Case "Width" UpdateSingleValue("WIDTH", CInt(newValue)) - CURRENT_CONTROL.Size = New Size(newValue, CURRENT_CONTROL.Size.Height) + CurrentControl.Size = New Size(newValue, CurrentControl.Size.Height) Case "Height" UpdateSingleValue("HEIGHT", CInt(newValue)) - CURRENT_CONTROL.Size = New Size(CURRENT_CONTROL.Size.Width, newValue) + CurrentControl.Size = New Size(CurrentControl.Size.Width, newValue) Case "Name" UpdateSingleValue("NAME", newValue) - CURRENT_CONTROL.Name = newValue + CurrentControl.Name = newValue Case "Index" UpdateSingleValue("INDEX_NAME", newValue) @@ -1364,7 +715,7 @@ Public Class frmFormDesigner Case "Text" UpdateSingleValue("CTRL_TEXT", newValue) - CURRENT_CONTROL.Text = newValue + CurrentControl.Text = newValue Case "Required" UpdateSingleValue("VALIDATION", IIf(newValue = True, 1, 0)) @@ -1379,12 +730,12 @@ Public Class frmFormDesigner UpdateSingleValue("FONT_FAMILY", font.FontFamily.Name) UpdateSingleValue("FONT_STYLE", font.Style.ToString) - CURRENT_CONTROL.Font = font + CurrentControl.Font = font Case "TextColor" Dim color As Color = newValue UpdateSingleValue("FONT_COLOR", ColorToInt(color)) - CURRENT_CONTROL.ForeColor = color + CurrentControl.ForeColor = color Case "SQLCommand" UpdateSingleValue("SQL_UEBERPRUEFUNG", newValue) UpdateSingleValue("CHOICE_LIST", "") @@ -1399,7 +750,7 @@ Public Class frmFormDesigner Dim guid As Integer = CURRENT_CONTROL_ID Dim escapedValue = value - ' Strings und SQL-Commands müssen vor dem speichern escaped und mit Anführungszeichen versehen werden + ' Strings und SQL-Commands müssen vor dem Speichern escaped und mit Anführungszeichen versehen werden If TypeOf value Is String Then escapedValue = $"'{value}'" ElseIf TypeOf value Is InputProperties.SQLValue Then @@ -1418,5 +769,4 @@ Public Class frmFormDesigner ClassLogger.Add(msg) End Try End Sub -#End Region End Class \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/frmProfileDesigner.vb b/app/DD_PM_WINDREAM/frmProfileDesigner.vb index 6223f93..3cbf288 100644 --- a/app/DD_PM_WINDREAM/frmProfileDesigner.vb +++ b/app/DD_PM_WINDREAM/frmProfileDesigner.vb @@ -221,7 +221,12 @@ Public Class frmProfileDesigner My.Settings.Save() CURRENT_OBJECTTYPE = cmbObjekttypen.Text CURRENT_ProfilName = NAMETextBox.Text + + frmFormDesigner.ProfileId = CURRENT_ProfilGUID + frmFormDesigner.ProfileName = CURRENT_ProfilName + frmFormDesigner.ProfileObjectType = cmbObjekttypen.Text frmFormDesigner.ShowDialog() + Else MsgBox("Eindeutiges Profil konnte nicht an den FormDesigner weitergegeben werden:", MsgBoxStyle.Exclamation) End If diff --git a/app/DD_PM_WINDREAM/frmValidator.Designer.vb b/app/DD_PM_WINDREAM/frmValidator.Designer.vb index e6a125e..475869c 100644 --- a/app/DD_PM_WINDREAM/frmValidator.Designer.vb +++ b/app/DD_PM_WINDREAM/frmValidator.Designer.vb @@ -396,6 +396,7 @@ Partial Class frmValidator 'TableAdapterManager ' Me.TableAdapterManager.BackupDataSetBeforeUpdate = False + Me.TableAdapterManager.TBDD_USERTableAdapter = Nothing Me.TableAdapterManager.TBPM_CONNECTIONTableAdapter = Me.TBPM_CONNECTIONTableAdapter Me.TableAdapterManager.TBPM_CONTROL_TABLETableAdapter = Me.TBPM_CONTROL_TABLETableAdapter Me.TableAdapterManager.TBPM_ERROR_LOGTableAdapter = Nothing @@ -406,7 +407,6 @@ Partial Class frmValidator Me.TableAdapterManager.TBPM_PROFILE_FINAL_INDEXINGTableAdapter = Me.TBPM_PROFILE_FINAL_INDEXINGTableAdapter Me.TableAdapterManager.TBPM_PROFILETableAdapter = Me.TBPM_PROFILETableAdapter Me.TableAdapterManager.TBPM_TYPETableAdapter = Nothing - Me.TableAdapterManager.TBDD_USERTableAdapter = Nothing Me.TableAdapterManager.UpdateOrder = DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete ' 'TBPM_CONNECTIONTableAdapter @@ -966,6 +966,7 @@ Partial Class frmValidator Me.SplitContainer1.Size = New System.Drawing.Size(962, 593) Me.SplitContainer1.SplitterDistance = 477 Me.SplitContainer1.TabIndex = 37 + Me.SplitContainer1.TabStop = False ' 'grpbxMailBody ' diff --git a/app/DD_PM_WINDREAM/frmValidator.vb b/app/DD_PM_WINDREAM/frmValidator.vb index fce8dce..0a81502 100644 --- a/app/DD_PM_WINDREAM/frmValidator.vb +++ b/app/DD_PM_WINDREAM/frmValidator.vb @@ -655,7 +655,7 @@ Public Class frmValidator If LogErrorsOnly = False Then ClassLogger.Add(" >> Versuch DTP zu laden", False) ctrl = ClassControlCreator.CreateExistingDatepicker(dr, False) - add_DTP(dr.Item("GUID"), dr.Item("CTRL_NAME"), CInt(dr.Item("X_LOC")), CInt(dr.Item("Y_LOC")), CInt(dr.Item("WIDTH")), CInt(dr.Item("HEIGHT")), dr.Item("READ_ONLY"), dr.Item("LOAD_IDX_VALUE")) 'dr.Item("INDEX_NAME"), + 'add_DTP(dr.Item("GUID"), dr.Item("NAME"), CInt(dr.Item("X_LOC")), CInt(dr.Item("Y_LOC")), CInt(dr.Item("WIDTH")), CInt(dr.Item("HEIGHT")), dr.Item("READ_ONLY"), dr.Item("LOAD_IDX_VALUE")) 'dr.Item("INDEX_NAME"), Case "DGV" If LogErrorsOnly = False Then ClassLogger.Add(" >> Versuch DGV zu laden", False) Dim dgv = ClassControlCreator.CreateExistingDataGridView(dr, False) @@ -679,6 +679,10 @@ Public Class frmValidator ctrl = ClassControlCreator.CreateExistingTable(dr, columns, False) 'add_TABLE(dr.Item("GUID"), dr.Item("CTRL_NAME"), CInt(dr.Item("X_LOC")), CInt(dr.Item("Y_LOC")), dr.Item("WIDTH"), CInt(dr.Item("HEIGHT")), dr.Item("READ_ONLY")) + Case "LINE" + If LogErrorsOnly = False Then ClassLogger.Add(" >> Versuch Linie zu laden", False) + + ctrl = ClassControlCreator.CreateExistingLine(dr, False) End Select If first_control Is Nothing Then