WIP: begin support for list tile
This commit is contained in:
parent
9575ae8ffb
commit
adeb97dbb5
@ -68,6 +68,9 @@
|
|||||||
<DependentUpon>Resources.resx</DependentUpon>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="RyzStudio\Drawing\Rectangoid.cs" />
|
<Compile Include="RyzStudio\Drawing\Rectangoid.cs" />
|
||||||
|
<Compile Include="RyzStudio\Windows\Forms\FlatButton.cs">
|
||||||
|
<SubType>Component</SubType>
|
||||||
|
</Compile>
|
||||||
<Compile Include="RyzStudio\Windows\Forms\HorizontalSeparator.cs">
|
<Compile Include="RyzStudio\Windows\Forms\HorizontalSeparator.cs">
|
||||||
<SubType>UserControl</SubType>
|
<SubType>UserControl</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -83,8 +86,6 @@
|
|||||||
<Compile Include="RyzStudio\Windows\ThemedForms\Button.designer.cs">
|
<Compile Include="RyzStudio\Windows\ThemedForms\Button.designer.cs">
|
||||||
<DependentUpon>Button.cs</DependentUpon>
|
<DependentUpon>Button.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="RyzStudio\Windows\ThemedForms\ButtonState.cs" />
|
|
||||||
<Compile Include="RyzStudio\Windows\ThemedForms\ButtonStyle.cs" />
|
|
||||||
<Compile Include="RyzStudio\Windows\ThemedForms\DialogForm.cs">
|
<Compile Include="RyzStudio\Windows\ThemedForms\DialogForm.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -128,12 +129,18 @@
|
|||||||
<Compile Include="RyzStudio\Windows\ThemedForms\UserControl.designer.cs">
|
<Compile Include="RyzStudio\Windows\ThemedForms\UserControl.designer.cs">
|
||||||
<DependentUpon>UserControl.cs</DependentUpon>
|
<DependentUpon>UserControl.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Windows\Forms\Tile\AddListTileForm.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Windows\Forms\Tile\AddTileForm.cs">
|
<Compile Include="Windows\Forms\Tile\AddTileForm.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Windows\Forms\Tile\EditGroupForm.cs">
|
<Compile Include="Windows\Forms\Tile\EditGroupForm.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Windows\Forms\Tile\EditListTileForm.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Windows\Forms\Tile\EditTileForm.cs">
|
<Compile Include="Windows\Forms\Tile\EditTileForm.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -198,12 +205,18 @@
|
|||||||
<EmbeddedResource Include="RyzStudio\Windows\ThemedForms\TextButtonBox.resx">
|
<EmbeddedResource Include="RyzStudio\Windows\ThemedForms\TextButtonBox.resx">
|
||||||
<DependentUpon>TextButtonBox.cs</DependentUpon>
|
<DependentUpon>TextButtonBox.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Windows\Forms\Tile\AddListTileForm.resx">
|
||||||
|
<DependentUpon>AddListTileForm.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Windows\Forms\Tile\AddTileForm.resx">
|
<EmbeddedResource Include="Windows\Forms\Tile\AddTileForm.resx">
|
||||||
<DependentUpon>AddTileForm.cs</DependentUpon>
|
<DependentUpon>AddTileForm.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Windows\Forms\Tile\EditGroupForm.resx">
|
<EmbeddedResource Include="Windows\Forms\Tile\EditGroupForm.resx">
|
||||||
<DependentUpon>EditGroupForm.cs</DependentUpon>
|
<DependentUpon>EditGroupForm.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Windows\Forms\Tile\EditListTileForm.resx">
|
||||||
|
<DependentUpon>EditListTileForm.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Windows\Forms\Tile\EditTileForm.resx">
|
<EmbeddedResource Include="Windows\Forms\Tile\EditTileForm.resx">
|
||||||
<DependentUpon>EditTileForm.cs</DependentUpon>
|
<DependentUpon>EditTileForm.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
1
MainForm.Designer.cs
generated
1
MainForm.Designer.cs
generated
@ -115,6 +115,7 @@
|
|||||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(12, 59);
|
this.flowLayoutPanel1.Location = new System.Drawing.Point(12, 59);
|
||||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||||
|
this.flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(0, 0, 10, 0);
|
||||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(600, 361);
|
this.flowLayoutPanel1.Size = new System.Drawing.Size(600, 361);
|
||||||
this.flowLayoutPanel1.TabIndex = 27;
|
this.flowLayoutPanel1.TabIndex = 27;
|
||||||
this.flowLayoutPanel1.WrapContents = false;
|
this.flowLayoutPanel1.WrapContents = false;
|
||||||
|
16
MainForm.cs
16
MainForm.cs
@ -3,6 +3,7 @@ using AppLauncher.Windows.Forms;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@ -18,10 +19,21 @@ namespace AppLauncher
|
|||||||
public MainForm() : base()
|
public MainForm() : base()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
//this.Visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnLoad(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnLoad(e);
|
||||||
|
|
||||||
|
//this.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnShown(EventArgs e)
|
protected override void OnShown(EventArgs e)
|
||||||
{
|
{
|
||||||
|
this.Visible = false;
|
||||||
|
|
||||||
base.OnShown(e);
|
base.OnShown(e);
|
||||||
|
|
||||||
string jsonfigFilename = Path.ChangeExtension(Application.ExecutablePath, "jsonfig");
|
string jsonfigFilename = Path.ChangeExtension(Application.ExecutablePath, "jsonfig");
|
||||||
@ -30,6 +42,8 @@ namespace AppLauncher
|
|||||||
loadSession(jsonfigFilename);
|
loadSession(jsonfigFilename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.Location = this.DefaultLocation;
|
||||||
|
this.Visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task ToggleSize()
|
public async Task ToggleSize()
|
||||||
@ -182,7 +196,7 @@ namespace AppLauncher
|
|||||||
flowLayoutPanel1.Controls.Add(panel);
|
flowLayoutPanel1.Controls.Add(panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
flowLayoutPanel1.Width = maxWidth + SystemInformation.VerticalScrollBarWidth;
|
flowLayoutPanel1.Width = maxWidth + SystemInformation.VerticalScrollBarWidth + 20;
|
||||||
|
|
||||||
//this.Width = flowLayoutPanel1.Width + (flowLayoutPanel1.Left * 2);
|
//this.Width = flowLayoutPanel1.Width + (flowLayoutPanel1.Left * 2);
|
||||||
this.Width = flowLayoutPanel1.Width + flowLayoutPanel1.Left;
|
this.Width = flowLayoutPanel1.Width + flowLayoutPanel1.Left;
|
||||||
|
112
RyzStudio/Windows/Forms/FlatButton.cs
Normal file
112
RyzStudio/Windows/Forms/FlatButton.cs
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace RyzStudio.Windows.Forms
|
||||||
|
{
|
||||||
|
public class FlatButton : Label
|
||||||
|
{
|
||||||
|
public class Style
|
||||||
|
{
|
||||||
|
public Color BackColour { get; set; } = Color.Transparent;
|
||||||
|
public Color PenColour { get; set; } = Color.Transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum State
|
||||||
|
{
|
||||||
|
Idle = 0,
|
||||||
|
Hover,
|
||||||
|
Down
|
||||||
|
}
|
||||||
|
|
||||||
|
protected State controlState = State.Idle;
|
||||||
|
|
||||||
|
public FlatButton() : base()
|
||||||
|
{
|
||||||
|
this.AutoSize = false;
|
||||||
|
this.ImageAlign = ContentAlignment.MiddleCenter;
|
||||||
|
this.TextAlign = ContentAlignment.MiddleCenter;
|
||||||
|
|
||||||
|
// customise
|
||||||
|
this.StyleOver = new Style()
|
||||||
|
{
|
||||||
|
BackColour = Color.FromArgb(51, 51, 51),
|
||||||
|
PenColour = Color.White
|
||||||
|
};
|
||||||
|
this.StyleDown = new Style()
|
||||||
|
{
|
||||||
|
BackColour = Color.FromArgb(179, 179, 179),
|
||||||
|
PenColour = Color.Black
|
||||||
|
};
|
||||||
|
this.StyleDefault = new Style()
|
||||||
|
{
|
||||||
|
BackColour = Color.White,
|
||||||
|
PenColour = Color.Black
|
||||||
|
};
|
||||||
|
|
||||||
|
this.VisualState = State.Idle;
|
||||||
|
|
||||||
|
this.Click += delegate { this.OnClick(null); };
|
||||||
|
this.MouseEnter += delegate { this.VisualState = State.Hover; };
|
||||||
|
this.MouseLeave += delegate { this.VisualState = State.Idle; };
|
||||||
|
this.MouseDown += delegate { this.VisualState = State.Down; };
|
||||||
|
this.MouseUp += delegate { this.VisualState = State.Idle; };
|
||||||
|
}
|
||||||
|
|
||||||
|
protected State VisualState
|
||||||
|
{
|
||||||
|
get { return controlState; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
switch (value)
|
||||||
|
{
|
||||||
|
case State.Idle:
|
||||||
|
if (this.VisualState == State.Down)
|
||||||
|
{
|
||||||
|
updateButton(StyleOver);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
updateButton(StyleDefault);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case State.Hover:
|
||||||
|
updateButton(StyleOver);
|
||||||
|
break;
|
||||||
|
case State.Down:
|
||||||
|
updateButton(StyleDown);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
updateButton(StyleDefault);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
controlState = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void updateButton(Style style)
|
||||||
|
{
|
||||||
|
this.ForeColor = style.PenColour;
|
||||||
|
this.BackColor = style.BackColour;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Browsable(false)]
|
||||||
|
public Style StyleOver { get; set; } = new Style();
|
||||||
|
|
||||||
|
[Browsable(false)]
|
||||||
|
public Style StyleDown { get; set; } = new Style();
|
||||||
|
|
||||||
|
[Browsable(false)]
|
||||||
|
public Style StyleDefault { get; set; } = new Style();
|
||||||
|
|
||||||
|
public void PerformClick() => this.OnClick(null);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,13 +1,26 @@
|
|||||||
namespace RyzStudio.Windows.ThemedForms
|
namespace RyzStudio.Windows.ThemedForms
|
||||||
{
|
{
|
||||||
using RyzStudio.Drawing;
|
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
|
||||||
public partial class Button : RyzStudio.Windows.ThemedForms.UserControl
|
public partial class Button : RyzStudio.Windows.ThemedForms.UserControl
|
||||||
{
|
{
|
||||||
protected ButtonState buttonState = ButtonState.Normal;
|
public class Style
|
||||||
|
{
|
||||||
|
public Color BackColour { get; set; } = Color.Transparent;
|
||||||
|
public Color PenColour { get; set; } = Color.Transparent;
|
||||||
|
public Image ForeImage { get; set; } = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum State
|
||||||
|
{
|
||||||
|
Idle = 0,
|
||||||
|
Hover,
|
||||||
|
Down
|
||||||
|
}
|
||||||
|
|
||||||
|
protected State controlState = State.Idle;
|
||||||
|
|
||||||
public Button() : base()
|
public Button() : base()
|
||||||
{
|
{
|
||||||
@ -16,34 +29,48 @@
|
|||||||
label1.ImageAlign = ContentAlignment.MiddleCenter;
|
label1.ImageAlign = ContentAlignment.MiddleCenter;
|
||||||
|
|
||||||
label1.Click += delegate { this.OnClick(null); };
|
label1.Click += delegate { this.OnClick(null); };
|
||||||
label1.MouseEnter += delegate { this.VisualState = ButtonState.Hover; };
|
label1.MouseEnter += delegate { this.VisualState = State.Hover; };
|
||||||
label1.MouseLeave += delegate { this.VisualState = ButtonState.Normal; };
|
label1.MouseLeave += delegate { this.VisualState = State.Idle; };
|
||||||
label1.MouseDown += delegate { this.VisualState = ButtonState.Down; };
|
label1.MouseDown += delegate { this.VisualState = State.Down; };
|
||||||
label1.MouseUp += delegate { this.VisualState = ButtonState.Normal; };
|
label1.MouseUp += delegate { this.VisualState = State.Idle; };
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnLoad(EventArgs e)
|
protected override void OnLoad(EventArgs e)
|
||||||
{
|
{
|
||||||
base.OnLoad(e);
|
base.OnLoad(e);
|
||||||
|
|
||||||
// customise
|
// customise
|
||||||
this.StyleOver = new ButtonStyle(Color.FromArgb(51, 51, 51), Color.White, this.OverImage);
|
this.StyleOver = new Style()
|
||||||
this.StyleDown = new ButtonStyle(Color.FromArgb(179, 179, 179), Color.Black, this.DownImage);
|
{
|
||||||
this.StyleDefault = new ButtonStyle(Color.White, Color.Black, this.DefaultImage);
|
BackColour = Color.FromArgb(51, 51, 51),
|
||||||
|
PenColour = Color.White,
|
||||||
|
ForeImage = this.OverImage
|
||||||
|
};
|
||||||
|
this.StyleDown = new Style()
|
||||||
|
{
|
||||||
|
BackColour = Color.FromArgb(179, 179, 179),
|
||||||
|
PenColour = Color.Black,
|
||||||
|
ForeImage = this.DownImage
|
||||||
|
};
|
||||||
|
this.StyleDefault = new Style()
|
||||||
|
{
|
||||||
|
BackColour = Color.White,
|
||||||
|
PenColour = Color.Black,
|
||||||
|
ForeImage = this.DefaultImage
|
||||||
|
};
|
||||||
|
|
||||||
this.VisualState = ButtonState.Normal;
|
this.VisualState = State.Idle;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ButtonState VisualState
|
protected State VisualState
|
||||||
{
|
{
|
||||||
get { return buttonState; }
|
get { return controlState; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
switch (value)
|
switch (value)
|
||||||
{
|
{
|
||||||
case ButtonState.Normal:
|
case State.Idle:
|
||||||
if (this.VisualState == ButtonState.Down)
|
if (this.VisualState == State.Down)
|
||||||
{
|
{
|
||||||
updateButton(StyleOver);
|
updateButton(StyleOver);
|
||||||
}
|
}
|
||||||
@ -53,10 +80,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ButtonState.Hover:
|
case State.Hover:
|
||||||
updateButton(StyleOver);
|
updateButton(StyleOver);
|
||||||
break;
|
break;
|
||||||
case ButtonState.Down:
|
case State.Down:
|
||||||
updateButton(StyleDown);
|
updateButton(StyleDown);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -64,22 +91,15 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
buttonState = value;
|
controlState = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateButton(ButtonStyle style)
|
protected void updateButton(Style style)
|
||||||
{
|
{
|
||||||
label1.ForeColor = style.PenColour;
|
label1.ForeColor = style.PenColour;
|
||||||
label1.BackColor = style.BackColour;
|
label1.BackColor = style.BackColour;
|
||||||
label1.Image = style.ForeImage;
|
label1.Image = style.ForeImage;
|
||||||
|
|
||||||
//var rect = label1.ClientRectangle;
|
|
||||||
////rect.Inflate(-3, -3);
|
|
||||||
//Rectangoid area = new Rectangoid(rect, 3, 1);
|
|
||||||
|
|
||||||
//label1.Region = new Region(area.ToGraphicsPath());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Browsable(true)]
|
[Browsable(true)]
|
||||||
@ -98,14 +118,14 @@
|
|||||||
[Category("Appearance")]
|
[Category("Appearance")]
|
||||||
public Image DefaultImage { get; set; } = null;
|
public Image DefaultImage { get; set; } = null;
|
||||||
|
|
||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
public ButtonStyle StyleOver { get; set; } = new ButtonStyle(Color.FromArgb(71, 142, 203), Color.FromArgb(250, 250, 250));
|
public Style StyleOver { get; set; } = new Style();
|
||||||
|
|
||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
public ButtonStyle StyleDown { get; set; } = new ButtonStyle(Color.FromArgb(61, 132, 193), Color.FromArgb(250, 250, 250));
|
public Style StyleDown { get; set; } = new Style();
|
||||||
|
|
||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
public ButtonStyle StyleDefault { get; set; } = new ButtonStyle(Color.FromArgb(51, 122, 183), Color.FromArgb(250, 250, 250));
|
public Style StyleDefault { get; set; } = new Style();
|
||||||
|
|
||||||
public void PerformClick() => this.OnClick(null);
|
public void PerformClick() => this.OnClick(null);
|
||||||
}
|
}
|
||||||
|
@ -12,9 +12,6 @@ namespace AppLauncher.Windows.Forms
|
|||||||
{
|
{
|
||||||
public class AForm : Form
|
public class AForm : Form
|
||||||
{
|
{
|
||||||
//private bool windowDragging = false;
|
|
||||||
//private Point windowOffset = new Point();
|
|
||||||
|
|
||||||
public AForm() : base()
|
public AForm() : base()
|
||||||
{
|
{
|
||||||
if (!this.DesignMode)
|
if (!this.DesignMode)
|
||||||
@ -33,9 +30,14 @@ namespace AppLauncher.Windows.Forms
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int requestedHeight = (int)Math.Floor(decimal.Divide((Screen.PrimaryScreen.WorkingArea.Height - this.Height), 2));
|
//int requestedHeight = (int)Math.Floor(decimal.Divide((Screen.PrimaryScreen.WorkingArea.Height - this.Height), 2));
|
||||||
|
//this.Location = new Point(Screen.PrimaryScreen.WorkingArea.X, (Screen.PrimaryScreen.WorkingArea.Y + requestedHeight));
|
||||||
|
|
||||||
this.Location = new Point(Screen.PrimaryScreen.WorkingArea.X, (Screen.PrimaryScreen.WorkingArea.Y + requestedHeight));
|
//Point newPosition = new Point(Cursor.Position.X, Cursor.Position.Y);
|
||||||
|
//newPosition.X -= (this.Width / 2);
|
||||||
|
//newPosition.Y -= (this.Height / 2);
|
||||||
|
|
||||||
|
//this.Location = newPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnPaintBackground(PaintEventArgs e)
|
protected override void OnPaintBackground(PaintEventArgs e)
|
||||||
@ -53,53 +55,20 @@ namespace AppLauncher.Windows.Forms
|
|||||||
//g.DrawRectangle(new Pen(new SolidBrush(Color.Red), 1), this.DisplayRectangle);
|
//g.DrawRectangle(new Pen(new SolidBrush(Color.Red), 1), this.DisplayRectangle);
|
||||||
}
|
}
|
||||||
|
|
||||||
//protected override void OnPaint(PaintEventArgs e)
|
protected Point DefaultLocation
|
||||||
//{
|
{
|
||||||
// base.OnPaint(e);
|
get
|
||||||
|
{
|
||||||
|
Point newPosition = new Point(Cursor.Position.X, Cursor.Position.Y);
|
||||||
|
newPosition.X -= (this.Width / 2);
|
||||||
|
newPosition.Y -= (this.Height / 2);
|
||||||
|
|
||||||
// if (this.BackgroundImage == null)
|
newPosition.X = Math.Max(newPosition.X, Screen.PrimaryScreen.WorkingArea.Left);
|
||||||
// {
|
newPosition.Y = Math.Max(newPosition.Y, Screen.PrimaryScreen.WorkingArea.Top);
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Graphics g = e.Graphics;
|
return newPosition;
|
||||||
|
}
|
||||||
// g.TextRenderingHint = TextRenderingHint.AntiAlias;
|
}
|
||||||
// g.InterpolationMode = InterpolationMode.HighQualityBilinear;
|
|
||||||
// g.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
|
||||||
// g.SmoothingMode = SmoothingMode.HighQuality;
|
|
||||||
|
|
||||||
// g.DrawImage(this.BackgroundImage, Point.Empty);
|
|
||||||
//}
|
|
||||||
|
|
||||||
//protected void windowMoveControl_MouseDown(object sender, MouseEventArgs e)
|
|
||||||
//{
|
|
||||||
// if (e.Button != MouseButtons.Left)
|
|
||||||
// {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// windowDragging = true;
|
|
||||||
// windowOffset = e.Location;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//protected void windowMoveControl_MouseUp(object sender, MouseEventArgs e)
|
|
||||||
//{
|
|
||||||
// windowDragging = false;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//protected void windowMoveControl_MouseMove(object sender, MouseEventArgs e)
|
|
||||||
//{
|
|
||||||
// if (windowDragging)
|
|
||||||
// {
|
|
||||||
// Point pos = this.PointToScreen(e.Location);
|
|
||||||
|
|
||||||
// int y = Math.Max((pos.Y - windowOffset.Y), Screen.PrimaryScreen.WorkingArea.Y);
|
|
||||||
// y = Math.Min(y, (Screen.PrimaryScreen.WorkingArea.Y + Screen.PrimaryScreen.WorkingArea.Height) - this.Height);
|
|
||||||
|
|
||||||
// this.Location = new Point(Screen.PrimaryScreen.WorkingArea.X, y);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
165
Windows/Forms/Tile/AddListTileForm.cs
Normal file
165
Windows/Forms/Tile/AddListTileForm.cs
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
using AppLauncher.Models;
|
||||||
|
using RyzStudio.Windows.ThemedForms;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace AppLauncher.Windows.Forms
|
||||||
|
{
|
||||||
|
public class AddListTileForm : DialogForm
|
||||||
|
{
|
||||||
|
public static void ShowDialog(TileLayoutPanel panel)
|
||||||
|
{
|
||||||
|
AddListTileForm form = new AddListTileForm(panel);
|
||||||
|
form.ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private Button button1;
|
||||||
|
private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator1;
|
||||||
|
private TextBox textBox1;
|
||||||
|
protected TileLayoutPanel parentPanel = null;
|
||||||
|
|
||||||
|
public AddListTileForm() : base()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public AddListTileForm(TileLayoutPanel panel) : base()
|
||||||
|
{
|
||||||
|
parentPanel = panel;
|
||||||
|
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddListTileForm));
|
||||||
|
RyzStudio.Windows.ThemedForms.Button.Style style4 = new RyzStudio.Windows.ThemedForms.Button.Style();
|
||||||
|
RyzStudio.Windows.ThemedForms.Button.Style style5 = new RyzStudio.Windows.ThemedForms.Button.Style();
|
||||||
|
RyzStudio.Windows.ThemedForms.Button.Style style6 = new RyzStudio.Windows.ThemedForms.Button.Style();
|
||||||
|
this.textBox1 = new RyzStudio.Windows.ThemedForms.TextBox();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.button1 = new RyzStudio.Windows.ThemedForms.Button();
|
||||||
|
this.horizontalSeparator1 = new RyzStudio.Windows.Forms.HorizontalSeparator();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// imgbxClose
|
||||||
|
//
|
||||||
|
this.imgbxClose.Image = ((System.Drawing.Image)(resources.GetObject("imgbxClose.Image")));
|
||||||
|
this.imgbxClose.Location = new System.Drawing.Point(367, 5);
|
||||||
|
//
|
||||||
|
// lblDescription
|
||||||
|
//
|
||||||
|
this.lblDescription.Size = new System.Drawing.Size(359, 30);
|
||||||
|
this.lblDescription.Text = "Add List Tile";
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
this.panel1.Location = new System.Drawing.Point(394, 474);
|
||||||
|
//
|
||||||
|
// area1
|
||||||
|
//
|
||||||
|
this.area1.Location = new System.Drawing.Point(1, 474);
|
||||||
|
this.area1.Size = new System.Drawing.Size(392, 5);
|
||||||
|
//
|
||||||
|
// textBox1
|
||||||
|
//
|
||||||
|
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.textBox1.BackColor = System.Drawing.Color.Transparent;
|
||||||
|
this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
|
||||||
|
this.textBox1.Location = new System.Drawing.Point(159, 50);
|
||||||
|
this.textBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
|
||||||
|
this.textBox1.Name = "textBox1";
|
||||||
|
this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9);
|
||||||
|
this.textBox1.Size = new System.Drawing.Size(220, 32);
|
||||||
|
this.textBox1.SubmitButton = null;
|
||||||
|
this.textBox1.TabIndex = 152;
|
||||||
|
this.textBox1.UseSystemPasswordChar = false;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.BackColor = System.Drawing.Color.Transparent;
|
||||||
|
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104)))));
|
||||||
|
this.label1.Location = new System.Drawing.Point(18, 50);
|
||||||
|
this.label1.Margin = new System.Windows.Forms.Padding(0);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(131, 32);
|
||||||
|
this.label1.TabIndex = 153;
|
||||||
|
this.label1.Text = "Title";
|
||||||
|
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.button1.BackColor = System.Drawing.Color.Transparent;
|
||||||
|
this.button1.DefaultImage = null;
|
||||||
|
this.button1.DownImage = null;
|
||||||
|
this.button1.LabelText = "&Save";
|
||||||
|
this.button1.Location = new System.Drawing.Point(251, 427);
|
||||||
|
this.button1.Name = "button1";
|
||||||
|
this.button1.OverImage = null;
|
||||||
|
this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
|
||||||
|
this.button1.Size = new System.Drawing.Size(128, 32);
|
||||||
|
style4.BackColour = System.Drawing.Color.White;
|
||||||
|
style4.ForeImage = null;
|
||||||
|
style4.PenColour = System.Drawing.Color.Black;
|
||||||
|
this.button1.StyleDefault = style4;
|
||||||
|
style5.BackColour = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(179)))), ((int)(((byte)(179)))));
|
||||||
|
style5.ForeImage = null;
|
||||||
|
style5.PenColour = System.Drawing.Color.Black;
|
||||||
|
this.button1.StyleDown = style5;
|
||||||
|
style6.BackColour = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||||
|
style6.ForeImage = null;
|
||||||
|
style6.PenColour = System.Drawing.Color.White;
|
||||||
|
this.button1.StyleOver = style6;
|
||||||
|
this.button1.TabIndex = 173;
|
||||||
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
//
|
||||||
|
// horizontalSeparator1
|
||||||
|
//
|
||||||
|
this.horizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.horizontalSeparator1.Location = new System.Drawing.Point(10, 92);
|
||||||
|
this.horizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2);
|
||||||
|
this.horizontalSeparator1.Name = "horizontalSeparator1";
|
||||||
|
this.horizontalSeparator1.Size = new System.Drawing.Size(380, 2);
|
||||||
|
this.horizontalSeparator1.TabIndex = 176;
|
||||||
|
//
|
||||||
|
// AddListTileForm
|
||||||
|
//
|
||||||
|
this.ClientSize = new System.Drawing.Size(400, 480);
|
||||||
|
this.Controls.Add(this.horizontalSeparator1);
|
||||||
|
this.Controls.Add(this.button1);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.textBox1);
|
||||||
|
this.Description = "Add List Tile";
|
||||||
|
this.Name = "AddListTileForm";
|
||||||
|
this.Controls.SetChildIndex(this.imgbxClose, 0);
|
||||||
|
this.Controls.SetChildIndex(this.lblDescription, 0);
|
||||||
|
this.Controls.SetChildIndex(this.panel1, 0);
|
||||||
|
this.Controls.SetChildIndex(this.area1, 0);
|
||||||
|
this.Controls.SetChildIndex(this.textBox1, 0);
|
||||||
|
this.Controls.SetChildIndex(this.label1, 0);
|
||||||
|
this.Controls.SetChildIndex(this.button1, 0);
|
||||||
|
this.Controls.SetChildIndex(this.horizontalSeparator1, 0);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
TileModel model = new TileModel()
|
||||||
|
{
|
||||||
|
Title = textBox1.Text?.Trim(),
|
||||||
|
IsGroup = true
|
||||||
|
};
|
||||||
|
|
||||||
|
parentPanel.AddTile(model);
|
||||||
|
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
131
Windows/Forms/Tile/AddListTileForm.resx
Normal file
131
Windows/Forms/Tile/AddListTileForm.resx
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
|
<data name="imgbxClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||||
|
wwAADsMBx2+oZAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS4xYyqcSwAAANlJREFUOE+lU1sO
|
||||||
|
gjAQrHgRY6KemQ+VT9NrgAfgfRA+SawzdTAk2lhkkgm7s7vTAq0py/LUNM0dHEEXSfYWfd8fDQIOD23b
|
||||||
|
nvFMY6jeAcxpMFIwC1HX9YWzNOCWUunR4AxnvxpUVbV3zm2UGsbUlHoEDfBhdsgf4BWDCcmYGmtqCxtw
|
||||||
|
NeQcoJ6JjGn43hXy8CvIxDeIGbREZY+pHjLgtqeVHf7SzVq7VdmDM6x9GGj1/19h9UckVv3GWMwNRh5L
|
||||||
|
6dGYH+UCHCTQ9SfV+7pMvJIIaLL0Oudd1x2eUQ8MyeAeq0cAAAAASUVORK5CYII=
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
@ -11,6 +11,12 @@ namespace AppLauncher.Windows.Forms
|
|||||||
{
|
{
|
||||||
public class AddTileForm : DialogForm
|
public class AddTileForm : DialogForm
|
||||||
{
|
{
|
||||||
|
public static void ShowDialog(TileLayoutPanel panel)
|
||||||
|
{
|
||||||
|
AddTileForm form = new AddTileForm(panel);
|
||||||
|
form.ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
private System.Windows.Forms.Label label6;
|
private System.Windows.Forms.Label label6;
|
||||||
private System.Windows.Forms.Label label7;
|
private System.Windows.Forms.Label label7;
|
||||||
private System.Windows.Forms.Label label4;
|
private System.Windows.Forms.Label label4;
|
||||||
@ -47,6 +53,9 @@ namespace AppLauncher.Windows.Forms
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddTileForm));
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddTileForm));
|
||||||
|
RyzStudio.Windows.ThemedForms.Button.Style style1 = new RyzStudio.Windows.ThemedForms.Button.Style();
|
||||||
|
RyzStudio.Windows.ThemedForms.Button.Style style2 = new RyzStudio.Windows.ThemedForms.Button.Style();
|
||||||
|
RyzStudio.Windows.ThemedForms.Button.Style style3 = new RyzStudio.Windows.ThemedForms.Button.Style();
|
||||||
this.textBox1 = new RyzStudio.Windows.ThemedForms.TextBox();
|
this.textBox1 = new RyzStudio.Windows.ThemedForms.TextBox();
|
||||||
this.label6 = new System.Windows.Forms.Label();
|
this.label6 = new System.Windows.Forms.Label();
|
||||||
this.label7 = new System.Windows.Forms.Label();
|
this.label7 = new System.Windows.Forms.Label();
|
||||||
@ -75,7 +84,7 @@ namespace AppLauncher.Windows.Forms
|
|||||||
// lblDescription
|
// lblDescription
|
||||||
//
|
//
|
||||||
this.lblDescription.Size = new System.Drawing.Size(359, 30);
|
this.lblDescription.Size = new System.Drawing.Size(359, 30);
|
||||||
this.lblDescription.Text = "Edit Tile";
|
this.lblDescription.Text = "Add Tile";
|
||||||
//
|
//
|
||||||
// panel1
|
// panel1
|
||||||
//
|
//
|
||||||
@ -231,6 +240,18 @@ namespace AppLauncher.Windows.Forms
|
|||||||
this.button1.OverImage = null;
|
this.button1.OverImage = null;
|
||||||
this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
|
this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
|
||||||
this.button1.Size = new System.Drawing.Size(128, 32);
|
this.button1.Size = new System.Drawing.Size(128, 32);
|
||||||
|
style1.BackColour = System.Drawing.Color.White;
|
||||||
|
style1.ForeImage = null;
|
||||||
|
style1.PenColour = System.Drawing.Color.Black;
|
||||||
|
this.button1.StyleDefault = style1;
|
||||||
|
style2.BackColour = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(179)))), ((int)(((byte)(179)))));
|
||||||
|
style2.ForeImage = null;
|
||||||
|
style2.PenColour = System.Drawing.Color.Black;
|
||||||
|
this.button1.StyleDown = style2;
|
||||||
|
style3.BackColour = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||||
|
style3.ForeImage = null;
|
||||||
|
style3.PenColour = System.Drawing.Color.White;
|
||||||
|
this.button1.StyleOver = style3;
|
||||||
this.button1.TabIndex = 173;
|
this.button1.TabIndex = 173;
|
||||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
//
|
//
|
||||||
@ -309,7 +330,7 @@ namespace AppLauncher.Windows.Forms
|
|||||||
this.Controls.Add(this.label2);
|
this.Controls.Add(this.label2);
|
||||||
this.Controls.Add(this.label1);
|
this.Controls.Add(this.label1);
|
||||||
this.Controls.Add(this.textBox1);
|
this.Controls.Add(this.textBox1);
|
||||||
this.Description = "Edit Tile";
|
this.Description = "Add Tile";
|
||||||
this.Name = "AddTileForm";
|
this.Name = "AddTileForm";
|
||||||
this.Controls.SetChildIndex(this.imgbxClose, 0);
|
this.Controls.SetChildIndex(this.imgbxClose, 0);
|
||||||
this.Controls.SetChildIndex(this.lblDescription, 0);
|
this.Controls.SetChildIndex(this.lblDescription, 0);
|
||||||
|
175
Windows/Forms/Tile/EditListTileForm.cs
Normal file
175
Windows/Forms/Tile/EditListTileForm.cs
Normal file
@ -0,0 +1,175 @@
|
|||||||
|
using AppLauncher.Models;
|
||||||
|
using RyzStudio.Windows.ThemedForms;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace AppLauncher.Windows.Forms
|
||||||
|
{
|
||||||
|
public class EditListTileForm : DialogForm
|
||||||
|
{
|
||||||
|
public static void ShowDialog(TilePanel panel)
|
||||||
|
{
|
||||||
|
EditListTileForm form = new EditListTileForm(panel);
|
||||||
|
form.ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private Button button1;
|
||||||
|
private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator2;
|
||||||
|
private TextBox textBox1;
|
||||||
|
protected TilePanel parentPanel = null;
|
||||||
|
|
||||||
|
public EditListTileForm() : base()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public EditListTileForm(TilePanel panel) : base()
|
||||||
|
{
|
||||||
|
parentPanel = panel;
|
||||||
|
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditListTileForm));
|
||||||
|
RyzStudio.Windows.ThemedForms.Button.Style style4 = new RyzStudio.Windows.ThemedForms.Button.Style();
|
||||||
|
RyzStudio.Windows.ThemedForms.Button.Style style5 = new RyzStudio.Windows.ThemedForms.Button.Style();
|
||||||
|
RyzStudio.Windows.ThemedForms.Button.Style style6 = new RyzStudio.Windows.ThemedForms.Button.Style();
|
||||||
|
this.textBox1 = new RyzStudio.Windows.ThemedForms.TextBox();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.button1 = new RyzStudio.Windows.ThemedForms.Button();
|
||||||
|
this.horizontalSeparator2 = new RyzStudio.Windows.Forms.HorizontalSeparator();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// imgbxClose
|
||||||
|
//
|
||||||
|
this.imgbxClose.Image = ((System.Drawing.Image)(resources.GetObject("imgbxClose.Image")));
|
||||||
|
this.imgbxClose.Location = new System.Drawing.Point(367, 5);
|
||||||
|
//
|
||||||
|
// lblDescription
|
||||||
|
//
|
||||||
|
this.lblDescription.Size = new System.Drawing.Size(359, 30);
|
||||||
|
this.lblDescription.Text = "Edit List Tile";
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
this.panel1.Location = new System.Drawing.Point(394, 474);
|
||||||
|
//
|
||||||
|
// area1
|
||||||
|
//
|
||||||
|
this.area1.Location = new System.Drawing.Point(1, 474);
|
||||||
|
this.area1.Size = new System.Drawing.Size(392, 5);
|
||||||
|
//
|
||||||
|
// textBox1
|
||||||
|
//
|
||||||
|
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.textBox1.BackColor = System.Drawing.Color.Transparent;
|
||||||
|
this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
|
||||||
|
this.textBox1.Location = new System.Drawing.Point(159, 50);
|
||||||
|
this.textBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
|
||||||
|
this.textBox1.Name = "textBox1";
|
||||||
|
this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9);
|
||||||
|
this.textBox1.Size = new System.Drawing.Size(220, 32);
|
||||||
|
this.textBox1.SubmitButton = null;
|
||||||
|
this.textBox1.TabIndex = 152;
|
||||||
|
this.textBox1.UseSystemPasswordChar = false;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.BackColor = System.Drawing.Color.Transparent;
|
||||||
|
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104)))));
|
||||||
|
this.label1.Location = new System.Drawing.Point(18, 50);
|
||||||
|
this.label1.Margin = new System.Windows.Forms.Padding(0);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(131, 32);
|
||||||
|
this.label1.TabIndex = 153;
|
||||||
|
this.label1.Text = "Title";
|
||||||
|
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.button1.BackColor = System.Drawing.Color.Transparent;
|
||||||
|
this.button1.DefaultImage = null;
|
||||||
|
this.button1.DownImage = null;
|
||||||
|
this.button1.LabelText = "&Save";
|
||||||
|
this.button1.Location = new System.Drawing.Point(251, 427);
|
||||||
|
this.button1.Name = "button1";
|
||||||
|
this.button1.OverImage = null;
|
||||||
|
this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
|
||||||
|
this.button1.Size = new System.Drawing.Size(128, 32);
|
||||||
|
style4.BackColour = System.Drawing.Color.White;
|
||||||
|
style4.ForeImage = null;
|
||||||
|
style4.PenColour = System.Drawing.Color.Black;
|
||||||
|
this.button1.StyleDefault = style4;
|
||||||
|
style5.BackColour = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(179)))), ((int)(((byte)(179)))));
|
||||||
|
style5.ForeImage = null;
|
||||||
|
style5.PenColour = System.Drawing.Color.Black;
|
||||||
|
this.button1.StyleDown = style5;
|
||||||
|
style6.BackColour = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||||
|
style6.ForeImage = null;
|
||||||
|
style6.PenColour = System.Drawing.Color.White;
|
||||||
|
this.button1.StyleOver = style6;
|
||||||
|
this.button1.TabIndex = 173;
|
||||||
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
//
|
||||||
|
// horizontalSeparator2
|
||||||
|
//
|
||||||
|
this.horizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.horizontalSeparator2.Location = new System.Drawing.Point(10, 92);
|
||||||
|
this.horizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2);
|
||||||
|
this.horizontalSeparator2.Name = "horizontalSeparator2";
|
||||||
|
this.horizontalSeparator2.Size = new System.Drawing.Size(380, 2);
|
||||||
|
this.horizontalSeparator2.TabIndex = 177;
|
||||||
|
//
|
||||||
|
// EditListTileForm
|
||||||
|
//
|
||||||
|
this.ClientSize = new System.Drawing.Size(400, 480);
|
||||||
|
this.Controls.Add(this.horizontalSeparator2);
|
||||||
|
this.Controls.Add(this.button1);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.textBox1);
|
||||||
|
this.Description = "Edit List Tile";
|
||||||
|
this.Name = "EditListTileForm";
|
||||||
|
this.Controls.SetChildIndex(this.imgbxClose, 0);
|
||||||
|
this.Controls.SetChildIndex(this.lblDescription, 0);
|
||||||
|
this.Controls.SetChildIndex(this.panel1, 0);
|
||||||
|
this.Controls.SetChildIndex(this.area1, 0);
|
||||||
|
this.Controls.SetChildIndex(this.textBox1, 0);
|
||||||
|
this.Controls.SetChildIndex(this.label1, 0);
|
||||||
|
this.Controls.SetChildIndex(this.button1, 0);
|
||||||
|
this.Controls.SetChildIndex(this.horizontalSeparator2, 0);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnShown(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnShown(e);
|
||||||
|
|
||||||
|
if (parentPanel != null)
|
||||||
|
{
|
||||||
|
textBox1.Text = parentPanel.ModelInfo.Title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
TileModel model = new TileModel()
|
||||||
|
{
|
||||||
|
Title = textBox1.Text?.Trim(),
|
||||||
|
IsGroup = true
|
||||||
|
};
|
||||||
|
|
||||||
|
parentPanel.LoadInfo(model);
|
||||||
|
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
131
Windows/Forms/Tile/EditListTileForm.resx
Normal file
131
Windows/Forms/Tile/EditListTileForm.resx
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
|
<data name="imgbxClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||||
|
wwAADsMBx2+oZAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS4xYyqcSwAAANlJREFUOE+lU1sO
|
||||||
|
gjAQrHgRY6KemQ+VT9NrgAfgfRA+SawzdTAk2lhkkgm7s7vTAq0py/LUNM0dHEEXSfYWfd8fDQIOD23b
|
||||||
|
nvFMY6jeAcxpMFIwC1HX9YWzNOCWUunR4AxnvxpUVbV3zm2UGsbUlHoEDfBhdsgf4BWDCcmYGmtqCxtw
|
||||||
|
NeQcoJ6JjGn43hXy8CvIxDeIGbREZY+pHjLgtqeVHf7SzVq7VdmDM6x9GGj1/19h9UckVv3GWMwNRh5L
|
||||||
|
6dGYH+UCHCTQ9SfV+7pMvJIIaLL0Oudd1x2eUQ8MyeAeq0cAAAAASUVORK5CYII=
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
@ -1,16 +1,18 @@
|
|||||||
using AppLauncher.Models;
|
using AppLauncher.Models;
|
||||||
using RyzStudio.Windows.ThemedForms;
|
using RyzStudio.Windows.ThemedForms;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace AppLauncher.Windows.Forms
|
namespace AppLauncher.Windows.Forms
|
||||||
{
|
{
|
||||||
public class EditTileForm : DialogForm
|
public class EditTileForm : DialogForm
|
||||||
{
|
{
|
||||||
|
public static void ShowDialog(TilePanel panel)
|
||||||
|
{
|
||||||
|
EditTileForm form = new EditTileForm(panel);
|
||||||
|
form.ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
private System.Windows.Forms.Label label6;
|
private System.Windows.Forms.Label label6;
|
||||||
private System.Windows.Forms.Label label7;
|
private System.Windows.Forms.Label label7;
|
||||||
private System.Windows.Forms.Label label4;
|
private System.Windows.Forms.Label label4;
|
||||||
|
20
Windows/Forms/Tile/TileLayoutContainer.Designer.cs
generated
20
Windows/Forms/Tile/TileLayoutContainer.Designer.cs
generated
@ -33,6 +33,7 @@
|
|||||||
this.panel1 = new AppLauncher.Windows.Forms.TileLayoutPanel();
|
this.panel1 = new AppLauncher.Windows.Forms.TileLayoutPanel();
|
||||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||||
this.addToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.addToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.addListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.contextMenuStrip1.SuspendLayout();
|
this.contextMenuStrip1.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
@ -65,25 +66,33 @@
|
|||||||
// contextMenuStrip1
|
// contextMenuStrip1
|
||||||
//
|
//
|
||||||
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.addToolStripMenuItem});
|
this.addToolStripMenuItem,
|
||||||
|
this.addListToolStripMenuItem});
|
||||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||||
this.contextMenuStrip1.Size = new System.Drawing.Size(181, 48);
|
this.contextMenuStrip1.Size = new System.Drawing.Size(181, 70);
|
||||||
//
|
//
|
||||||
// addToolStripMenuItem
|
// addToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.addToolStripMenuItem.Name = "addToolStripMenuItem";
|
this.addToolStripMenuItem.Name = "addToolStripMenuItem";
|
||||||
this.addToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
this.addToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
this.addToolStripMenuItem.Text = "&Add Tile";
|
this.addToolStripMenuItem.Text = "&Add Tile";
|
||||||
this.addToolStripMenuItem.Click += new System.EventHandler(this.addToolStripMenuItem_Click);
|
this.addToolStripMenuItem.Click += new System.EventHandler(this.addTileMenuItem_Click);
|
||||||
//
|
//
|
||||||
// TileContainer
|
// addListToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.addListToolStripMenuItem.Name = "addListToolStripMenuItem";
|
||||||
|
this.addListToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
|
this.addListToolStripMenuItem.Text = "Add &List Tile";
|
||||||
|
this.addListToolStripMenuItem.Click += new System.EventHandler(this.addListTileMenuItem_Click);
|
||||||
|
//
|
||||||
|
// TileLayoutContainer
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.BackColor = System.Drawing.Color.Transparent;
|
this.BackColor = System.Drawing.Color.Transparent;
|
||||||
this.Controls.Add(this.panel1);
|
this.Controls.Add(this.panel1);
|
||||||
this.Controls.Add(this.label1);
|
this.Controls.Add(this.label1);
|
||||||
this.Name = "TileContainer";
|
this.Name = "TileLayoutContainer";
|
||||||
this.Size = new System.Drawing.Size(370, 150);
|
this.Size = new System.Drawing.Size(370, 150);
|
||||||
this.contextMenuStrip1.ResumeLayout(false);
|
this.contextMenuStrip1.ResumeLayout(false);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
@ -96,5 +105,6 @@
|
|||||||
private TileLayoutPanel panel1;
|
private TileLayoutPanel panel1;
|
||||||
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
|
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
|
||||||
private System.Windows.Forms.ToolStripMenuItem addToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem addToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem addListToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -296,11 +296,9 @@ namespace AppLauncher.Windows.Forms
|
|||||||
this.FlowLayoutPanel.Controls.Remove(this);
|
this.FlowLayoutPanel.Controls.Remove(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addToolStripMenuItem_Click(object sender, EventArgs e)
|
private void addTileMenuItem_Click(object sender, EventArgs e) => AddTileForm.ShowDialog(panel1);
|
||||||
{
|
|
||||||
AddTileForm addForm = new AddTileForm(panel1);
|
private void addListTileMenuItem_Click(object sender, EventArgs e) => AddListTileForm.ShowDialog(panel1);
|
||||||
addForm.ShowDialog();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
3
Windows/Forms/Tile/TilePanel.Designer.cs
generated
3
Windows/Forms/Tile/TilePanel.Designer.cs
generated
@ -51,6 +51,7 @@
|
|||||||
this.label1.Size = new System.Drawing.Size(70, 13);
|
this.label1.Size = new System.Drawing.Size(70, 13);
|
||||||
this.label1.TabIndex = 24;
|
this.label1.TabIndex = 24;
|
||||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||||
|
this.label1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseClick);
|
||||||
this.label1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseDoubleClick);
|
this.label1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseDoubleClick);
|
||||||
//
|
//
|
||||||
// contextMenuStrip1
|
// contextMenuStrip1
|
||||||
@ -88,6 +89,7 @@
|
|||||||
this.pictureBox1.Size = new System.Drawing.Size(70, 38);
|
this.pictureBox1.Size = new System.Drawing.Size(70, 38);
|
||||||
this.pictureBox1.TabIndex = 25;
|
this.pictureBox1.TabIndex = 25;
|
||||||
this.pictureBox1.TabStop = false;
|
this.pictureBox1.TabStop = false;
|
||||||
|
this.pictureBox1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseClick);
|
||||||
this.pictureBox1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseDoubleClick);
|
this.pictureBox1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseDoubleClick);
|
||||||
//
|
//
|
||||||
// TilePanel
|
// TilePanel
|
||||||
@ -103,6 +105,7 @@
|
|||||||
this.MinimumSize = new System.Drawing.Size(70, 70);
|
this.MinimumSize = new System.Drawing.Size(70, 70);
|
||||||
this.Name = "TilePanel";
|
this.Name = "TilePanel";
|
||||||
this.Size = new System.Drawing.Size(70, 70);
|
this.Size = new System.Drawing.Size(70, 70);
|
||||||
|
this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseClick);
|
||||||
this.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseDoubleClick);
|
this.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseDoubleClick);
|
||||||
this.contextMenuStrip1.ResumeLayout(false);
|
this.contextMenuStrip1.ResumeLayout(false);
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||||
|
@ -14,7 +14,6 @@ namespace AppLauncher.Windows.Forms
|
|||||||
protected Point startPosition = new Point();
|
protected Point startPosition = new Point();
|
||||||
|
|
||||||
protected TileModel modelInfo = new TileModel();
|
protected TileModel modelInfo = new TileModel();
|
||||||
protected EditTileForm editForm = null;
|
|
||||||
|
|
||||||
public TilePanel() : base()
|
public TilePanel() : base()
|
||||||
{
|
{
|
||||||
@ -65,19 +64,27 @@ namespace AppLauncher.Windows.Forms
|
|||||||
this.modelInfo = model;
|
this.modelInfo = model;
|
||||||
|
|
||||||
this.Title = model.Title;
|
this.Title = model.Title;
|
||||||
this.Image = model.Icon;
|
|
||||||
|
|
||||||
if (this.Image == null)
|
if (this.modelInfo.IsGroup)
|
||||||
{
|
{
|
||||||
if (File.Exists(model.ProcessFilename))
|
this.Image = Properties.Resources.folder_ea_32;
|
||||||
{
|
}
|
||||||
try
|
else
|
||||||
{
|
{
|
||||||
this.Image = Icon.ExtractAssociatedIcon(model.ProcessFilename)?.ToBitmap();
|
this.Image = model.Icon;
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
|
if (this.Image == null)
|
||||||
|
{
|
||||||
|
if (File.Exists(model.ProcessFilename))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
this.Image = Icon.ExtractAssociatedIcon(model.ProcessFilename)?.ToBitmap();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,13 +135,45 @@ namespace AppLauncher.Windows.Forms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void panel_MouseClick(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Button != MouseButtons.Left)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.ModelInfo == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.ModelInfo.IsGroup)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
panel_MouseDoubleClick(sender, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void panel_MouseDoubleClick(object sender, MouseEventArgs e)
|
private void panel_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (e.Button != MouseButtons.Left)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.ModelInfo == null)
|
if (this.ModelInfo == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.ModelInfo.IsGroup)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(this.ModelInfo.ProcessFilename))
|
if (string.IsNullOrWhiteSpace(this.ModelInfo.ProcessFilename))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -164,8 +203,14 @@ namespace AppLauncher.Windows.Forms
|
|||||||
|
|
||||||
private void editToolStripMenuItem_Click(object sender, EventArgs e)
|
private void editToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (editForm == null) editForm = new EditTileForm(this);
|
if (this.ModelInfo.IsGroup)
|
||||||
editForm.ShowDialog();
|
{
|
||||||
|
EditListTileForm.ShowDialog(this);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EditTileForm.ShowDialog(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeToolStripMenuItem_Click(object sender, EventArgs e)
|
private void removeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
Reference in New Issue
Block a user