From f9ae01b6311c8da6695007efe6aa783e7257b125 Mon Sep 17 00:00:00 2001 From: Developer01 Date: Tue, 1 Apr 2025 08:19:42 +0200 Subject: [PATCH] V 2.4.0.1 FormDesigner Verbesserungen, Monitoring Bug Objektverweis bei 4. Grid --- app/TaskFlow/ClassParamRefresh.vb | 18 +++++ app/TaskFlow/ModuleRuntimeVariables.vb | 2 + app/TaskFlow/My Project/AssemblyInfo.vb | 2 +- app/TaskFlow/TaskFlow.vbproj | 5 +- app/TaskFlow/frmFormDesigner.Designer.vb | 46 ++++++++---- app/TaskFlow/frmFormDesigner.resx | 57 +++++++++------ app/TaskFlow/frmFormDesigner.vb | 89 +++++++++++++++++------- app/TaskFlow/frmMonitor.vb | 68 ++++++++++++++---- 8 files changed, 210 insertions(+), 77 deletions(-) diff --git a/app/TaskFlow/ClassParamRefresh.vb b/app/TaskFlow/ClassParamRefresh.vb index 454467f..1b1b5b8 100644 --- a/app/TaskFlow/ClassParamRefresh.vb +++ b/app/TaskFlow/ClassParamRefresh.vb @@ -158,6 +158,24 @@ Public Class ClassParamRefresh Catch ex As Exception LAST_ADDED_COLUMN = "" + End Try + ElseIf oMode.StartsWith("PM.MON_COL_CHANGED_WHEN") Then + Dim oLEDITEDCOL = oMode.Replace("PM.MON_COL_CHANGED_WHEN=", "") + Try + MON_EDITED_COLUMN = oLEDITEDCOL + LOGGER.Debug($"MON_EDITED_COLUMN: {oLEDITEDCOL}") + Catch ex As Exception + + + End Try + ElseIf oMode.StartsWith("PM.MON_COL_ADDED_WHEN") Then + Dim oLEDITEDCOL = oMode.Replace("PM.MON_COL_ADDED_WHEN=", "") + Try + MON_ADDED_COLUMN = oLEDITEDCOL + LOGGER.Debug($"MON_COL_ADDED_WHEN: {oLEDITEDCOL}") + Catch ex As Exception + + End Try ElseIf oMode.StartsWith("PM.USE_APPSERVER") Then Dim oUSE_APPSERVER = oMode.Replace("PM.USE_APPSERVER=", "") diff --git a/app/TaskFlow/ModuleRuntimeVariables.vb b/app/TaskFlow/ModuleRuntimeVariables.vb index 66cad3a..ff51a68 100644 --- a/app/TaskFlow/ModuleRuntimeVariables.vb +++ b/app/TaskFlow/ModuleRuntimeVariables.vb @@ -91,6 +91,8 @@ Module ModuleRuntimeVariables Public Property INACTIVITYRecognized As Boolean = False Public Property LAST_EDITED_COLUMN As String = "NONE" Public Property LAST_ADDED_COLUMN As String = "NONE" + Public Property MON_EDITED_COLUMN As String = "NONE" + Public Property MON_ADDED_COLUMN As String = "NONE" Public Property USE_APPSERVER As Boolean = False Public Property SEARCH1 As String = "" Public Property SEARCH2 As String = "" diff --git a/app/TaskFlow/My Project/AssemblyInfo.vb b/app/TaskFlow/My Project/AssemblyInfo.vb index 2be1fb8..350d697 100644 --- a/app/TaskFlow/My Project/AssemblyInfo.vb +++ b/app/TaskFlow/My Project/AssemblyInfo.vb @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + diff --git a/app/TaskFlow/TaskFlow.vbproj b/app/TaskFlow/TaskFlow.vbproj index 3493f1f..b400300 100644 --- a/app/TaskFlow/TaskFlow.vbproj +++ b/app/TaskFlow/TaskFlow.vbproj @@ -155,8 +155,9 @@ ..\..\..\..\2_DLL Projekte\DDMonorepo\Controls.LookupGrid\bin\Debug\DigitalData.Controls.LookupGrid.dll - - ..\..\..\DDMonorepo\Controls.SnapPanel\bin\Debug\DigitalData.Controls.SnapPanel.dll + + False + ..\..\..\..\2_DLL Projekte\DDMonorepo\Controls.SnapPanel\bin\Debug\DigitalData.Controls.SnapPanel.dll ..\packages\DigitalData.GUIs.Common.2.6.2\lib\net462\DigitalData.GUIs.Common.dll diff --git a/app/TaskFlow/frmFormDesigner.Designer.vb b/app/TaskFlow/frmFormDesigner.Designer.vb index b4118fd..b9f8ada 100644 --- a/app/TaskFlow/frmFormDesigner.Designer.vb +++ b/app/TaskFlow/frmFormDesigner.Designer.vb @@ -49,12 +49,12 @@ Partial Class frmFormDesigner Me.bbtniheight_plus = New DevExpress.XtraBars.BarButtonItem() Me.bbtniheight_min = New DevExpress.XtraBars.BarButtonItem() Me.tslblAenderungen = New DevExpress.XtraBars.BarStaticItem() + Me.bstitmProfilID = New DevExpress.XtraBars.BarStaticItem() Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonGroupControlFunctions = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonGroupControls = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibPGCtrlWidth = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() - Me.RibPGCtrlheight = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar() Me.TBPM_PROFILE_CONTROLSBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.DD_DMSLiteDataSet = New DD_ProcessManager.DD_DMSLiteDataSet() @@ -73,6 +73,8 @@ Partial Class frmFormDesigner Me.RPGControlFunction = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPage3 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup4 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() + Me.RibPGCtrlheight = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() + Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() CType(Me.SplitContainerDesigner, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainerDesigner.Panel1.SuspendLayout() Me.SplitContainerDesigner.Panel2.SuspendLayout() @@ -125,9 +127,9 @@ Partial Class frmFormDesigner 'RibbonControl1 ' Me.RibbonControl1.ExpandCollapseItem.Id = 0 - Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.bbtnItemFinishSQL, Me.BarButtonItem1, Me.BarButtonItem2, Me.BarButtonItem3, Me.BarStaticItem1, Me.BarButtonItem4, Me.BarButtonItem5, Me.bbtnitLabel, Me.bbtnitTextBox, Me.bbtnitLU, Me.bbtnitTable, Me.bbtnitDatePicker, Me.bbtnitCheckBox, Me.bbtnitButton, Me.bbtnitLine, Me.bbtniwidth_plus, Me.bbtniwidth_min, Me.bbtniheight_plus, Me.bbtniheight_min, Me.tslblAenderungen}) + Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.bbtnItemFinishSQL, Me.BarButtonItem1, Me.BarButtonItem2, Me.BarButtonItem3, Me.BarStaticItem1, Me.BarButtonItem4, Me.BarButtonItem5, Me.bbtnitLabel, Me.bbtnitTextBox, Me.bbtnitLU, Me.bbtnitTable, Me.bbtnitDatePicker, Me.bbtnitCheckBox, Me.bbtnitButton, Me.bbtnitLine, Me.bbtniwidth_plus, Me.bbtniwidth_min, Me.bbtniheight_plus, Me.bbtniheight_min, Me.tslblAenderungen, Me.bstitmProfilID}) resources.ApplyResources(Me.RibbonControl1, "RibbonControl1") - Me.RibbonControl1.MaxItemId = 21 + Me.RibbonControl1.MaxItemId = 22 Me.RibbonControl1.Name = "RibbonControl1" Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1}) Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False] @@ -283,9 +285,15 @@ Partial Class frmFormDesigner Me.tslblAenderungen.Name = "tslblAenderungen" Me.tslblAenderungen.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph ' + 'bstitmProfilID + ' + resources.ApplyResources(Me.bstitmProfilID, "bstitmProfilID") + Me.bstitmProfilID.Id = 21 + Me.bstitmProfilID.Name = "bstitmProfilID" + ' 'RibbonPage1 ' - Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonGroupControlFunctions, Me.RibbonGroupControls, Me.RibPGCtrlWidth, Me.RibPGCtrlheight}) + Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonGroupControlFunctions, Me.RibbonGroupControls, Me.RibPGCtrlWidth, Me.RibbonPageGroup2}) Me.RibbonPage1.Name = "RibbonPage1" resources.ApplyResources(Me.RibbonPage1, "RibbonPage1") ' @@ -318,20 +326,15 @@ Partial Class frmFormDesigner ' 'RibPGCtrlWidth ' + Me.RibPGCtrlWidth.AllowTextClipping = False Me.RibPGCtrlWidth.ItemLinks.Add(Me.bbtniwidth_plus) Me.RibPGCtrlWidth.ItemLinks.Add(Me.bbtniwidth_min) Me.RibPGCtrlWidth.Name = "RibPGCtrlWidth" resources.ApplyResources(Me.RibPGCtrlWidth, "RibPGCtrlWidth") ' - 'RibPGCtrlheight - ' - Me.RibPGCtrlheight.ItemLinks.Add(Me.bbtniheight_plus) - Me.RibPGCtrlheight.ItemLinks.Add(Me.bbtniheight_min) - Me.RibPGCtrlheight.Name = "RibPGCtrlheight" - resources.ApplyResources(Me.RibPGCtrlheight, "RibPGCtrlheight") - ' 'RibbonStatusBar1 ' + Me.RibbonStatusBar1.ItemLinks.Add(Me.bstitmProfilID) Me.RibbonStatusBar1.ItemLinks.Add(Me.tslblAenderungen) resources.ApplyResources(Me.RibbonStatusBar1, "RibbonStatusBar1") Me.RibbonStatusBar1.Name = "RibbonStatusBar1" @@ -426,6 +429,22 @@ Partial Class frmFormDesigner Me.RibbonPageGroup4.Name = "RibbonPageGroup4" resources.ApplyResources(Me.RibbonPageGroup4, "RibbonPageGroup4") ' + 'RibPGCtrlheight + ' + Me.RibPGCtrlheight.AllowTextClipping = False + Me.RibPGCtrlheight.ItemLinks.Add(Me.bbtniheight_plus) + Me.RibPGCtrlheight.ItemLinks.Add(Me.bbtniheight_min) + Me.RibPGCtrlheight.Name = "RibPGCtrlheight" + resources.ApplyResources(Me.RibPGCtrlheight, "RibPGCtrlheight") + ' + 'RibbonPageGroup2 + ' + Me.RibbonPageGroup2.AllowTextClipping = False + Me.RibbonPageGroup2.ItemLinks.Add(Me.bbtniheight_plus) + Me.RibbonPageGroup2.ItemLinks.Add(Me.bbtniheight_min) + Me.RibbonPageGroup2.Name = "RibbonPageGroup2" + resources.ApplyResources(Me.RibbonPageGroup2, "RibbonPageGroup2") + ' 'frmFormDesigner ' Me.Appearance.Options.UseFont = True @@ -436,6 +455,7 @@ Partial Class frmFormDesigner Me.Controls.Add(Me.RibbonControl1) Me.IconOptions.Icon = CType(resources.GetObject("frmFormDesigner.IconOptions.Icon"), System.Drawing.Icon) Me.IconOptions.SvgImage = Global.DD_ProcessManager.My.Resources.Resources.chartdesigner1 + Me.KeyPreview = True Me.MinimizeBox = False Me.Name = "frmFormDesigner" Me.Ribbon = Me.RibbonControl1 @@ -503,8 +523,10 @@ Partial Class frmFormDesigner Friend WithEvents bbtniheight_plus As DevExpress.XtraBars.BarButtonItem Friend WithEvents bbtniheight_min As DevExpress.XtraBars.BarButtonItem Friend WithEvents RibPGCtrlWidth As DevExpress.XtraBars.Ribbon.RibbonPageGroup - Friend WithEvents RibPGCtrlheight As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents pnldesigner As DigitalData.Controls.SnapPanel.ClassSnapPanel Friend WithEvents tslblAenderungen As DevExpress.XtraBars.BarStaticItem Friend WithEvents pgControlsNew As DevExpress.XtraVerticalGrid.PropertyGridControl + Friend WithEvents bstitmProfilID As DevExpress.XtraBars.BarStaticItem + Friend WithEvents RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup + Friend WithEvents RibPGCtrlheight As DevExpress.XtraBars.Ribbon.RibbonPageGroup End Class diff --git a/app/TaskFlow/frmFormDesigner.resx b/app/TaskFlow/frmFormDesigner.resx index 4a93fe4..13b94b0 100644 --- a/app/TaskFlow/frmFormDesigner.resx +++ b/app/TaskFlow/frmFormDesigner.resx @@ -125,6 +125,10 @@ 0, 132 + + + True + Fill @@ -134,15 +138,14 @@ 820, 455 - - 1 + 0 pnldesigner - DigitalData.Controls.SnapPanel.ClassSnapPanel, DigitalData.Controls.SnapPanel, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null + DigitalData.Controls.SnapPanel.ClassSnapPanel, DigitalData.Controls.SnapPanel, Version=2.0.1.0, Culture=neutral, PublicKeyToken=null SplitContainerDesigner.Panel1 @@ -197,7 +200,7 @@ - Control löschen + Löschen (entf) @@ -221,7 +224,7 @@ - Aktualisieren + Aktualisieren (F5) @@ -418,6 +421,9 @@ Noch keine Änderungen + + ProfilID: + 0, 0 @@ -431,10 +437,10 @@ Controls einfügen - Control - Breite + Control - Breite (+/-) - - Control - Höhe + + Control-Höhe (Strg + +/-) Start @@ -536,7 +542,7 @@ 820 - 25 + 0 SplitContainerDesigner @@ -613,6 +619,9 @@ RibbonPageGroup4 + + Control - Höhe (Strg + +/-) + True @@ -1176,6 +1185,12 @@ DevExpress.XtraBars.BarStaticItem, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + bstitmProfilID + + + DevExpress.XtraBars.BarStaticItem, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + RibbonPage1 @@ -1206,12 +1221,6 @@ DevExpress.XtraBars.Ribbon.RibbonPageGroup, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - RibPGCtrlheight - - - DevExpress.XtraBars.Ribbon.RibbonPageGroup, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - TBPM_PROFILE_CONTROLSBindingSource @@ -1308,16 +1317,22 @@ DevExpress.XtraBars.Ribbon.RibbonPageGroup, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + RibPGCtrlheight + + + DevExpress.XtraBars.Ribbon.RibbonPageGroup, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + RibbonPageGroup2 + + + DevExpress.XtraBars.Ribbon.RibbonPageGroup, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + frmFormDesigner DevExpress.XtraBars.Ribbon.RibbonForm, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - Steuerelement - - - Steuerelement hinzufügen - \ No newline at end of file diff --git a/app/TaskFlow/frmFormDesigner.vb b/app/TaskFlow/frmFormDesigner.vb index c001c73..34704ad 100644 --- a/app/TaskFlow/frmFormDesigner.vb +++ b/app/TaskFlow/frmFormDesigner.vb @@ -11,6 +11,7 @@ Imports System.Drawing Imports DigitalData.GUIs.Common Imports DevExpress.Utils.Filtering.Internal Imports DevExpress.XtraEditors +Imports DevExpress.Utils.Controls Public Class frmFormDesigner Public ProfileId As Integer @@ -71,7 +72,7 @@ Public Class frmFormDesigner ' Setzt den typ des SQL-Befehls für frmSQL_DESIGNER CURRENT_DESIGN_TYPE = "INPUT_INDEX" CHANGES_FORM_DESIGN = False - + bstitmProfilID.Caption = $"ProfilID: {ProfileId.ToString}" ' Profil Name in Fenstertitel setzen Text = $"Validation Designer - Profil: {ProfileName}" @@ -320,6 +321,7 @@ Public Class frmFormDesigner SetMovementHandlers(oButton) End Select Next + Catch ex As Exception _Logger.Error(ex) MsgBox("Unexpected error in LoadControls " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") @@ -408,15 +410,11 @@ Public Class frmFormDesigner Sub DeleteControl(controlName As String) Try - 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 controlId As Integer = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(ProfileId, controlName) - If controlId > 0 Then - TBPM_CONTROL_TABLETableAdapter.DeleteColumnsByControlId(controlId) - TBPM_PROFILE_CONTROLSTableAdapter.Delete(controlId) - LoadControls() - End If + Dim controlId As Integer = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(ProfileId, controlName) + If controlId > 0 Then + TBPM_CONTROL_TABLETableAdapter.DeleteColumnsByControlId(controlId) + TBPM_PROFILE_CONTROLSTableAdapter.Delete(controlId) + LoadControls() End If Catch ex As Exception _Logger.Error(ex) @@ -1018,20 +1016,30 @@ Public Class frmFormDesigner End Sub Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick + Control_Delete() + End Sub + Sub Control_Delete() If CurrentControl Is Nothing = False Then - DeleteControl(CurrentControl.Name) - 'pgControls.Enabled = False - pgControlsNew.Enabled = False - CurrentControl = Nothing - RibPGCtrlheight.Enabled = False - RibPGCtrlWidth.Enabled = False + Dim result As MsgBoxResult = MsgBox("Wollen Sie das Control: " & CurrentControl.Name & " wirklich löschen?", MsgBoxStyle.YesNo, "Bestätigung:") + ' wenn Speichern ja + If result = MsgBoxResult.Yes Then + DeleteControl(CurrentControl.Name) + 'pgControls.Enabled = False + pgControlsNew.Enabled = False + tslblAenderungen.Caption = $"Control {CurrentControl.Name} deleted - " + Now.ToString + CurrentControl = Nothing + RibPGCtrlheight.Enabled = False + RibPGCtrlWidth.Enabled = False + + Reload_ControlNameList() + + End If - Reload_ControlNameList() End If End Sub - Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick LoadControls() + tslblAenderungen.Caption = "Controls loaded - " + Now.ToString End Sub Private Sub BarButtonItem3_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem3.ItemClick @@ -1092,13 +1100,31 @@ Public Class frmFormDesigner End Sub Private Sub frmFormDesigner_KeyUp(sender As Object, e As KeyEventArgs) Handles MyBase.KeyUp - If e.KeyCode = Keys.Escape Then - If Me.Cursor = Cursors.Cross Then - Mouse_IsPressed = False - Me.Cursor = Cursors.Default + If e.Control Then + If e.KeyCode = e.KeyCode.Delete Then + Control_Delete() + ElseIf e.KeyCode = e.KeyCode.F5 Then + LoadControls() + tslblAenderungen.Caption = "Controls loaded - " + Now.ToString + ElseIf e.KeyCode = e.KeyCode.Add Then + Height_plus() + ElseIf e.KeyCode = e.KeyCode.Subtract Then + Height_minus() + End If + Else + If e.KeyCode = Keys.Escape Then + If Me.Cursor = Cursors.Cross Then + Mouse_IsPressed = False + Me.Cursor = Cursors.Default + End If + ElseIf e.KeyCode = e.KeyCode.Add Then + Width_More() + ElseIf e.KeyCode = e.KeyCode.Subtract Then + Width_min() End If - End If + + End Sub Private Sub pnldesigner_MouseDown(sender As Object, e As MouseEventArgs) Handles pnldesigner.MouseDown @@ -1268,6 +1294,9 @@ Public Class frmFormDesigner End Sub Private Sub bbtniwidth_plus_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniwidth_plus.ItemClick + Width_More() + End Sub + Sub Width_More() If CurrentControl Is Nothing = False Then CurrentControl.Size = New Size(CurrentControl.Width + 5, CurrentControl.Height) DirectCast(pgControlsNew.SelectedObject, BaseProperties).Size = CurrentControl.Size @@ -1276,8 +1305,10 @@ Public Class frmFormDesigner UpdateSingleValue("WIDTH", CurrentControl.Size.Width) End If End Sub - Private Sub bbtniwidth_min_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniwidth_min.ItemClick + Width_min() + End Sub + Sub Width_min() If CurrentControl Is Nothing = False Then Dim newWidth = CurrentControl.Width - 5 ' Verhindert, dass das Control unsichtbar wird @@ -1293,6 +1324,9 @@ Public Class frmFormDesigner End Sub Private Sub bbtniheight_min_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniheight_min.ItemClick + Height_minus() + End Sub + Sub Height_minus() If CurrentControl Is Nothing = False Then Dim newHeight As Integer = CurrentControl.Height - 5 @@ -1313,8 +1347,11 @@ Public Class frmFormDesigner UpdateSingleValue("HEIGHT", newHeight) End If End Sub - Private Sub bbtniheight_plus_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniheight_plus.ItemClick + Height_plus() + End Sub + + Sub Height_plus() If CurrentControl Is Nothing = False Then Dim newHeight As Integer = CurrentControl.Height + 5 @@ -1330,6 +1367,4 @@ Public Class frmFormDesigner UpdateSingleValue("HEIGHT", newHeight) End If End Sub - - End Class \ No newline at end of file diff --git a/app/TaskFlow/frmMonitor.vb b/app/TaskFlow/frmMonitor.vb index 665befb..c83ba18 100644 --- a/app/TaskFlow/frmMonitor.vb +++ b/app/TaskFlow/frmMonitor.vb @@ -64,13 +64,7 @@ Public Class frmMonitor LOGGER.Debug($"Found {oDT2.Rows.Count} rows for GridView2") GridView2.Columns.Clear() GridControl2.DataSource = oDT2 - Try - GridView2.Columns("Wann").DisplayFormat.FormatType = FormatType.DateTime - GridView2.Columns("Wann").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" - Catch ex As Exception - GridView2.Columns("When").DisplayFormat.FormatType = FormatType.DateTime - GridView2.Columns("When").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" - End Try + Format_Datetime_Columns(GridView2, "Grid 2") End If If DT_MONITOR_KONFIG.Rows.Count > 2 Then @@ -86,6 +80,7 @@ Public Class frmMonitor LOGGER.Debug($"Found {oDT3.Rows.Count} rows for GridView3") GridView3.Columns.Clear() GridControl3.DataSource = oDT3 + Format_Datetime_Columns(GridView3, "Grid 3") End If If DT_MONITOR_KONFIG.Rows.Count = 4 Then LOGGER.Debug($"DT_MONITOR_KONFIG.Rows.Count = 4") @@ -100,13 +95,14 @@ Public Class frmMonitor LOGGER.Debug($"Found {oDT4.Rows.Count} rows for GridView4") GridView4.Columns.Clear() GridControl4.DataSource = oDT4 - Try - GridView4.Columns("Geändert wann").DisplayFormat.FormatType = FormatType.DateTime - GridView4.Columns("Geändert wann").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" - Catch ex As Exception - GridView4.Columns("Changed when").DisplayFormat.FormatType = FormatType.DateTime - GridView4.Columns("Changed when").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" - End Try + Format_Datetime_Columns(GridView4, "Grid 4") + 'Try + ' GridView4.Columns("Geändert wann").DisplayFormat.FormatType = FormatType.DateTime + ' GridView4.Columns("Geändert wann").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" + 'Catch ex As Exception + ' GridView4.Columns("Changed when").DisplayFormat.FormatType = FormatType.DateTime + ' GridView4.Columns("Changed when").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" + 'End Try End If End If End If @@ -125,6 +121,49 @@ Public Class frmMonitor End Try End Sub + Sub Format_Datetime_Columns(pGridView As GridView, pWhichGridView As String) + Dim oColExists As Boolean = False + Try + + If MON_ADDED_COLUMN <> "None" Then + MON_ADDED_COLUMN = MON_ADDED_COLUMN.Replace("[", "") + MON_ADDED_COLUMN = MON_ADDED_COLUMN.Replace("]", "") + For Each ocol As Columns.GridColumn In pGridView.Columns + If ocol.ToString = MON_ADDED_COLUMN Then + oColExists = True + Exit For + End If + Next + If oColExists Then + pGridView.Columns(MON_ADDED_COLUMN).DisplayFormat.FormatType = FormatType.DateTime + pGridView.Columns(MON_ADDED_COLUMN).DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" + End If + + End If + + Catch ex As Exception + LOGGER.Warn($"Error formatting column [{MON_ADDED_COLUMN}] {ex.Message} - Check wether it exists in columns of GridView [{pWhichGridView}]!") + End Try + Try + If MON_EDITED_COLUMN <> "None" Then + oColExists = False + For Each ocol As Columns.GridColumn In pGridView.Columns + If ocol.ToString = MON_EDITED_COLUMN Then + oColExists = True + Exit For + End If + Next + If oColExists Then + pGridView.Columns(MON_EDITED_COLUMN).DisplayFormat.FormatType = FormatType.DateTime + pGridView.Columns(MON_EDITED_COLUMN).DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" + End If + + End If + + Catch ex As Exception + LOGGER.Warn($"Error formatting column [{MON_EDITED_COLUMN}] {ex.Message} - Check wether it exists in columns of GridView [{pWhichGridView}]!") + End Try + End Sub Sub Load_Doc(oDocPath As String) Try If SplitContainerControlMain.Collapsed = False And oDocPath <> String.Empty Then @@ -210,6 +249,7 @@ Public Class frmMonitor GRID1_TITLE = DT_MONITOR_KONFIG.Rows(0).Item("GRID_TITLE") GridView1.ViewCaption = GRID1_TITLE + Format_Datetime_Columns(GridView1, "Grid 1") Try 'GridView1.Columns.Item("FULL_FILE_PATH").Visible = False Catch ex As Exception