B2022-107: Added Loading Screen / Progress Display

This commit is contained in:
Jake 2022-09-08 19:48:35 +00:00
parent 19b35b5540
commit aaffa70671
3 changed files with 2212 additions and 0 deletions

View File

@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using Volian.Base.Library;
using JR.Utils.GUI.Forms;
using System.Threading;
namespace VEPROMS.CSLA.Library
{
public partial class frmRofstLoadStatus : Form
{
#region Fields
#endregion
#region Properties
public string Title
{
get { return lblTitle.Text; }
}
public string DisplayText
{
get { return statusProgressBar.Text; }
}
#endregion
#region Constructor
public frmRofstLoadStatus()
{
// B2022-107: Display Progress Bar Messages/Statuses when a new ROFST binary file is loaded into the database
// Initialize Base Component
InitializeComponent();
}
#endregion
#region Public Methods
public void UpdateProgress(string title, string displayText, int curVal = 0, int maxVal = 100)
{
// Check if Initializing Status/Progress Bar
if (curVal <= 0)
{
statusProgressBar.TextVisible = true;
statusProgressBar.Maximum = maxVal;
statusProgressBar.Minimum = 0;
}
if (displayText == null) displayText = string.Empty;
if (title == null) title = string.Empty;
statusProgressBar.Value = curVal;
statusProgressBar.Text = displayText;
lblTitle.Text = title;
this.Refresh();
Application.DoEvents();
// Check if Finalizing Status/Progress Bar
if (curVal >= 100)
{
Thread.Sleep(3000);
this.Close();
}
}
#endregion
#region Private Methods
private void frmRofstLoadStatus_Load(object sender, EventArgs e)
{
// Initialize Display/Variables
UpdateProgress("Initializing ROFST file..", null, 0, 100);
}
#endregion
}
}

View File

@ -0,0 +1,88 @@
namespace VEPROMS.CSLA.Library
{
partial class frmRofstLoadStatus
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmRofstLoadStatus));
this.lblTitle = new DevComponents.DotNetBar.LabelX();
this.statusProgressBar = new DevComponents.DotNetBar.Controls.ProgressBarX();
this.SuspendLayout();
//
// lblTitle
//
//
//
//
this.lblTitle.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.lblTitle.Location = new System.Drawing.Point(9, 10);
this.lblTitle.Margin = new System.Windows.Forms.Padding(2);
this.lblTitle.Name = "lblTitle";
this.lblTitle.Size = new System.Drawing.Size(716, 19);
this.lblTitle.TabIndex = 0;
this.lblTitle.Text = "Initializing ROFST File ...";
//
// statusProgressBar
//
//
//
//
this.statusProgressBar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.statusProgressBar.Location = new System.Drawing.Point(9, 38);
this.statusProgressBar.Margin = new System.Windows.Forms.Padding(2);
this.statusProgressBar.Name = "statusProgressBar";
this.statusProgressBar.Size = new System.Drawing.Size(716, 19);
this.statusProgressBar.TabIndex = 1;
this.statusProgressBar.TextVisible = true;
//
// frmRofstLoadStatus
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(736, 74);
this.ControlBox = false;
this.Controls.Add(this.statusProgressBar);
this.Controls.Add(this.lblTitle);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(2);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmRofstLoadStatus";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "ROFST Load Status";
this.TopMost = true;
this.Load += new System.EventHandler(this.frmRofstLoadStatus_Load);
this.ResumeLayout(false);
}
#endregion
private DevComponents.DotNetBar.LabelX lblTitle;
private DevComponents.DotNetBar.Controls.ProgressBarX statusProgressBar;
}
}

File diff suppressed because it is too large Load Diff