Changed: scrolling container

This commit is contained in:
Ray committed 2020-05-07 23:31:03 +01:00
1 parent 3b4f19ae40
commit 9575ae8ffb
12 files changed
+111 -77

No files matched your search

+3 -3
View File
@@ -11,7 +11,7 @@ namespace AppLauncher.Windows.Forms
private Button button1;
private PickerBox pickerBox1;
private TextBox textBox1;
protected TileContainer parentContainer = null;
protected TileLayoutContainer parentContainer = null;
public EditGroupForm() : base()
{
@@ -19,7 +19,7 @@ namespace AppLauncher.Windows.Forms
initialiseComponents2();
}
public EditGroupForm(TileContainer container) : base()
public EditGroupForm(TileLayoutContainer container) : base()
{
parentContainer = container;
@@ -162,7 +162,7 @@ namespace AppLauncher.Windows.Forms
if (parentContainer != null)
{
textBox1.Text = parentContainer.Model.Title;
pickerBox1.ComboBox.SelectedIndex = (parentContainer.Model.IsExpanded ? 1 : 0);
pickerBox1.ComboBox.SelectedIndex = (parentContainer.Model.IsExclusive ? 1 : 0);
}
}
+21 -11
View File
@@ -42,6 +42,7 @@
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
@@ -69,32 +70,33 @@
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem2,
this.toolStripMenuItem5,
this.toolStripMenuItem1,
this.toolStripSeparator2,
this.toolStripMenuItem4,
this.toolStripSeparator1,
this.toolStripMenuItem3});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(133, 104);
this.contextMenuStrip1.Size = new System.Drawing.Size(181, 148);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(132, 22);
this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem2.Text = "&Add Group";
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(132, 22);
this.toolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem1.Text = "&Edit";
this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(129, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
//
// toolStripMenuItem4
//
@@ -104,46 +106,46 @@
this.downToolStripMenuItem,
this.bottomToolStripMenuItem});
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
this.toolStripMenuItem4.Size = new System.Drawing.Size(132, 22);
this.toolStripMenuItem4.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem4.Text = "&Move";
//
// topToolStripMenuItem
//
this.topToolStripMenuItem.Name = "topToolStripMenuItem";
this.topToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.topToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
this.topToolStripMenuItem.Text = "&Top";
this.topToolStripMenuItem.Click += new System.EventHandler(this.topToolStripMenuItem_Click);
//
// upToolStripMenuItem
//
this.upToolStripMenuItem.Name = "upToolStripMenuItem";
this.upToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.upToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
this.upToolStripMenuItem.Text = "&Up";
this.upToolStripMenuItem.Click += new System.EventHandler(this.upToolStripMenuItem_Click);
//
// downToolStripMenuItem
//
this.downToolStripMenuItem.Name = "downToolStripMenuItem";
this.downToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.downToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
this.downToolStripMenuItem.Text = "&Down";
this.downToolStripMenuItem.Click += new System.EventHandler(this.downToolStripMenuItem_Click);
//
// bottomToolStripMenuItem
//
this.bottomToolStripMenuItem.Name = "bottomToolStripMenuItem";
this.bottomToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.bottomToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
this.bottomToolStripMenuItem.Text = "&Bottom";
this.bottomToolStripMenuItem.Click += new System.EventHandler(this.bottomToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(129, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(132, 22);
this.toolStripMenuItem3.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem3.Text = "&Remove";
this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
//
@@ -167,6 +169,13 @@
this.pictureBox1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseClick);
this.pictureBox1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseClick);
//
// toolStripMenuItem5
//
this.toolStripMenuItem5.Name = "toolStripMenuItem5";
this.toolStripMenuItem5.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem5.Text = "Add &Row";
this.toolStripMenuItem5.Click += new System.EventHandler(this.toolStripMenuItem5_Click);
//
// TileGroupLabel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -199,5 +208,6 @@
private System.Windows.Forms.ToolStripMenuItem upToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem downToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem bottomToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5;
}
}
+6 -1
View File
@@ -30,7 +30,7 @@ namespace AppLauncher.Windows.Forms
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public TileContainer TileGroupPanel { get; set; } = null;
public TileLayoutContainer TileGroupPanel { get; set; } = null;
protected void panel_MouseClick(object sender, MouseEventArgs e)
{
@@ -92,5 +92,10 @@ namespace AppLauncher.Windows.Forms
if (this.TileGroupPanel != null) this.TileGroupPanel.Remove();
}
private void toolStripMenuItem5_Click(object sender, System.EventArgs e)
{
if (this.TileGroupPanel != null) this.TileGroupPanel.AddRow();
}
}
}
@@ -1,6 +1,6 @@
namespace AppLauncher.Windows.Forms
{
partial class TileContainer
partial class TileLayoutContainer
{
/// <summary>
/// Required designer variable.
@@ -8,14 +8,14 @@ using System.Windows.Forms;
namespace AppLauncher.Windows.Forms
{
public partial class TileContainer : AUserControl
public partial class TileLayoutContainer : AUserControl
{
protected int collapseIncrement = 6;
protected int expandIncrement = 8;
protected TileGroupModel groupInfo = null;
protected bool isAnimating = false;
public TileContainer(TileGroupModel model) : base()
public TileLayoutContainer(TileGroupModel model) : base()
{
InitializeComponent();
@@ -200,13 +200,18 @@ namespace AppLauncher.Windows.Forms
return;
}
this.FlowLayoutPanel.Controls.Add(new TileContainer(new TileGroupModel()
this.FlowLayoutPanel.Controls.Add(new TileLayoutContainer(new TileGroupModel()
{
Title = "New Group",
GridSize = new Size(8, 1)
}));
}
public void AddRow()
{
panel1.SetGridSize(groupInfo.GridSize.Width, (groupInfo.GridSize.Height + 1));
}
public void EditGroup()
{
EditGroupForm editForm = new EditGroupForm(this);
@@ -220,6 +225,7 @@ namespace AppLauncher.Windows.Forms
label1.TitleText = groupInfo.Title;
panel1.SetGridSize(groupInfo.GridSize.Width, groupInfo.GridSize.Height);
this.Width = panel1.Width;
label1.Checked = groupInfo.IsExpanded;
if (loadTiles)
+4 -4
View File
@@ -30,7 +30,7 @@ namespace AppLauncher.Windows.Forms
InitializeComponent();
this.AllowDrop = true;
this.BackColor = System.Drawing.Color.Transparent;
this.BackColor = Color.Transparent;
}
private void InitializeComponent()
@@ -63,7 +63,7 @@ namespace AppLauncher.Windows.Forms
}
}
public TileContainer TileContainer
public TileLayoutContainer TileContainer
{
get
{
@@ -72,12 +72,12 @@ namespace AppLauncher.Windows.Forms
return null;
}
if (this.Parent.GetType() != typeof(TileContainer))
if (this.Parent.GetType() != typeof(TileLayoutContainer))
{
return null;
}
return (TileContainer)this.Parent;
return (TileLayoutContainer)this.Parent;
}
}