diff --git a/AppResource.Designer.cs b/AppResource.Designer.cs
index 35848c8..9fa888a 100644
--- a/AppResource.Designer.cs
+++ b/AppResource.Designer.cs
@@ -19,7 +19,7 @@ namespace RokettoLaunch {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class AppResource {
@@ -106,6 +106,26 @@ namespace RokettoLaunch {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap folder_minus {
+ get {
+ object obj = ResourceManager.GetObject("folder_minus", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap help_circle {
+ get {
+ object obj = ResourceManager.GetObject("help_circle", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -115,5 +135,45 @@ namespace RokettoLaunch {
return ((System.Drawing.Bitmap)(obj));
}
}
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap plus {
+ get {
+ object obj = ResourceManager.GetObject("plus", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap save {
+ get {
+ object obj = ResourceManager.GetObject("save", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap settings {
+ get {
+ object obj = ResourceManager.GetObject("settings", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap trash_2 {
+ get {
+ object obj = ResourceManager.GetObject("trash_2", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
}
}
diff --git a/AppResource.resx b/AppResource.resx
index ead4e1e..6ea4339 100644
--- a/AppResource.resx
+++ b/AppResource.resx
@@ -133,7 +133,25 @@
Resources\folder_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ Resources\MainMenu\folder-minus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ Resources\MainMenu\help-circle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
Resources\icon-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ Resources\MainMenu\plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ Resources\MainMenu\save.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ Resources\MainMenu\settings.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ Resources\MainMenu\trash-2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
\ No newline at end of file
diff --git a/CopyToTileForm.cs b/CopyToTileForm.cs
new file mode 100644
index 0000000..6ef750f
--- /dev/null
+++ b/CopyToTileForm.cs
@@ -0,0 +1,105 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Windows.Forms;
+using RyzStudio.Windows.Forms;
+using RyzStudio.Windows.ThemedForms;
+
+namespace RokettoLaunch
+{
+ public class CopyToTileForm : Form
+ {
+ private Label label1;
+ private ThPickerBox pickerBox1;
+ private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
+
+
+ private List result = null;
+
+
+ public CopyToTileForm(List model = null)
+ {
+ InitializeComponent();
+
+ UISetup.Dialog(this, true);
+
+ this.Text = "Copy To...";
+
+ result = model;
+
+ pickerBox1.Setup(model, 0);
+ }
+
+ protected override void OnShown(EventArgs e)
+ {
+ base.OnShown(e);
+
+ pickerBox1.Value = 0;
+ }
+
+ private void InitializeComponent()
+ {
+ label1 = new Label();
+ pickerBox1 = new ThPickerBox();
+ dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
+ SuspendLayout();
+ //
+ // label1
+ //
+ label1.AutoSize = true;
+ label1.BackColor = Color.Transparent;
+ label1.ForeColor = SystemColors.ControlText;
+ label1.Location = new Point(10, 20);
+ label1.Margin = new Padding(0);
+ label1.Name = "label1";
+ label1.Padding = new Padding(0, 9, 0, 0);
+ label1.Size = new Size(40, 24);
+ label1.TabIndex = 153;
+ label1.Text = "Group";
+ label1.TextAlign = ContentAlignment.MiddleLeft;
+ //
+ // pickerBox1
+ //
+ pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+ pickerBox1.BackColor = Color.Transparent;
+ pickerBox1.EnableMovable = false;
+ pickerBox1.Location = new Point(95, 20);
+ pickerBox1.Name = "pickerBox1";
+ pickerBox1.SelectedIndex = -1;
+ pickerBox1.Size = new Size(280, 32);
+ pickerBox1.TabIndex = 174;
+ pickerBox1.TabStop = false;
+ //
+ // dialogFooter1
+ //
+ dialogFooter1.BackColor = Color.FromArgb(240, 240, 240);
+ dialogFooter1.Dock = DockStyle.Bottom;
+ dialogFooter1.EnableMovable = false;
+ dialogFooter1.IsBusy = false;
+ dialogFooter1.Location = new Point(0, 451);
+ dialogFooter1.Name = "dialogFooter1";
+ dialogFooter1.Size = new Size(384, 70);
+ dialogFooter1.TabIndex = 0;
+ dialogFooter1.TabStop = false;
+ //
+ // CopyToTileForm
+ //
+ BackColor = Color.White;
+ ClientSize = new Size(384, 521);
+ Controls.Add(dialogFooter1);
+ Controls.Add(pickerBox1);
+ Controls.Add(label1);
+ MinimumSize = new Size(400, 560);
+ Name = "CopyToTileForm";
+ Text = "Copy To...";
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ public int Result
+ {
+ get => pickerBox1.Value;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/EditSectionForm.resx b/CopyToTileForm.resx
similarity index 100%
rename from EditSectionForm.resx
rename to CopyToTileForm.resx
diff --git a/EditTileFolderForm.cs b/EditFolderForm.cs
similarity index 66%
rename from EditTileFolderForm.cs
rename to EditFolderForm.cs
index fdfcf7b..045285d 100644
--- a/EditTileFolderForm.cs
+++ b/EditFolderForm.cs
@@ -5,14 +5,14 @@ using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
-using RokettoLaunch.Models;
+using RokettoLaunch.Models.SaveFile;
using RyzStudio.Windows.Forms;
using RyzStudio.Windows.ThemedForms;
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
namespace RokettoLaunch
{
- public class EditTileFolderForm : Form
+ public class EditFolderForm : Form
{
private Label label1;
private ThClearableTextBox textBox1;
@@ -21,21 +21,27 @@ namespace RokettoLaunch
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
- private TileModel result = null;
+ private App4Options.Item result = null;
- public EditTileFolderForm(TileModel model = null)
+ public EditFolderForm(App4Options.Item model = null)
{
InitializeComponent();
- UISetup.Dialog(this);
+ UISetup.Dialog(this, true);
this.Text = (result == null) ? "Add Folder" : "Edit Folder";
result = model;
+ }
+
+ protected override void OnShown(EventArgs e)
+ {
+ base.OnShown(e);
textBox1.Text = result?.Title ?? "New Folder";
- foreach (TileModel item in result?.Items ?? new List())
+
+ foreach (var item in result?.Items ?? new List())
{
if (item.IsGroup)
{
@@ -60,13 +66,11 @@ namespace RokettoLaunch
textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
textBox1.BackColor = Color.Transparent;
textBox1.ClearedValue = "";
- textBox1.EnableReactiveVisual = true;
- textBox1.Font = new Font("Microsoft Sans Serif", 8.25F);
+ textBox1.EnableMovable = false;
textBox1.Icon = "O";
textBox1.IconSize = 13F;
- textBox1.Location = new Point(109, 20);
+ textBox1.Location = new Point(115, 20);
textBox1.Name = "textBox1";
- textBox1.Padding = new Padding(4, 4, 3, 3);
textBox1.Size = new Size(260, 32);
textBox1.TabIndex = 152;
textBox1.TabStop = false;
@@ -88,21 +92,18 @@ namespace RokettoLaunch
//
// listBox1
//
- listBox1.AllowDrop = true;
listBox1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
listBox1.BackColor = Color.Transparent;
- listBox1.EnableReactiveVisual = true;
- listBox1.Font = new Font("Microsoft Sans Serif", 8.25F);
- listBox1.Location = new Point(109, 62);
+ listBox1.EnableMovable = false;
+ listBox1.Location = new Point(115, 62);
listBox1.Name = "listBox1";
- listBox1.Padding = new Padding(4, 4, 3, 3);
listBox1.Size = new Size(260, 366);
listBox1.TabIndex = 180;
- listBox1.OnAdd += listBox1_OnAdd;
- listBox1.OnEdit += listBox1_OnEdit;
- listBox1.OnCopy += listBox1_OnCopy;
- listBox1.DragDrop += listBox1_DragDrop;
- listBox1.DragOver += listBox1_DragOver;
+ listBox1.OnAdd += ListBox_OnAdd;
+ listBox1.OnEdit += ListBox_OnEdit;
+ listBox1.OnCopy += ListBox_OnCopy;
+ listBox1.DragDrop += ListBox_DragDrop;
+ listBox1.DragOver += ListBox_DragOver;
//
// label2
//
@@ -113,21 +114,22 @@ namespace RokettoLaunch
label2.Margin = new Padding(0);
label2.Name = "label2";
label2.Padding = new Padding(0, 9, 0, 0);
- label2.Size = new Size(82, 24);
+ label2.Size = new Size(30, 24);
label2.TabIndex = 181;
- label2.Text = "Tile Collection";
+ label2.Text = "Tiles";
label2.TextAlign = ContentAlignment.MiddleLeft;
//
// dialogFooter1
//
dialogFooter1.BackColor = Color.FromArgb(240, 240, 240);
- dialogFooter1.Button1Text = "&Save";
- dialogFooter1.Dialog = this;
dialogFooter1.Dock = DockStyle.Bottom;
+ dialogFooter1.EnableMovable = false;
dialogFooter1.IsBusy = false;
- dialogFooter1.Location = new Point(0, 437);
+ dialogFooter1.Location = new Point(0, 451);
dialogFooter1.Name = "dialogFooter1";
- dialogFooter1.Size = new Size(384, 84);
+ dialogFooter1.Size = new Size(384, 70);
+ dialogFooter1.TabIndex = 0;
+ dialogFooter1.TabStop = false;
//
// EditFolderForm
//
@@ -145,20 +147,20 @@ namespace RokettoLaunch
PerformLayout();
}
- public TileModel Result
+ public App4Options.Item Result
{
get
{
if (result == null)
{
- result = new TileModel();
+ result = new App4Options.Item();
}
result.Title = textBox1.Text?.Trim() ?? string.Empty;
result.IsGroup = true;
- result.Items = new List();
+ result.Items = new List();
- foreach (TileModel item in listBox1.ListBox.Items.OfType())
+ foreach (var item in listBox1.ListBox.Items.OfType())
{
if (item.IsGroup)
{
@@ -173,7 +175,7 @@ namespace RokettoLaunch
}
- private void listBox1_OnAdd(object sender, EventArgs e)
+ private void ListBox_OnAdd(object sender, EventArgs e)
{
var form = new EditTileForm();
if (form.ShowDialog() == DialogResult.OK)
@@ -182,7 +184,7 @@ namespace RokettoLaunch
};
}
- private void listBox1_OnEdit(object sender, EventArgs e)
+ private void ListBox_OnEdit(object sender, EventArgs e)
{
if (listBox1.ListBox.Items.Count <= 0)
{
@@ -200,7 +202,7 @@ namespace RokettoLaunch
return;
}
- var form = new EditTileForm((TileModel)listBox1.ListBox.SelectedItem);
+ var form = new EditTileForm((App4Options.Item)listBox1.ListBox.SelectedItem);
if (form.ShowDialog() == DialogResult.OK)
{
listBox1.ListBox.Items.RemoveAt(n);
@@ -208,12 +210,12 @@ namespace RokettoLaunch
};
}
- private void listBox1_OnCopy(object sender, EventArgs e)
+ private void ListBox_OnCopy(object sender, EventArgs e)
{
- listBox1.ListBox.CopyItem();
+ listBox1.ListBox.CopyItem();
}
- private void listBox1_DragOver(object sender, DragEventArgs e)
+ private void ListBox_DragOver(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
@@ -225,7 +227,7 @@ namespace RokettoLaunch
}
}
- private void listBox1_DragDrop(object sender, DragEventArgs e)
+ private void ListBox_DragDrop(object sender, DragEventArgs e)
{
var fileList = e.Data.GetData(DataFormats.FileDrop) as string[];
if (fileList == null)
@@ -245,34 +247,12 @@ namespace RokettoLaunch
continue;
}
- var model = new TileModel()
+ var model = new App4Options.Item()
{
- ProcessFilename = item,
- Title = Path.GetFileName(item)
+ TargetPath = item,
+ Title = RyzStudio.IO.File.GetName(item)
};
- // exe
- if (Path.GetExtension(item).Equals(".exe", StringComparison.CurrentCultureIgnoreCase))
- {
- if (File.Exists(item))
- {
- try
- {
- FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(item);
- if (fvi != null)
- {
- model.Title = fvi.ProductName;
- }
- }
- catch
- {
- // do nothing
- }
- }
-
- model.Title = (string.IsNullOrWhiteSpace(model.Title) ? "Untitled" : Path.GetFileNameWithoutExtension(item));
- }
-
listBox1.ListBox.Items.Add(model);
}
}
diff --git a/EditTileFolderForm.resx b/EditFolderForm.resx
similarity index 100%
rename from EditTileFolderForm.resx
rename to EditFolderForm.resx
diff --git a/EditGroupForm.cs b/EditGroupForm.cs
new file mode 100644
index 0000000..744e0cf
--- /dev/null
+++ b/EditGroupForm.cs
@@ -0,0 +1,242 @@
+using System;
+using System.Windows.Forms;
+using RokettoLaunch.Models.SaveFile;
+using RokettoLaunch.Windows.Forms;
+using RyzStudio.Windows.Forms;
+using RyzStudio.Windows.ThemedForms.ButtonTextBox;
+using RyzStudio.Windows.ThemedForms.PickerBox;
+
+namespace RokettoLaunch
+{
+ public class EditGroupForm : Form
+ {
+ private Label label2;
+ private Label label1;
+ private ThYesNoPickerBox pickerBox1;
+ private ThClearableTextBox textBox1;
+ private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
+ private THorizontalSeparator horizontalSeparator1;
+ private RyzStudio.Windows.ThemedForms.ThNumericBox numericBox1;
+ private Label label4;
+ private RyzStudio.Windows.ThemedForms.ThNumericBox numericBox2;
+ private Label label3;
+ private App4Options.Group result = null;
+
+
+ public EditGroupForm(App4Options.Group model = null)
+ {
+ InitializeComponent();
+
+ UISetup.Dialog(this, true);
+
+ this.Text = (result == null) ? "Add Group" : "Edit Group";
+
+ result = model;
+
+ pickerBox1.Setup([ "No", "Yes" ], 0);
+ numericBox1.Minimum = TileLayoutPanel.MIN_COLUMNS;
+ numericBox1.Maximum = 32;
+ numericBox2.Minimum = 1;
+ numericBox2.Maximum = 32;
+ }
+
+ protected override void OnShown(EventArgs e)
+ {
+ base.OnShown(e);
+
+ textBox1.Text = result?.Title?.Trim() ?? "New Group";
+ pickerBox1.Value = result?.IsOpen ?? true;
+ numericBox1.Value = Math.Max(TileLayoutPanel.MIN_COLUMNS, result?.GridSize.Width ?? TileLayoutPanel.MIN_COLUMNS);
+ numericBox2.Value = Math.Max(1, result?.GridSize.Height ?? 1);
+ }
+
+
+ private void InitializeComponent()
+ {
+ textBox1 = new ThClearableTextBox();
+ label2 = new Label();
+ label1 = new Label();
+ pickerBox1 = new ThYesNoPickerBox();
+ dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
+ horizontalSeparator1 = new THorizontalSeparator();
+ numericBox1 = new RyzStudio.Windows.ThemedForms.ThNumericBox();
+ label4 = new Label();
+ numericBox2 = new RyzStudio.Windows.ThemedForms.ThNumericBox();
+ label3 = new Label();
+ SuspendLayout();
+ //
+ // textBox1
+ //
+ textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+ textBox1.BackColor = System.Drawing.Color.Transparent;
+ textBox1.ClearedValue = "";
+ textBox1.EnableMovable = false;
+ textBox1.Icon = "O";
+ textBox1.IconSize = 13F;
+ textBox1.Location = new System.Drawing.Point(115, 20);
+ textBox1.Name = "textBox1";
+ textBox1.Size = new System.Drawing.Size(260, 32);
+ textBox1.TabIndex = 152;
+ textBox1.TabStop = false;
+ textBox1.UseSystemPasswordChar = false;
+ //
+ // label2
+ //
+ label2.AutoSize = true;
+ label2.BackColor = System.Drawing.Color.Transparent;
+ label2.ForeColor = System.Drawing.SystemColors.ControlText;
+ label2.Location = new System.Drawing.Point(10, 62);
+ label2.Margin = new Padding(0);
+ label2.Name = "label2";
+ label2.Padding = new Padding(0, 9, 0, 0);
+ label2.Size = new System.Drawing.Size(91, 24);
+ label2.TabIndex = 155;
+ label2.Text = "Show Expanded";
+ label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // label1
+ //
+ label1.AutoSize = true;
+ label1.BackColor = System.Drawing.Color.Transparent;
+ label1.ForeColor = System.Drawing.SystemColors.ControlText;
+ label1.Location = new System.Drawing.Point(10, 20);
+ label1.Margin = new Padding(0);
+ label1.Name = "label1";
+ label1.Padding = new Padding(0, 9, 0, 0);
+ label1.Size = new System.Drawing.Size(29, 24);
+ label1.TabIndex = 153;
+ label1.Text = "Title";
+ label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // pickerBox1
+ //
+ pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
+ pickerBox1.BackColor = System.Drawing.Color.Transparent;
+ pickerBox1.EnableMovable = false;
+ pickerBox1.Location = new System.Drawing.Point(295, 62);
+ pickerBox1.Name = "pickerBox1";
+ pickerBox1.SelectedIndex = 0;
+ pickerBox1.Size = new System.Drawing.Size(80, 32);
+ pickerBox1.TabIndex = 174;
+ pickerBox1.TabStop = false;
+ pickerBox1.Value = false;
+ //
+ // dialogFooter1
+ //
+ dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
+ dialogFooter1.Dock = DockStyle.Bottom;
+ dialogFooter1.EnableMovable = false;
+ dialogFooter1.IsBusy = false;
+ dialogFooter1.Location = new System.Drawing.Point(0, 451);
+ dialogFooter1.Name = "dialogFooter1";
+ dialogFooter1.Size = new System.Drawing.Size(384, 70);
+ dialogFooter1.TabIndex = 0;
+ dialogFooter1.TabStop = false;
+ //
+ // horizontalSeparator1
+ //
+ horizontalSeparator1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+ horizontalSeparator1.Location = new System.Drawing.Point(5, 99);
+ horizontalSeparator1.Name = "horizontalSeparator1";
+ horizontalSeparator1.Size = new System.Drawing.Size(375, 10);
+ //
+ // numericBox1
+ //
+ numericBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
+ numericBox1.BackColor = System.Drawing.Color.Transparent;
+ numericBox1.EnableMovable = false;
+ numericBox1.Location = new System.Drawing.Point(275, 116);
+ numericBox1.Maximum = 20;
+ numericBox1.Minimum = 4;
+ numericBox1.Name = "numericBox1";
+ numericBox1.Size = new System.Drawing.Size(100, 32);
+ numericBox1.TabIndex = 198;
+ numericBox1.TabStop = false;
+ numericBox1.Value = 1;
+ //
+ // label4
+ //
+ label4.AutoSize = true;
+ label4.BackColor = System.Drawing.Color.Transparent;
+ label4.ForeColor = System.Drawing.SystemColors.ControlText;
+ label4.Location = new System.Drawing.Point(10, 116);
+ label4.Margin = new Padding(0);
+ label4.Name = "label4";
+ label4.Padding = new Padding(0, 8, 0, 0);
+ label4.Size = new System.Drawing.Size(76, 23);
+ label4.TabIndex = 197;
+ label4.Text = "Tiles Per Row";
+ label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // numericBox2
+ //
+ numericBox2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
+ numericBox2.BackColor = System.Drawing.Color.Transparent;
+ numericBox2.EnableMovable = false;
+ numericBox2.Location = new System.Drawing.Point(275, 158);
+ numericBox2.Maximum = 32;
+ numericBox2.Minimum = 1;
+ numericBox2.Name = "numericBox2";
+ numericBox2.Size = new System.Drawing.Size(100, 32);
+ numericBox2.TabIndex = 200;
+ numericBox2.TabStop = false;
+ numericBox2.Value = 1;
+ //
+ // label3
+ //
+ label3.AutoSize = true;
+ label3.BackColor = System.Drawing.Color.Transparent;
+ label3.ForeColor = System.Drawing.SystemColors.ControlText;
+ label3.Location = new System.Drawing.Point(10, 158);
+ label3.Margin = new Padding(0);
+ label3.Name = "label3";
+ label3.Padding = new Padding(0, 8, 0, 0);
+ label3.Size = new System.Drawing.Size(96, 23);
+ label3.TabIndex = 199;
+ label3.Text = "Number of Rows";
+ label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // EditGroupForm
+ //
+ BackColor = System.Drawing.Color.White;
+ ClientSize = new System.Drawing.Size(384, 521);
+ Controls.Add(numericBox2);
+ Controls.Add(label3);
+ Controls.Add(numericBox1);
+ Controls.Add(label4);
+ Controls.Add(horizontalSeparator1);
+ Controls.Add(dialogFooter1);
+ Controls.Add(pickerBox1);
+ Controls.Add(label2);
+ Controls.Add(label1);
+ Controls.Add(textBox1);
+ MinimumSize = new System.Drawing.Size(400, 560);
+ Name = "EditGroupForm";
+ Text = "Edit Section";
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ public App4Options.Group Result
+ {
+ get
+ {
+ if (result == null)
+ {
+ result = new App4Options.Group();
+ }
+
+ var maxGridSize = result.GetMaxGridSize();
+ var x = Math.Max(maxGridSize.Width, numericBox1.Value);
+ var y = Math.Max(maxGridSize.Height, numericBox2.Value);
+
+ result.Title = textBox1.Text?.Trim() ?? string.Empty;
+ result.IsOpen = pickerBox1.Value;
+ result.GridSize = new System.Drawing.Size(x, y);
+
+ return result;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/EditGroupForm.resx b/EditGroupForm.resx
new file mode 100644
index 0000000..8b2ff64
--- /dev/null
+++ b/EditGroupForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/EditSectionForm.cs b/EditSectionForm.cs
deleted file mode 100644
index 5bcc2d8..0000000
--- a/EditSectionForm.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-using System.Windows.Forms;
-using RokettoLaunch.Models;
-using RyzStudio.Windows.Forms;
-using RyzStudio.Windows.ThemedForms.ButtonTextBox;
-using RyzStudio.Windows.ThemedForms.PickerBox;
-
-namespace RokettoLaunch
-{
- public class EditSectionForm : Form
- {
- private Label label2;
- private Label label1;
- private ThYesNoPickerBox pickerBox1;
- private ThClearableTextBox textBox1;
- private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
-
-
- private TileGroupModel result = null;
-
-
- public EditSectionForm(TileGroupModel model = null)
- {
- InitializeComponent();
-
- UISetup.Dialog(this);
-
- this.Text = (result == null) ? "Add Group" : "Edit Group";
-
- result = model;
-
- pickerBox1.ComboBox.Items.Clear();
- pickerBox1.ComboBox.Items.AddRange(new string[] { "No", "Yes" });
- if (pickerBox1.ComboBox.Items.Count > 0)
- {
- pickerBox1.ComboBox.SelectedIndex = 0;
- }
-
- if (result != null)
- {
- textBox1.Text = result.Title?.Trim() ?? string.Empty;
- pickerBox1.Value = result.IsExpanded;
- }
- }
-
- private void InitializeComponent()
- {
- textBox1 = new ThClearableTextBox();
- label2 = new Label();
- label1 = new Label();
- pickerBox1 = new ThYesNoPickerBox();
- dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
- SuspendLayout();
- //
- // textBox1
- //
- textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
- textBox1.BackColor = System.Drawing.Color.Transparent;
- textBox1.ClearedValue = "";
- textBox1.EnableReactiveVisual = true;
- textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
- textBox1.Icon = "O";
- textBox1.IconSize = 13F;
- textBox1.Location = new System.Drawing.Point(192, 20);
- textBox1.Name = "textBox1";
- textBox1.Padding = new Padding(4, 4, 3, 3);
- textBox1.Size = new System.Drawing.Size(177, 32);
- textBox1.TabIndex = 152;
- textBox1.TabStop = false;
- textBox1.UseSystemPasswordChar = false;
- //
- // label2
- //
- label2.AutoSize = true;
- label2.BackColor = System.Drawing.Color.Transparent;
- label2.ForeColor = System.Drawing.SystemColors.ControlText;
- label2.Location = new System.Drawing.Point(10, 62);
- label2.Margin = new Padding(0);
- label2.Name = "label2";
- label2.Padding = new Padding(0, 9, 0, 0);
- label2.Size = new System.Drawing.Size(91, 24);
- label2.TabIndex = 155;
- label2.Text = "Show Expanded";
- label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // label1
- //
- label1.AutoSize = true;
- label1.BackColor = System.Drawing.Color.Transparent;
- label1.ForeColor = System.Drawing.SystemColors.ControlText;
- label1.Location = new System.Drawing.Point(10, 20);
- label1.Margin = new Padding(0);
- label1.Name = "label1";
- label1.Padding = new Padding(0, 9, 0, 0);
- label1.Size = new System.Drawing.Size(29, 24);
- label1.TabIndex = 153;
- label1.Text = "Title";
- label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // pickerBox1
- //
- pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
- pickerBox1.BackColor = System.Drawing.Color.Transparent;
- pickerBox1.EnableReactiveVisual = true;
- pickerBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
- pickerBox1.Location = new System.Drawing.Point(285, 62);
- pickerBox1.Name = "pickerBox1";
- pickerBox1.Padding = new Padding(4, 4, 3, 3);
- pickerBox1.SelectedIndex = 0;
- pickerBox1.Size = new System.Drawing.Size(84, 34);
- pickerBox1.TabIndex = 174;
- pickerBox1.TabStop = false;
- pickerBox1.Value = false;
- //
- // dialogFooter1
- //
- dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
- dialogFooter1.Button1Text = "&Save";
- dialogFooter1.Dialog = this;
- dialogFooter1.Dock = DockStyle.Bottom;
- dialogFooter1.IsBusy = false;
- dialogFooter1.Location = new System.Drawing.Point(0, 437);
- dialogFooter1.Name = "dialogFooter1";
- dialogFooter1.Size = new System.Drawing.Size(384, 84);
- //
- // EditSectionForm
- //
- BackColor = System.Drawing.Color.White;
- ClientSize = new System.Drawing.Size(384, 521);
- Controls.Add(dialogFooter1);
- Controls.Add(pickerBox1);
- Controls.Add(label2);
- Controls.Add(label1);
- Controls.Add(textBox1);
- MinimumSize = new System.Drawing.Size(400, 560);
- Name = "EditSectionForm";
- Text = "Edit Section";
- ResumeLayout(false);
- PerformLayout();
- }
-
- public TileGroupModel Result
- {
- get
- {
- if (result == null)
- {
- result = new TileGroupModel();
- }
-
- result.Title = textBox1.Text?.Trim() ?? string.Empty;
- result.IsExpanded = pickerBox1.Value;
-
- return result;
- }
- }
-
- }
-}
\ No newline at end of file
diff --git a/EditTileForm.cs b/EditTileForm.cs
index 34fcf42..3b936f5 100644
--- a/EditTileForm.cs
+++ b/EditTileForm.cs
@@ -1,7 +1,8 @@
-using System.Diagnostics;
+using System;
+using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;
-using RokettoLaunch.Models;
+using RokettoLaunch.Models.SaveFile;
using RyzStudio.Windows.Forms;
using RyzStudio.Windows.ThemedForms;
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
@@ -17,9 +18,9 @@ namespace RokettoLaunch
private Label label3;
private Label label2;
private Label label1;
- private ThPathDialogTextBox textBox2;
+ private ThPathTextBox textBox2;
private ThClearableTextBox textBox3;
- private ThPathDialogTextBox textBox4;
+ private ThPathTextBox textBox4;
private ThPickerBox pickerBox1;
private ThYesNoPickerBox pickerBox2;
private THorizontalSeparator horizontalSeparator1;
@@ -27,32 +28,32 @@ namespace RokettoLaunch
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
- private TileModel result = null;
+ private App4Options.Item result = null;
- public EditTileForm(TileModel model = null)
+ public EditTileForm(App4Options.Item model = null)
{
InitializeComponent();
- UISetup.Dialog(this);
+ UISetup.Dialog(this, true);
this.Text = (result == null) ? "Add Tile" : "Edit Tile";
result = model;
- pickerBox1.ComboBox.Items.Clear();
- pickerBox1.ComboBox.Items.AddRange(new string[] { "Normal", "Hidden", "Minimized", "Maximized" });
- if (pickerBox1.ComboBox.Items.Count > 0)
- {
- pickerBox1.ComboBox.SelectedIndex = 0;
- }
+ pickerBox1.Setup([ "Normal", "Hidden", "Minimized", "Maximized" ], 0);
+ }
+
+ protected override void OnShown(EventArgs e)
+ {
+ base.OnShown(e);
textBox1.Text = result?.Title ?? "New Tile";
- textBox2.Text = result?.ProcessFilename ?? string.Empty;
- textBox3.Text = result?.ProcessArgument ?? string.Empty;
- textBox4.Text = result?.ProcessWorkingDirectory ?? string.Empty;
- pickerBox1.ComboBox.SelectedIndex = (int)(result?.ProcessWindowStyle ?? ProcessWindowStyle.Normal);
- pickerBox2.Value = result?.ProcessAsAdmin ?? false;
+ textBox2.Text = result?.TargetPath ?? string.Empty;
+ textBox3.Text = result?.Argument ?? string.Empty;
+ textBox4.Text = result?.ResolvedStartPath ?? string.Empty;
+ pickerBox1.Value = (int)(result?.WindowStyle ?? ProcessWindowStyle.Normal);
+ pickerBox2.Value = result?.RunAsAdmin ?? false;
}
private void InitializeComponent()
@@ -64,9 +65,9 @@ namespace RokettoLaunch
label3 = new Label();
label2 = new Label();
label1 = new Label();
- textBox2 = new ThPathDialogTextBox();
+ textBox2 = new ThPathTextBox();
textBox3 = new ThClearableTextBox();
- textBox4 = new ThPathDialogTextBox();
+ textBox4 = new ThPathTextBox();
pickerBox1 = new ThPickerBox();
pickerBox2 = new ThYesNoPickerBox();
horizontalSeparator1 = new THorizontalSeparator();
@@ -78,13 +79,12 @@ namespace RokettoLaunch
textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
textBox1.BackColor = Color.Transparent;
textBox1.ClearedValue = "";
- textBox1.EnableReactiveVisual = true;
- textBox1.Font = new Font("Segoe UI", 9F);
+ textBox1.EnableMovable = false;
textBox1.Icon = "O";
textBox1.IconSize = 13F;
- textBox1.Location = new Point(109, 20);
+ textBox1.Location = new Point(95, 20);
textBox1.Name = "textBox1";
- textBox1.Size = new Size(260, 32);
+ textBox1.Size = new Size(280, 32);
textBox1.TabIndex = 152;
textBox1.TabStop = false;
textBox1.UseSystemPasswordChar = false;
@@ -94,7 +94,7 @@ namespace RokettoLaunch
label6.AutoSize = true;
label6.BackColor = Color.Transparent;
label6.ForeColor = SystemColors.ControlText;
- label6.Location = new Point(10, 264);
+ label6.Location = new Point(10, 242);
label6.Margin = new Padding(0);
label6.Name = "label6";
label6.Padding = new Padding(0, 9, 0, 0);
@@ -108,7 +108,7 @@ namespace RokettoLaunch
label7.AutoSize = true;
label7.BackColor = Color.Transparent;
label7.ForeColor = SystemColors.ControlText;
- label7.Location = new Point(10, 220);
+ label7.Location = new Point(10, 200);
label7.Margin = new Padding(0);
label7.Name = "label7";
label7.Padding = new Padding(0, 9, 0, 0);
@@ -126,9 +126,9 @@ namespace RokettoLaunch
label4.Margin = new Padding(0);
label4.Name = "label4";
label4.Padding = new Padding(0, 9, 0, 0);
- label4.Size = new Size(103, 24);
+ label4.Size = new Size(82, 24);
label4.TabIndex = 159;
- label4.Text = "Working Directory";
+ label4.Text = "Start Directory";
label4.TextAlign = ContentAlignment.MiddleLeft;
//
// label3
@@ -177,16 +177,13 @@ namespace RokettoLaunch
//
textBox2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
textBox2.BackColor = Color.Transparent;
- textBox2.DialogMode = ThPathDialogTextBox.DialogType.OpenFile;
- textBox2.EnableReactiveVisual = true;
+ textBox2.DialogMode = ThPathTextBox.DialogType.OpenFile;
+ textBox2.EnableMovable = false;
textBox2.FolderBrowserDialog = null;
- textBox2.Font = new Font("Segoe UI", 9F);
- textBox2.Icon = "C";
+ textBox2.Icon = "D";
textBox2.IconSize = 13F;
- textBox2.Location = new Point(109, 62);
+ textBox2.Location = new Point(115, 62);
textBox2.Name = "textBox2";
- textBox2.OpenFileDialog = null;
- textBox2.SaveFileDialog = null;
textBox2.Size = new Size(260, 32);
textBox2.TabIndex = 170;
textBox2.TabStop = false;
@@ -197,13 +194,12 @@ namespace RokettoLaunch
textBox3.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
textBox3.BackColor = Color.Transparent;
textBox3.ClearedValue = "";
- textBox3.EnableReactiveVisual = true;
- textBox3.Font = new Font("Segoe UI", 9F);
+ textBox3.EnableMovable = false;
textBox3.Icon = "O";
textBox3.IconSize = 13F;
- textBox3.Location = new Point(149, 104);
+ textBox3.Location = new Point(135, 104);
textBox3.Name = "textBox3";
- textBox3.Size = new Size(220, 32);
+ textBox3.Size = new Size(240, 32);
textBox3.TabIndex = 171;
textBox3.TabStop = false;
textBox3.UseSystemPasswordChar = false;
@@ -212,17 +208,14 @@ namespace RokettoLaunch
//
textBox4.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
textBox4.BackColor = Color.Transparent;
- textBox4.DialogMode = ThPathDialogTextBox.DialogType.FolderBrowser;
- textBox4.EnableReactiveVisual = true;
+ textBox4.DialogMode = ThPathTextBox.DialogType.FolderBrowser;
+ textBox4.EnableMovable = false;
textBox4.FolderBrowserDialog = null;
- textBox4.Font = new Font("Segoe UI", 9F);
textBox4.Icon = "D";
textBox4.IconSize = 13F;
- textBox4.Location = new Point(149, 146);
+ textBox4.Location = new Point(135, 146);
textBox4.Name = "textBox4";
- textBox4.OpenFileDialog = null;
- textBox4.SaveFileDialog = null;
- textBox4.Size = new Size(220, 32);
+ textBox4.Size = new Size(240, 32);
textBox4.TabIndex = 172;
textBox4.TabStop = false;
textBox4.UseSystemPasswordChar = false;
@@ -231,12 +224,11 @@ namespace RokettoLaunch
//
pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
pickerBox1.BackColor = Color.Transparent;
- pickerBox1.EnableReactiveVisual = true;
- pickerBox1.Font = new Font("Segoe UI", 9F);
- pickerBox1.Location = new Point(249, 220);
+ pickerBox1.EnableMovable = false;
+ pickerBox1.Location = new Point(255, 200);
pickerBox1.Name = "pickerBox1";
pickerBox1.SelectedIndex = -1;
- pickerBox1.Size = new Size(120, 34);
+ pickerBox1.Size = new Size(120, 32);
pickerBox1.TabIndex = 174;
pickerBox1.TabStop = false;
//
@@ -244,12 +236,11 @@ namespace RokettoLaunch
//
pickerBox2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
pickerBox2.BackColor = Color.Transparent;
- pickerBox2.EnableReactiveVisual = true;
- pickerBox2.Font = new Font("Segoe UI", 9F);
- pickerBox2.Location = new Point(289, 264);
+ pickerBox2.EnableMovable = false;
+ pickerBox2.Location = new Point(295, 242);
pickerBox2.Name = "pickerBox2";
pickerBox2.SelectedIndex = 0;
- pickerBox2.Size = new Size(80, 34);
+ pickerBox2.Size = new Size(80, 32);
pickerBox2.TabIndex = 175;
pickerBox2.TabStop = false;
pickerBox2.Value = false;
@@ -257,27 +248,21 @@ namespace RokettoLaunch
// horizontalSeparator1
//
horizontalSeparator1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
- horizontalSeparator1.AutoScrollMargin = new Size(0, 0);
- horizontalSeparator1.AutoScrollMinSize = new Size(0, 0);
- horizontalSeparator1.BackColor = Color.Transparent;
- horizontalSeparator1.Location = new Point(10, 187);
- horizontalSeparator1.Margin = new Padding(0, 10, 0, 0);
- horizontalSeparator1.MaximumSize = new Size(4920, 2);
- horizontalSeparator1.MinimumSize = new Size(0, 22);
+ horizontalSeparator1.Location = new Point(5, 183);
horizontalSeparator1.Name = "horizontalSeparator1";
- horizontalSeparator1.Size = new Size(364, 22);
- horizontalSeparator1.TabIndex = 176;
- horizontalSeparator1.TabStop = false;
+ horizontalSeparator1.Size = new Size(375, 10);
//
// dialogFooter1
//
dialogFooter1.BackColor = Color.FromArgb(240, 240, 240);
- dialogFooter1.Button1Text = "&Save";
- dialogFooter1.Dialog = this;
dialogFooter1.Dock = DockStyle.Bottom;
- dialogFooter1.Location = new Point(0, 437);
+ dialogFooter1.EnableMovable = false;
+ dialogFooter1.IsBusy = false;
+ dialogFooter1.Location = new Point(0, 451);
dialogFooter1.Name = "dialogFooter1";
- dialogFooter1.Size = new Size(384, 84);
+ dialogFooter1.Size = new Size(384, 70);
+ dialogFooter1.TabIndex = 0;
+ dialogFooter1.TabStop = false;
//
// EditTileForm
//
@@ -304,21 +289,21 @@ namespace RokettoLaunch
PerformLayout();
}
- public TileModel Result
+ public App4Options.Item Result
{
get
{
if (result == null)
{
- result = new TileModel();
+ result = new App4Options.Item();
}
result.Title = textBox1.Text?.Trim() ?? string.Empty;
- result.ProcessFilename = textBox2.Text?.Trim() ?? string.Empty;
- result.ProcessArgument = textBox3.Text?.Trim() ?? string.Empty;
- result.ProcessWorkingDirectory = textBox4.Text?.Trim();
- result.ProcessWindowStyle = (System.Diagnostics.ProcessWindowStyle)pickerBox1.ComboBox.SelectedIndex;
- result.ProcessAsAdmin = pickerBox2.Value;
+ result.TargetPath = textBox2.Text?.Trim() ?? string.Empty;
+ result.Argument = textBox3.Text?.Trim() ?? string.Empty;
+ result.StartPath = textBox4.Text?.Trim();
+ result.WindowStyle = (ProcessWindowStyle)pickerBox1.ComboBox.SelectedIndex;
+ result.RunAsAdmin = pickerBox2.Value;
return result;
}
diff --git a/EditTileForm.resx b/EditTileForm.resx
index af32865..8b2ff64 100644
--- a/EditTileForm.resx
+++ b/EditTileForm.resx
@@ -1,7 +1,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs
index 983d534..72e4028 100644
--- a/MainForm.Designer.cs
+++ b/MainForm.Designer.cs
@@ -35,7 +35,7 @@ namespace RokettoLaunch
saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
notifyIcon1 = new System.Windows.Forms.NotifyIcon(components);
- contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(components);
+ trayMenuStrip = new System.Windows.Forms.ContextMenuStrip(components);
exitToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
menuStrip1 = new System.Windows.Forms.MenuStrip();
fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -59,7 +59,7 @@ namespace RokettoLaunch
viewHelpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
toolStripMenuItem16 = new System.Windows.Forms.ToolStripSeparator();
aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
- tileContainerMenu1 = new System.Windows.Forms.ContextMenuStrip(components);
+ groupMenuStrip = new System.Windows.Forms.ContextMenuStrip(components);
addGroupToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -74,16 +74,16 @@ namespace RokettoLaunch
removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
panel1 = new System.Windows.Forms.Panel();
- tileMenu1 = new System.Windows.Forms.ContextMenuStrip(components);
+ tileMenuStrip = new System.Windows.Forms.ContextMenuStrip(components);
editToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem();
toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
removeToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
- contextMenuStrip2.SuspendLayout();
+ trayMenuStrip.SuspendLayout();
menuStrip1.SuspendLayout();
- tileContainerMenu1.SuspendLayout();
+ groupMenuStrip.SuspendLayout();
panel1.SuspendLayout();
- tileMenu1.SuspendLayout();
+ tileMenuStrip.SuspendLayout();
SuspendLayout();
//
// saveFileDialog1
@@ -98,33 +98,33 @@ namespace RokettoLaunch
//
// notifyIcon1
//
- notifyIcon1.ContextMenuStrip = contextMenuStrip2;
+ notifyIcon1.ContextMenuStrip = trayMenuStrip;
notifyIcon1.Icon = (System.Drawing.Icon)resources.GetObject("notifyIcon1.Icon");
notifyIcon1.Text = "notifyIcon1";
notifyIcon1.Visible = true;
- notifyIcon1.MouseClick += notifyIcon1_MouseClick;
+ notifyIcon1.MouseClick += NotifyIcon_MouseClick;
//
- // contextMenuStrip2
+ // trayMenuStrip
//
- contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { exitToolStripMenuItem1 });
- contextMenuStrip2.Name = "contextMenuStrip2";
- contextMenuStrip2.Size = new System.Drawing.Size(94, 26);
+ trayMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { exitToolStripMenuItem1 });
+ trayMenuStrip.Name = "contextMenuStrip2";
+ trayMenuStrip.Size = new System.Drawing.Size(94, 26);
//
// exitToolStripMenuItem1
//
exitToolStripMenuItem1.Name = "exitToolStripMenuItem1";
exitToolStripMenuItem1.Size = new System.Drawing.Size(93, 22);
exitToolStripMenuItem1.Text = "E&xit";
- exitToolStripMenuItem1.Click += exitToolStripMenuItem1_Click;
+ exitToolStripMenuItem1.Click += NotifyExitToolStripMenuItem_Click;
//
// menuStrip1
//
menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { fileToolStripMenuItem, toolStripMenuItem1, viewToolStripMenuItem, toolsToolStripMenuItem, helpToolStripMenuItem1 });
menuStrip1.Location = new System.Drawing.Point(0, 0);
menuStrip1.Name = "menuStrip1";
- menuStrip1.Size = new System.Drawing.Size(404, 24);
+ menuStrip1.Size = new System.Drawing.Size(464, 24);
menuStrip1.TabIndex = 2;
- menuStrip1.MenuActivate += menuStrip1_MenuActivate;
+ menuStrip1.MenuActivate += MainMenuStrip_MenuActivate;
//
// fileToolStripMenuItem
//
@@ -140,16 +140,16 @@ namespace RokettoLaunch
newToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N;
newToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
newToolStripMenuItem.Text = "&New";
- newToolStripMenuItem.Click += newToolStripMenuItem_Click;
+ newToolStripMenuItem.Click += NewToolStripMenuItem_Click;
//
// openToolStripMenuItem
//
- openToolStripMenuItem.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
+ openToolStripMenuItem.Image = AppResource.folder_minus;
openToolStripMenuItem.Name = "openToolStripMenuItem";
openToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O;
openToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
openToolStripMenuItem.Text = "&Open";
- openToolStripMenuItem.Click += openToolStripMenuItem_Click;
+ openToolStripMenuItem.Click += OpenToolStripMenuItem_Click;
//
// toolStripMenuItem13
//
@@ -161,7 +161,7 @@ namespace RokettoLaunch
closeToolStripMenuItem.Name = "closeToolStripMenuItem";
closeToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
closeToolStripMenuItem.Text = "&Close";
- closeToolStripMenuItem.Click += closeToolStripMenuItem_Click;
+ closeToolStripMenuItem.Click += CloseToolStripMenuItem_Click;
//
// toolStripMenuItem14
//
@@ -170,19 +170,19 @@ namespace RokettoLaunch
//
// saveToolStripMenuItem
//
- saveToolStripMenuItem.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
+ saveToolStripMenuItem.Image = AppResource.save;
saveToolStripMenuItem.Name = "saveToolStripMenuItem";
saveToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S;
saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
saveToolStripMenuItem.Text = "&Save";
- saveToolStripMenuItem.Click += saveToolStripMenuItem_Click;
+ saveToolStripMenuItem.Click += SaveToolStripMenuItem_Click;
//
// saveAsToolStripMenuItem
//
saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
saveAsToolStripMenuItem.Text = "Save &As...";
- saveAsToolStripMenuItem.Click += saveAsToolStripMenuItem_Click;
+ saveAsToolStripMenuItem.Click += SaveAsToolStripMenuItem_Click;
//
// toolStripMenuItem15
//
@@ -194,7 +194,7 @@ namespace RokettoLaunch
exitToolStripMenuItem2.Name = "exitToolStripMenuItem2";
exitToolStripMenuItem2.Size = new System.Drawing.Size(146, 22);
exitToolStripMenuItem2.Text = "E&xit";
- exitToolStripMenuItem2.Click += exitToolStripMenuItem2_Click;
+ exitToolStripMenuItem2.Click += ExitToolStripMenuItem_Click;
//
// toolStripMenuItem1
//
@@ -205,10 +205,11 @@ namespace RokettoLaunch
//
// addGroupToolStripMenuItem
//
+ addGroupToolStripMenuItem.Image = AppResource.plus;
addGroupToolStripMenuItem.Name = "addGroupToolStripMenuItem";
- addGroupToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
- addGroupToolStripMenuItem.Text = "&Add Section";
- addGroupToolStripMenuItem.Click += addGroupToolStripMenuItem_Click;
+ addGroupToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
+ addGroupToolStripMenuItem.Text = "&Add Group";
+ addGroupToolStripMenuItem.Click += AddGroupToolStripMenuItem_Click;
//
// viewToolStripMenuItem
//
@@ -222,14 +223,14 @@ namespace RokettoLaunch
showBigIconsToolStripMenuItem.Name = "showBigIconsToolStripMenuItem";
showBigIconsToolStripMenuItem.Size = new System.Drawing.Size(154, 22);
showBigIconsToolStripMenuItem.Text = "Show &Big Icons";
- showBigIconsToolStripMenuItem.Click += showBigIconsToolStripMenuItem_Click;
+ showBigIconsToolStripMenuItem.Click += ShowBigIconsToolStripMenuItem_Click;
//
// alwaysOnTopToolStripMenuItem
//
alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem";
alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(154, 22);
alwaysOnTopToolStripMenuItem.Text = "Always On &Top";
- alwaysOnTopToolStripMenuItem.Click += alwaysOnTopToolStripMenuItem_Click;
+ alwaysOnTopToolStripMenuItem.Click += AlwaysOnTopToolStripMenuItem_Click;
//
// toolsToolStripMenuItem
//
@@ -240,12 +241,12 @@ namespace RokettoLaunch
//
// optionsToolStripMenuItem
//
- optionsToolStripMenuItem.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
+ optionsToolStripMenuItem.Image = AppResource.settings;
optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
optionsToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F12;
optionsToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
optionsToolStripMenuItem.Text = "&Options";
- optionsToolStripMenuItem.Click += optionsToolStripMenuItem_Click;
+ optionsToolStripMenuItem.Click += OptionsToolStripMenuItem_Click;
//
// helpToolStripMenuItem1
//
@@ -256,12 +257,12 @@ namespace RokettoLaunch
//
// viewHelpToolStripMenuItem1
//
- viewHelpToolStripMenuItem1.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
+ viewHelpToolStripMenuItem1.Image = AppResource.help_circle;
viewHelpToolStripMenuItem1.Name = "viewHelpToolStripMenuItem1";
viewHelpToolStripMenuItem1.ShortcutKeys = System.Windows.Forms.Keys.F1;
viewHelpToolStripMenuItem1.Size = new System.Drawing.Size(146, 22);
viewHelpToolStripMenuItem1.Text = "&View Help";
- viewHelpToolStripMenuItem1.Click += viewHelpToolStripMenuItem1_Click;
+ viewHelpToolStripMenuItem1.Click += ViewHelpToolStripMenuItem_Click;
//
// toolStripMenuItem16
//
@@ -273,93 +274,95 @@ namespace RokettoLaunch
aboutToolStripMenuItem1.Name = "aboutToolStripMenuItem1";
aboutToolStripMenuItem1.Size = new System.Drawing.Size(146, 22);
aboutToolStripMenuItem1.Text = "&About";
- aboutToolStripMenuItem1.Click += aboutToolStripMenuItem1_Click;
+ aboutToolStripMenuItem1.Click += AboutToolStripMenuItem_Click;
//
- // tileContainerMenu1
+ // groupMenuStrip
//
- tileContainerMenu1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { addGroupToolStripMenuItem1, toolStripMenuItem4, editToolStripMenuItem, toolStripMenuItem5, toolStripSeparator1, toolStripMenuItem3, toolStripSeparator3, removeToolStripMenuItem });
- tileContainerMenu1.Name = "tileContainerMenu1";
- tileContainerMenu1.Size = new System.Drawing.Size(181, 170);
+ groupMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { addGroupToolStripMenuItem1, toolStripMenuItem4, editToolStripMenuItem, toolStripMenuItem5, toolStripSeparator1, toolStripMenuItem3, toolStripSeparator3, removeToolStripMenuItem });
+ groupMenuStrip.Name = "tileContainerMenu1";
+ groupMenuStrip.Size = new System.Drawing.Size(133, 148);
//
// addGroupToolStripMenuItem1
//
+ addGroupToolStripMenuItem1.Image = AppResource.plus;
addGroupToolStripMenuItem1.Name = "addGroupToolStripMenuItem1";
- addGroupToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
+ addGroupToolStripMenuItem1.Size = new System.Drawing.Size(132, 22);
addGroupToolStripMenuItem1.Text = "&Add Tile";
- addGroupToolStripMenuItem1.Click += addGroupToolStripMenuItem1_Click;
+ addGroupToolStripMenuItem1.Click += AddTileToolStripMenuItem_Click;
//
// toolStripMenuItem4
//
toolStripMenuItem4.Name = "toolStripMenuItem4";
- toolStripMenuItem4.Size = new System.Drawing.Size(180, 22);
+ toolStripMenuItem4.Size = new System.Drawing.Size(132, 22);
toolStripMenuItem4.Text = "Add &Folder";
- toolStripMenuItem4.Click += toolStripMenuItem4_Click;
+ toolStripMenuItem4.Click += AddFolderToolStripMenuItem_Click;
//
// editToolStripMenuItem
//
editToolStripMenuItem.Name = "editToolStripMenuItem";
- editToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+ editToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
editToolStripMenuItem.Text = "&Edit";
- editToolStripMenuItem.Click += editToolStripMenuItem_Click;
+ editToolStripMenuItem.Click += EditGroupToolStripMenuItem_Click;
//
// toolStripMenuItem5
//
toolStripMenuItem5.Name = "toolStripMenuItem5";
- toolStripMenuItem5.Size = new System.Drawing.Size(180, 22);
+ toolStripMenuItem5.Size = new System.Drawing.Size(132, 22);
toolStripMenuItem5.Text = "&Duplicate";
toolStripMenuItem5.Click += toolStripMenuItem5_Click;
//
// toolStripSeparator1
//
toolStripSeparator1.Name = "toolStripSeparator1";
- toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
+ toolStripSeparator1.Size = new System.Drawing.Size(129, 6);
//
// toolStripMenuItem3
//
toolStripMenuItem3.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { topToolStripMenuItem, upToolStripMenuItem, downToolStripMenuItem, bottomToolStripMenuItem });
toolStripMenuItem3.Name = "toolStripMenuItem3";
- toolStripMenuItem3.Size = new System.Drawing.Size(180, 22);
+ toolStripMenuItem3.Size = new System.Drawing.Size(132, 22);
toolStripMenuItem3.Text = "&Move";
//
// topToolStripMenuItem
//
topToolStripMenuItem.Name = "topToolStripMenuItem";
- topToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+ topToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
topToolStripMenuItem.Text = "&Top";
- topToolStripMenuItem.Click += topToolStripMenuItem_Click;
+ topToolStripMenuItem.Click += MoveTopToolStripMenuItem_Click;
//
// upToolStripMenuItem
//
upToolStripMenuItem.Name = "upToolStripMenuItem";
- upToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+ upToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
upToolStripMenuItem.Text = "&Up";
- upToolStripMenuItem.Click += upToolStripMenuItem_Click;
+ upToolStripMenuItem.Click += MoveUpToolStripMenuItem_Click;
//
// downToolStripMenuItem
//
downToolStripMenuItem.Name = "downToolStripMenuItem";
- downToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+ downToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
downToolStripMenuItem.Text = "&Down";
- downToolStripMenuItem.Click += downToolStripMenuItem_Click;
+ downToolStripMenuItem.Click += MoveDownToolStripMenuItem_Click;
//
// bottomToolStripMenuItem
//
bottomToolStripMenuItem.Name = "bottomToolStripMenuItem";
- bottomToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+ bottomToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
bottomToolStripMenuItem.Text = "&Bottom";
- bottomToolStripMenuItem.Click += bottomToolStripMenuItem_Click;
+ bottomToolStripMenuItem.Click += MoveBottomToolStripMenuItem_Click;
//
// toolStripSeparator3
//
toolStripSeparator3.Name = "toolStripSeparator3";
- toolStripSeparator3.Size = new System.Drawing.Size(177, 6);
+ toolStripSeparator3.Size = new System.Drawing.Size(129, 6);
//
// removeToolStripMenuItem
//
+ removeToolStripMenuItem.Image = AppResource.trash_2;
removeToolStripMenuItem.Name = "removeToolStripMenuItem";
- removeToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+ removeToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
removeToolStripMenuItem.Text = "&Remove";
- removeToolStripMenuItem.Click += removeToolStripMenuItem_Click;
+ removeToolStripMenuItem.Click += RemoveGroupToolStripMenuItem_Click;
//
// flowLayoutPanel1
//
@@ -367,10 +370,10 @@ namespace RokettoLaunch
flowLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
- flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+ flowLayoutPanel1.Location = new System.Drawing.Point(10, 0);
flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
flowLayoutPanel1.Name = "flowLayoutPanel1";
- flowLayoutPanel1.Size = new System.Drawing.Size(404, 417);
+ flowLayoutPanel1.Size = new System.Drawing.Size(454, 257);
flowLayoutPanel1.TabIndex = 8;
flowLayoutPanel1.WrapContents = false;
//
@@ -382,47 +385,49 @@ namespace RokettoLaunch
panel1.Location = new System.Drawing.Point(0, 24);
panel1.Margin = new System.Windows.Forms.Padding(0);
panel1.Name = "panel1";
- panel1.Size = new System.Drawing.Size(404, 417);
+ panel1.Padding = new System.Windows.Forms.Padding(10, 0, 0, 0);
+ panel1.Size = new System.Drawing.Size(464, 257);
panel1.TabIndex = 9;
//
- // tileMenu1
+ // tileMenuStrip
//
- tileMenu1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { editToolStripMenuItem1, toolStripMenuItem6, toolStripSeparator4, removeToolStripMenuItem1 });
- tileMenu1.Name = "tileMenu1";
- tileMenu1.Size = new System.Drawing.Size(125, 76);
+ tileMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { editToolStripMenuItem1, toolStripMenuItem6, toolStripSeparator4, removeToolStripMenuItem1 });
+ tileMenuStrip.Name = "tileMenu1";
+ tileMenuStrip.Size = new System.Drawing.Size(127, 76);
//
// editToolStripMenuItem1
//
editToolStripMenuItem1.Name = "editToolStripMenuItem1";
- editToolStripMenuItem1.Size = new System.Drawing.Size(124, 22);
+ editToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
editToolStripMenuItem1.Text = "&Edit";
- editToolStripMenuItem1.Click += editToolStripMenuItem1_Click;
+ editToolStripMenuItem1.Click += EditTileToolStripMenuItem_Click;
//
// toolStripMenuItem6
//
toolStripMenuItem6.Name = "toolStripMenuItem6";
- toolStripMenuItem6.Size = new System.Drawing.Size(124, 22);
- toolStripMenuItem6.Text = "&Duplicate";
- toolStripMenuItem6.Click += toolStripMenuItem6_Click;
+ toolStripMenuItem6.Size = new System.Drawing.Size(180, 22);
+ toolStripMenuItem6.Text = "Copy To...";
+ toolStripMenuItem6.Click += CopyToTileToolStripMenuItem_Click;
//
// toolStripSeparator4
//
toolStripSeparator4.Name = "toolStripSeparator4";
- toolStripSeparator4.Size = new System.Drawing.Size(121, 6);
+ toolStripSeparator4.Size = new System.Drawing.Size(177, 6);
//
// removeToolStripMenuItem1
//
+ removeToolStripMenuItem1.Image = AppResource.trash_2;
removeToolStripMenuItem1.Name = "removeToolStripMenuItem1";
- removeToolStripMenuItem1.Size = new System.Drawing.Size(124, 22);
+ removeToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
removeToolStripMenuItem1.Text = "&Remove";
- removeToolStripMenuItem1.Click += removeToolStripMenuItem1_Click;
+ removeToolStripMenuItem1.Click += RemoveTileToolStripMenuItem_Click;
//
// MainForm
//
AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
BackColor = System.Drawing.Color.White;
BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
- ClientSize = new System.Drawing.Size(404, 441);
+ ClientSize = new System.Drawing.Size(464, 281);
Controls.Add(panel1);
Controls.Add(menuStrip1);
DoubleBuffered = true;
@@ -433,12 +438,12 @@ namespace RokettoLaunch
MinimizeBox = false;
MinimumSize = new System.Drawing.Size(300, 320);
Name = "MainForm";
- contextMenuStrip2.ResumeLayout(false);
+ trayMenuStrip.ResumeLayout(false);
menuStrip1.ResumeLayout(false);
menuStrip1.PerformLayout();
- tileContainerMenu1.ResumeLayout(false);
+ groupMenuStrip.ResumeLayout(false);
panel1.ResumeLayout(false);
- tileMenu1.ResumeLayout(false);
+ tileMenuStrip.ResumeLayout(false);
ResumeLayout(false);
PerformLayout();
}
@@ -447,7 +452,7 @@ namespace RokettoLaunch
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.NotifyIcon notifyIcon1;
- private System.Windows.Forms.ContextMenuStrip contextMenuStrip2;
+ private System.Windows.Forms.ContextMenuStrip trayMenuStrip;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem1;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
@@ -471,7 +476,7 @@ namespace RokettoLaunch
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem addGroupToolStripMenuItem;
- private System.Windows.Forms.ContextMenuStrip tileContainerMenu1;
+ private System.Windows.Forms.ContextMenuStrip groupMenuStrip;
private System.Windows.Forms.ToolStripMenuItem addGroupToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem;
@@ -486,7 +491,7 @@ namespace RokettoLaunch
private System.Windows.Forms.ToolStripMenuItem bottomToolStripMenuItem;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5;
- private System.Windows.Forms.ContextMenuStrip tileMenu1;
+ private System.Windows.Forms.ContextMenuStrip tileMenuStrip;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem6;
diff --git a/MainForm.cs b/MainForm.cs
index eb17fc8..1bff967 100644
--- a/MainForm.cs
+++ b/MainForm.cs
@@ -4,24 +4,22 @@ using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Linq;
-using System.Text.Json;
using System.Threading.Tasks;
using System.Windows.Forms;
-using RokettoLaunch.Models;
+using Microsoft.Extensions.DependencyInjection;
+using RokettoLaunch.Models.SaveFile;
using RokettoLaunch.Windows.Forms;
using RyzStudio;
using RyzStudio.Windows.Forms;
using RyzStudio.Windows.ThemedForms;
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
-using RyzStudio.Windows.TileForms;
namespace RokettoLaunch
{
public partial class MainForm : Form
{
- private const int MIN_ITEMS_PER_ROW = 4;
-
- private readonly FileSessionManager _fileSessionManager;
+ private readonly IServiceProvider _provider;
+ private readonly IFileSessionManager _fileSessionManager;
private bool _isBusy = false;
private bool _requestExit = false;
@@ -34,19 +32,20 @@ namespace RokettoLaunch
this.AutoScaleMode = AutoScaleMode.None;
this.Text = Application.ProductName;
- this.CurrentSession = new AppOptions();
+ this.CurrentSession = new App4Options();
-#if DEBUG
- flowLayoutPanel1.BackColor = Color.LightGreen;
-#endif
+//#if DEBUG
+ //flowLayoutPanel1.BackColor = Color.LightGreen;
+//#endif
- newToolStripMenuItem.Image = RyzStudio.Windows.ThemedForms.DefaultVisualStyle.GetImage("a", Color.Black, 2);
- openToolStripMenuItem.Image = RyzStudio.Windows.ThemedForms.DefaultVisualStyle.GetImage("b", Color.Black, 2);
- saveToolStripMenuItem.Image = RyzStudio.Windows.ThemedForms.DefaultVisualStyle.GetImage("c", Color.Black, 2);
- optionsToolStripMenuItem.Image = RyzStudio.Windows.ThemedForms.DefaultVisualStyle.GetImage("i", Color.Black, 2);
- viewHelpToolStripMenuItem1.Image = RyzStudio.Windows.ThemedForms.DefaultVisualStyle.GetImage("j", Color.Black, 2);
+ notifyIcon1.Text = Application.ProductName;
+ }
+
+ public MainForm(IServiceProvider provider, IFileSessionManager fileSessionManager) : this()
+ {
+ _provider = provider;
+ _fileSessionManager = fileSessionManager;
- _fileSessionManager = new FileSessionManager();
_fileSessionManager.OpenFileDialog = openFileDialog1;
_fileSessionManager.SaveFileDialog = saveFileDialog1;
_fileSessionManager.OnNewing += fileSessionManager_OnNewSession;
@@ -54,8 +53,6 @@ namespace RokettoLaunch
_fileSessionManager.OnSaving += fileSessionManager_OnSaveSession;
_fileSessionManager.OnClearing += fileSessionManager_OnClearSession;
_fileSessionManager.OnFilenameChanged += fileSessionManager_OnFilenameChanged;
-
- notifyIcon1.Text = Application.ProductName;
}
protected async override void OnShown(EventArgs e)
@@ -76,31 +73,37 @@ namespace RokettoLaunch
}
else
{
- await _fileSessionManager.NewSession();
+ //await _fileSessionManager.NewSession();
}
UIControl.SetFocus(this);
}
- protected async override void OnClosing(CancelEventArgs e)
+ protected async override void OnFormClosing(FormClosingEventArgs e)
{
- base.OnClosing(e);
+ base.OnFormClosing(e);
if (this.CurrentSession == null)
{
- this.CurrentSession = new AppOptions();
+ this.CurrentSession = new App4Options();
}
if (this.CurrentSession.HideOnClose && !_requestExit)
{
- this.Visible = !this.Visible;
+ this.Hide();
+
e.Cancel = true;
return;
}
_requestExit = false;
- await _fileSessionManager.CloseSession();
+ var result = await _fileSessionManager.CloseSession();
+ if (!result)
+ {
+ e.Cancel = true;
+ return;
+ }
if ((this.CurrentSession?.ShowToggleHotkey ?? new ThKeyCodeTextBox.Results()).Key != Keys.None)
{
@@ -135,7 +138,8 @@ namespace RokettoLaunch
}
- public AppOptions CurrentSession { get; set; } = null;
+ [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public App4Options CurrentSession { get; set; } = null;
private void InvalidateOptions(bool resize)
@@ -147,6 +151,11 @@ namespace RokettoLaunch
UIControl.SetLocation(this, this.CurrentSession.StartPosition);
}
+ if (this.CurrentSession.Width > 0)
+ {
+ UIControl.SetClientWidth(this, this.CurrentSession.Width);
+ }
+
if (this.CurrentSession.Height > 0)
{
UIControl.SetClientHeight(this, this.CurrentSession.Height);
@@ -170,12 +179,10 @@ namespace RokettoLaunch
}
#endif
- AutoResizeWidth();
-
UIControl.SetTopMost(this, this.CurrentSession.AlwaysOnTop);
}
- private void menuStrip1_MenuActivate(object sender, EventArgs e)
+ private void MainMenuStrip_MenuActivate(object sender, EventArgs e)
{
closeToolStripMenuItem.Enabled = (_fileSessionManager.SessionState != FileSessionManager.SessionStateEnum.Close);
@@ -188,42 +195,6 @@ namespace RokettoLaunch
alwaysOnTopToolStripMenuItem.Checked = this.CurrentSession?.AlwaysOnTop ?? false;
}
- private void tileContainer_MouseClick(object sender, MouseEventArgs e)
- {
- if (e.Button != MouseButtons.Middle)
- {
- return;
- }
-
- var control = (sender as Control);
- if (control == null)
- {
- return;
- }
-
- var container = UIControl.GetParentsUntil(sender as Control);
- if (container == null)
- {
- return;
- }
-
- var newCoord = container.GetNextCoord();
-
- var tileModel = new TileModel()
- {
- Title = "New Tile",
- IsGroup = false
- };
-
- var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
- newTile.ContextMenuStrip = tileMenu1;
- newTile.LoadInfo(tileModel);
-
- container.Add(newTile, newCoord.X, newCoord.Y);
-
- _fileSessionManager.HasChanged = true;
- }
-
#region Main Menu
@@ -232,7 +203,7 @@ namespace RokettoLaunch
///
///
///
- private async void newToolStripMenuItem_Click(object sender, EventArgs e)
+ private async void NewToolStripMenuItem_Click(object sender, EventArgs e)
{
if (_isBusy)
{
@@ -247,7 +218,7 @@ namespace RokettoLaunch
///
///
///
- private async void openToolStripMenuItem_Click(object sender, EventArgs e)
+ private async void OpenToolStripMenuItem_Click(object sender, EventArgs e)
{
if (_isBusy)
{
@@ -262,7 +233,7 @@ namespace RokettoLaunch
///
///
///
- private async void closeToolStripMenuItem_Click(object sender, EventArgs e)
+ private async void CloseToolStripMenuItem_Click(object sender, EventArgs e)
{
if (_isBusy)
{
@@ -277,7 +248,7 @@ namespace RokettoLaunch
///
///
///
- private async void saveToolStripMenuItem_Click(object sender, EventArgs e)
+ private async void SaveToolStripMenuItem_Click(object sender, EventArgs e)
{
if (_isBusy)
{
@@ -292,7 +263,7 @@ namespace RokettoLaunch
///
///
///
- private async void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
+ private async void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
if (_isBusy)
{
@@ -307,7 +278,7 @@ namespace RokettoLaunch
///
///
///
- private void exitToolStripMenuItem2_Click(object sender, EventArgs e)
+ private void ExitToolStripMenuItem_Click(object sender, EventArgs e)
{
if (_isBusy)
{
@@ -325,9 +296,20 @@ namespace RokettoLaunch
///
///
///
- private async void addGroupToolStripMenuItem_Click(object sender, EventArgs e)
+ private async void AddGroupToolStripMenuItem_Click(object sender, EventArgs e)
{
- await AddNewSection();
+ var group = new App4Options.Group()
+ {
+ Id = Guid.NewGuid(),
+ Title = "New Group",
+ IsOpen = true,
+ GridSize = new Size(this.CurrentSession.TilesPerRow, 1)
+ };
+
+ this.CurrentSession.Groups.Add(group);
+ this.AddGroup(group);
+
+ _fileSessionManager.HasChanged = true;
}
@@ -336,7 +318,7 @@ namespace RokettoLaunch
///
///
///
- private void showBigIconsToolStripMenuItem_Click(object sender, EventArgs e)
+ private void ShowBigIconsToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.CurrentSession == null)
{
@@ -351,7 +333,7 @@ namespace RokettoLaunch
///
///
///
- private void alwaysOnTopToolStripMenuItem_Click(object sender, EventArgs e)
+ private void AlwaysOnTopToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.CurrentSession == null)
{
@@ -369,7 +351,7 @@ namespace RokettoLaunch
///
///
///
- private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
+ private void OptionsToolStripMenuItem_Click(object sender, EventArgs e)
{
var form = new OptionsForm(this.CurrentSession);
if (form.ShowDialog() == DialogResult.OK)
@@ -386,7 +368,7 @@ namespace RokettoLaunch
///
///
///
- private void viewHelpToolStripMenuItem1_Click(object sender, EventArgs e)
+ private void ViewHelpToolStripMenuItem_Click(object sender, EventArgs e)
{
RyzStudio.Diagnostics.Process.Execute(AppResource.AppHelpURL);
}
@@ -396,7 +378,7 @@ namespace RokettoLaunch
///
///
///
- private void aboutToolStripMenuItem1_Click(object sender, EventArgs e)
+ private void AboutToolStripMenuItem_Click(object sender, EventArgs e)
{
var form = new RyzStudio.Windows.ThemedForms.AboutForm();
form.ProductURL = AppResource.AppProductURL;
@@ -412,7 +394,7 @@ namespace RokettoLaunch
#region Notification Icon
- private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)
+ private void NotifyIcon_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
@@ -420,8 +402,13 @@ namespace RokettoLaunch
}
}
- private void exitToolStripMenuItem1_Click(object sender, EventArgs e)
+ private void NotifyExitToolStripMenuItem_Click(object sender, EventArgs e)
{
+ if (_isBusy)
+ {
+ return;
+ }
+
_requestExit = true;
this.Close();
@@ -435,11 +422,11 @@ namespace RokettoLaunch
private async Task fileSessionManager_OnNewSession(FileSessionManager sender)
{
// Enforce minimum number of rows
- this.CurrentSession.TilesPerRow = Math.Max(this.CurrentSession.TilesPerRow, MIN_ITEMS_PER_ROW);
+ this.CurrentSession.TilesPerRow = Math.Max(this.CurrentSession.TilesPerRow, TileLayoutPanel.MIN_COLUMNS);
UIControl.Clear(flowLayoutPanel1);
- await AddNewSection();
+ AddGroupToolStripMenuItem_Click(null, null);
InvalidateOptions(false);
@@ -448,34 +435,31 @@ namespace RokettoLaunch
private async Task fileSessionManager_OnLoadSession(FileSessionManager sender, string filename, int formatType)
{
- var newSession = new AppOptions();
-
- switch (Path.GetExtension(filename?.ToLower()?.Trim() ?? string.Empty))
+ // Progress indicator
+ var loadingForm = _provider.GetRequiredService();
+ var result = await loadingForm.ShowDialog(filename);
+ if (result != DialogResult.OK)
{
- case ".json":
- case ".jsonfig":
- newSession = await RyzStudio.Text.Json.JsonSerialiser.DeserialiseFile(filename);
- break;
- case ".jsnx":
- newSession = await RyzStudio.IO.Compression.ZFile.ReadFile(filename, "Document.json");
- break;
- default:
- break;
+ return false;
}
- if (newSession == null) newSession = new AppOptions();
-
- // Load tiles
- UIControl.Clear(flowLayoutPanel1);
-
- foreach (var item in newSession.Groups ?? new List())
+ await Task.Run(() =>
{
- await AddSection(item);
- }
+ this.CurrentSession = loadingForm.Result;
- this.CurrentSession = newSession;
+ InvalidateOptions(true);
- InvalidateOptions(true);
+ foreach (var group in this.CurrentSession.Groups ?? new List())
+ {
+ var gridSize = group.GetMaxGridSize();
+ gridSize.Width = Math.Max(gridSize.Width, TileLayoutPanel.MIN_COLUMNS);
+
+ group.GridSize = new Size(gridSize.Width, gridSize.Height);
+
+ this.AddGroup(group);
+ }
+
+ });
return true;
}
@@ -487,11 +471,6 @@ namespace RokettoLaunch
return false;
}
- if (!flowLayoutPanel1.Controls.OfType().Any())
- {
- return true;
- }
-
return await Task.Run(async () =>
{
if (_isBusy)
@@ -504,21 +483,12 @@ namespace RokettoLaunch
// update session
if (this.CurrentSession == null)
{
- this.CurrentSession = new AppOptions();
+ this.CurrentSession = new App4Options();
}
this.CurrentSession.StartPosition = this.Location;
- this.CurrentSession.Height = this.Height;
-
- this.CurrentSession.Groups = new List();
- foreach (var section in flowLayoutPanel1.Controls.OfType())
- {
- var newTag = GetSectionTag(section);
-
- section.Tag = newTag;
-
- this.CurrentSession.Groups.Add(newTag);
- }
+ this.CurrentSession.Width = this.DisplayRectangle.Width;
+ this.CurrentSession.Height = this.DisplayRectangle.Height;
var result = GenericResult.Create();
@@ -533,7 +503,7 @@ namespace RokettoLaunch
{
System.IO.File.Delete(filename);
}
- catch(Exception)
+ catch (Exception)
{
// do nothing
}
@@ -596,64 +566,94 @@ namespace RokettoLaunch
#endregion
- #region Tile Container
+ #region Group
///
/// Add Tile
///
///
///
- private void addGroupToolStripMenuItem1_Click(object sender, EventArgs e)
+ private void AddTileToolStripMenuItem_Click(object sender, EventArgs e)
{
- var section = UIControl.GetOwner((ToolStripMenuItem)sender);
- if (section == null)
+ var panel = UIControl.GetOwner((ToolStripMenuItem)sender);
+ if (panel == null)
{
return;
}
- var form = new EditTileForm();
- if (form.ShowDialog() == DialogResult.OK)
+ if (panel.ToggleControlId == null)
{
- var result = form.Result;
- var newCoord = section.GetNextCoord();
+ return;
+ }
- var newTile = new TilePanel();
- newTile.ContextMenuStrip = tileMenu1;
- newTile.LoadInfo(result);
+ var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == panel.ToggleControlId.Value).FirstOrDefault();
+ if (groupInfo == null)
+ {
+ return;
+ }
- section.Add(newTile, newCoord.X, newCoord.Y);
-
- _fileSessionManager.HasChanged = true;
+ var newTileInfo = new App4Options.Item()
+ {
+ Id = Guid.NewGuid(),
+ Title = "New Tile",
+ IsGroup = false,
+ Position = new Point(-1, -1)
};
+
+ newTileInfo = groupInfo.AddItem(newTileInfo);
+
+ // Update table layout
+ var newTilePanel = CreateTile(newTileInfo);
+
+ var tableLayout = (TileLayoutPanel)panel.ToggleControl;
+ tableLayout.AddTilePanel(newTilePanel, newTileInfo.Position.X, newTileInfo.Position.Y);
+ tableLayout.SetGridSize(groupInfo.GridSize);
+
+ _fileSessionManager.HasChanged = true;
}
///
- /// Add Tile Group
+ /// Add Folder
///
///
///
- private void toolStripMenuItem4_Click(object sender, EventArgs e)
+ private void AddFolderToolStripMenuItem_Click(object sender, EventArgs e)
{
- var container = UIControl.GetOwner((ToolStripMenuItem)sender);
- if (container == null)
+ var panel = UIControl.GetOwner((ToolStripMenuItem)sender);
+ if (panel == null)
{
return;
}
- var form = new EditTileFolderForm();
- if (form.ShowDialog() == DialogResult.OK)
+ if (panel.ToggleControlId == null)
{
- var result = form.Result;
- var newCoord = container.GetNextCoord();
+ return;
+ }
- var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
- newTile.ContextMenuStrip = tileMenu1;
- newTile.LoadInfo(result);
+ var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == panel.ToggleControlId.Value).FirstOrDefault();
+ if (groupInfo == null)
+ {
+ return;
+ }
- container.Add(newTile, newCoord.X, newCoord.Y);
-
- _fileSessionManager.HasChanged = true;
+ var newTileInfo = new App4Options.Item()
+ {
+ Id = Guid.NewGuid(),
+ Title = "New Folder",
+ IsGroup = true,
+ Position = new Point(-1, -1)
};
+
+ newTileInfo = groupInfo.AddItem(newTileInfo);
+
+ // Update table layout
+ var newTilePanel = CreateTile(newTileInfo);
+
+ var tableLayout = (TileLayoutPanel)panel.ToggleControl;
+ tableLayout.AddTilePanel(newTilePanel, newTileInfo.Position.X, newTileInfo.Position.Y);
+ tableLayout.SetGridSize(groupInfo.GridSize);
+
+ _fileSessionManager.HasChanged = true;
}
///
@@ -661,28 +661,43 @@ namespace RokettoLaunch
///
///
///
- private void editToolStripMenuItem_Click(object sender, EventArgs e)
+ private void EditGroupToolStripMenuItem_Click(object sender, EventArgs e)
{
- var container = UIControl.GetOwner((ToolStripMenuItem)sender);
- if (container == null)
+ var panel = UIControl.GetOwner((ToolStripMenuItem)sender);
+ if (panel == null)
{
return;
}
- var model = UIControl.GetTag(container);
-
- var form = new EditSectionForm(model);
- if (form.ShowDialog() == DialogResult.OK)
+ if (panel.ToggleControlId == null)
{
- var result = form.Result;
+ return;
+ }
- container.Title = result.Title;
- container.Tag = result;
+ var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == panel.ToggleControlId.Value).FirstOrDefault();
+ if (groupInfo == null)
+ {
+ return;
+ }
- container.Invalidate();
+ var tableLayout = (TileLayoutPanel)panel.ToggleControl;
+
+ var editGroupForm = new EditGroupForm(groupInfo);
+ if (editGroupForm.ShowDialog() == DialogResult.OK)
+ {
+ var newGroupInfo = editGroupForm.Result;
+
+ groupInfo.Title = newGroupInfo.Title;
+ groupInfo.IsOpen = newGroupInfo.IsOpen;
+ groupInfo.GridSize = newGroupInfo.GridSize;
+
+ panel.Title = newGroupInfo.Title;
+ panel.Invalidate();
+
+ tableLayout.SetGridSize(groupInfo.GridSize);
_fileSessionManager.HasChanged = true;
- };
+ }
}
///
@@ -692,29 +707,35 @@ namespace RokettoLaunch
///
private async void toolStripMenuItem5_Click(object sender, EventArgs e)
{
- var section = UIControl.GetOwner((ToolStripMenuItem)sender);
- if (section == null)
+ var panel = UIControl.GetOwner((ToolStripMenuItem)sender);
+ if (panel == null)
{
return;
}
- var newTag = GetSectionTag(section);
- section.Tag = newTag;
-
- try
- {
- var newerTag = JsonSerializer.Deserialize(JsonSerializer.Serialize(newTag));
- newerTag.IsExpanded = true;
- newerTag.Title = (string.IsNullOrWhiteSpace(newerTag.Title) ? "New Section" : newerTag.Title?.Trim()) + " (Copy)";
-
- await AddSection(newerTag);
- }
- catch (Exception)
+ if (panel.ToggleControlId == null)
{
return;
}
+ var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == panel.ToggleControlId.Value).FirstOrDefault();
+ if (groupInfo == null)
+ {
+ return;
+ }
+
+ _isBusy = true;
+
+ await Task.Run(() =>
+ {
+ var newGroupInfo = groupInfo.CopyOf();
+
+ this.CurrentSession.Groups.Add(newGroupInfo);
+ this.AddGroup(newGroupInfo);
+ });
+
_fileSessionManager.HasChanged = true;
+ _isBusy = false;
}
///
@@ -722,15 +743,32 @@ namespace RokettoLaunch
///
///
///
- private void topToolStripMenuItem_Click(object sender, EventArgs e)
+ private void MoveTopToolStripMenuItem_Click(object sender, EventArgs e)
{
- var container = UIControl.GetOwner((ToolStripDropDownItem)sender);
- if (container == null)
+ var panel = UIControl.GetOwner((ToolStripDropDownItem)sender);
+ if (panel == null)
{
return;
}
- UIControl.MoveTop(flowLayoutPanel1, container);
+ // Move header
+ UIControl.MoveTop(flowLayoutPanel1, panel);
+
+ // Move sidecar
+ if (panel.ToggleControl != null)
+ {
+ UIControl.MoveNext(flowLayoutPanel1, panel, panel.ToggleControl);
+ }
+
+ // Move group
+ var n = this.CurrentSession.Groups.FindIndex(x => x.Id == panel.ToggleControlId);
+ if (n >= 0)
+ {
+ var item = this.CurrentSession.Groups[n];
+
+ this.CurrentSession.Groups.RemoveAt(n);
+ this.CurrentSession.Groups.Insert(0, item);
+ }
_fileSessionManager.HasChanged = true;
}
@@ -740,15 +778,32 @@ namespace RokettoLaunch
///
///
///
- private void upToolStripMenuItem_Click(object sender, EventArgs e)
+ private void MoveUpToolStripMenuItem_Click(object sender, EventArgs e)
{
- var container = UIControl.GetOwner((ToolStripDropDownItem)sender);
- if (container == null)
+ var panel = UIControl.GetOwner((ToolStripDropDownItem)sender);
+ if (panel == null)
{
return;
}
- UIControl.MoveUp(flowLayoutPanel1, container);
+ // Move header
+ UIControl.MovePos(flowLayoutPanel1, panel, -2);
+
+ // Move sidecar
+ if (panel.ToggleControl != null)
+ {
+ UIControl.MoveNext(flowLayoutPanel1, panel, panel.ToggleControl);
+ }
+
+ // Move group
+ var n = this.CurrentSession.Groups.FindIndex(x => x.Id == panel.ToggleControlId);
+ if (n > 0)
+ {
+ var item = this.CurrentSession.Groups[n];
+
+ this.CurrentSession.Groups.RemoveAt(n);
+ this.CurrentSession.Groups.Insert((n - 1), item);
+ }
_fileSessionManager.HasChanged = true;
}
@@ -758,15 +813,32 @@ namespace RokettoLaunch
///
///
///
- private void downToolStripMenuItem_Click(object sender, EventArgs e)
+ private void MoveDownToolStripMenuItem_Click(object sender, EventArgs e)
{
- var container = UIControl.GetOwner((ToolStripDropDownItem)sender);
- if (container == null)
+ var panel = UIControl.GetOwner((ToolStripDropDownItem)sender);
+ if (panel == null)
{
return;
}
- UIControl.MoveDown(flowLayoutPanel1, container);
+ // Move header
+ UIControl.MovePos(flowLayoutPanel1, panel, 3);
+
+ // Move sidecar
+ if (panel.ToggleControl != null)
+ {
+ UIControl.MovePos(flowLayoutPanel1, panel.ToggleControl, 3);
+ }
+
+ // Move group
+ var n = this.CurrentSession.Groups.FindIndex(x => x.Id == panel.ToggleControlId);
+ if ((n >= 0) && (n < (this.CurrentSession.Groups.Count - 1)))
+ {
+ var item = this.CurrentSession.Groups[n];
+
+ this.CurrentSession.Groups.RemoveAt(n);
+ this.CurrentSession.Groups.Insert((n + 1), item);
+ }
_fileSessionManager.HasChanged = true;
}
@@ -776,15 +848,33 @@ namespace RokettoLaunch
///
///
///
- private void bottomToolStripMenuItem_Click(object sender, EventArgs e)
+ private void MoveBottomToolStripMenuItem_Click(object sender, EventArgs e)
{
- var container = UIControl.GetOwner((ToolStripDropDownItem)sender);
- if (container == null)
+ var panel = UIControl.GetOwner((ToolStripDropDownItem)sender);
+ if (panel == null)
{
return;
}
- UIControl.MoveBottom(flowLayoutPanel1, container);
+ // Move header
+ UIControl.MoveBottom(flowLayoutPanel1, panel);
+
+ // Move sidecar
+ if (panel.ToggleControl != null)
+ {
+ UIControl.MoveNext(flowLayoutPanel1, panel, panel.ToggleControl);
+ }
+
+ // Move group
+ var lastPos = (this.CurrentSession.Groups.Count - 1);
+ var n = this.CurrentSession.Groups.FindIndex(x => x.Id == panel.ToggleControlId);
+ if ((n >= 0) && (n < lastPos))
+ {
+ var item = this.CurrentSession.Groups[n];
+
+ this.CurrentSession.Groups.RemoveAt(n);
+ this.CurrentSession.Groups.Insert(lastPos, item);
+ }
_fileSessionManager.HasChanged = true;
}
@@ -794,7 +884,7 @@ namespace RokettoLaunch
///
///
///
- private void removeToolStripMenuItem_Click(object sender, EventArgs e)
+ private void RemoveGroupToolStripMenuItem_Click(object sender, EventArgs e)
{
var result = MessageBox.Show("Are you sure you want to remove section?", "Remove Section", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (result != DialogResult.Yes)
@@ -802,13 +892,28 @@ namespace RokettoLaunch
return;
}
- var container = UIControl.GetOwner((ToolStripMenuItem)sender);
- if (container == null)
+ var panel = UIControl.GetOwner((ToolStripMenuItem)sender);
+ if (panel?.Parent == null)
{
return;
}
- container?.Parent.Controls?.Remove(container);
+ // Remove side-car
+ if (panel.ToggleControl != null)
+ {
+ if (panel.ToggleControl.Parent != null)
+ {
+ if (panel.ToggleControlId.HasValue)
+ {
+ this.CurrentSession.Remove(panel.ToggleControlId.Value);
+ }
+
+ panel.ToggleControl.Parent.Controls.Remove(panel.ToggleControl);
+ }
+ }
+
+ // Remove header
+ panel?.Parent.Controls?.Remove(panel);
_fileSessionManager.HasChanged = true;
}
@@ -822,50 +927,97 @@ namespace RokettoLaunch
///
///
///
- private void editToolStripMenuItem1_Click(object sender, EventArgs e)
+ private void EditTileToolStripMenuItem_Click(object sender, EventArgs e)
{
- var tile = UIControl.GetOwner((ToolStripMenuItem)sender);
- if (tile == null)
+ var tilePanel = UIControl.GetOwner((ToolStripMenuItem)sender);
+
+ var tileInfo = this.GetTileInfo(tilePanel);
+ if (tileInfo == null)
{
return;
}
- if (tile.ModelInfo.IsGroup)
- {
- var form = new EditTileFolderForm(tile.ModelInfo);
- if (form.ShowDialog() == DialogResult.OK)
- {
- tile.LoadInfo(form.Result);
+ App4Options.Item resultTileInfo = null;
- _fileSessionManager.HasChanged = true;
- };
+ if (tileInfo.IsGroup)
+ {
+ var editFolderForm = new EditFolderForm(tileInfo);
+ if (editFolderForm.ShowDialog() == DialogResult.OK)
+ {
+ resultTileInfo = editFolderForm.Result;
+ }
}
else
{
- var form = new EditTileForm(tile.ModelInfo);
- if (form.ShowDialog() == DialogResult.OK)
+ var editForm = new EditTileForm(tileInfo);
+ if (editForm.ShowDialog() == DialogResult.OK)
{
- tile.LoadInfo(form.Result);
-
- _fileSessionManager.HasChanged = true;
- };
+ resultTileInfo = editForm.Result;
+ }
}
- }
- ///
- /// Duplicate
- ///
- ///
- ///
- private void toolStripMenuItem6_Click(object sender, EventArgs e)
- {
- var tile = UIControl.GetOwner((ToolStripMenuItem)sender);
- if (tile == null)
+ if (resultTileInfo == null)
{
return;
}
- DuplicateTile(tile);
+ var updatedTileInfo = this.CurrentSession.FindById(tileInfo.Id);
+ updatedTileInfo.Load(resultTileInfo);
+
+ this.UpdateTile(tilePanel, updatedTileInfo);
+
+ _fileSessionManager.HasChanged = true;
+ }
+
+ ///
+ /// Copy To
+ ///
+ ///
+ ///
+ private async void CopyToTileToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var tilePanel = UIControl.GetOwner((ToolStripMenuItem)sender);
+
+ var tileInfo = this.GetTileInfo(tilePanel);
+ if (tileInfo == null)
+ {
+ return;
+ }
+
+ var groups = this.CurrentSession.Groups.Select(x => x.Title)?.ToList() ?? new List();
+
+ var copyToTileForm = new CopyToTileForm(groups);
+ if (copyToTileForm.ShowDialog() == DialogResult.OK)
+ {
+ var n = copyToTileForm.Result;
+
+ await Task.Run(() =>
+ {
+ var newTileInfo = tileInfo.CopyOf();
+
+ var headers = flowLayoutPanel1.Controls.OfType().ToList();
+ if (headers != null)
+ {
+ if (n >= 0 && n <= (headers.Count - 1))
+ {
+ // Add to group
+ newTileInfo = this.CurrentSession.Groups[n].AddItem(newTileInfo);
+
+ // Update table layout
+ var newTilePanel = CreateTile(newTileInfo);
+
+ var tableLayout = (TileLayoutPanel)headers[n].ToggleControl;
+ tableLayout.AddTilePanel(newTilePanel, newTileInfo.Position.X, newTileInfo.Position.Y);
+ tableLayout.SetGridSize(this.CurrentSession.Groups[n].GridSize);
+
+
+ }
+ }
+
+ });
+
+ _fileSessionManager.HasChanged = true;
+ }
}
///
@@ -873,140 +1025,368 @@ namespace RokettoLaunch
///
///
///
- private void removeToolStripMenuItem1_Click(object sender, EventArgs e)
+ private void RemoveTileToolStripMenuItem_Click(object sender, EventArgs e)
{
- var result = MessageBox.Show("Are you sure you want to remove tile?", "Remove Tile", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
- if (result != DialogResult.Yes)
+ var tilePanel = UIControl.GetOwner((ToolStripMenuItem)sender);
+
+ var tileInfo = this.GetTileInfo(tilePanel);
+ if (tileInfo == null)
{
return;
}
- var tile = UIControl.GetOwner((ToolStripMenuItem)sender);
- if (tile == null)
+ var dialogResult = MessageBox.Show(this, "Are you sure you want to remove tile?", "Remove Tile", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
+ if (dialogResult != DialogResult.Yes)
{
return;
}
- var container = UIControl.GetParentsUntil(tile);
- if (container == null)
+ var result = this.CurrentSession.Remove(tileInfo.Id);
+ if (result)
{
- return;
+ tilePanel.Parent.Controls.Remove(tilePanel);
+
+ _fileSessionManager.HasChanged = true;
+ }
+ else
+ {
+ MessageBox.Show(this, "Unable to remove tile", "Remove Tile", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
-
- container.Controls?.Remove(tile);
-
- _fileSessionManager.HasChanged = true;
}
#endregion
- private async Task AddNewSection()
+ private void AddGroup(App4Options.Group groupInfo)
{
- var group = new TileGroupModel();
- group.Title = "New Section";
- group.IsExpanded = true;
- group.GridSize = new System.Drawing.Size(this.CurrentSession.TilesPerRow, 1);
+ var tableLayout = CreateTable(groupInfo.GridSize);
+ tableLayout.GroupId = groupInfo.Id;
- await AddSection(group);
+ var header = CreateHeader(groupInfo);
+ header.ToggleControlId = groupInfo.Id;
+ header.ToggleControl = tableLayout;
+ header.IsOpen = groupInfo.IsOpen;
+
+ UIControl.Add(flowLayoutPanel1, header);
+ UIControl.Add(flowLayoutPanel1, tableLayout);
+
+ foreach (var item in groupInfo.Items ?? new List())
+ {
+ var tilePanel = CreateTile(item);
+
+ tableLayout.AddTilePanel(tilePanel, item.Position.X, item.Position.Y);
+ }
+
+ tableLayout.SetGridSize(groupInfo.GridSize);
+ }
+
+ private void AddToFolder(App4Options.Item item, List paths, bool appendTo = true)
+ {
+ item.IsGroup = true;
+
+ if (!appendTo)
+ {
+ item.Items.Clear();
+ }
+
+ foreach (var path in paths)
+ {
+ var newTileInfo = new App4Options.Item()
+ {
+ Id = Guid.NewGuid(),
+ IsGroup = false,
+ TargetPath = path,
+ };
+
+ newTileInfo.ResolvePaths();
+ newTileInfo.Title = RyzStudio.IO.File.GetName(newTileInfo.ResolvedTargetPath);
+
+ item.Items.Add(newTileInfo);
+ }
+ }
+
+ private TileLayoutPanel CreateTable(Size gridSize)
+ {
+ var layoutPanel = new TileLayoutPanel();
+ layoutPanel.DragDrop += LayoutPanel_DragDrop;
+ layoutPanel.SetGridSize(gridSize);
+
+ return layoutPanel;
+ }
+
+ private TToggleHeaderPanel CreateHeader(App4Options.Group group)
+ {
+ var width = (TileLayoutPanel.TILE_SIZE + TileLayoutPanel.TILE_PADDING);
+
+ var headerPanel = new TToggleHeaderPanel();
+ headerPanel.ContextMenuStrip = groupMenuStrip;
+ headerPanel.Height = 20;
+ headerPanel.Padding = new Padding(0, 0, 0, 0);
+ headerPanel.Width = (group.GridSize.Width * width);
+ headerPanel.Title = group.Title;
+ headerPanel.IsOpen = group.IsOpen;
+
+ return headerPanel;
+ }
+
+ private TilePanel CreateTile(App4Options.Item item)
+ {
+ var tilePanel = new TilePanel();
+ tilePanel.ContextMenuStrip = tileMenuStrip;
+ tilePanel.Dock = DockStyle.Fill;
+ tilePanel.Margin = new Padding(0, 0, 3, 3);
+ tilePanel.Padding = new Padding(0);
+
+ tilePanel.MouseClick += TilePanel_MouseClick;
+ tilePanel.MouseDoubleClick += TilePanel_MouseClick;
+ tilePanel.OnFileDrop += TilePanel_OnFileDrop;
+
+ this.UpdateTile(tilePanel, item);
+
+ return tilePanel;
+ }
+
+ private App4Options.Item GetTileInfo(object sender)
+ {
+ App4Options.Item result = null;
+
+ if (sender is TilePanel)
+ {
+ var panel = (sender as TilePanel);
+ result = this.CurrentSession.FindById(panel.TileId);
+ }
+ else if (sender is ToolStripMenuItem)
+ {
+ var menuItem = (sender as ToolStripMenuItem);
+ if (menuItem.Tag == null)
+ {
+ return null;
+ }
+
+ if (string.IsNullOrWhiteSpace(menuItem.Tag.ToString()))
+ {
+ return null;
+ }
+
+ if (!Guid.TryParse(menuItem.Tag.ToString(), out var tileId))
+ {
+ return null;
+ }
+
+ result = this.CurrentSession.FindById(tileId);
+ }
+
+ return result;
+ }
+
+ private void UpdateTile(TilePanel tilePanel, App4Options.Item item)
+ {
+ tilePanel.TileId = item.Id;
+ tilePanel.Title = item.Title;
+ tilePanel.IsGroup = item.IsGroup;
+
+ if (item.IsGroup)
+ {
+ var iconSize = this.CurrentSession.ShowBigIcons ? 24 : 16;
+
+ tilePanel.LargeIcon = AppResource.folder_32;
+ tilePanel.TileContextMenu = new ContextMenuStrip();
+ tilePanel.TileContextMenu!.ImageScalingSize = new Size(iconSize, iconSize);
+
+ this.UpdateContextMenu(tilePanel.TileContextMenu, item.Items);
+ }
+ else
+ {
+ tilePanel.LargeIcon = RyzStudio.IO.File.GetIcon(item.ResolvedTargetPath);
+ tilePanel.TileContextMenu = null;
+ }
+ }
+
+ private ContextMenuStrip UpdateContextMenu(ContextMenuStrip contextMenu, List items)
+ {
+ contextMenu.Items.Clear();
+
+ foreach (var item in items ?? new List())
+ {
+ var subItemMenuItem = new ToolStripMenuItem()
+ {
+ Text = item.Title,
+ Image = RyzStudio.IO.File.GetIcon(item.ResolvedTargetPath),
+ Tag = item.Id
+ };
+ subItemMenuItem.Click += TileMenuItem_MouseClick;
+
+ contextMenu.Items.Add(subItemMenuItem);
+ }
+
+ return contextMenu;
+ }
+
+ private async void LayoutPanel_DragDrop(object sender, DragEventArgs e)
+ {
+ if (!e.Data.TryGetData(out var tilePanel))
+ {
+ return;
+ }
+
+ var tableLayout = (sender as TileLayoutPanel);
+
+ var point = tableLayout.PointToClient(new Point(e.X, e.Y));
+ var newPosition = tableLayout.GetCellFromPoint(new Point(point.X, point.Y));
+
+ var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == tableLayout.GroupId).FirstOrDefault();
+ if (groupInfo == null)
+ {
+ return;
+ }
+
+ var newGridPosition = new Point(newPosition.X, newPosition.Y);
+ if (groupInfo.Items.Where(x => x.Position == newGridPosition).Any())
+ {
+ // Position already occupied
+ return;
+ }
+
+ await Task.Run(() =>
+ {
+ var foundTileInfo = this.CurrentSession.FindById(tilePanel.TileId);
+ foundTileInfo.Position = newGridPosition;
+
+ this.Controls.Remove(tilePanel);
+
+ tableLayout.AddTilePanel(tilePanel, newPosition.X, newPosition.Y);
+ });
_fileSessionManager.HasChanged = true;
}
- private async Task AddSection(TileGroupModel model)
+
+ private void TilePanel_MouseClick(object sender, MouseEventArgs e)
{
- var panel = new RyzStudio.Windows.TileForms.TileContainer();
- panel.Title = model.Title;
- panel.IsOpen = model.IsExpanded;
- panel.TitleContextMenuStrip = tileContainerMenu1;
- panel.AutoSizeHeight = true;
- panel.Tag = model;
- panel.AutoSize(model.GridSize.Width, model.GridSize.Height);
+ var tilePanel = (sender as TilePanel);
-#if DEBUG
- panel.BackColor = Color.LightSteelBlue;
-#endif
-
- panel.MouseClick += tileContainer_MouseClick;
-
- UIControl.Add(flowLayoutPanel1, panel);
-
- // Load tiles
- foreach (var item2 in model.Items ?? new List())
+ var tileInfo = this.GetTileInfo(sender);
+ if (tileInfo == null)
+ {
+ return;
+ }
+
+ if (e.Button == MouseButtons.Left)
+ {
+ if (tilePanel.IsGroup)
+ {
+ tilePanel.TileContextMenu?.Show(tilePanel, e.Location);
+ }
+ else
+ {
+ Execute(tileInfo);
+ }
+ }
+ else
{
- var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
- newTile.ContextMenuStrip = tileMenu1;
- newTile.LoadInfo(item2);
- panel.Add(newTile, item2.Position.X, item2.Position.Y);
}
}
- private void AutoResizeWidth()
+ private void TileMenuItem_MouseClick(object sender, EventArgs e)
{
- if (flowLayoutPanel1.Controls.Count <= 0)
+ var tileInfo = this.GetTileInfo(sender);
+ if (tileInfo == null)
{
return;
}
- var width = MIN_ITEMS_PER_ROW;
- foreach (var item in flowLayoutPanel1.Controls.OfType())
- {
- width = Math.Max(width, item.Width);
- }
-
- var padding = panel1.Padding.Horizontal + this.Padding.Horizontal + SystemInformation.VerticalScrollBarWidth;
-
- UIControl.SetClientWidth(this, width + padding);
+ Execute(tileInfo);
}
- public void DuplicateTile(TilePanel tile)
+ private async Task TilePanel_OnFileDrop(TilePanel sender, Keys keys, List paths)
{
- var container = UIControl.GetParentsUntil(tile);
- if (container == null)
+ await Task.Run(() =>
{
- return;
- }
+ var tileInfo = this.CurrentSession.FindById(sender.TileId);
- var newModel = new TileModel();
+ // Append
+ if (keys.HasFlag(Keys.Shift))
+ {
+ if (tileInfo.IsGroup)
+ {
+ this.AddToFolder(tileInfo, paths, true);
+ }
+ else
+ {
+ var newTileInfo = tileInfo.CopyOf();
- try
- {
- newModel = JsonSerializer.Deserialize(JsonSerializer.Serialize(tile.ModelInfo));
- newModel.Title = (string.IsNullOrWhiteSpace(newModel.Title) ? "New Tile" : newModel.Title?.Trim()) + " (Copy)";
- }
- catch (Exception)
- {
- return;
- }
+ tileInfo.Title = "New Folder";
+ tileInfo.IsGroup = true;
+ tileInfo.TargetPath = string.Empty;
+ tileInfo.StartPath = string.Empty;
+ tileInfo.Argument = string.Empty;
+ tileInfo.RunAsAdmin = false;
- var newCoord = container.GetNextCoord();
+ tileInfo.Items.Clear();
+ tileInfo.Items.Add(newTileInfo);
- var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
- newTile.ContextMenuStrip = tileMenu1;
- newTile.LoadInfo(newModel);
+ this.AddToFolder(tileInfo, paths, true);
- container.Add(newTile, newCoord.X, newCoord.Y);
+ tileInfo.ResolvePaths();
+ }
+ }
+ else
+ {
+ if (paths.Count <= 1)
+ {
+ tileInfo.IsGroup = false;
+ tileInfo.TargetPath = paths[0];
+ tileInfo.StartPath = string.Empty;
+ tileInfo.Argument = string.Empty;
+ tileInfo.RunAsAdmin = false;
+
+ tileInfo.Items.Clear();
+ tileInfo.ResolvePaths();
+
+ tileInfo.Title = RyzStudio.IO.File.GetName(tileInfo.ResolvedTargetPath);
+ }
+ else
+ {
+ tileInfo.Title = "New Folder";
+ tileInfo.IsGroup = true;
+ tileInfo.TargetPath = string.Empty;
+ tileInfo.StartPath = string.Empty;
+ tileInfo.Argument = string.Empty;
+ tileInfo.RunAsAdmin = false;
+
+ tileInfo.Items.Clear();
+
+ this.AddToFolder(tileInfo, paths, false);
+
+ tileInfo.ResolvePaths();
+ }
+ }
+
+ this.UpdateTile(sender, tileInfo);
+ });
_fileSessionManager.HasChanged = true;
}
- private TileGroupModel GetSectionTag(TileContainer section)
+ private void Execute(App4Options.Item model)
{
- var newTag = new TileGroupModel();
- newTag.Title = section.Title ?? "New Section";
- newTag.IsExpanded = section.IsOpen;
- newTag.GridSize = section.GridSize;
- newTag.Items = new List();
-
- foreach (var tile in section?.Controls?.OfType() ?? new List())
+ if (model == null)
{
- tile.ModelInfo.Position = section.GetCoord(tile);
-
- newTag.Items.Add(tile.ModelInfo);
+ return;
}
- return newTag;
+ if (model.IsGroup)
+ {
+ return;
+ }
+
+ if (this.CurrentSession.HideOnExecute)
+ {
+ this.Visible = false;
+ }
+
+ RyzStudio.Diagnostics.Process.Execute(model.ResolvedTargetPath, model.ResolvedStartPath, model.ResolvedArgument, model.WindowStyle, model.RunAsAdmin);
}
}
diff --git a/MainForm.resx b/MainForm.resx
index c441c6c..c321215 100644
--- a/MainForm.resx
+++ b/MainForm.resx
@@ -126,7 +126,7 @@
448, 17
-
+
561, 17
@@ -428,12 +428,12 @@
- 716, 17
+ 46, 13
-
+
831, 17
-
+
990, 17
diff --git a/Models/SaveFile/App3Options.cs b/Models/SaveFile/App3Options.cs
new file mode 100644
index 0000000..d77d22c
--- /dev/null
+++ b/Models/SaveFile/App3Options.cs
@@ -0,0 +1,58 @@
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Drawing;
+using System.Text.Json.Serialization;
+
+namespace RokettoLaunch.Models.SaveFile
+{
+ public class App3Options : AppOptionsBase
+ {
+ public class Group
+ {
+ public string Title { get; set; }
+
+ public bool IsExpanded { get; set; } = false;
+
+ public List- Items { get; set; } = new List
- ();
+
+ [JsonConverter(typeof(RyzStudio.Text.Json.JsonSizeConverter))]
+ public Size GridSize { get; set; } = new Size(0, 0);
+
+ }
+
+ public class Item
+ {
+ public string Title { get; set; }
+
+ public string ProcessFilename { get; set; }
+
+ public string ProcessArgument { get; set; }
+
+ public string ProcessWorkingDirectory { get; set; }
+
+ public ProcessWindowStyle ProcessWindowStyle { get; set; } = ProcessWindowStyle.Normal;
+
+ public bool ProcessAsAdmin { get; set; } = false;
+
+ [JsonConverter(typeof(RyzStudio.Text.Json.JsonPointConverter))]
+ public Point Position { get; set; }
+
+ public bool IsGroup { get; set; } = false;
+
+ public List
- Items { get; set; } = new List
- ();
+
+
+ public override string ToString()
+ {
+ return this.Title?.Trim() ?? string.Empty;
+ }
+
+ }
+
+
+ public new int FileVersion { get; set; } = 3;
+
+ public List Groups { get; set; } = new List();
+
+ }
+}
\ No newline at end of file
diff --git a/Models/SaveFile/App4Options.cs b/Models/SaveFile/App4Options.cs
new file mode 100644
index 0000000..828719d
--- /dev/null
+++ b/Models/SaveFile/App4Options.cs
@@ -0,0 +1,378 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Drawing;
+using System.Linq;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace RokettoLaunch.Models.SaveFile
+{
+ public class App4Options : AppOptionsBase
+ {
+ public class Group
+ {
+ public Guid Id { get; set; } = Guid.NewGuid();
+
+ public string Title { get; set; }
+
+ public bool IsOpen { get; set; } = false;
+
+ public List
- Items { get; set; } = new List
- ();
+
+ [JsonConverter(typeof(RyzStudio.Text.Json.JsonSizeConverter))]
+ public Size GridSize { get; set; } = new Size(0, 0);
+
+
+ public Item AddItem(Item item)
+ {
+ var canPosition = this.CanPosition(item);
+ if (!canPosition)
+ {
+ // Find next available position
+ item.Position = this.GetNextPosition();
+ }
+
+ // Resize-expand table
+ if ((item.Position.Y + 1) > this.GridSize.Height)
+ {
+ this.GridSize = new Size(this.GridSize.Width, (item.Position.Y + 1));
+
+ //this.UpdateTable(table, this.GridSize);
+ }
+
+ // Add item
+ this.Items.Add(item);
+
+ return item;
+ }
+
+
+ public Group CopyOf()
+ {
+ var json = JsonSerializer.Serialize(this);
+
+ var newGroupInfo = JsonSerializer.Deserialize(json);
+ newGroupInfo.Id = Guid.NewGuid();
+ newGroupInfo.Title = "Copy of " + newGroupInfo.Title;
+
+ // Resolve paths
+ foreach (var item in newGroupInfo.Items ?? new List
- ())
+ {
+ item.Id = Guid.NewGuid();
+
+ if (item.IsGroup)
+ {
+ foreach (var subItem in item.Items ?? new List
- ())
+ {
+ subItem.Id = Guid.NewGuid();
+
+ subItem.ResolvePaths();
+ }
+ }
+ else
+ {
+ item.ResolvePaths();
+ }
+ }
+
+ return newGroupInfo;
+ }
+
+ public Size GetMaxGridSize()
+ {
+ var result = this.GridSize;
+ var maxPosition = this.GetMaxPosition();
+
+ result.Width = Math.Max(result.Width, (maxPosition.X + 1));
+ result.Height = Math.Max(result.Height, (maxPosition.Y + 1));
+
+ return result;
+ }
+
+ public Point GetMaxPosition()
+ {
+ if (this.Items.Count <= 0)
+ {
+ return new Point(0, 0);
+ }
+
+ var result = new Point(0, 0);
+ result.Y = this.Items.Select(x => x.Position.Y).Max();
+ result.X = this.Items.Where(x => x.Position.Y == result.Y)?.Select(x => x.Position.X)?.Max() ?? 0;
+
+ return result;
+ }
+
+ public Point GetNextPosition()
+ {
+ if (this.Items.Count <= 0)
+ {
+ return new Point(0, 0);
+ }
+
+ var pos = this.GetMaxPosition();
+ pos.X++;
+
+ if (pos.X > (this.GridSize.Width - 1))
+ {
+ pos.X = 0;
+ pos.Y++;
+ }
+
+ return pos;
+ }
+
+ public bool CanPosition(Item tile)
+ {
+ if (tile.Position == new Point(-1, -1))
+ {
+ return false;
+ }
+
+ if (Items.Count <= 0)
+ {
+ return true;
+ }
+
+ return !Items.Where(x => x.Id != tile.Id && x.Position == tile.Position).Any();
+ }
+
+ }
+
+ public class Item
+ {
+ public static Item Create(App3Options.Item model)
+ {
+ var result = new Item();
+ result.Load(model);
+
+ return result;
+ }
+
+
+ public Guid Id { get; set; } = Guid.NewGuid();
+
+ public string Title { get; set; }
+
+ public string TargetPath { get; set; }
+
+ public string Argument { get; set; }
+
+ public string StartPath { get; set; }
+
+ public ProcessWindowStyle WindowStyle { get; set; } = ProcessWindowStyle.Normal;
+
+ public bool RunAsAdmin { get; set; } = false;
+
+ [JsonConverter(typeof(RyzStudio.Text.Json.JsonPointConverter))]
+ public Point Position { get; set; }
+
+ public bool IsGroup { get; set; } = false;
+
+ public List
- Items { get; set; } = new List
- ();
+
+ [JsonIgnore]
+ public string ResolvedTargetPath { get; private set; }
+
+ [JsonIgnore]
+ public string ResolvedArgument { get; private set; }
+
+ [JsonIgnore]
+ public string ResolvedStartPath { get; private set; }
+
+
+ public Item CopyOf()
+ {
+ var json = JsonSerializer.Serialize(this);
+
+ var newTileInfo = JsonSerializer.Deserialize
- (json);
+ newTileInfo.Id = Guid.NewGuid();
+ newTileInfo.Title = "Copy of " + newTileInfo.Title;
+ newTileInfo.Position = new Point(-1, -1);
+
+ if (newTileInfo.IsGroup)
+ {
+ foreach (var subItem in newTileInfo.Items ?? new List
- ())
+ {
+ subItem.Id = Guid.NewGuid();
+
+ subItem.ResolvePaths();
+ }
+ }
+ else
+ {
+ newTileInfo.ResolvePaths();
+ }
+
+ return newTileInfo;
+ }
+
+ public void Load(App3Options.Item model)
+ {
+ this.Title = model.Title;
+ this.TargetPath = model.ProcessFilename;
+ this.Argument = model.ProcessArgument;
+ this.StartPath = model.ProcessWorkingDirectory;
+ this.WindowStyle = model.ProcessWindowStyle;
+ this.RunAsAdmin = model.ProcessAsAdmin;
+ this.Position = model.Position;
+ this.IsGroup = model.IsGroup;
+ this.Items = model.Items.Select(x => Item.Create(x))?.ToList() ?? new List
- ();
+ }
+
+ public void Load(Item model)
+ {
+ this.Title = model.Title;
+ this.TargetPath = model.TargetPath;
+ this.Argument = model.Argument;
+ this.StartPath = model.StartPath;
+ this.WindowStyle = model.WindowStyle;
+ this.RunAsAdmin = model.RunAsAdmin;
+ this.Position = model.Position;
+ this.IsGroup = model.IsGroup;
+
+ this.Items = model.Items ?? new List
- ();
+
+ this.ResolvedTargetPath = model.ResolvedTargetPath;
+ this.ResolvedStartPath = model.ResolvedStartPath;
+ this.ResolvedArgument = model.ResolvedArgument;
+
+ this.ResolvePaths();
+ }
+
+ public void ResolvePaths()
+ {
+ if (this.IsGroup)
+ {
+ foreach (var subItem in this.Items ?? new List
- ())
+ {
+ subItem.ResolvePaths();
+ }
+ }
+ else
+ {
+ this.ResolvedTargetPath = RyzStudio.IO.File.ResolvePath(this.TargetPath);
+ this.ResolvedArgument = RyzStudio.IO.File.ResolvePath(this.Argument);
+ this.ResolvedStartPath = RyzStudio.IO.File.ResolvePath(this.StartPath);
+ }
+ }
+
+
+ public override string ToString()
+ {
+ return this.Title?.Trim() ?? string.Empty;
+ }
+
+ }
+
+
+ public new int FileVersion { get; set; } = 4;
+
+ public List Groups { get; set; } = new List();
+
+ public void Load(App3Options options)
+ {
+ this.TilesPerRow = options.TilesPerRow;
+ this.ShowBigIcons = options.ShowBigIcons;
+ this.ShowToggleHotkey = options.ShowToggleHotkey;
+ this.HideOnClose = options.HideOnClose;
+ this.HideOnExecute = options.HideOnExecute;
+ this.AlwaysOnTop = options.AlwaysOnTop;
+ this.StartPosition = options.StartPosition;
+ this.Height = options.Height;
+
+ foreach (var group in options.Groups)
+ {
+ var newGroup = new Group()
+ {
+ Title = group.Title,
+ IsOpen = group.IsExpanded,
+ GridSize = group.GridSize
+ };
+
+ newGroup.Items = group.Items.Select(x => Item.Create(x))?.ToList() ?? new List
- ();
+
+ this.Groups.Add(newGroup);
+ }
+ }
+
+ public Item FindById(Guid id)
+ {
+ if (id == Guid.Empty)
+ {
+ return null;
+ }
+
+ foreach (var group in this.Groups)
+ {
+ foreach (var item in group.Items)
+ {
+ if (item.Id == id)
+ {
+ return item;
+ }
+
+ if (item.IsGroup)
+ {
+ foreach (var subItem in item.Items)
+ {
+ if (subItem.Id == id)
+ {
+ return subItem;
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ //public bool Update(Item value)
+ //{
+ // var result = this.FindById(value.Id);
+ // if (result == null)
+ // {
+ // return false;
+ // }
+
+ // result.Load(value);
+
+ // return true;
+ //}
+
+ public bool Remove(Guid id)
+ {
+ if (id == Guid.Empty)
+ {
+ return false;
+ }
+
+ foreach (var group in this.Groups)
+ {
+ foreach (var item in group.Items)
+ {
+ if (item.Id == id)
+ {
+ return group.Items.Remove(item);
+ }
+
+ if (item.IsGroup)
+ {
+ foreach (var subItem in item.Items)
+ {
+ if (subItem.Id == id)
+ {
+ return item.Items.Remove(subItem);
+ }
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Models/AppOptions.cs b/Models/SaveFile/AppOptionsBase.cs
similarity index 58%
rename from Models/AppOptions.cs
rename to Models/SaveFile/AppOptionsBase.cs
index afd46e7..cf60c20 100644
--- a/Models/AppOptions.cs
+++ b/Models/SaveFile/AppOptionsBase.cs
@@ -1,11 +1,12 @@
-using System.Collections.Generic;
-using System.Drawing;
+using System.Drawing;
-namespace RokettoLaunch.Models
+namespace RokettoLaunch.Models.SaveFile
{
- public class AppOptions
+ public class AppOptionsBase
{
- public int TilesPerRow { get; set; } = 8;
+ public int FileVersion { get; set; } = 0;
+
+ public int TilesPerRow { get; set; } = 6;
public bool ShowBigIcons { get; set; } = true;
@@ -17,11 +18,10 @@ namespace RokettoLaunch.Models
public bool AlwaysOnTop { get; set; } = false;
- public List Groups { get; set; } = new List();
-
public Point StartPosition { get; set; } = Point.Empty;
- public int Height { get; set; } = 280;
+ public int Width { get; set; } = 0;
+ public int Height { get; set; } = 320;
}
}
\ No newline at end of file
diff --git a/Models/TileGroupModel.cs b/Models/TileGroupModel.cs
deleted file mode 100644
index d5e25ef..0000000
--- a/Models/TileGroupModel.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System.Collections.Generic;
-using System.Drawing;
-using System.Text.Json.Serialization;
-
-namespace RokettoLaunch.Models
-{
- public class TileGroupModel
- {
- public string Title { get; set; }
-
- public bool IsExpanded { get; set; } = false;
-
- public List Items { get; set; } = new List();
-
- [JsonConverter(typeof(RyzStudio.Text.Json.JsonSizeConverter))]
- public Size GridSize { get; set; } = new Size(0, 0);
-
- }
-}
\ No newline at end of file
diff --git a/Models/TileModel.cs b/Models/TileModel.cs
deleted file mode 100644
index b70d6a6..0000000
--- a/Models/TileModel.cs
+++ /dev/null
@@ -1,259 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Drawing;
-using System.Text.Json.Serialization;
-
-namespace RokettoLaunch.Models
-{
- public class TileModel
- {
- public string Title { get; set; }
-
- public string ProcessFilename { get; set; }
-
- public string ProcessArgument { get; set; }
-
- public string ProcessWorkingDirectory { get; set; }
-
- public ProcessWindowStyle ProcessWindowStyle { get; set; } = ProcessWindowStyle.Normal;
-
- public bool ProcessAsAdmin { get; set; } = false;
-
- [JsonConverter(typeof(RyzStudio.Text.Json.JsonPointConverter))]
- public Point Position { get; set; }
-
- public bool IsGroup { get; set; } = false;
-
- public List Items { get; set; } = new List();
-
- public string Version { get; set; }
-
-
- public override string ToString() => this.Title ?? string.Empty;
-
-
- [JsonIgnore]
- public string CleanProcessFilename
- {
- get
- {
- return (string.IsNullOrWhiteSpace(this.ProcessFilename) ? string.Empty : ResolvePath(this.ProcessFilename));
- }
- }
-
- [JsonIgnore]
- public string CleanProcessArgument
- {
- get
- {
- return (string.IsNullOrWhiteSpace(this.ProcessArgument) ? string.Empty : ResolvePath(this.ProcessArgument));
- }
- }
-
- [JsonIgnore]
- public string CleanProcessWorkingDirectory
- {
- get
- {
- return (string.IsNullOrWhiteSpace(this.ProcessWorkingDirectory) ? string.Empty : ResolvePath(this.ProcessWorkingDirectory));
- }
- }
-
-
- private Tuple SplitPath(string path, string needle)
- {
- if (string.IsNullOrWhiteSpace(path))
- {
- return null;
- }
-
- if (string.IsNullOrWhiteSpace(needle))
- {
- return null;
- }
-
- if (!path.Contains(needle))
- {
- return null;
- }
-
- string head = path.Substring(0, path.IndexOf(needle));
- string tail = path.Substring(path.IndexOf(needle) + needle.Length);
-
- return new Tuple(head, tail);
- }
-
- private string GetFirstPath(string value)
- {
- var parts = SplitPath(value, "%FIRST%");
- if (parts == null)
- {
- return null;
- }
-
- string[] dirList = new string[0];
-
- try
- {
- dirList = System.IO.Directory.GetDirectories(parts.Item1, "*", System.IO.SearchOption.TopDirectoryOnly);
- }
- catch
- {
- // do nothing
- }
-
- if (dirList.Length <= 0)
- {
- return null;
- }
-
- return System.IO.Path.GetFileName(dirList[0]);
- }
-
- private string GetLastPath(string value)
- {
- var parts = SplitPath(value, "%LAST%");
- if (parts == null)
- {
- return null;
- }
-
- string[] dirList = new string[0];
-
- try
- {
- dirList = System.IO.Directory.GetDirectories(parts.Item1, "*", System.IO.SearchOption.TopDirectoryOnly);
- }
- catch
- {
- // do nothing
- }
-
- if (dirList.Length <= 0)
- {
- return null;
- }
-
- return System.IO.Path.GetFileName(dirList[(dirList.Length - 1)]);
- }
-
- private string ResolvePath(string path)
- {
- var result = Environment.ExpandEnvironmentVariables(path);
-
- if (result.Contains("%FIRST%"))
- {
- result = ResolveFirstPath(result);
- }
-
- if (result.Contains("%LAST%"))
- {
- result = ResolveLastPath(result);
- }
-
- return result;
- }
-
- private string ResolveFirstPath(string value)
- {
- var parts = SplitPath(value, "%FIRST%");
- if (parts == null)
- {
- return value;
- }
-
- try
- {
- if (!System.IO.Directory.Exists(parts.Item1))
- {
- return value;
- }
- }
- catch (Exception)
- {
- return value;
- }
-
- // Try cached version
- if (!string.IsNullOrWhiteSpace(this.Version))
- {
- var filename = parts.Item1 + this.Version + parts.Item2;
-
- try
- {
- if (System.IO.File.Exists(filename))
- {
- return filename;
- }
- }
- catch (Exception)
- {
-
- }
- }
-
- // Resolve version
- var version = GetFirstPath(value);
- if (version == null)
- {
- return value;
- }
-
- this.Version = version;
-
- return parts.Item1 + version + parts.Item2;
- }
-
- private string ResolveLastPath(string value)
- {
- var parts = SplitPath(value, "%LAST%");
- if (parts == null)
- {
- return value;
- }
-
- try
- {
- if (!System.IO.Directory.Exists(parts.Item1))
- {
- return value;
- }
- }
- catch (Exception)
- {
- return value;
- }
-
- // Try cached version
- if (!string.IsNullOrWhiteSpace(this.Version))
- {
- var filename = parts.Item1 + this.Version + parts.Item2;
-
- try
- {
- if (System.IO.File.Exists(filename))
- {
- return filename;
- }
- }
- catch (Exception)
- {
-
- }
- }
-
- // Resolve version
- var version = GetLastPath(value);
- if (version == null)
- {
- return value;
- }
-
- this.Version = version;
-
- return parts.Item1 + version + parts.Item2;
- }
-
- }
-}
\ No newline at end of file
diff --git a/OptionsForm.cs b/OptionsForm.cs
index 40f1bcf..38b71fc 100644
--- a/OptionsForm.cs
+++ b/OptionsForm.cs
@@ -1,7 +1,6 @@
using System;
-using System.Linq;
using System.Windows.Forms;
-using RokettoLaunch.Models;
+using RokettoLaunch.Models.SaveFile;
using RyzStudio.Windows.Forms;
using RyzStudio.Windows.ThemedForms;
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
@@ -11,247 +10,153 @@ namespace RokettoLaunch
{
public class OptionsForm : Form
{
- private System.Windows.Forms.Label label1;
- private ThYesNoPickerBox yesNoPickerBox2;
- private System.Windows.Forms.Label label6;
- private ThYesNoPickerBox yesNoPickerBox3;
- private System.Windows.Forms.Label label7;
- private ThKeyCodeTextBox textBox1;
- private ThNumericBox numericBox1;
- private Label label4;
- private FlowLayoutPanel flowLayoutPanel1;
- private TTogglePanel tTogglePanel1;
- private TTogglePanel tTogglePanel2;
- private ThYesNoPickerBox yesNoPickerBox1;
- private Label label2;
- private ThYesNoPickerBox yesNoPickerBox4;
- private Label label3;
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
+ private FlowLayoutPanel flowLayoutPanel1;
+ private TTogglePanel togglePanel1;
+ private Label label2;
+ private Label label4;
+ private TTogglePanel togglePanel2;
+ private Label label3;
+ private Label label1;
+ private Label label6;
+ private Label label7;
+ private ThYesNoPickerBox yesNoPickerBox1;
+ private ThNumericBox numericBox1;
+ private ThYesNoPickerBox yesNoPickerBox4;
+ private ThKeyCodeTextBox textBox1;
+ private ThYesNoPickerBox yesNoPickerBox2;
+ private ThYesNoPickerBox yesNoPickerBox3;
+ private TTogglePanel togglePanel3;
+
+ private App4Options _appSession = null;
- private AppOptions _appSession = null;
-
-
- public OptionsForm(AppOptions appSession)
+ public OptionsForm(App4Options appSession)
{
InitializeComponent();
- UISetup.Dialog(this);
+ UISetup.Dialog(this, true);
+ UISetup.AutoSizeChildren(flowLayoutPanel1);
_appSession = appSession;
numericBox1.Minimum = 4;
numericBox1.Maximum = 24;
+ }
- if (_appSession != null)
- {
- numericBox1.Value = _appSession.TilesPerRow;
- yesNoPickerBox1.Value = _appSession.ShowBigIcons;
- textBox1.UpdateKeyCode(_appSession?.ShowToggleHotkey ?? new ThKeyCodeTextBox.Results());
- yesNoPickerBox2.Value = _appSession.HideOnClose;
- yesNoPickerBox3.Value = _appSession.HideOnExecute;
- yesNoPickerBox4.Value = _appSession.AlwaysOnTop;
- }
+ protected override void OnShown(EventArgs e)
+ {
+ base.OnShown(e);
+
+ numericBox1.Value = _appSession?.TilesPerRow ?? 4;
+ yesNoPickerBox1.Value = _appSession?.ShowBigIcons ?? true;
+ textBox1.UpdateKeyCode(_appSession?.ShowToggleHotkey ?? new ThKeyCodeTextBox.Results());
+ yesNoPickerBox4.Value = _appSession?.AlwaysOnTop ?? true;
+ yesNoPickerBox2.Value = _appSession?.HideOnClose ?? true;
+ yesNoPickerBox3.Value = _appSession?.HideOnExecute ?? true;
}
private void InitializeComponent()
{
ThKeyCodeTextBox.Results results1 = new ThKeyCodeTextBox.Results();
- label1 = new Label();
- yesNoPickerBox2 = new ThYesNoPickerBox();
- label6 = new Label();
- yesNoPickerBox3 = new ThYesNoPickerBox();
- label7 = new Label();
- textBox1 = new ThKeyCodeTextBox();
- numericBox1 = new ThNumericBox();
- label4 = new Label();
- flowLayoutPanel1 = new FlowLayoutPanel();
- tTogglePanel1 = new TTogglePanel();
- yesNoPickerBox1 = new ThYesNoPickerBox();
- label2 = new Label();
- tTogglePanel2 = new TTogglePanel();
- yesNoPickerBox4 = new ThYesNoPickerBox();
- label3 = new Label();
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
+ flowLayoutPanel1 = new FlowLayoutPanel();
+ togglePanel1 = new TTogglePanel();
+ yesNoPickerBox1 = new ThYesNoPickerBox();
+ numericBox1 = new ThNumericBox();
+ label2 = new Label();
+ label4 = new Label();
+ togglePanel2 = new TTogglePanel();
+ label6 = new Label();
+ yesNoPickerBox4 = new ThYesNoPickerBox();
+ textBox1 = new ThKeyCodeTextBox();
+ yesNoPickerBox2 = new ThYesNoPickerBox();
+ label3 = new Label();
+ label1 = new Label();
+ togglePanel3 = new TTogglePanel();
+ label7 = new Label();
+ yesNoPickerBox3 = new ThYesNoPickerBox();
flowLayoutPanel1.SuspendLayout();
- tTogglePanel1.SuspendLayout();
- tTogglePanel2.SuspendLayout();
+ togglePanel1.SuspendLayout();
+ togglePanel2.SuspendLayout();
+ togglePanel3.SuspendLayout();
SuspendLayout();
//
- // label1
+ // dialogFooter1
//
- label1.AutoSize = true;
- label1.BackColor = System.Drawing.Color.Transparent;
- label1.ForeColor = System.Drawing.SystemColors.ControlText;
- label1.Location = new System.Drawing.Point(1, 22);
- label1.Margin = new Padding(0);
- label1.Name = "label1";
- label1.Padding = new Padding(0, 8, 0, 0);
- label1.Size = new System.Drawing.Size(115, 23);
- label1.TabIndex = 153;
- label1.Text = "Show Toggle Hotkey";
- label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // yesNoPickerBox2
- //
- yesNoPickerBox2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
- yesNoPickerBox2.BackColor = System.Drawing.Color.Transparent;
- yesNoPickerBox2.EnableReactiveVisual = true;
- yesNoPickerBox2.Font = new System.Drawing.Font("Segoe UI", 9F);
- yesNoPickerBox2.Location = new System.Drawing.Point(307, 63);
- yesNoPickerBox2.Name = "yesNoPickerBox2";
- yesNoPickerBox2.Padding = new Padding(4, 4, 3, 3);
- yesNoPickerBox2.SelectedIndex = 1;
- yesNoPickerBox2.Size = new System.Drawing.Size(84, 34);
- yesNoPickerBox2.TabIndex = 183;
- yesNoPickerBox2.TabStop = false;
- yesNoPickerBox2.Value = true;
- //
- // label6
- //
- label6.AutoSize = true;
- label6.BackColor = System.Drawing.Color.Transparent;
- label6.ForeColor = System.Drawing.SystemColors.ControlText;
- label6.Location = new System.Drawing.Point(1, 63);
- label6.Margin = new Padding(0);
- label6.Name = "label6";
- label6.Padding = new Padding(0, 8, 0, 0);
- label6.Size = new System.Drawing.Size(83, 23);
- label6.TabIndex = 182;
- label6.Text = "Hide On Close";
- label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // yesNoPickerBox3
- //
- yesNoPickerBox3.Anchor = AnchorStyles.Top | AnchorStyles.Right;
- yesNoPickerBox3.BackColor = System.Drawing.Color.Transparent;
- yesNoPickerBox3.EnableReactiveVisual = true;
- yesNoPickerBox3.Font = new System.Drawing.Font("Segoe UI", 9F);
- yesNoPickerBox3.Location = new System.Drawing.Point(307, 107);
- yesNoPickerBox3.Name = "yesNoPickerBox3";
- yesNoPickerBox3.Padding = new Padding(4, 4, 3, 3);
- yesNoPickerBox3.SelectedIndex = 1;
- yesNoPickerBox3.Size = new System.Drawing.Size(84, 34);
- yesNoPickerBox3.TabIndex = 185;
- yesNoPickerBox3.TabStop = false;
- yesNoPickerBox3.Value = true;
- //
- // label7
- //
- label7.AutoSize = true;
- label7.BackColor = System.Drawing.Color.Transparent;
- label7.ForeColor = System.Drawing.SystemColors.ControlText;
- label7.Location = new System.Drawing.Point(1, 107);
- label7.Margin = new Padding(0);
- label7.Name = "label7";
- label7.Padding = new Padding(0, 8, 0, 0);
- label7.Size = new System.Drawing.Size(95, 23);
- label7.TabIndex = 184;
- label7.Text = "Hide On Execute";
- label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // textBox1
- //
- textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
- textBox1.BackColor = System.Drawing.Color.Transparent;
- textBox1.EnableReactiveVisual = true;
- textBox1.Font = new System.Drawing.Font("Segoe UI", 9F);
- textBox1.Icon = "O";
- textBox1.IconSize = 13F;
- results1.IsAlt = false;
- results1.IsCtrl = false;
- results1.IsShift = false;
- results1.Key = Keys.None;
- textBox1.KeyCodeResults = results1;
- textBox1.Location = new System.Drawing.Point(192, 21);
- textBox1.Name = "textBox1";
- textBox1.Padding = new Padding(4, 4, 3, 3);
- textBox1.Size = new System.Drawing.Size(199, 32);
- textBox1.TabIndex = 189;
- textBox1.TabStop = false;
- textBox1.UseSystemPasswordChar = false;
- //
- // numericBox1
- //
- numericBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
- numericBox1.BackColor = System.Drawing.Color.Transparent;
- numericBox1.EnableReactiveVisual = true;
- numericBox1.Font = new System.Drawing.Font("Segoe UI", 9F);
- numericBox1.Location = new System.Drawing.Point(252, 22);
- numericBox1.Maximum = 100;
- numericBox1.Minimum = 1;
- numericBox1.Name = "numericBox1";
- numericBox1.Padding = new Padding(4, 4, 3, 3);
- numericBox1.Size = new System.Drawing.Size(139, 32);
- numericBox1.TabIndex = 192;
- numericBox1.TabStop = false;
- numericBox1.Value = 1;
- //
- // label4
- //
- label4.AutoSize = true;
- label4.BackColor = System.Drawing.Color.Transparent;
- label4.ForeColor = System.Drawing.SystemColors.ControlText;
- label4.Location = new System.Drawing.Point(1, 22);
- label4.Margin = new Padding(0);
- label4.Name = "label4";
- label4.Padding = new Padding(0, 8, 0, 0);
- label4.Size = new System.Drawing.Size(76, 23);
- label4.TabIndex = 193;
- label4.Text = "Tiles Per Row";
- label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
+ dialogFooter1.Dock = DockStyle.Bottom;
+ dialogFooter1.EnableMovable = false;
+ dialogFooter1.IsBusy = false;
+ dialogFooter1.Location = new System.Drawing.Point(0, 451);
+ dialogFooter1.Name = "dialogFooter1";
+ dialogFooter1.Size = new System.Drawing.Size(444, 70);
+ dialogFooter1.TabIndex = 0;
+ dialogFooter1.TabStop = false;
//
// flowLayoutPanel1
//
- flowLayoutPanel1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
flowLayoutPanel1.AutoScroll = true;
flowLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
- flowLayoutPanel1.Controls.Add(tTogglePanel1);
- flowLayoutPanel1.Controls.Add(tTogglePanel2);
+ flowLayoutPanel1.Controls.Add(togglePanel1);
+ flowLayoutPanel1.Controls.Add(togglePanel2);
+ flowLayoutPanel1.Controls.Add(togglePanel3);
+ flowLayoutPanel1.Dock = DockStyle.Fill;
flowLayoutPanel1.FlowDirection = FlowDirection.TopDown;
- flowLayoutPanel1.Location = new System.Drawing.Point(8, 12);
+ flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
flowLayoutPanel1.Name = "flowLayoutPanel1";
- flowLayoutPanel1.Size = new System.Drawing.Size(436, 412);
- flowLayoutPanel1.TabIndex = 194;
+ flowLayoutPanel1.Padding = new Padding(10, 0, 0, 0);
+ flowLayoutPanel1.Size = new System.Drawing.Size(444, 451);
+ flowLayoutPanel1.TabIndex = 195;
flowLayoutPanel1.WrapContents = false;
- flowLayoutPanel1.Resize += flowLayoutPanel1_Resize;
//
- // tTogglePanel1
+ // togglePanel1
//
- tTogglePanel1.AutoScrollMargin = new System.Drawing.Size(0, 0);
- tTogglePanel1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
- tTogglePanel1.Controls.Add(yesNoPickerBox1);
- tTogglePanel1.Controls.Add(label2);
- tTogglePanel1.Controls.Add(label4);
- tTogglePanel1.Controls.Add(numericBox1);
- tTogglePanel1.ExpandedHeight = 119;
- tTogglePanel1.ForeColor = System.Drawing.Color.FromArgb(99, 105, 119);
- tTogglePanel1.HeaderPadding = new Padding(4, 0, 0, 2);
- tTogglePanel1.IsOpen = true;
- tTogglePanel1.Location = new System.Drawing.Point(0, 0);
- tTogglePanel1.Margin = new Padding(0);
- tTogglePanel1.Name = "tTogglePanel1";
- tTogglePanel1.Padding = new Padding(0, 22, 0, 0);
- tTogglePanel1.Size = new System.Drawing.Size(401, 119);
- tTogglePanel1.TabIndex = 0;
- tTogglePanel1.Title = "Appearance";
- tTogglePanel1.TitleContextMenuStrip = null;
- tTogglePanel1.TitleCursor = Cursors.Default;
+ togglePanel1.BackColor = System.Drawing.Color.FromArgb(252, 252, 252);
+ togglePanel1.CloseIcon = "H";
+ togglePanel1.Controls.Add(yesNoPickerBox1);
+ togglePanel1.Controls.Add(numericBox1);
+ togglePanel1.Controls.Add(label2);
+ togglePanel1.Controls.Add(label4);
+ togglePanel1.EnableMovable = false;
+ togglePanel1.ExpandedHeight = 103;
+ togglePanel1.HeaderPadding = new Padding(4, 0, 0, 2);
+ togglePanel1.IconWidth = 20;
+ togglePanel1.Location = new System.Drawing.Point(10, 0);
+ togglePanel1.Name = "togglePanel1";
+ togglePanel1.OpenIcon = "G";
+ togglePanel1.Size = new System.Drawing.Size(401, 103);
+ togglePanel1.TabIndex = 0;
+ togglePanel1.Title = "Appearance";
+ togglePanel1.TitleContextMenuStrip = null;
+ togglePanel1.TitleCursor = Cursors.Default;
//
// yesNoPickerBox1
//
yesNoPickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
yesNoPickerBox1.BackColor = System.Drawing.Color.Transparent;
- yesNoPickerBox1.EnableReactiveVisual = true;
- yesNoPickerBox1.Font = new System.Drawing.Font("Segoe UI", 9F);
- yesNoPickerBox1.Location = new System.Drawing.Point(307, 64);
+ yesNoPickerBox1.EnableMovable = false;
+ yesNoPickerBox1.Location = new System.Drawing.Point(311, 61);
yesNoPickerBox1.Name = "yesNoPickerBox1";
- yesNoPickerBox1.Padding = new Padding(4, 4, 3, 3);
- yesNoPickerBox1.SelectedIndex = 1;
- yesNoPickerBox1.Size = new System.Drawing.Size(84, 34);
- yesNoPickerBox1.TabIndex = 195;
+ yesNoPickerBox1.SelectedIndex = 0;
+ yesNoPickerBox1.Size = new System.Drawing.Size(80, 32);
+ yesNoPickerBox1.TabIndex = 197;
yesNoPickerBox1.TabStop = false;
- yesNoPickerBox1.Value = true;
+ yesNoPickerBox1.Value = false;
+ //
+ // numericBox1
+ //
+ numericBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
+ numericBox1.BackColor = System.Drawing.Color.Transparent;
+ numericBox1.EnableMovable = false;
+ numericBox1.Location = new System.Drawing.Point(251, 19);
+ numericBox1.Maximum = 100;
+ numericBox1.Minimum = 1;
+ numericBox1.Name = "numericBox1";
+ numericBox1.Size = new System.Drawing.Size(140, 32);
+ numericBox1.TabIndex = 196;
+ numericBox1.TabStop = false;
+ numericBox1.Value = 1;
//
// label2
//
@@ -267,53 +172,108 @@ namespace RokettoLaunch
label2.Text = "Show Big Icons";
label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
- // tTogglePanel2
+ // label4
//
- tTogglePanel2.AutoScrollMargin = new System.Drawing.Size(0, 0);
- tTogglePanel2.AutoScrollMinSize = new System.Drawing.Size(0, 0);
- tTogglePanel2.Controls.Add(yesNoPickerBox4);
- tTogglePanel2.Controls.Add(label3);
- tTogglePanel2.Controls.Add(label1);
- tTogglePanel2.Controls.Add(textBox1);
- tTogglePanel2.Controls.Add(yesNoPickerBox2);
- tTogglePanel2.Controls.Add(yesNoPickerBox3);
- tTogglePanel2.Controls.Add(label6);
- tTogglePanel2.Controls.Add(label7);
- tTogglePanel2.ExpandedHeight = 206;
- tTogglePanel2.ForeColor = System.Drawing.Color.FromArgb(99, 105, 119);
- tTogglePanel2.HeaderPadding = new Padding(4, 0, 0, 2);
- tTogglePanel2.IsOpen = true;
- tTogglePanel2.Location = new System.Drawing.Point(0, 119);
- tTogglePanel2.Margin = new Padding(0);
- tTogglePanel2.Name = "tTogglePanel2";
- tTogglePanel2.Padding = new Padding(0, 22, 0, 0);
- tTogglePanel2.Size = new System.Drawing.Size(401, 206);
- tTogglePanel2.TabIndex = 1;
- tTogglePanel2.Title = "Behaviour";
- tTogglePanel2.TitleContextMenuStrip = null;
- tTogglePanel2.TitleCursor = Cursors.Default;
+ label4.AutoSize = true;
+ label4.BackColor = System.Drawing.Color.Transparent;
+ label4.ForeColor = System.Drawing.SystemColors.ControlText;
+ label4.Location = new System.Drawing.Point(1, 22);
+ label4.Margin = new Padding(0);
+ label4.Name = "label4";
+ label4.Padding = new Padding(0, 8, 0, 0);
+ label4.Size = new System.Drawing.Size(76, 23);
+ label4.TabIndex = 193;
+ label4.Text = "Tiles Per Row";
+ label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // togglePanel2
+ //
+ togglePanel2.BackColor = System.Drawing.Color.FromArgb(252, 252, 252);
+ togglePanel2.CloseIcon = "H";
+ togglePanel2.Controls.Add(label6);
+ togglePanel2.Controls.Add(yesNoPickerBox4);
+ togglePanel2.Controls.Add(textBox1);
+ togglePanel2.Controls.Add(yesNoPickerBox2);
+ togglePanel2.Controls.Add(label3);
+ togglePanel2.Controls.Add(label1);
+ togglePanel2.EnableMovable = false;
+ togglePanel2.ExpandedHeight = 148;
+ togglePanel2.HeaderPadding = new Padding(4, 0, 0, 2);
+ togglePanel2.IconWidth = 20;
+ togglePanel2.Location = new System.Drawing.Point(10, 113);
+ togglePanel2.Name = "togglePanel2";
+ togglePanel2.OpenIcon = "G";
+ togglePanel2.Size = new System.Drawing.Size(401, 148);
+ togglePanel2.TabIndex = 1;
+ togglePanel2.Title = "Behaviour";
+ togglePanel2.TitleContextMenuStrip = null;
+ togglePanel2.TitleCursor = Cursors.Default;
+ //
+ // label6
+ //
+ label6.AutoSize = true;
+ label6.BackColor = System.Drawing.Color.Transparent;
+ label6.ForeColor = System.Drawing.SystemColors.ControlText;
+ label6.Location = new System.Drawing.Point(1, 106);
+ label6.Margin = new Padding(0);
+ label6.Name = "label6";
+ label6.Padding = new Padding(0, 8, 0, 0);
+ label6.Size = new System.Drawing.Size(116, 23);
+ label6.TabIndex = 182;
+ label6.Text = "Close To System Tray";
+ label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// yesNoPickerBox4
//
yesNoPickerBox4.Anchor = AnchorStyles.Top | AnchorStyles.Right;
yesNoPickerBox4.BackColor = System.Drawing.Color.Transparent;
- yesNoPickerBox4.EnableReactiveVisual = true;
- yesNoPickerBox4.Font = new System.Drawing.Font("Segoe UI", 9F);
- yesNoPickerBox4.Location = new System.Drawing.Point(307, 151);
+ yesNoPickerBox4.EnableMovable = false;
+ yesNoPickerBox4.Location = new System.Drawing.Point(311, 64);
yesNoPickerBox4.Name = "yesNoPickerBox4";
- yesNoPickerBox4.Padding = new Padding(4, 4, 3, 3);
- yesNoPickerBox4.SelectedIndex = 1;
- yesNoPickerBox4.Size = new System.Drawing.Size(84, 34);
- yesNoPickerBox4.TabIndex = 191;
+ yesNoPickerBox4.SelectedIndex = 0;
+ yesNoPickerBox4.Size = new System.Drawing.Size(80, 32);
+ yesNoPickerBox4.TabIndex = 195;
yesNoPickerBox4.TabStop = false;
- yesNoPickerBox4.Value = true;
+ yesNoPickerBox4.Value = false;
+ //
+ // textBox1
+ //
+ textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+ textBox1.BackColor = System.Drawing.Color.Transparent;
+ textBox1.EnableMovable = false;
+ textBox1.Icon = "O";
+ textBox1.IconSize = 13F;
+ results1.IsAlt = false;
+ results1.IsCtrl = false;
+ results1.IsShift = false;
+ results1.Key = Keys.None;
+ textBox1.KeyCodeResults = results1;
+ textBox1.Location = new System.Drawing.Point(211, 22);
+ textBox1.Name = "textBox1";
+ textBox1.Size = new System.Drawing.Size(180, 32);
+ textBox1.TabIndex = 194;
+ textBox1.TabStop = false;
+ textBox1.UseSystemPasswordChar = false;
+ //
+ // yesNoPickerBox2
+ //
+ yesNoPickerBox2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
+ yesNoPickerBox2.BackColor = System.Drawing.Color.Transparent;
+ yesNoPickerBox2.EnableMovable = false;
+ yesNoPickerBox2.Location = new System.Drawing.Point(311, 106);
+ yesNoPickerBox2.Name = "yesNoPickerBox2";
+ yesNoPickerBox2.SelectedIndex = 0;
+ yesNoPickerBox2.Size = new System.Drawing.Size(80, 32);
+ yesNoPickerBox2.TabIndex = 192;
+ yesNoPickerBox2.TabStop = false;
+ yesNoPickerBox2.Value = false;
//
// label3
//
label3.AutoSize = true;
label3.BackColor = System.Drawing.Color.Transparent;
label3.ForeColor = System.Drawing.SystemColors.ControlText;
- label3.Location = new System.Drawing.Point(1, 151);
+ label3.Location = new System.Drawing.Point(1, 64);
label3.Margin = new Padding(0);
label3.Name = "label3";
label3.Padding = new Padding(0, 8, 0, 0);
@@ -322,16 +282,65 @@ namespace RokettoLaunch
label3.Text = "Always On Top";
label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
- // dialogFooter1
+ // label1
//
- dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
- dialogFooter1.Button1Text = "&Save";
- dialogFooter1.Dialog = this;
- dialogFooter1.Dock = DockStyle.Bottom;
- dialogFooter1.IsBusy = false;
- dialogFooter1.Location = new System.Drawing.Point(0, 437);
- dialogFooter1.Name = "dialogFooter1";
- dialogFooter1.Size = new System.Drawing.Size(444, 84);
+ label1.AutoSize = true;
+ label1.BackColor = System.Drawing.Color.Transparent;
+ label1.ForeColor = System.Drawing.SystemColors.ControlText;
+ label1.Location = new System.Drawing.Point(1, 22);
+ label1.Margin = new Padding(0);
+ label1.Name = "label1";
+ label1.Padding = new Padding(0, 8, 0, 0);
+ label1.Size = new System.Drawing.Size(115, 23);
+ label1.TabIndex = 153;
+ label1.Text = "Show Toggle Hotkey";
+ label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // togglePanel3
+ //
+ togglePanel3.BackColor = System.Drawing.Color.FromArgb(252, 252, 252);
+ togglePanel3.CloseIcon = "H";
+ togglePanel3.Controls.Add(label7);
+ togglePanel3.Controls.Add(yesNoPickerBox3);
+ togglePanel3.EnableMovable = false;
+ togglePanel3.ExpandedHeight = 64;
+ togglePanel3.HeaderPadding = new Padding(4, 0, 0, 2);
+ togglePanel3.IconWidth = 20;
+ togglePanel3.Location = new System.Drawing.Point(10, 271);
+ togglePanel3.Name = "togglePanel3";
+ togglePanel3.OpenIcon = "G";
+ togglePanel3.Size = new System.Drawing.Size(401, 64);
+ togglePanel3.TabIndex = 2;
+ togglePanel3.Title = "Action";
+ togglePanel3.TitleContextMenuStrip = null;
+ togglePanel3.TitleCursor = Cursors.Default;
+ //
+ // label7
+ //
+ label7.AutoSize = true;
+ label7.BackColor = System.Drawing.Color.Transparent;
+ label7.ForeColor = System.Drawing.SystemColors.ControlText;
+ label7.Location = new System.Drawing.Point(1, 22);
+ label7.Margin = new Padding(0);
+ label7.Name = "label7";
+ label7.Padding = new Padding(0, 8, 0, 0);
+ label7.Size = new System.Drawing.Size(95, 23);
+ label7.TabIndex = 184;
+ label7.Text = "Hide On Execute";
+ label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // yesNoPickerBox3
+ //
+ yesNoPickerBox3.Anchor = AnchorStyles.Top | AnchorStyles.Right;
+ yesNoPickerBox3.BackColor = System.Drawing.Color.Transparent;
+ yesNoPickerBox3.EnableMovable = false;
+ yesNoPickerBox3.Location = new System.Drawing.Point(311, 22);
+ yesNoPickerBox3.Name = "yesNoPickerBox3";
+ yesNoPickerBox3.SelectedIndex = 0;
+ yesNoPickerBox3.Size = new System.Drawing.Size(80, 32);
+ yesNoPickerBox3.TabIndex = 193;
+ yesNoPickerBox3.TabStop = false;
+ yesNoPickerBox3.Value = false;
//
// OptionsForm
//
@@ -339,52 +348,36 @@ namespace RokettoLaunch
AutoScaleMode = AutoScaleMode.Font;
BackColor = System.Drawing.Color.White;
ClientSize = new System.Drawing.Size(444, 521);
- Controls.Add(dialogFooter1);
Controls.Add(flowLayoutPanel1);
+ Controls.Add(dialogFooter1);
MinimumSize = new System.Drawing.Size(460, 560);
Name = "OptionsForm";
Text = "Options";
flowLayoutPanel1.ResumeLayout(false);
- tTogglePanel1.ResumeLayout(false);
- tTogglePanel1.PerformLayout();
- tTogglePanel2.ResumeLayout(false);
- tTogglePanel2.PerformLayout();
+ togglePanel1.ResumeLayout(false);
+ togglePanel1.PerformLayout();
+ togglePanel2.ResumeLayout(false);
+ togglePanel2.PerformLayout();
+ togglePanel3.ResumeLayout(false);
+ togglePanel3.PerformLayout();
ResumeLayout(false);
}
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
-
- flowLayoutPanel1_Resize(null, e);
- }
-
- private void flowLayoutPanel1_Resize(object sender, EventArgs e)
- {
- var width = flowLayoutPanel1.ClientRectangle.Width - SystemInformation.VerticalScrollBarWidth;
-
- foreach (var item in flowLayoutPanel1.Controls.OfType())
- {
- item.Width = width;
- }
- }
-
-
- public AppOptions Result
+ public App4Options Result
{
get
{
if (_appSession == null)
{
- _appSession = new AppOptions();
+ _appSession = new App4Options();
}
_appSession.TilesPerRow = numericBox1.Value;
_appSession.ShowBigIcons = yesNoPickerBox1.Value;
_appSession.ShowToggleHotkey = textBox1.KeyCodeResults;
+ _appSession.AlwaysOnTop = yesNoPickerBox4.Value;
_appSession.HideOnClose = yesNoPickerBox2.Value;
_appSession.HideOnExecute = yesNoPickerBox3.Value;
- _appSession.AlwaysOnTop = yesNoPickerBox4.Value;
return _appSession;
}
diff --git a/Program.cs b/Program.cs
index 9470017..fbc2799 100644
--- a/Program.cs
+++ b/Program.cs
@@ -1,5 +1,7 @@
using System;
using System.Windows.Forms;
+using Microsoft.Extensions.DependencyInjection;
+using RyzStudio.Windows.Forms;
namespace RokettoLaunch
{
@@ -11,10 +13,19 @@ namespace RokettoLaunch
[STAThread]
static void Main()
{
+ var services = new ServiceCollection();
+ services.AddSingleton();
+ services.AddTransient();
+ services.AddTransient();
+
+ var provider = services.BuildServiceProvider();
+
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new MainForm());
+ //Application.Run(new MainForm());
+
+ Application.Run(provider.GetRequiredService());
}
}
}
diff --git a/Resources/MainMenu/folder-minus.png b/Resources/MainMenu/folder-minus.png
new file mode 100644
index 0000000..655cfd8
Binary files /dev/null and b/Resources/MainMenu/folder-minus.png differ
diff --git a/Resources/MainMenu/folder-minus.svg b/Resources/MainMenu/folder-minus.svg
new file mode 100644
index 0000000..2d81d34
--- /dev/null
+++ b/Resources/MainMenu/folder-minus.svg
@@ -0,0 +1,54 @@
+
+
diff --git a/Resources/MainMenu/help-circle.png b/Resources/MainMenu/help-circle.png
new file mode 100644
index 0000000..fa87ded
Binary files /dev/null and b/Resources/MainMenu/help-circle.png differ
diff --git a/Resources/MainMenu/help-circle.svg b/Resources/MainMenu/help-circle.svg
new file mode 100644
index 0000000..88a6846
--- /dev/null
+++ b/Resources/MainMenu/help-circle.svg
@@ -0,0 +1,60 @@
+
+
diff --git a/Resources/MainMenu/plus.png b/Resources/MainMenu/plus.png
new file mode 100644
index 0000000..21c5be4
Binary files /dev/null and b/Resources/MainMenu/plus.png differ
diff --git a/Resources/MainMenu/plus.svg b/Resources/MainMenu/plus.svg
new file mode 100644
index 0000000..309770d
--- /dev/null
+++ b/Resources/MainMenu/plus.svg
@@ -0,0 +1,57 @@
+
+
diff --git a/Resources/MainMenu/save.png b/Resources/MainMenu/save.png
new file mode 100644
index 0000000..72dfc90
Binary files /dev/null and b/Resources/MainMenu/save.png differ
diff --git a/Resources/MainMenu/save.svg b/Resources/MainMenu/save.svg
new file mode 100644
index 0000000..19251ad
--- /dev/null
+++ b/Resources/MainMenu/save.svg
@@ -0,0 +1,55 @@
+
+
diff --git a/Resources/MainMenu/settings.png b/Resources/MainMenu/settings.png
new file mode 100644
index 0000000..e4e4b3a
Binary files /dev/null and b/Resources/MainMenu/settings.png differ
diff --git a/Resources/MainMenu/settings.svg b/Resources/MainMenu/settings.svg
new file mode 100644
index 0000000..bf8a9f0
--- /dev/null
+++ b/Resources/MainMenu/settings.svg
@@ -0,0 +1,53 @@
+
+
diff --git a/Resources/MainMenu/trash-2.png b/Resources/MainMenu/trash-2.png
new file mode 100644
index 0000000..f04f773
Binary files /dev/null and b/Resources/MainMenu/trash-2.png differ
diff --git a/Resources/MainMenu/trash-2.svg b/Resources/MainMenu/trash-2.svg
new file mode 100644
index 0000000..f4c5330
--- /dev/null
+++ b/Resources/MainMenu/trash-2.svg
@@ -0,0 +1,65 @@
+
+
diff --git a/RokettoLaunch.csproj b/RokettoLaunch.csproj
index 167a76d..f3d3df9 100644
--- a/RokettoLaunch.csproj
+++ b/RokettoLaunch.csproj
@@ -2,7 +2,7 @@
WinExe
- net8.0-windows8.0
+ net10.0-windows8.0
true
true
favicon.ico
@@ -14,7 +14,7 @@
Ray Lam
1.0.0.0
1.0.0.0
- 0.3.6.0604
+ 0.4.1.0202
False
x64
icon-128.png
@@ -79,16 +79,22 @@
-
-
+
+
+
-
True
True
AppResource.resx
+
+ Form
+
+
+ Form
+
diff --git a/Windows/Forms/TileLayoutPanel.cs b/Windows/Forms/TileLayoutPanel.cs
new file mode 100644
index 0000000..b1b4c84
--- /dev/null
+++ b/Windows/Forms/TileLayoutPanel.cs
@@ -0,0 +1,146 @@
+using System;
+using System.ComponentModel;
+using System.Drawing;
+using System.Windows.Forms;
+using RyzStudio.Windows.Forms;
+
+namespace RokettoLaunch.Windows.Forms
+{
+ public class TileLayoutPanel : System.Windows.Forms.TableLayoutPanel
+ {
+ public const int MIN_COLUMNS = 4;
+ public const int TILE_SIZE = 70;
+ public const int TILE_PADDING = 3;
+
+
+ public TileLayoutPanel() : base()
+ {
+ this.AllowDrop = true;
+ this.Margin = new Padding(0);
+ this.Padding = new Padding(0);
+ this.ColumnCount = 0;
+ this.RowCount = 0;
+ }
+
+ protected override void OnDragEnter(DragEventArgs e)
+ {
+ base.OnDragEnter(e);
+
+ if (e.Data.TryGetData(out var data))
+ {
+ e.Effect = DragDropEffects.Move;
+ }
+ }
+
+
+ [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public Guid GroupId { get; set; } = Guid.Empty;
+
+
+ public void AddTilePanel(TilePanel tilePanel, int x, int y)
+ {
+ UIControl.Add(this, tilePanel, x, y);
+ }
+
+ public void SetGridSize(Size gridSize)
+ {
+ this.SetGridWidth(gridSize.Width);
+ this.SetGridHeight(gridSize.Height);
+ }
+
+ public void SetGridWidth(int width)
+ {
+ width = Math.Max(MIN_COLUMNS, width);
+
+ var diffColumns = width - this.ColumnCount;
+ var tileWidth = (TILE_SIZE + TILE_PADDING);
+
+ UIControl.Invoke(this, (x) =>
+ {
+ this.ColumnCount = width;
+ this.Width = (width * tileWidth);
+
+ // Resize columns
+ if (diffColumns == 0)
+ {
+ // Do nothing
+ }
+ else if (diffColumns > 0)
+ {
+ for (var i = 0; i < diffColumns; i++)
+ {
+ this.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, tileWidth));
+ }
+ }
+ else
+ {
+ for (var i = 0; i < (diffColumns * -1); i++)
+ {
+ this.ColumnStyles.RemoveAt((this.ColumnStyles.Count - 1));
+ }
+ }
+
+ // Update column width
+ foreach (ColumnStyle column in this.ColumnStyles)
+ {
+ column.SizeType = SizeType.Absolute;
+ column.Width = tileWidth;
+ }
+ });
+ }
+
+ public void SetGridHeight(int height)
+ {
+ var diffRows = height - this.RowCount;
+ var tileHeight = (TILE_SIZE + TILE_PADDING);
+
+ UIControl.Invoke(this, (x) =>
+ {
+ this.RowCount = height;
+ this.Height = (height * tileHeight) + TILE_PADDING;
+
+ // Resize rows
+ if (diffRows == 0)
+ {
+ // Do nothing
+ }
+ else if (diffRows > 0)
+ {
+ for (var i = 0; i < diffRows; i++)
+ {
+ this.RowStyles.Add(new RowStyle(SizeType.Absolute, tileHeight));
+ }
+ }
+ else
+ {
+ for (var i = 0; i < (diffRows * -1); i++)
+ {
+ this.RowStyles.RemoveAt((this.RowStyles.Count - 1));
+ }
+ }
+
+ // Update row height
+ foreach (RowStyle row in this.RowStyles)
+ {
+ row.SizeType = SizeType.Absolute;
+ row.Height = tileHeight;
+ }
+ });
+ }
+
+ public Point GetCellFromPoint(Point point)
+ {
+ var width = this.ClientSize.Width;
+ var height = this.ClientSize.Height;
+
+ var x = (int)((float)point.X / width * this.ColumnCount);
+ var y = (int)((float)point.Y / height * this.RowCount);
+
+ x = Math.Max(0, Math.Min(this.ColumnCount - 1, x));
+ y = Math.Max(0, Math.Min(this.RowCount - 1, y));
+
+ return new Point(x, y);
+ }
+
+ }
+}
diff --git a/Windows/Forms/TilePanel.cs b/Windows/Forms/TilePanel.cs
index 460a428..af33696 100644
--- a/Windows/Forms/TilePanel.cs
+++ b/Windows/Forms/TilePanel.cs
@@ -1,16 +1,18 @@
using System;
+using System.Collections.Generic;
using System.ComponentModel;
-using System.Diagnostics;
using System.Drawing;
-using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
using System.Windows.Forms;
-using RokettoLaunch.Models;
-using RyzStudio.Windows.Forms;
namespace RokettoLaunch.Windows.Forms
{
public partial class TilePanel : RyzStudio.Windows.TileForms.Tile
{
+ public delegate Task OnFileDropEvent(TilePanel sender, Keys keys, List paths);
+
+
public TilePanel()
{
InitializeComponent();
@@ -20,16 +22,20 @@ namespace RokettoLaunch.Windows.Forms
this.Size = new Size(70, 70);
this.AutoScaleMode = AutoScaleMode.None;
- this.EnableMovable = true;
+ this.EnableMovable = false;
}
+ [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public Guid TileId { get; set; } = Guid.Empty;
- [Browsable(false)]
- public TileModel ModelInfo { get; protected set; } = new TileModel();
+ [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public bool IsGroup { get; set; } = false;
- public RyzStudio.Windows.TileForms.TileContainer TileContainer { get => UIControl.GetParentsUntil(this); }
+ [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public ContextMenuStrip TileContextMenu { get; set; }
- protected MainForm MainForm { get => UIControl.GetParentsUntil(this); }
+ [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public OnFileDropEvent OnFileDrop { get; set; }
protected override void OnDragOver(DragEventArgs e)
@@ -41,252 +47,31 @@ namespace RokettoLaunch.Windows.Forms
protected override void OnDragDrop(DragEventArgs e)
{
- string[] fileList = e.Data.GetData(DataFormats.FileDrop) as string[];
- fileList = fileList ?? new string[0];
+ var fileList = e.Data.GetData(DataFormats.FileDrop) as string[];
+ if (fileList == null)
+ {
+ return;
+ }
if (fileList.Length <= 0)
{
return;
}
- if (this.ModelInfo.IsGroup)
+ if (this.OnFileDrop != null)
{
- foreach (var item in fileList)
- {
- var model = GetTileModel(item);
- if (model == null)
- {
- continue;
- }
-
- this.ModelInfo.Items.Add(model);
- }
-
- InvalidateGroupMenu();
- }
- else
- {
- if (fileList.Length > 1)
- {
- var result = MessageBox.Show("Do you want to add this as a folder ?", "Convert to Folder", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
- if (result == DialogResult.Yes)
- {
- this.ModelInfo.Title = "New Folder";
- this.ModelInfo.IsGroup = true;
-
- foreach (var item in fileList)
- {
- var model = GetTileModel(item);
- if (model == null)
- {
- continue;
- }
-
- this.ModelInfo.Items.Add(model);
- }
-
- InvalidateGroupMenu();
- }
- else if (result == DialogResult.No)
- {
- LoadInfo(fileList[0]);
- }
- }
- else
- {
- LoadInfo(fileList[0]);
- }
+ this.OnFileDrop(this, Control.ModifierKeys, fileList.ToList());
}
}
- protected override void OnMouseClick(MouseEventArgs e)
+ protected override void OnMouseDown(MouseEventArgs e)
{
- if (Control.ModifierKeys == Keys.Control)
+ base.OnMouseDown(e);
+
+ if (Control.ModifierKeys == Keys.Control && e.Button == MouseButtons.Right)
{
- return;
+ this.DoDragDrop(this, DragDropEffects.Move);
}
-
- if (this.ModelInfo == null)
- {
- return;
- }
-
- if (e.Button == MouseButtons.Left)
- {
- if (this.ModelInfo.IsGroup)
- {
- var iconSize = ((this.MainForm?.CurrentSession?.ShowBigIcons ?? true) ? 24 : 16);
-
- this.LeftContextMenuStrip.ImageScalingSize = new Size(iconSize, iconSize);
-
- this.LeftContextMenuStrip?.Show(this, e.Location);
- }
- else
- {
- OnMouseDoubleClick(e);
- }
- }
- else if (e.Button == MouseButtons.Middle)
- {
- var mainForm = UIControl.GetParentsUntil(this);
- if (mainForm == null)
- {
- return;
- }
-
- if (this.ModelInfo.IsGroup)
- {
- var result = MessageBox.Show("Are you sure you want to duplicate tile?", "Duplicate Tile", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
- if (result != DialogResult.Yes)
- {
- return;
- }
- }
-
- mainForm.DuplicateTile(this);
- }
- }
-
- protected override void OnMouseDoubleClick(MouseEventArgs e)
- {
- base.OnMouseDoubleClick(e);
-
- if (Control.ModifierKeys == Keys.Control)
- {
- return;
- }
-
- if (e.Button == MouseButtons.Left)
- {
- Execute(this.ModelInfo);
- }
- }
-
-
- public void LoadInfo(TileModel model)
- {
- this.ModelInfo = model;
-
- InvalidateGroupMenu();
- }
-
- public void LoadInfo(string filename)
- {
- var model = GetTileModel(filename);
- if (model == null)
- {
- return;
- }
-
- LoadInfo(model);
- }
-
- private void Execute(TileModel model)
- {
- if (model == null)
- {
- return;
- }
-
- if (model.IsGroup)
- {
- return;
- }
-
- if (this.MainForm != null)
- {
- if (this.MainForm.CurrentSession?.HideOnExecute ?? true)
- {
- this.MainForm.Visible = false;
- }
- }
-
- RyzStudio.Diagnostics.Process.Execute(model.CleanProcessFilename, model.CleanProcessWorkingDirectory, model.CleanProcessArgument, model.ProcessWindowStyle, model.ProcessAsAdmin);
- }
-
- private void InvalidateGroupMenu()
- {
- this.Title = this.ModelInfo.Title;
- this.LargeIcon = (this.ModelInfo.IsGroup ? AppResource.folder_32 : RyzStudio.IO.File.GetIcon(this.ModelInfo.CleanProcessFilename));
-
- if (this.ModelInfo.IsGroup)
- {
- this.ModelInfo.ProcessFilename = "";
- this.ModelInfo.ProcessArgument = "";
- this.ModelInfo.ProcessAsAdmin = false;
- this.ModelInfo.ProcessWindowStyle = ProcessWindowStyle.Normal;
- this.ModelInfo.ProcessWorkingDirectory = "";
- this.ModelInfo.Version = "";
-
- if (this.LeftContextMenuStrip == null) this.LeftContextMenuStrip = new ContextMenuStrip();
- this.LeftContextMenuStrip.Items.Clear();
-
- foreach (var item in this.ModelInfo?.Items ?? new System.Collections.Generic.List())
- {
- ToolStripItem toolItem = this.LeftContextMenuStrip.Items.Add(item.Title);
- toolItem.Image = RyzStudio.IO.File.GetIcon(item.CleanProcessFilename);
- toolItem.Tag = item;
- toolItem.Click += (object sender, EventArgs e) =>
- {
- var menuItem = (System.Windows.Forms.ToolStripMenuItem)sender;
- if (menuItem == null)
- {
- return;
- }
-
- var model = (menuItem.Tag as TileModel);
- if (model == null)
- {
- return;
- }
-
- Execute(model);
- };
- }
- }
-
- toolTip1.SetToolTip(this, this.Title);
- }
-
- private TileModel GetTileModel(string filename)
- {
- if (string.IsNullOrWhiteSpace(filename))
- {
- return null;
- }
-
- TileModel model = new TileModel()
- {
- ProcessFilename = filename,
- Title = Path.GetFileName(filename)
- };
-
- // exe
- if (Path.GetExtension(filename).Equals(".exe", StringComparison.CurrentCultureIgnoreCase))
- {
- if (File.Exists(filename))
- {
- try
- {
- FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(filename);
- if (fvi != null)
- {
- model.Title = fvi.ProductName;
- }
- }
- catch
- {
- // do nothing
- }
- }
-
- if (string.IsNullOrWhiteSpace(model.Title))
- {
- model.Title = Path.GetFileNameWithoutExtension(filename);
- }
- }
-
- return model;
}
}
diff --git a/skye.sln b/skye.sln
index 4e11779..8b48949 100644
--- a/skye.sln
+++ b/skye.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.4.33205.214
+# Visual Studio Version 18
+VisualStudioVersion = 18.5.11723.231
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RokettoLaunch", "RokettoLaunch.csproj", "{4833FB27-0817-4720-A54B-180369B0C374}"
EndProject