From dd53acc6f53a17bb51742430bd38835ba4badffb Mon Sep 17 00:00:00 2001 From: Jens True Date: Sat, 12 Jun 2021 13:24:13 +0200 Subject: [PATCH] Removed up/down sorting feature --- Tidstagning/Form1.Designer.cs | 47 ----------------------------- Tidstagning/Form1.cs | 56 ----------------------------------- 2 files changed, 103 deletions(-) diff --git a/Tidstagning/Form1.Designer.cs b/Tidstagning/Form1.Designer.cs index b730aa1..88cd941 100644 --- a/Tidstagning/Form1.Designer.cs +++ b/Tidstagning/Form1.Designer.cs @@ -36,9 +36,6 @@ this.button1 = new System.Windows.Forms.Button(); this.txtDebug = new System.Windows.Forms.TextBox(); this.panel2 = new System.Windows.Forms.Panel(); - this.btnEditList = new System.Windows.Forms.Button(); - this.btnMoveUp = new System.Windows.Forms.Button(); - this.btnMoveDown = new System.Windows.Forms.Button(); this.panel1 = new System.Windows.Forms.Panel(); this.checkStartProcedure = new System.Windows.Forms.CheckBox(); this.btnAutoStart = new System.Windows.Forms.Button(); @@ -56,7 +53,6 @@ this.lblClock = new System.Windows.Forms.Label(); this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.entryBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.panel2.SuspendLayout(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.grid)).BeginInit(); this.txtLog.SuspendLayout(); @@ -104,50 +100,12 @@ // // panel2 // - this.panel2.Controls.Add(this.btnEditList); - this.panel2.Controls.Add(this.btnMoveUp); - this.panel2.Controls.Add(this.btnMoveDown); this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; this.panel2.Location = new System.Drawing.Point(3, 72); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(194, 479); this.panel2.TabIndex = 9; // - // btnEditList - // - this.btnEditList.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F); - this.btnEditList.Location = new System.Drawing.Point(0, 3); - this.btnEditList.Name = "btnEditList"; - this.btnEditList.Size = new System.Drawing.Size(185, 37); - this.btnEditList.TabIndex = 3; - this.btnEditList.Text = "Rediger "; - this.btnEditList.UseVisualStyleBackColor = true; - this.btnEditList.Click += new System.EventHandler(this.btnEditList_Click); - // - // btnMoveUp - // - this.btnMoveUp.Enabled = false; - this.btnMoveUp.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F); - this.btnMoveUp.Location = new System.Drawing.Point(0, 46); - this.btnMoveUp.Name = "btnMoveUp"; - this.btnMoveUp.Size = new System.Drawing.Size(185, 37); - this.btnMoveUp.TabIndex = 1; - this.btnMoveUp.Text = "Op"; - this.btnMoveUp.UseVisualStyleBackColor = true; - this.btnMoveUp.Click += new System.EventHandler(this.btnMoveUp_Click); - // - // btnMoveDown - // - this.btnMoveDown.Enabled = false; - this.btnMoveDown.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F); - this.btnMoveDown.Location = new System.Drawing.Point(0, 89); - this.btnMoveDown.Name = "btnMoveDown"; - this.btnMoveDown.Size = new System.Drawing.Size(185, 37); - this.btnMoveDown.TabIndex = 2; - this.btnMoveDown.Text = "Ned"; - this.btnMoveDown.UseVisualStyleBackColor = true; - this.btnMoveDown.Click += new System.EventHandler(this.btnMoveDown_Click); - // // panel1 // this.panel1.Controls.Add(this.checkStartProcedure); @@ -333,7 +291,6 @@ this.lblClock.TabIndex = 16; this.lblClock.Text = "--:--:--"; this.lblClock.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.lblClock.Click += new System.EventHandler(this.lblClock_Click); // // nameDataGridViewTextBoxColumn // @@ -361,7 +318,6 @@ this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.HelpButtonClicked += new System.ComponentModel.CancelEventHandler(this.Form1_HelpButtonClicked); this.Load += new System.EventHandler(this.Form1_Load); - this.panel2.ResumeLayout(false); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.grid)).EndInit(); @@ -382,8 +338,6 @@ private System.Windows.Forms.Button button1; private System.Windows.Forms.TextBox txtDebug; private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Button btnMoveUp; - private System.Windows.Forms.Button btnMoveDown; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Button btnAutoStart; private System.Windows.Forms.Button btnStop; @@ -392,7 +346,6 @@ private System.Windows.Forms.TableLayoutPanel txtLog; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; private System.Windows.Forms.ComboBox comboSoundTime; - private System.Windows.Forms.Button btnEditList; private System.Windows.Forms.DataGridViewButtonColumn Complete; private System.Windows.Forms.DataGridViewTextBoxColumn nameDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewButtonColumn DNF; diff --git a/Tidstagning/Form1.cs b/Tidstagning/Form1.cs index 65e9e12..7ed071a 100644 --- a/Tidstagning/Form1.cs +++ b/Tidstagning/Form1.cs @@ -72,9 +72,6 @@ namespace Tidstagning if (!btnStop.Enabled) return; - if (btnMoveUp.Enabled) - return; - if (e.RowIndex >= 0 && e.ColumnIndex == grid.Columns["DNF"].Index) { entries[e.RowIndex].DNF(); @@ -101,42 +98,10 @@ namespace Tidstagning } - private void btnMoveUp_Click(object sender, EventArgs e) - { - if (grid.SelectedRows.Count == 1) - { - int idx = grid.SelectedRows[0].Index; - if (idx == 0) - return; - Entry entry = entries[idx]; - entries.Remove(entry); - entries.Insert(idx - 1, entry); - grid.ClearSelection(); - - grid.Rows[idx - 1].Selected = true; - } - } - - private void btnMoveDown_Click(object sender, EventArgs e) - { - if (grid.SelectedRows.Count == 1) - { - int idx = grid.SelectedRows[0].Index; - if (idx == grid.Rows.Count - 1 ) - return; - Entry entry = entries[idx]; - entries.Remove(entry); - entries.Insert(idx + 1, entry); - grid.ClearSelection(); - grid.Rows[idx + 1].Selected = true; - } - } - private void btnAutoStart_Click(object sender, EventArgs e) { if (txtHeader.Text == "") { - MessageBox.Show("Udfyld løbs titel"); return; } @@ -215,30 +180,9 @@ namespace Tidstagning countdowntimer.Start(); } - private void btnEditList_Click(object sender, EventArgs e) - { - if (btnMoveUp.Enabled) - { - btnEditList.Text = "Rediger"; - btnMoveUp.Enabled = false; - btnMoveDown.Enabled = false; - } - else - { - btnEditList.Text = "Aktiv"; - btnMoveUp.Enabled = true; - btnMoveDown.Enabled = true; - } - } - private void Clock_Tick(object sender, EventArgs e) { lblClock.Text = DateTime.Now.ToString("HH:mm:ss"); } - - private void lblClock_Click(object sender, EventArgs e) - { - - } } }