From b4181e3e0b379e6167cf40107f6e480cd387e698 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 14 Dec 2021 16:26:13 +0100 Subject: [PATCH] ZooFlow: Add wait form for frmIndex, move init logic of frmIndex into FormShown --- .../Globix/frmGlobix_Index.Designer.vb | 6 + GUIs.ZooFlow/Globix/frmGlobix_Index.vb | 49 ++++--- GUIs.ZooFlow/ZooFlow.vbproj | 9 ++ GUIs.ZooFlow/frmWaitForm.Designer.vb | 83 ++++++++++++ GUIs.ZooFlow/frmWaitForm.resx | 120 ++++++++++++++++++ GUIs.ZooFlow/frmWaitForm.vb | 24 ++++ 6 files changed, 265 insertions(+), 26 deletions(-) create mode 100644 GUIs.ZooFlow/frmWaitForm.Designer.vb create mode 100644 GUIs.ZooFlow/frmWaitForm.resx create mode 100644 GUIs.ZooFlow/frmWaitForm.vb diff --git a/GUIs.ZooFlow/Globix/frmGlobix_Index.Designer.vb b/GUIs.ZooFlow/Globix/frmGlobix_Index.Designer.vb index afda87ff..3334dba6 100644 --- a/GUIs.ZooFlow/Globix/frmGlobix_Index.Designer.vb +++ b/GUIs.ZooFlow/Globix/frmGlobix_Index.Designer.vb @@ -59,6 +59,7 @@ Partial Class frmGlobix_Index Me.cmbDocType = New DevExpress.XtraEditors.ComboBoxEdit() Me.DocumentViewer1 = New DigitalData.Controls.DocumentViewer.DocumentViewer() Me.GlobixDataset = New DigitalData.GUIs.ZooFlow.GlobixDataset() + Me.SplashScreenManager = New DevExpress.XtraSplashScreen.SplashScreenManager(Me, GetType(Global.DigitalData.GUIs.ZooFlow.frmWaitForm), True, True) CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainerControl1.SuspendLayout() @@ -326,6 +327,10 @@ Partial Class frmGlobix_Index Me.GlobixDataset.DataSetName = "GlobixDataset" Me.GlobixDataset.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema ' + 'SplashScreenManager + ' + Me.SplashScreenManager.ClosingDelay = 500 + ' 'frmGlobix_Index ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -381,4 +386,5 @@ Partial Class frmGlobix_Index Friend WithEvents GlobixDataset As GlobixDataset Friend WithEvents cmbDocType As DevExpress.XtraEditors.ComboBoxEdit Friend WithEvents SimpleButton1 As SimpleButton + Friend WithEvents SplashScreenManager As DevExpress.XtraSplashScreen.SplashScreenManager End Class diff --git a/GUIs.ZooFlow/Globix/frmGlobix_Index.vb b/GUIs.ZooFlow/Globix/frmGlobix_Index.vb index cc5c2d1a..34994e85 100644 --- a/GUIs.ZooFlow/Globix/frmGlobix_Index.vb +++ b/GUIs.ZooFlow/Globix/frmGlobix_Index.vb @@ -61,14 +61,28 @@ Public Class frmGlobix_Index End Sub Private Sub frmGlobix_Index_Load(sender As Object, e As EventArgs) Handles MyBase.Load - ColorizeInactiveIcon = False + ColorizeInactiveIcon = DevExpress.Utils.DefaultBoolean.True ' Abbruchzähler zurücksetzen CancelAttempts = 0 My.Application.Globix.INDEXING_ACTIVE = True + End Sub + + Private Sub frmGlobix_Index_Shown(sender As Object, e As EventArgs) Handles Me.Shown + Cursor = Cursors.Default + + SplashScreenManager.ShowWaitForm() + + checkItemTopMost.Checked = My.UIConfig.Globix.TopMost + TopMost = My.UIConfig.Globix.TopMost + BringToFront() + Focus() Try + Refresh_Dokart() + pnlIndex.Controls.Clear() + My.Application.Globix.CURRENT_ISATTACHMENT = False Dim oSql = $"SELECT HANDLE_TYPE FROM TBGI_FILES_USER WHERE GUID = {My.Application.Globix.CurrentWorkfile.Id}" DropType = My.DatabaseECM.GetScalarValue(oSql) @@ -115,27 +129,6 @@ Public Class frmGlobix_Index End If - Catch ex As Exception - Logger.Warn(" - Unexpected error in Öffnen des Formulares - Fehler: " & vbNewLine & ex.Message) - Logger.Error(ex.Message) - MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in Öffnen des Formulares:") - End Try - End Sub - - Private Sub frmGlobix_Index_Shown(sender As Object, e As EventArgs) Handles Me.Shown - BringToFront() - Focus() - Cursor = Cursors.Default - Refresh_Dokart() - pnlIndex.Controls.Clear() - - checkItemTopMost.Checked = My.UIConfig.Globix.TopMost - TopMost = My.UIConfig.Globix.TopMost - BringToFront() - - FormLoaded = True - - Try ' Letzte Auswahl merken überschreibt die automatische selektion If My.UIConfig.Globix.ProfilePreselection Then checkItemPreselection.Checked = True @@ -152,7 +145,7 @@ Public Class frmGlobix_Index End If Else - Dim oSQL As String = "SELECT DISTINCT T1.DOCTYPE as DocType, T.* FROM TBGI_REGEX_DOCTYPE T, VWGI_DOCTYPE_USER T1 WHERE T.DOCTYPE_ID = T1.DOCTYPE_ID" + oSql = "SELECT DISTINCT T1.DOCTYPE as DocType, T.* FROM TBGI_REGEX_DOCTYPE T, VWGI_DOCTYPE_USER T1 WHERE T.DOCTYPE_ID = T1.DOCTYPE_ID" Dim oRegexDoctypeTable = Database.GetDatatable("DTTBGI_REGEX_DOCTYPE", oSQL, ECM) For Each oRoW As DataRow In oRegexDoctypeTable.Rows @@ -173,9 +166,13 @@ Public Class frmGlobix_Index End If Next End If + + Catch ex As Exception Logger.Warn("Unexpected error DTTBGI_REGEX_DOCTYPE - ErrorMessage: " & vbNewLine & ex.Message) - + Finally + SplashScreenManager.CloseWaitForm() + FormLoaded = True End Try End Sub @@ -348,9 +345,9 @@ Public Class frmGlobix_Index T.DOK_ID = {dokartid} ORDER BY T.SEQUENCE" - Dim oFilter = "DOK_ID = " & dokartid Dim oTable = My.Database.GetDatatable("VWDDINDEX_MAN", oSql, ECM, - pSortByColumn:="SEQUENCE") + pSortByColumn:="SEQUENCE", + pFilterExpression:=$"DOK_ID = {dokartid}") Dim oManualIndexes As New List(Of ManualIndex) diff --git a/GUIs.ZooFlow/ZooFlow.vbproj b/GUIs.ZooFlow/ZooFlow.vbproj index df7db57c..e975c3ab 100644 --- a/GUIs.ZooFlow/ZooFlow.vbproj +++ b/GUIs.ZooFlow/ZooFlow.vbproj @@ -247,6 +247,12 @@ + + frmWaitForm.vb + + + Form + True @@ -423,6 +429,9 @@ frmGlobixNameconvention.vb + + frmWaitForm.vb + frmFlowSearch.vb diff --git a/GUIs.ZooFlow/frmWaitForm.Designer.vb b/GUIs.ZooFlow/frmWaitForm.Designer.vb new file mode 100644 index 00000000..1a20c4c9 --- /dev/null +++ b/GUIs.ZooFlow/frmWaitForm.Designer.vb @@ -0,0 +1,83 @@ + _ +Partial Class frmWaitForm + Inherits DevExpress.XtraWaitForm.WaitForm + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.progressPanel1 = New DevExpress.XtraWaitForm.ProgressPanel() + Me.tableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel() + Me.tableLayoutPanel1.SuspendLayout() + Me.SuspendLayout() + ' + 'progressPanel1 + ' + Me.progressPanel1.Appearance.BackColor = System.Drawing.Color.Transparent + Me.progressPanel1.Appearance.Options.UseBackColor = True + Me.progressPanel1.AppearanceCaption.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!) + Me.progressPanel1.AppearanceCaption.Options.UseFont = True + Me.progressPanel1.AppearanceDescription.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.progressPanel1.AppearanceDescription.Options.UseFont = True + Me.progressPanel1.Dock = System.Windows.Forms.DockStyle.Fill + Me.progressPanel1.ImageHorzOffset = 20 + Me.progressPanel1.Location = New System.Drawing.Point(0, 17) + Me.progressPanel1.Margin = New System.Windows.Forms.Padding(0, 3, 0, 3) + Me.progressPanel1.Name = "progressPanel1" + Me.progressPanel1.Size = New System.Drawing.Size(246, 39) + Me.progressPanel1.TabIndex = 0 + Me.progressPanel1.Text = "progressPanel1" + ' + 'tableLayoutPanel1 + ' + Me.tableLayoutPanel1.AutoSize = True + Me.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent + Me.tableLayoutPanel1.ColumnCount = 1 + Me.tableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) + Me.tableLayoutPanel1.Controls.Add(Me.progressPanel1, 0, 0) + Me.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill + Me.tableLayoutPanel1.Location = New System.Drawing.Point(0, 0) + Me.tableLayoutPanel1.Name = "tableLayoutPanel1" + Me.tableLayoutPanel1.Padding = New System.Windows.Forms.Padding(0, 14, 0, 14) + Me.tableLayoutPanel1.RowCount = 1 + Me.tableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) + Me.tableLayoutPanel1.Size = New System.Drawing.Size(246, 73) + Me.tableLayoutPanel1.TabIndex = 1 + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.AutoSize = True + Me.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ClientSize = New System.Drawing.Size(246, 73) + Me.Controls.Add(Me.tableLayoutPanel1) + Me.DoubleBuffered = True + Me.Name = "Form1" + Me.StartPosition = FormStartPosition.Manual + Me.Text = "Form1" + Me.tableLayoutPanel1.ResumeLayout(false) + Me.ResumeLayout(False) + Me.PerformLayout() + End Sub + + Private WithEvents progressPanel1 As DevExpress.XtraWaitForm.ProgressPanel + Private WithEvents tableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel +End Class diff --git a/GUIs.ZooFlow/frmWaitForm.resx b/GUIs.ZooFlow/frmWaitForm.resx new file mode 100644 index 00000000..9d1fc387 --- /dev/null +++ b/GUIs.ZooFlow/frmWaitForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/GUIs.ZooFlow/frmWaitForm.vb b/GUIs.ZooFlow/frmWaitForm.vb new file mode 100644 index 00000000..04b65efe --- /dev/null +++ b/GUIs.ZooFlow/frmWaitForm.vb @@ -0,0 +1,24 @@ +Public Class frmWaitForm + Sub New + InitializeComponent() + Me.progressPanel1.AutoHeight = True + End Sub + + Public Overrides Sub SetCaption(ByVal caption As String) + MyBase.SetCaption(caption) + Me.progressPanel1.Caption = caption + End Sub + + Public Overrides Sub SetDescription(ByVal description As String) + MyBase.SetDescription(description) + Me.progressPanel1.Description = description + End Sub + + Public Overrides Sub ProcessCommand(ByVal cmd As System.Enum, ByVal arg As Object) + MyBase.ProcessCommand(cmd, arg) + End Sub + + Public Enum WaitFormCommand + SomeCommandId + End Enum +End Class