rename elements in new dialogue to PerlCase per PR comment

This commit is contained in:
mshafer1
2024-12-21 08:42:24 -06:00
parent c4e5a9059d
commit 1ae481b434
2 changed files with 101 additions and 101 deletions

View File

@@ -28,90 +28,90 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
tbTitle = new System.Windows.Forms.TextBox(); TxBTitle = new System.Windows.Forms.TextBox();
button1 = new System.Windows.Forms.Button(); ButtonClose = new System.Windows.Forms.Button();
tbMessage = new System.Windows.Forms.RichTextBox(); TxBMessage = new System.Windows.Forms.RichTextBox();
iconBox = new System.Windows.Forms.PictureBox(); IconBox = new System.Windows.Forms.PictureBox();
progressBar1 = new System.Windows.Forms.ProgressBar(); ProgressBar1 = new System.Windows.Forms.ProgressBar();
lbTimeout = new System.Windows.Forms.Label(); LblTimeout = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)iconBox).BeginInit(); ((System.ComponentModel.ISupportInitialize)IconBox).BeginInit();
SuspendLayout(); SuspendLayout();
// //
// tbTitle // TxBTitle
// //
tbTitle.BackColor = System.Drawing.SystemColors.ControlDark; TxBTitle.BackColor = System.Drawing.SystemColors.ControlDark;
tbTitle.BorderStyle = System.Windows.Forms.BorderStyle.None; TxBTitle.BorderStyle = System.Windows.Forms.BorderStyle.None;
tbTitle.Font = new System.Drawing.Font("Segoe UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); TxBTitle.Font = new System.Drawing.Font("Segoe UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
tbTitle.ForeColor = System.Drawing.SystemColors.ControlLightLight; TxBTitle.ForeColor = System.Drawing.SystemColors.ControlLightLight;
tbTitle.Location = new System.Drawing.Point(54, 13); TxBTitle.Location = new System.Drawing.Point(54, 13);
tbTitle.Name = "tbTitle"; TxBTitle.Name = "TxBTitle";
tbTitle.ReadOnly = true; TxBTitle.ReadOnly = true;
tbTitle.Size = new System.Drawing.Size(683, 32); TxBTitle.Size = new System.Drawing.Size(683, 32);
tbTitle.TabIndex = 0; TxBTitle.TabIndex = 0;
tbTitle.MouseDown += window_MouseDown; TxBTitle.MouseDown += window_MouseDown;
// //
// button1 // ButtonClose
// //
button1.BackColor = System.Drawing.SystemColors.ActiveCaptionText; ButtonClose.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; ButtonClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
button1.FlatAppearance.BorderColor = System.Drawing.Color.White; ButtonClose.FlatAppearance.BorderColor = System.Drawing.Color.White;
button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Silver; ButtonClose.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Silver;
button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; ButtonClose.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
button1.ForeColor = System.Drawing.SystemColors.ButtonFace; ButtonClose.ForeColor = System.Drawing.SystemColors.ButtonFace;
button1.Location = new System.Drawing.Point(759, 7); ButtonClose.Location = new System.Drawing.Point(759, 7);
button1.Name = "button1"; ButtonClose.Name = "ButtonClose";
button1.Size = new System.Drawing.Size(29, 38); ButtonClose.Size = new System.Drawing.Size(29, 38);
button1.TabIndex = 1; ButtonClose.TabIndex = 1;
button1.Text = "X"; ButtonClose.Text = "X";
button1.UseVisualStyleBackColor = false; ButtonClose.UseVisualStyleBackColor = false;
button1.Click += btnClose_Click; ButtonClose.Click += ButtonClose_ClickHandler;
// //
// tbMessage // TxBMessage
// //
tbMessage.BackColor = System.Drawing.SystemColors.ControlDark; TxBMessage.BackColor = System.Drawing.SystemColors.ControlDark;
tbMessage.BorderStyle = System.Windows.Forms.BorderStyle.None; TxBMessage.BorderStyle = System.Windows.Forms.BorderStyle.None;
tbMessage.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); TxBMessage.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
tbMessage.ForeColor = System.Drawing.SystemColors.ControlLightLight; TxBMessage.ForeColor = System.Drawing.SystemColors.ControlLightLight;
tbMessage.Location = new System.Drawing.Point(12, 57); TxBMessage.Location = new System.Drawing.Point(12, 57);
tbMessage.Name = "tbMessage"; TxBMessage.Name = "TxBMessage";
tbMessage.ReadOnly = true; TxBMessage.ReadOnly = true;
tbMessage.Size = new System.Drawing.Size(776, 191); TxBMessage.Size = new System.Drawing.Size(776, 191);
tbMessage.TabIndex = 2; TxBMessage.TabIndex = 2;
tbMessage.Text = ""; TxBMessage.Text = "";
tbMessage.MouseDown += window_MouseDown; TxBMessage.MouseDown += window_MouseDown;
// //
// iconBox // IconBox
// //
iconBox.Location = new System.Drawing.Point(12, 12); IconBox.Location = new System.Drawing.Point(12, 12);
iconBox.Name = "iconBox"; IconBox.Name = "IconBox";
iconBox.Size = new System.Drawing.Size(36, 39); IconBox.Size = new System.Drawing.Size(36, 39);
iconBox.TabIndex = 3; IconBox.TabIndex = 3;
iconBox.TabStop = false; IconBox.TabStop = false;
// //
// progressBar1 // ProgressBar1
// //
progressBar1.BackColor = System.Drawing.SystemColors.ControlDarkDark; ProgressBar1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
progressBar1.Enabled = false; ProgressBar1.Enabled = false;
progressBar1.ForeColor = System.Drawing.SystemColors.WindowFrame; ProgressBar1.ForeColor = System.Drawing.SystemColors.WindowFrame;
progressBar1.Location = new System.Drawing.Point(70, 254); ProgressBar1.Location = new System.Drawing.Point(70, 254);
progressBar1.MarqueeAnimationSpeed = 1; ProgressBar1.MarqueeAnimationSpeed = 1;
progressBar1.Name = "progressBar1"; ProgressBar1.Name = "ProgressBar1";
progressBar1.Size = new System.Drawing.Size(718, 23); ProgressBar1.Size = new System.Drawing.Size(718, 23);
progressBar1.Step = 1; ProgressBar1.Step = 1;
progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous; ProgressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
progressBar1.TabIndex = 4; ProgressBar1.TabIndex = 4;
progressBar1.Value = 100; ProgressBar1.Value = 100;
// //
// lbTimeout // LblTimeout
// //
lbTimeout.AutoSize = true; LblTimeout.AutoSize = true;
lbTimeout.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); LblTimeout.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
lbTimeout.Location = new System.Drawing.Point(21, 254); LblTimeout.Location = new System.Drawing.Point(21, 254);
lbTimeout.Name = "lbTimeout"; LblTimeout.Name = "LblTimeout";
lbTimeout.Size = new System.Drawing.Size(43, 17); LblTimeout.Size = new System.Drawing.Size(43, 17);
lbTimeout.TabIndex = 5; LblTimeout.TabIndex = 5;
lbTimeout.Text = "label1"; LblTimeout.Text = "label1";
lbTimeout.TextAlign = System.Drawing.ContentAlignment.TopRight; LblTimeout.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// NotificationDialog // NotificationDialog
// //
@@ -119,28 +119,28 @@
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
BackColor = System.Drawing.SystemColors.ControlDark; BackColor = System.Drawing.SystemColors.ControlDark;
ClientSize = new System.Drawing.Size(800, 289); ClientSize = new System.Drawing.Size(800, 289);
Controls.Add(lbTimeout); Controls.Add(LblTimeout);
Controls.Add(progressBar1); Controls.Add(ProgressBar1);
Controls.Add(iconBox); Controls.Add(IconBox);
Controls.Add(tbMessage); Controls.Add(TxBMessage);
Controls.Add(button1); Controls.Add(ButtonClose);
Controls.Add(tbTitle); Controls.Add(TxBTitle);
FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
Name = "NotificationDialog"; Name = "NotificationDialog";
Text = "NotificationDialog"; Text = "NotificationDialog";
Click += window_MouseDown; Click += window_MouseDown;
((System.ComponentModel.ISupportInitialize)iconBox).EndInit(); ((System.ComponentModel.ISupportInitialize)IconBox).EndInit();
ResumeLayout(false); ResumeLayout(false);
PerformLayout(); PerformLayout();
} }
#endregion #endregion
private System.Windows.Forms.TextBox tbTitle; private System.Windows.Forms.TextBox TxBTitle;
private System.Windows.Forms.Button button1; private System.Windows.Forms.Button ButtonClose;
private System.Windows.Forms.RichTextBox tbMessage; private System.Windows.Forms.RichTextBox TxBMessage;
private System.Windows.Forms.PictureBox iconBox; private System.Windows.Forms.PictureBox IconBox;
private System.Windows.Forms.ProgressBar progressBar1; private System.Windows.Forms.ProgressBar ProgressBar1;
private System.Windows.Forms.Label lbTimeout; private System.Windows.Forms.Label LblTimeout;
} }
} }

