OK comportamento generale...

This commit is contained in:
Samuele E. Locatelli
2019-12-21 10:46:44 +01:00
parent 20db8feb6e
commit d55b863bf6
2 changed files with 79 additions and 33 deletions
+51 -20
View File
@@ -31,19 +31,21 @@
this.components = new System.ComponentModel.Container();
this.btnOpen = new System.Windows.Forms.Button();
this.btnClose = new System.Windows.Forms.Button();
this.childList = new System.Windows.Forms.ListBox();
this.MainTimer = new System.Windows.Forms.Timer(this.components);
this.lblNumChild = new System.Windows.Forms.Label();
this.dgvManagedItems = new System.Windows.Forms.DataGridView();
this.btnCloseAll = new System.Windows.Forms.Button();
this.btnRestartAll = new System.Windows.Forms.Button();
this.btnUpdateMode = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgvManagedItems)).BeginInit();
this.SuspendLayout();
//
// btnOpen
//
this.btnOpen.Location = new System.Drawing.Point(18, 60);
this.btnOpen.Location = new System.Drawing.Point(11, 11);
this.btnOpen.Margin = new System.Windows.Forms.Padding(2);
this.btnOpen.Name = "btnOpen";
this.btnOpen.Size = new System.Drawing.Size(56, 27);
this.btnOpen.Size = new System.Drawing.Size(108, 27);
this.btnOpen.TabIndex = 1;
this.btnOpen.Text = "Open";
this.btnOpen.UseVisualStyleBackColor = true;
@@ -51,24 +53,15 @@
//
// btnClose
//
this.btnClose.Location = new System.Drawing.Point(114, 60);
this.btnClose.Location = new System.Drawing.Point(133, 11);
this.btnClose.Margin = new System.Windows.Forms.Padding(2);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(56, 27);
this.btnClose.Size = new System.Drawing.Size(108, 27);
this.btnClose.TabIndex = 70;
this.btnClose.Text = "Close";
this.btnClose.Text = "Close SEL";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// childList
//
this.childList.FormattingEnabled = true;
this.childList.Location = new System.Drawing.Point(21, 160);
this.childList.Margin = new System.Windows.Forms.Padding(2);
this.childList.Name = "childList";
this.childList.Size = new System.Drawing.Size(166, 160);
this.childList.TabIndex = 71;
//
// MainTimer
//
this.MainTimer.Tick += new System.EventHandler(this.MainTimer_Tick);
@@ -76,33 +69,68 @@
// lblNumChild
//
this.lblNumChild.AutoSize = true;
this.lblNumChild.Location = new System.Drawing.Point(18, 119);
this.lblNumChild.Location = new System.Drawing.Point(12, 40);
this.lblNumChild.Name = "lblNumChild";
this.lblNumChild.Size = new System.Drawing.Size(16, 13);
this.lblNumChild.TabIndex = 73;
this.lblNumChild.Text = "...";
this.lblNumChild.Click += new System.EventHandler(this.lblNumChild_Click);
//
// dgvManagedItems
//
this.dgvManagedItems.AllowUserToAddRows = false;
this.dgvManagedItems.AllowUserToDeleteRows = false;
this.dgvManagedItems.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvManagedItems.Location = new System.Drawing.Point(192, 60);
this.dgvManagedItems.Location = new System.Drawing.Point(11, 70);
this.dgvManagedItems.Name = "dgvManagedItems";
this.dgvManagedItems.ReadOnly = true;
this.dgvManagedItems.Size = new System.Drawing.Size(468, 260);
this.dgvManagedItems.Size = new System.Drawing.Size(647, 246);
this.dgvManagedItems.TabIndex = 75;
this.dgvManagedItems.SelectionChanged += new System.EventHandler(this.dgvManagedItems_SelectionChanged);
//
// btnCloseAll
//
this.btnCloseAll.Location = new System.Drawing.Point(552, 11);
this.btnCloseAll.Margin = new System.Windows.Forms.Padding(2);
this.btnCloseAll.Name = "btnCloseAll";
this.btnCloseAll.Size = new System.Drawing.Size(108, 27);
this.btnCloseAll.TabIndex = 77;
this.btnCloseAll.Text = "Close ALL";
this.btnCloseAll.UseVisualStyleBackColor = true;
this.btnCloseAll.Click += new System.EventHandler(this.button1_Click);
//
// btnRestartAll
//
this.btnRestartAll.Location = new System.Drawing.Point(429, 11);
this.btnRestartAll.Margin = new System.Windows.Forms.Padding(2);
this.btnRestartAll.Name = "btnRestartAll";
this.btnRestartAll.Size = new System.Drawing.Size(108, 27);
this.btnRestartAll.TabIndex = 78;
this.btnRestartAll.Text = "Restart ALL";
this.btnRestartAll.UseVisualStyleBackColor = true;
this.btnRestartAll.Click += new System.EventHandler(this.button2_Click);
//
// btnUpdateMode
//
this.btnUpdateMode.Location = new System.Drawing.Point(280, 11);
this.btnUpdateMode.Margin = new System.Windows.Forms.Padding(2);
this.btnUpdateMode.Name = "btnUpdateMode";
this.btnUpdateMode.Size = new System.Drawing.Size(108, 27);
this.btnUpdateMode.TabIndex = 79;
this.btnUpdateMode.Text = "Update mode";
this.btnUpdateMode.UseVisualStyleBackColor = true;
//
// IOBManPanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ControlLight;
this.ClientSize = new System.Drawing.Size(670, 409);
this.Controls.Add(this.btnUpdateMode);
this.Controls.Add(this.btnRestartAll);
this.Controls.Add(this.btnCloseAll);
this.Controls.Add(this.dgvManagedItems);
this.Controls.Add(this.lblNumChild);
this.Controls.Add(this.childList);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.btnOpen);
this.IsMdiContainer = true;
@@ -110,6 +138,7 @@
this.Name = "IOBManPanel";
this.Text = "IOB MANAGER";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.IOBManPanel_FormClosing);
this.Load += new System.EventHandler(this.IOBManPanel_Load_1);
((System.ComponentModel.ISupportInitialize)(this.dgvManagedItems)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -119,10 +148,12 @@
#endregion
private System.Windows.Forms.Button btnOpen;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.ListBox childList;
private System.Windows.Forms.Timer MainTimer;
private System.Windows.Forms.Label lblNumChild;
private System.Windows.Forms.DataGridView dgvManagedItems;
private System.Windows.Forms.Button btnCloseAll;
private System.Windows.Forms.Button btnRestartAll;
private System.Windows.Forms.Button btnUpdateMode;
}
}
+28 -13
View File
@@ -41,7 +41,7 @@ namespace IOB_MAN
private void updateStatus()
{
// aggiorno labels
lblNumChild.Text = $"Avviati {childList.Items.Count} / {ElencoIOB.Count} processi child";
lblNumChild.Text = $"Avviati {ElencoIOB.Count} processi child";
//dgvManagedItems.bind
}
/// <summary>
@@ -78,8 +78,6 @@ namespace IOB_MAN
newIob.startTime = adesso;
newIob.pID = p.Id;
newIob.isRunning = true;
// aggiorno elenco...
childList.Items.Add(p.Id);
// aggiungo a datasource
ElencoIOB.Add(newIob);
}
@@ -98,7 +96,6 @@ namespace IOB_MAN
private void chiudiChild()
{
int pid = -1;
string currSelection = "";
// SOLO SE selezionato in dgv...
if (dgvManagedItems.SelectedRows.Count > 0)
{
@@ -123,8 +120,6 @@ namespace IOB_MAN
}
// rimuovo da datasource
ElencoIOB.RemoveAt(riga.Index);
// rimuovo altri
childList.Items.Remove(pid);
}
}
}
@@ -242,17 +237,11 @@ namespace IOB_MAN
}
}
// ora procdedo alla cancellazione...
foreach (var item in item2rem)
{
ElencoIOB.Remove(item);
}
// ora procdedo alla cancellazione...
foreach (var item in proc2rem)
{
childList.Items.Remove(item);
}
}
private void showUpdate()
@@ -301,6 +290,32 @@ namespace IOB_MAN
{
}
private void button1_Click(object sender, EventArgs e)
{
closeAllChild();
}
private void button2_Click(object sender, EventArgs e)
{
// chiude tutto
closeAllChild();
// FAKE!!! x ora ne apre 10...
for (int i = 0; i < 10; i++)
{
apriChild();
}
}
private void lblNumChild_Click(object sender, EventArgs e)
{
}
private void IOBManPanel_Load_1(object sender, EventArgs e)
{
}
}
}