Prepare Form1 for new docking queue
This commit is contained in:
parent
d5ba405de0
commit
3c0485cfa9
13 changed files with 2771 additions and 381 deletions
|
|
@ -21,10 +21,14 @@ namespace LibationWinForms
|
|||
|
||||
private ProductsGrid productsGrid { get; }
|
||||
|
||||
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
splitContainer1.Panel2Collapsed = true;
|
||||
processBookQueue1.popoutBtn.Click += ProcessBookQueue1_PopOut;
|
||||
|
||||
productsGrid = new ProductsGrid { Dock = DockStyle.Fill };
|
||||
productsGrid.VisibleCountChanged += (_, qty) => visibleCountLbl.Text = string.Format("Visible: {0}", qty);
|
||||
gridPanel.Controls.Add(productsGrid);
|
||||
|
|
@ -600,5 +604,35 @@ namespace LibationWinForms
|
|||
this.scanningToolStripMenuItem.Visible = false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Process Queue
|
||||
|
||||
private void ProcessBookQueue1_PopOut(object sender, EventArgs e)
|
||||
{
|
||||
ProcessBookForm dockForm = new();
|
||||
dockForm.WidthChange = splitContainer1.Panel2.Width + Width - splitContainer1.Width - splitContainer1.SplitterWidth;
|
||||
dockForm.RestoreSizeAndLocation(Configuration.Instance);
|
||||
dockForm.FormClosing += DockForm_FormClosing;
|
||||
splitContainer1.Panel2.Controls.Remove(processBookQueue1);
|
||||
splitContainer1.Panel2Collapsed = true;
|
||||
processBookQueue1.popoutBtn.Visible = false;
|
||||
dockForm.PassControl(processBookQueue1);
|
||||
dockForm.Show();
|
||||
this.Width -= dockForm.WidthChange;
|
||||
}
|
||||
|
||||
private void DockForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (sender is ProcessBookForm dockForm)
|
||||
{
|
||||
this.Width += dockForm.WidthChange;
|
||||
splitContainer1.Panel2.Controls.Add(dockForm.RegainControl());
|
||||
splitContainer1.Panel2Collapsed = false;
|
||||
processBookQueue1.popoutBtn.Visible = true;
|
||||
dockForm.SaveSizeAndLocation(Configuration.Instance);
|
||||
this.Focus();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue