This commit is contained in:
moco 2024-11-28 00:19:12 +08:00
parent acb9b73e9d
commit a205df57ff
3 changed files with 18 additions and 126 deletions

View File

@ -561,7 +561,7 @@
this.tableLayoutPanel1.Controls.Add(this.pl_right, 2, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 24);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 3;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 55F));
@ -594,7 +594,7 @@
this.DataProcess_panel.EdgeColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(41)))), ((int)(((byte)(50)))));
this.DataProcess_panel.Location = new System.Drawing.Point(3, 3);
this.DataProcess_panel.Name = "DataProcess_panel";
this.DataProcess_panel.Padding = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.DataProcess_panel.Padding = new System.Windows.Forms.Padding(5);
this.tl_right_main_view.SetRowSpan(this.DataProcess_panel, 2);
this.DataProcess_panel.Size = new System.Drawing.Size(553, 489);
this.DataProcess_panel.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
@ -612,7 +612,7 @@
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel1.Location = new System.Drawing.Point(2, 88);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(2);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(206, 491);
this.flowLayoutPanel1.TabIndex = 18;
@ -642,9 +642,9 @@
this.pl_right.Dock = System.Windows.Forms.DockStyle.Fill;
this.pl_right.EdgeColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(41)))), ((int)(((byte)(50)))));
this.pl_right.Location = new System.Drawing.Point(771, 57);
this.pl_right.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pl_right.Margin = new System.Windows.Forms.Padding(2);
this.pl_right.Name = "pl_right";
this.pl_right.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.pl_right.Padding = new System.Windows.Forms.Padding(4);
this.tableLayoutPanel1.SetRowSpan(this.pl_right, 2);
this.pl_right.Size = new System.Drawing.Size(324, 522);
this.pl_right.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
@ -659,7 +659,7 @@
this.thunderLabel1.Name = "thunderLabel1";
this.thunderLabel1.Size = new System.Drawing.Size(200, 16);
this.thunderLabel1.TabIndex = 19;
this.thunderLabel1.Text = "PBAnaly v0.1.2";
this.thunderLabel1.Text = "PBAnaly v0.1.3";
//
// MainForm
//

View File

@ -396,127 +396,13 @@ namespace PBAnaly
bool isGridView = false;
private void materialButton_changeFormSize_Click(object sender, EventArgs e)
{
//isGridView = isGridView == false ? true : false;
//initPanel();
#if true
//var forms = ImageToolMannage.imageDataPath.Values.ToList();
//int formCount = forms.Count;
//int rows, columns;
//// 根据窗体数量确定布局
//if (formCount == 1)
//{
// rows = 1;
// columns = 1;
//}
//else if (formCount == 2)
//{
// rows = 1;
// columns = 2;
//}
//else if (formCount == 3)
//{
// rows = 1;
// columns = 3;
//}
//else if (formCount == 4)
//{
// rows = 2;
// columns = 2;
//}
//else if (formCount == 5)
//{
// rows = 2;
// columns = 3;
//}
//else if (formCount == 6)
//{
// rows = 2;
// columns = 3;
//}
//else // formCount >= 7
//{
// rows = (int)Math.Ceiling(formCount / 2.0);
// columns = 2;
//}
//// 计算每个窗体的大小
//int formWidth = DataProcess_panel.Width / columns;
//int formHeight = DataProcess_panel.Height / rows;
//// 清除 DataProcess_panel 中已有的控件
//DataProcess_panel.Controls.Clear();
//// 调整每个窗体的位置和大小
//for (int i = 0; i < formCount; i++)
//{
// var form = forms[i];
// PictureBox pictureBox = new PictureBox();
// pictureBox.Image = form.GetPseuImage;
// int row = i / columns;
// int col = i % columns;
// pictureBox.Bounds = new System.Drawing.Rectangle(col * formWidth, row * formHeight, formWidth, formHeight);
// // 添加窗体到 Panel 中并显示
// DataProcess_panel.Controls.Add(pictureBox);
// pictureBox.Show();
//}
//COMMImageToolPaletteForm cOMMImageToolPaletteForm = new COMMImageToolPaletteForm(this);
//cOMMImageToolPaletteForm.TopLevel = false;
//cOMMImageToolPaletteForm.Dock = DockStyle.Fill;
//pl_right.Controls.Clear();
//pl_right.Controls.Add(cOMMImageToolPaletteForm);
//cOMMImageToolPaletteForm.Show();
int margin = 5;
int formCount = ImageToolMannage.imageDataPath.Count;
if (formCount == 0) return;
int columns = (int)Math.Ceiling(Math.Sqrt(formCount));
int rows = (int)Math.Ceiling((double)formCount / columns);
int formWidth = (DataProcess_panel.Width - (columns + 1) * margin) / columns;
int formHeight = (DataProcess_panel.Height - (rows + 1) * margin) / rows;
int totalWidth = columns * formWidth + (columns + 1) * margin;
int totalHeight = rows * formHeight + (rows + 1) * margin;
if (totalWidth > DataProcess_panel.Width)
if (bioanalysisMannages.Count == 1)
{
formWidth = (DataProcess_panel.Width - (columns + 1) * margin) / columns;
foreach (var item in bioanalysisMannages)
{
item.Value.WindowAdaptive();
}
}
if (totalHeight > DataProcess_panel.Height)
{
formHeight = (DataProcess_panel.Height - (rows + 1) * margin) / rows;
}
int index = 0;
foreach (var item in ImageToolMannage.imageDataPath)
{
int row = index / columns;
int col = index % columns;
int x = margin + col * (formWidth + margin);
int y = margin + row * (formHeight + margin);
var panel = item.Value;
panel.Size = new Size(formWidth, formHeight);
panel.Location = new System.Drawing.Point(x, y);
panel.TopLevel = false;
panel.FormBorderStyle = FormBorderStyle.None;
panel.Visible = true;
DataProcess_panel.Controls.Add(panel);
panel.Show();
panel.BringToFront();
index++;
}
#endif
}
}
}

View File

@ -1672,7 +1672,13 @@ namespace PBAnaly.Module
public BioanalyImagePanel GetImagePanel
{
get { return imagePanel; }
}
}
public void WindowAdaptive()
{
imagePanel.WindowState = FormWindowState.Maximized;
}
#endregion
}
}