View File

@@ -39,10 +39,10 @@ namespace ntfysh_client
} }
// setup data // setup data
iconBox.Image = (icon is null) ? null : ConvertToolTipIconToImage(icon.Value); IconBox.Image = (icon is null) ? null : ConvertToolTipIconToImage(icon.Value);
tbTitle.Text = title; TxBTitle.Text = title;
tbMessage.Text = message; TxBMessage.Text = message;
// setup timers // setup timers
if (_displayTimeoutTimer != null) if (_displayTimeoutTimer != null)
@@ -65,7 +65,7 @@ namespace ntfysh_client
if (showTimeOutBar) if (showTimeOutBar)
{ {
progressBar1.Value = 100; ProgressBar1.Value = 100;
_updateTimer = new System.Windows.Forms.Timer(); _updateTimer = new System.Windows.Forms.Timer();
_updateTimer.Interval = 100; _updateTimer.Interval = 100;
_updateTimer.Tick += UpdateProgress; _updateTimer.Tick += UpdateProgress;
@@ -74,20 +74,20 @@ namespace ntfysh_client
_shownStopwatch = new Stopwatch(); _shownStopwatch = new Stopwatch();
_shownStopwatch.Start(); _shownStopwatch.Start();
progressBar1.Visible = true; ProgressBar1.Visible = true;
lbTimeout.Visible = true; LblTimeout.Visible = true;
_timeout = timeout_ms; _timeout = timeout_ms;
} }
else else
{ {
progressBar1.Visible = false; ProgressBar1.Visible = false;
lbTimeout.Visible = false; LblTimeout.Visible = false;
} }
} }
else else
{ {
progressBar1.Visible = false; ProgressBar1.Visible = false;
lbTimeout.Visible = false; LblTimeout.Visible = false;
} }
// ok, show the window // ok, show the window
@@ -99,8 +99,8 @@ namespace ntfysh_client
{ {
if (_shownStopwatch is null) return; if (_shownStopwatch is null) return;
progressBar1.Value = (int)((_timeout - _shownStopwatch.ElapsedMilliseconds) * 100 / _timeout); ProgressBar1.Value = (int)((_timeout - _shownStopwatch.ElapsedMilliseconds) * 100 / _timeout);
lbTimeout.Text = $"{(int)(_timeout - _shownStopwatch.ElapsedMilliseconds) / 1000}"; LblTimeout.Text = $"{(int)(_timeout - _shownStopwatch.ElapsedMilliseconds) / 1000}";
} }
protected override void SetVisibleCore(bool value) protected override void SetVisibleCore(bool value)
@@ -174,7 +174,7 @@ namespace ntfysh_client
Opacity = 1; Opacity = 1;
} }
private void btnClose_Click(object sender, EventArgs e) private void ButtonClose_ClickHandler(object sender, EventArgs e)
{ {
// don't animate, immediately "close" // don't animate, immediately "close"
Visible = false; Visible = false;
@@ -202,15 +202,15 @@ namespace ntfysh_client
// on a background thread, so invoke on the UI thread // on a background thread, so invoke on the UI thread
Invoke(new Action(() => Invoke(new Action(() =>
{ {
lbTimeout.Visible = false; LblTimeout.Visible = false;
progressBar1.Visible = false; ProgressBar1.Visible = false;
})); }));
} }
else else
{ {
// in the UI thread, invoke directly // in the UI thread, invoke directly
lbTimeout.Visible = false; LblTimeout.Visible = false;
progressBar1.Visible = false; ProgressBar1.Visible = false;
} }
if (_displayTimeoutTimer != null) // check if the timer has already been disposed if (_displayTimeoutTimer != null) // check if the timer has already been disposed