diff --git a/app/DD_PM_WINDREAM/ClassImageValue.vb b/app/DD_PM_WINDREAM/ClassImageValue.vb index 4bd2aeb..2ce5b0c 100644 --- a/app/DD_PM_WINDREAM/ClassImageValue.vb +++ b/app/DD_PM_WINDREAM/ClassImageValue.vb @@ -13,4 +13,12 @@ Public Class ImageValue Public Sub New(value As String) Me.Value = value End Sub + + Public Overrides Function ToString() As String + If Value = String.Empty Then + Return String.Empty + Else + Return "(Image)" + End If + End Function End Class \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/ClassSnapPanel.vb b/app/DD_PM_WINDREAM/ClassSnapPanel.vb new file mode 100644 index 0000000..02fd701 --- /dev/null +++ b/app/DD_PM_WINDREAM/ClassSnapPanel.vb @@ -0,0 +1,56 @@ +Public Class ClassSnapPanel + Inherits System.Windows.Forms.Panel + + Private _ShowGrid As Boolean = True + Private _GridSize As Integer = 16 + + Private Property AutoScaleMode As AutoScaleMode + + Public Property GridSize As Integer + Get + Return _GridSize + End Get + Set(value As Integer) + _GridSize = value + Refresh() + End Set + End Property + + Public Property ShowGrid As Boolean + Get + Return _ShowGrid + End Get + Set(value As Boolean) + _ShowGrid = value + Refresh() + End Set + End Property + + Protected Overrides Sub OnControlAdded(e As System.Windows.Forms.ControlEventArgs) + AddHandler e.Control.LocationChanged, AddressOf AlignToGrid + AddHandler e.Control.DragDrop, AddressOf AlignToGrid + MyBase.OnControlAdded(e) + End Sub + + Protected Overrides Sub OnControlRemoved(e As System.Windows.Forms.ControlEventArgs) + RemoveHandler e.Control.LocationChanged, AddressOf AlignToGrid + RemoveHandler e.Control.DragDrop, AddressOf AlignToGrid + MyBase.OnControlRemoved(e) + End Sub + + Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs) + If _ShowGrid Then + ControlPaint.DrawGrid(e.Graphics, ClientRectangle, New Size(_GridSize, _GridSize), BackColor) + End If + MyBase.OnPaint(e) + End Sub + + Private Sub AlignToGrid(sender As Object, e As EventArgs) + If _ShowGrid Then + Dim item As Control = CType(sender, Control) + Dim x As Integer = Math.Round(item.Left / _GridSize) * _GridSize + Dim y As Integer = Math.Round(item.Top / _GridSize) * _GridSize + item.Location = New Point(x, y) + End If + End Sub +End Class diff --git a/app/DD_PM_WINDREAM/DD_PM_WINDREAM.vbproj b/app/DD_PM_WINDREAM/DD_PM_WINDREAM.vbproj index c312e41..3d9c178 100644 --- a/app/DD_PM_WINDREAM/DD_PM_WINDREAM.vbproj +++ b/app/DD_PM_WINDREAM/DD_PM_WINDREAM.vbproj @@ -212,6 +212,9 @@ + + Component + diff --git a/app/DD_PM_WINDREAM/ModuleControlProperties.vb b/app/DD_PM_WINDREAM/ModuleControlProperties.vb index a626d0f..522ed09 100644 --- a/app/DD_PM_WINDREAM/ModuleControlProperties.vb +++ b/app/DD_PM_WINDREAM/ModuleControlProperties.vb @@ -80,7 +80,7 @@ Public Module ModuleControlProperties Private _sql_command As String Private _Override_SQL As String Private _Enable_SQL As String - Private _image_Value As String + Private _default_value Public Property Required() As Boolean @@ -124,15 +124,7 @@ Public Module ModuleControlProperties _Enable_SQL = value.Value End Set End Property - - Public Property CtrlImage() As ImageValue - Get - Return New ImageValue(NotNull(_image_Value, "")) - End Get - Set(ByVal value As ImageValue) - _image_Value = value.Value - End Set - End Property + Public Property DefaultValue() As String Get @@ -224,8 +216,22 @@ Public Module ModuleControlProperties End Class Public Class ButtonProperties Inherits InputProperties + + Private _image_Value As String + + Public Property Text() As String + + + Public Property CtrlImage() As ImageValue + Get + Return New ImageValue(NotNull(_image_Value, "")) + End Get + Set(ByVal value As ImageValue) + _image_Value = value.Value + End Set + End Property End Class Public Class LookupControlProperties Inherits InputProperties diff --git a/app/DD_PM_WINDREAM/frmFormDesigner.Designer.vb b/app/DD_PM_WINDREAM/frmFormDesigner.Designer.vb index 66d780d..b2bdb28 100644 --- a/app/DD_PM_WINDREAM/frmFormDesigner.Designer.vb +++ b/app/DD_PM_WINDREAM/frmFormDesigner.Designer.vb @@ -33,7 +33,7 @@ Partial Class frmFormDesigner Me.btndtp = New System.Windows.Forms.Button() Me.btntextbox = New System.Windows.Forms.Button() Me.btnlabel = New System.Windows.Forms.Button() - Me.pnldesigner = New System.Windows.Forms.Panel() + Me.pnldesigner = New DD_PM_WINDREAM.ClassSnapPanel() Me.Label1 = New System.Windows.Forms.Label() Me.lblhintergrund = New System.Windows.Forms.Label() Me.TabControlEigenschaften = New System.Windows.Forms.TabControl() @@ -215,8 +215,10 @@ Partial Class frmFormDesigner Me.pnldesigner.Controls.Add(Me.Label1) Me.pnldesigner.Controls.Add(Me.lblhintergrund) Me.pnldesigner.Dock = System.Windows.Forms.DockStyle.Fill + Me.pnldesigner.GridSize = 20 Me.pnldesigner.Location = New System.Drawing.Point(0, 0) Me.pnldesigner.Name = "pnldesigner" + Me.pnldesigner.ShowGrid = True Me.pnldesigner.Size = New System.Drawing.Size(842, 650) Me.pnldesigner.TabIndex = 3 ' @@ -287,7 +289,7 @@ Partial Class frmFormDesigner Me.pageFormat.Location = New System.Drawing.Point(4, 22) Me.pageFormat.Name = "pageFormat" Me.pageFormat.Padding = New System.Windows.Forms.Padding(3) - Me.pageFormat.Size = New System.Drawing.Size(532, 523) + Me.pageFormat.Size = New System.Drawing.Size(363, 439) Me.pageFormat.TabIndex = 1 Me.pageFormat.Text = "Format" Me.pageFormat.UseVisualStyleBackColor = True @@ -428,6 +430,7 @@ Partial Class frmFormDesigner Me.TableAdapterManager.BackupDataSetBeforeUpdate = False Me.TableAdapterManager.TBDD_CONNECTIONTableAdapter = Nothing Me.TableAdapterManager.TBDD_EMAIL_TEMPLATETableAdapter = Nothing + Me.TableAdapterManager.TBDD_GUI_LANGUAGE_PHRASETableAdapter = Nothing Me.TableAdapterManager.TBDD_USERTableAdapter = Nothing Me.TableAdapterManager.TBPM_CONTROL_TABLETableAdapter = Nothing Me.TableAdapterManager.TBPM_ERROR_LOGTableAdapter = Nothing @@ -536,7 +539,7 @@ Partial Class frmFormDesigner 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 pnldesigner As DD_PM_WINDREAM.ClassSnapPanel Friend WithEvents btndtp As System.Windows.Forms.Button Friend WithEvents lblhintergrund As System.Windows.Forms.Label Friend WithEvents btndelete As System.Windows.Forms.Button diff --git a/app/DD_PM_WINDREAM/frmFormDesigner.vb b/app/DD_PM_WINDREAM/frmFormDesigner.vb index fc3e001..babeb58 100644 --- a/app/DD_PM_WINDREAM/frmFormDesigner.vb +++ b/app/DD_PM_WINDREAM/frmFormDesigner.vb @@ -522,6 +522,8 @@ Public Class frmFormDesigner oControl.BackColor = oControl.ForeColor Case "DigitalData.Controls.LookupGrid.LookupControl2" oControl.BackColor = Color.White + Case "System.Windows.Forms.Button" + oControl.BackColor = SystemColors.Control End Select End If End If @@ -921,7 +923,7 @@ Public Class frmFormDesigner If Not IsDBNull(row.Item("IMAGE_CONTROL")) Then Dim obimg() As Byte = row.Item("IMAGE_CONTROL") Dim oBitmap As Bitmap = ByteArrayToBitmap(obimg) - oButtonProps.CtrlImage = New ImageValue(Nothing) + oButtonProps.CtrlImage = New ImageValue("IMAGE") oButton.Image = oBitmap End If diff --git a/app/DD_PM_WINDREAM/frmSQL_DESIGNER.vb b/app/DD_PM_WINDREAM/frmSQL_DESIGNER.vb index 77b1c6a..b48fda6 100644 --- a/app/DD_PM_WINDREAM/frmSQL_DESIGNER.vb +++ b/app/DD_PM_WINDREAM/frmSQL_DESIGNER.vb @@ -226,22 +226,10 @@ Public Class frmSQL_DESIGNER Private Sub btnSaveSQLCommand_Click(sender As Object, e As EventArgs) Handles btnSaveSQLCommand.Click If CURRENT_DESIGN_TYPE = "FINAL_INDEX" Then ' SQL wird nicht hier, sondern in frmAdministration gespeichert - 'TBPM_PROFILE_FINAL_INDEXINGTableAdapter.cmdUpdateSQL(cmbConnection.SelectedValue, SQL_COMMANDTextBox.Text, Environment.UserName, CURRENT_INDEX_ID) lblSaveFinalIndex.Visible = True lblSaveFinalIndex.Text = "SQL für finalen Index wurde erfolgreich gespeichert! " & Now.ToString - Me.ConnectionId = cmbConnection.SelectedValue - ElseIf CURRENT_DESIGN_TYPE = "INPUT_INDEX" Then - Dim command = SQL_COMMANDTextBox.Text - command = command.Replace("'", "''") - Dim upd As String = String.Format("UPDATE TBPM_PROFILE_CONTROLS SET CONNECTION_ID = {0} , SQL_UEBERPRUEFUNG = '{1}' WHERE GUID = {2}", cmbConnection.SelectedValue, command, CURRENT_CONTROL_ID) - If ClassDatabase.Execute_non_Query(upd, True) Then - lblSaveFinalIndex.Visible = True - lblSaveFinalIndex.Text = "SQL für Indexdisplay wurde erfolgreich gespeichert! " & Now.ToString - Else - lblSaveFinalIndex.Visible = False - End If End If - Me.SQLCommand = SQL_COMMANDTextBox.Text + SQLCommand = SQL_COMMANDTextBox.Text End Sub Private Sub btnAddControl_Click(sender As Object, e As EventArgs) Handles btnAddControl.Click diff --git a/app/DD_PM_WINDREAM/frmValidator.vb b/app/DD_PM_WINDREAM/frmValidator.vb index e1ce602..ea91a57 100644 --- a/app/DD_PM_WINDREAM/frmValidator.vb +++ b/app/DD_PM_WINDREAM/frmValidator.vb @@ -2799,7 +2799,6 @@ Public Class frmValidator If oValue.ToUpper = "SQL-Command".ToUpper Then '###### Indexierung mit variablen SQL ### LOGGER.Debug("Indexing wih dynamic sql...") Dim oSQLCommand = oFinalIndexRow.Item("SQL_COMMAND") - s oSQLCommand = clsPatterns.ReplaceAllValues(oSQLCommand, pnldesigner, CURRENT_WMFILE, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID) If IsNothing(oSQLCommand) Then errormessage = "Error while replacing Values in final indexing - Check the log"