Changed to upgrade nupkg
Added prompts for drag-drop on tiles Added drag-drop on tile layout container Changed drag icon for tile movement and file drop Changed to remove legacy TileContainer
This commit is contained in:
parent
810b129f94
commit
1b59a4cc29
@ -182,13 +182,13 @@ namespace RokettoLaunch.DTOs.SaveFile
|
|||||||
public string ResolvedStartPath { get; private set; }
|
public string ResolvedStartPath { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
public Item CopyOf()
|
public Item CopyOf(bool addPrefix = true)
|
||||||
{
|
{
|
||||||
var json = JsonSerializer.Serialize(this);
|
var json = JsonSerializer.Serialize(this);
|
||||||
|
|
||||||
var newTileInfo = JsonSerializer.Deserialize<Item>(json);
|
var newTileInfo = JsonSerializer.Deserialize<Item>(json);
|
||||||
newTileInfo.Id = Guid.NewGuid();
|
newTileInfo.Id = Guid.NewGuid();
|
||||||
newTileInfo.Title = "Copy of " + newTileInfo.Title;
|
newTileInfo.Title = (addPrefix ? "Copy of " : "") + newTileInfo.Title;
|
||||||
newTileInfo.Position = new Point(-1, -1);
|
newTileInfo.Position = new Point(-1, -1);
|
||||||
|
|
||||||
if (newTileInfo.IsGroup)
|
if (newTileInfo.IsGroup)
|
||||||
|
|||||||
@ -10,7 +10,7 @@ namespace RokettoLaunch.DTOs.SaveFile
|
|||||||
|
|
||||||
public bool ShowBigIcons { get; set; } = true;
|
public bool ShowBigIcons { get; set; } = true;
|
||||||
|
|
||||||
public RyzStudio.Windows.ThemedForms.ButtonTextBox.ThKeyCodeTextBox.Results ShowToggleHotkey { get; set; } = null;
|
public RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox.Results ShowToggleHotkey { get; set; } = null;
|
||||||
|
|
||||||
public bool HideOnClose { get; set; } = true;
|
public bool HideOnClose { get; set; } = true;
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ namespace RokettoLaunch.Forms
|
|||||||
public class CopyToTileForm : Form
|
public class CopyToTileForm : Form
|
||||||
{
|
{
|
||||||
private Label label1;
|
private Label label1;
|
||||||
private ThPickerBox pickerBox1;
|
private RyzStudio.Windows.ThemedForms.T3PickerBox pickerBox1;
|
||||||
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
|
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
|
||||||
|
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ namespace RokettoLaunch.Forms
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
UISetup.Dialog(this, true);
|
this.SetupDialog();
|
||||||
|
|
||||||
this.Text = "Copy To...";
|
this.Text = "Copy To...";
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ namespace RokettoLaunch.Forms
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
label1 = new Label();
|
label1 = new Label();
|
||||||
pickerBox1 = new ThPickerBox();
|
pickerBox1 = new RyzStudio.Windows.ThemedForms.T3PickerBox();
|
||||||
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
|
|||||||
@ -1,22 +1,18 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using RokettoLaunch.DTOs.SaveFile;
|
using RokettoLaunch.DTOs.SaveFile;
|
||||||
using RyzStudio.Windows.Forms;
|
using RyzStudio.Windows.Forms;
|
||||||
using RyzStudio.Windows.ThemedForms;
|
|
||||||
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
|
|
||||||
|
|
||||||
namespace RokettoLaunch.Forms
|
namespace RokettoLaunch.Forms
|
||||||
{
|
{
|
||||||
public class EditFolderForm : Form
|
public class EditFolderForm : Form
|
||||||
{
|
{
|
||||||
private Label label1;
|
private Label label1;
|
||||||
private ThClearableTextBox textBox1;
|
private RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox textBox1;
|
||||||
private ThListBox listBox1;
|
private RyzStudio.Windows.ThemedForms.T3ListBox listBox1;
|
||||||
private Label label2;
|
private Label label2;
|
||||||
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
|
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
|
||||||
|
|
||||||
@ -28,7 +24,7 @@ namespace RokettoLaunch.Forms
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
UISetup.Dialog(this, true);
|
this.SetupDialog();
|
||||||
|
|
||||||
this.Text = (result == null) ? "Add Folder" : "Edit Folder";
|
this.Text = (result == null) ? "Add Folder" : "Edit Folder";
|
||||||
|
|
||||||
@ -54,9 +50,9 @@ namespace RokettoLaunch.Forms
|
|||||||
|
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
textBox1 = new ThClearableTextBox();
|
textBox1 = new RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox();
|
||||||
label1 = new Label();
|
label1 = new Label();
|
||||||
listBox1 = new ThListBox();
|
listBox1 = new RyzStudio.Windows.ThemedForms.T3ListBox();
|
||||||
label2 = new Label();
|
label2 = new Label();
|
||||||
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
|
|||||||
@ -3,8 +3,6 @@ using System.Windows.Forms;
|
|||||||
using RokettoLaunch.DTOs.SaveFile;
|
using RokettoLaunch.DTOs.SaveFile;
|
||||||
using RokettoLaunch.Windows.Forms;
|
using RokettoLaunch.Windows.Forms;
|
||||||
using RyzStudio.Windows.Forms;
|
using RyzStudio.Windows.Forms;
|
||||||
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
|
|
||||||
using RyzStudio.Windows.ThemedForms.PickerBox;
|
|
||||||
|
|
||||||
namespace RokettoLaunch.Forms
|
namespace RokettoLaunch.Forms
|
||||||
{
|
{
|
||||||
@ -12,13 +10,13 @@ namespace RokettoLaunch.Forms
|
|||||||
{
|
{
|
||||||
private Label label2;
|
private Label label2;
|
||||||
private Label label1;
|
private Label label1;
|
||||||
private ThYesNoPickerBox pickerBox1;
|
private RyzStudio.Windows.ThemedForms.T3YnPickerBox pickerBox1;
|
||||||
private ThClearableTextBox textBox1;
|
private RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox textBox1;
|
||||||
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
|
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
|
||||||
private THorizontalSeparator horizontalSeparator1;
|
private THorizontalSeparator horizontalSeparator1;
|
||||||
private RyzStudio.Windows.ThemedForms.ThNumericBox numericBox1;
|
private RyzStudio.Windows.ThemedForms.T4NumericBox numericBox1;
|
||||||
private Label label4;
|
private Label label4;
|
||||||
private RyzStudio.Windows.ThemedForms.ThNumericBox numericBox2;
|
private RyzStudio.Windows.ThemedForms.T4NumericBox numericBox2;
|
||||||
private Label label3;
|
private Label label3;
|
||||||
private App4Options.Group result = null;
|
private App4Options.Group result = null;
|
||||||
|
|
||||||
@ -27,7 +25,7 @@ namespace RokettoLaunch.Forms
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
UISetup.Dialog(this, true);
|
this.SetupDialog();
|
||||||
|
|
||||||
this.Text = (result == null) ? "Add Group" : "Edit Group";
|
this.Text = (result == null) ? "Add Group" : "Edit Group";
|
||||||
|
|
||||||
@ -53,15 +51,15 @@ namespace RokettoLaunch.Forms
|
|||||||
|
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
textBox1 = new ThClearableTextBox();
|
textBox1 = new RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox();
|
||||||
label2 = new Label();
|
label2 = new Label();
|
||||||
label1 = new Label();
|
label1 = new Label();
|
||||||
pickerBox1 = new ThYesNoPickerBox();
|
pickerBox1 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox();
|
||||||
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
||||||
horizontalSeparator1 = new THorizontalSeparator();
|
horizontalSeparator1 = new THorizontalSeparator();
|
||||||
numericBox1 = new RyzStudio.Windows.ThemedForms.ThNumericBox();
|
numericBox1 = new RyzStudio.Windows.ThemedForms.T4NumericBox();
|
||||||
label4 = new Label();
|
label4 = new Label();
|
||||||
numericBox2 = new RyzStudio.Windows.ThemedForms.ThNumericBox();
|
numericBox2 = new RyzStudio.Windows.ThemedForms.T4NumericBox();
|
||||||
label3 = new Label();
|
label3 = new Label();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
|
|||||||
@ -4,9 +4,6 @@ using System.Drawing;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using RokettoLaunch.DTOs.SaveFile;
|
using RokettoLaunch.DTOs.SaveFile;
|
||||||
using RyzStudio.Windows.Forms;
|
using RyzStudio.Windows.Forms;
|
||||||
using RyzStudio.Windows.ThemedForms;
|
|
||||||
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
|
|
||||||
using RyzStudio.Windows.ThemedForms.PickerBox;
|
|
||||||
|
|
||||||
namespace RokettoLaunch.Forms
|
namespace RokettoLaunch.Forms
|
||||||
{
|
{
|
||||||
@ -18,13 +15,13 @@ namespace RokettoLaunch.Forms
|
|||||||
private Label label3;
|
private Label label3;
|
||||||
private Label label2;
|
private Label label2;
|
||||||
private Label label1;
|
private Label label1;
|
||||||
private ThPathTextBox textBox2;
|
private RyzStudio.Windows.FontForms.TextBox.T4PathTextBox textBox2;
|
||||||
private ThClearableTextBox textBox3;
|
private RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox textBox3;
|
||||||
private ThPathTextBox textBox4;
|
private RyzStudio.Windows.FontForms.TextBox.T4PathTextBox textBox4;
|
||||||
private ThPickerBox pickerBox1;
|
private RyzStudio.Windows.ThemedForms.T3PickerBox pickerBox1;
|
||||||
private ThYesNoPickerBox pickerBox2;
|
private RyzStudio.Windows.ThemedForms.T3YnPickerBox pickerBox2;
|
||||||
private THorizontalSeparator horizontalSeparator1;
|
private THorizontalSeparator horizontalSeparator1;
|
||||||
private ThClearableTextBox textBox1;
|
private RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox textBox1;
|
||||||
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
|
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
|
||||||
|
|
||||||
|
|
||||||
@ -35,7 +32,7 @@ namespace RokettoLaunch.Forms
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
UISetup.Dialog(this, true);
|
this.SetupDialog();
|
||||||
|
|
||||||
this.Text = (result == null) ? "Add Tile" : "Edit Tile";
|
this.Text = (result == null) ? "Add Tile" : "Edit Tile";
|
||||||
|
|
||||||
@ -58,18 +55,18 @@ namespace RokettoLaunch.Forms
|
|||||||
|
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
textBox1 = new ThClearableTextBox();
|
textBox1 = new RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox();
|
||||||
label6 = new Label();
|
label6 = new Label();
|
||||||
label7 = new Label();
|
label7 = new Label();
|
||||||
label4 = new Label();
|
label4 = new Label();
|
||||||
label3 = new Label();
|
label3 = new Label();
|
||||||
label2 = new Label();
|
label2 = new Label();
|
||||||
label1 = new Label();
|
label1 = new Label();
|
||||||
textBox2 = new ThPathTextBox();
|
textBox2 = new RyzStudio.Windows.FontForms.TextBox.T4PathTextBox();
|
||||||
textBox3 = new ThClearableTextBox();
|
textBox3 = new RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox();
|
||||||
textBox4 = new ThPathTextBox();
|
textBox4 = new RyzStudio.Windows.FontForms.TextBox.T4PathTextBox();
|
||||||
pickerBox1 = new ThPickerBox();
|
pickerBox1 = new RyzStudio.Windows.ThemedForms.T3PickerBox();
|
||||||
pickerBox2 = new ThYesNoPickerBox();
|
pickerBox2 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox();
|
||||||
horizontalSeparator1 = new THorizontalSeparator();
|
horizontalSeparator1 = new THorizontalSeparator();
|
||||||
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
@ -177,7 +174,7 @@ namespace RokettoLaunch.Forms
|
|||||||
//
|
//
|
||||||
textBox2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
textBox2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
textBox2.BackColor = Color.Transparent;
|
textBox2.BackColor = Color.Transparent;
|
||||||
textBox2.DialogMode = ThPathTextBox.DialogType.OpenFile;
|
textBox2.DialogMode = RyzStudio.Windows.FontForms.TextBox.T4PathTextBox.DialogType.OpenFile;
|
||||||
textBox2.EnableMovable = false;
|
textBox2.EnableMovable = false;
|
||||||
textBox2.FolderBrowserDialog = null;
|
textBox2.FolderBrowserDialog = null;
|
||||||
textBox2.Icon = "D";
|
textBox2.Icon = "D";
|
||||||
@ -208,7 +205,7 @@ namespace RokettoLaunch.Forms
|
|||||||
//
|
//
|
||||||
textBox4.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
textBox4.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
textBox4.BackColor = Color.Transparent;
|
textBox4.BackColor = Color.Transparent;
|
||||||
textBox4.DialogMode = ThPathTextBox.DialogType.FolderBrowser;
|
textBox4.DialogMode = RyzStudio.Windows.FontForms.TextBox.T4PathTextBox.DialogType.FolderBrowser;
|
||||||
textBox4.EnableMovable = false;
|
textBox4.EnableMovable = false;
|
||||||
textBox4.FolderBrowserDialog = null;
|
textBox4.FolderBrowserDialog = null;
|
||||||
textBox4.Icon = "D";
|
textBox4.Icon = "D";
|
||||||
|
|||||||
@ -11,8 +11,8 @@ namespace RokettoLaunch.Forms
|
|||||||
public class LoadingForm : Form
|
public class LoadingForm : Form
|
||||||
{
|
{
|
||||||
private TProgressBar progressBar1;
|
private TProgressBar progressBar1;
|
||||||
private RyzStudio.Windows.ThemedForms.ThUserControl userControl1;
|
private RyzStudio.Windows.ThemedForms.T3UserControl userControl1;
|
||||||
private RyzStudio.Windows.ThemedForms.ThUserControl userControl2;
|
private RyzStudio.Windows.ThemedForms.T3UserControl userControl2;
|
||||||
private TProgressBar progressBar2;
|
private TProgressBar progressBar2;
|
||||||
|
|
||||||
private App4Options result = null;
|
private App4Options result = null;
|
||||||
@ -25,7 +25,7 @@ namespace RokettoLaunch.Forms
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
UISetup.Dialog(this, true);
|
this.SetupDialog();
|
||||||
|
|
||||||
this.Text = "Loading";
|
this.Text = "Loading";
|
||||||
}
|
}
|
||||||
@ -34,8 +34,8 @@ namespace RokettoLaunch.Forms
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
progressBar1 = new TProgressBar();
|
progressBar1 = new TProgressBar();
|
||||||
userControl1 = new RyzStudio.Windows.ThemedForms.ThUserControl();
|
userControl1 = new RyzStudio.Windows.ThemedForms.T3UserControl();
|
||||||
userControl2 = new RyzStudio.Windows.ThemedForms.ThUserControl();
|
userControl2 = new RyzStudio.Windows.ThemedForms.T3UserControl();
|
||||||
progressBar2 = new TProgressBar();
|
progressBar2 = new TProgressBar();
|
||||||
label1 = new Label();
|
label1 = new Label();
|
||||||
label2 = new Label();
|
label2 = new Label();
|
||||||
@ -137,8 +137,8 @@ namespace RokettoLaunch.Forms
|
|||||||
{
|
{
|
||||||
this.Clear();
|
this.Clear();
|
||||||
|
|
||||||
UIControl.SetText(label1, "Loading...");
|
label1.SetText("Loading...");
|
||||||
UIControl.SetText(label2, "... " + Path.GetFileName(loadFilename));
|
label2.SetText("... " + Path.GetFileName(loadFilename));
|
||||||
|
|
||||||
var newSession = await LoadSaveSessionWithVersion(loadFilename);
|
var newSession = await LoadSaveSessionWithVersion(loadFilename);
|
||||||
|
|
||||||
@ -146,12 +146,12 @@ namespace RokettoLaunch.Forms
|
|||||||
progressBar1.Maximum = newSession.Groups?.Count ?? 0;
|
progressBar1.Maximum = newSession.Groups?.Count ?? 0;
|
||||||
progressBar2.Maximum = 0;
|
progressBar2.Maximum = 0;
|
||||||
|
|
||||||
UIControl.SetText(label1, "Counting...");
|
label1.SetText("Counting...");
|
||||||
UIControl.SetText(label2, "");
|
label2.SetText("");
|
||||||
|
|
||||||
foreach (var group in newSession?.Groups ?? new List<App4Options.Group>())
|
foreach (var group in newSession?.Groups ?? new List<App4Options.Group>())
|
||||||
{
|
{
|
||||||
UIControl.SetText(label2, "... " + group.Title);
|
label2.SetText("... " + group.Title);
|
||||||
|
|
||||||
foreach (var item in group?.Items ?? new List<App4Options.Item>())
|
foreach (var item in group?.Items ?? new List<App4Options.Item>())
|
||||||
{
|
{
|
||||||
@ -169,8 +169,8 @@ namespace RokettoLaunch.Forms
|
|||||||
// Resolve paths
|
// Resolve paths
|
||||||
progressBar2.Value = 0;
|
progressBar2.Value = 0;
|
||||||
|
|
||||||
UIControl.SetText(label1, "Seeking...");
|
label1.SetText("Seeking...");
|
||||||
UIControl.SetText(label2, "");
|
label2.SetText("");
|
||||||
|
|
||||||
// Resolve paths
|
// Resolve paths
|
||||||
foreach (var group in newSession?.Groups ?? new List<App4Options.Group>())
|
foreach (var group in newSession?.Groups ?? new List<App4Options.Group>())
|
||||||
@ -179,7 +179,7 @@ namespace RokettoLaunch.Forms
|
|||||||
{
|
{
|
||||||
progressBar1.Value++;
|
progressBar1.Value++;
|
||||||
|
|
||||||
UIControl.SetText(label2, "... " + group.Title);
|
label2.SetText("... " + group.Title);
|
||||||
|
|
||||||
if (item.IsGroup)
|
if (item.IsGroup)
|
||||||
{
|
{
|
||||||
@ -187,7 +187,7 @@ namespace RokettoLaunch.Forms
|
|||||||
{
|
{
|
||||||
progressBar2.Value++;
|
progressBar2.Value++;
|
||||||
|
|
||||||
UIControl.SetText(label2, "... " + subItem.Title);
|
label2.SetText("... " + subItem.Title);
|
||||||
|
|
||||||
subItem.ResolvePaths();
|
subItem.ResolvePaths();
|
||||||
}
|
}
|
||||||
@ -196,7 +196,7 @@ namespace RokettoLaunch.Forms
|
|||||||
{
|
{
|
||||||
progressBar2.Value++;
|
progressBar2.Value++;
|
||||||
|
|
||||||
UIControl.SetText(label2, "... " + item.Title);
|
label2.SetText("... " + item.Title);
|
||||||
|
|
||||||
item.ResolvePaths();
|
item.ResolvePaths();
|
||||||
}
|
}
|
||||||
@ -205,8 +205,8 @@ namespace RokettoLaunch.Forms
|
|||||||
|
|
||||||
result = newSession;
|
result = newSession;
|
||||||
|
|
||||||
UIControl.SetText(label1, "Done");
|
label1.SetText("Done");
|
||||||
UIControl.SetText(label2, "Done");
|
label2.SetText("Done");
|
||||||
});
|
});
|
||||||
|
|
||||||
this.DialogResult = DialogResult.OK;
|
this.DialogResult = DialogResult.OK;
|
||||||
@ -237,8 +237,8 @@ namespace RokettoLaunch.Forms
|
|||||||
|
|
||||||
public void Clear()
|
public void Clear()
|
||||||
{
|
{
|
||||||
UIControl.SetText(label1, "Ready");
|
label1.SetText("Ready");
|
||||||
UIControl.SetText(label2, "");
|
label2.SetText("");
|
||||||
|
|
||||||
progressBar1.Value = progressBar1.Maximum = 0;
|
progressBar1.Value = progressBar1.Maximum = 0;
|
||||||
progressBar2.Value = progressBar2.Maximum = 0;
|
progressBar2.Value = progressBar2.Maximum = 0;
|
||||||
|
|||||||
@ -2,9 +2,6 @@
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using RokettoLaunch.DTOs.SaveFile;
|
using RokettoLaunch.DTOs.SaveFile;
|
||||||
using RyzStudio.Windows.Forms;
|
using RyzStudio.Windows.Forms;
|
||||||
using RyzStudio.Windows.ThemedForms;
|
|
||||||
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
|
|
||||||
using RyzStudio.Windows.ThemedForms.PickerBox;
|
|
||||||
|
|
||||||
namespace RokettoLaunch.Forms
|
namespace RokettoLaunch.Forms
|
||||||
{
|
{
|
||||||
@ -20,12 +17,12 @@ namespace RokettoLaunch.Forms
|
|||||||
private Label label1;
|
private Label label1;
|
||||||
private Label label6;
|
private Label label6;
|
||||||
private Label label7;
|
private Label label7;
|
||||||
private ThYesNoPickerBox yesNoPickerBox1;
|
private RyzStudio.Windows.ThemedForms.T3YnPickerBox yesNoPickerBox1;
|
||||||
private ThNumericBox numericBox1;
|
private RyzStudio.Windows.ThemedForms.T4NumericBox numericBox1;
|
||||||
private ThYesNoPickerBox yesNoPickerBox4;
|
private RyzStudio.Windows.ThemedForms.T3YnPickerBox yesNoPickerBox4;
|
||||||
private ThKeyCodeTextBox textBox1;
|
private RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox textBox1;
|
||||||
private ThYesNoPickerBox yesNoPickerBox2;
|
private RyzStudio.Windows.ThemedForms.T3YnPickerBox yesNoPickerBox2;
|
||||||
private ThYesNoPickerBox yesNoPickerBox3;
|
private RyzStudio.Windows.ThemedForms.T3YnPickerBox yesNoPickerBox3;
|
||||||
private TTogglePanel togglePanel3;
|
private TTogglePanel togglePanel3;
|
||||||
|
|
||||||
private App4Options _appSession = null;
|
private App4Options _appSession = null;
|
||||||
@ -35,11 +32,11 @@ namespace RokettoLaunch.Forms
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
UISetup.Dialog(this, true);
|
this.SetupDialog();
|
||||||
UISetup.AutoSizeChildren(flowLayoutPanel1);
|
|
||||||
|
|
||||||
_appSession = appSession;
|
_appSession = appSession;
|
||||||
|
|
||||||
|
flowLayoutPanel1.AutoSizeChildren();
|
||||||
numericBox1.Minimum = 4;
|
numericBox1.Minimum = 4;
|
||||||
numericBox1.Maximum = 24;
|
numericBox1.Maximum = 24;
|
||||||
}
|
}
|
||||||
@ -50,7 +47,7 @@ namespace RokettoLaunch.Forms
|
|||||||
|
|
||||||
numericBox1.Value = _appSession?.TilesPerRow ?? 4;
|
numericBox1.Value = _appSession?.TilesPerRow ?? 4;
|
||||||
yesNoPickerBox1.Value = _appSession?.ShowBigIcons ?? true;
|
yesNoPickerBox1.Value = _appSession?.ShowBigIcons ?? true;
|
||||||
textBox1.UpdateKeyCode(_appSession?.ShowToggleHotkey ?? new ThKeyCodeTextBox.Results());
|
textBox1.UpdateKeyCode(_appSession?.ShowToggleHotkey ?? new RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox.Results());
|
||||||
yesNoPickerBox4.Value = _appSession?.AlwaysOnTop ?? true;
|
yesNoPickerBox4.Value = _appSession?.AlwaysOnTop ?? true;
|
||||||
yesNoPickerBox2.Value = _appSession?.HideOnClose ?? true;
|
yesNoPickerBox2.Value = _appSession?.HideOnClose ?? true;
|
||||||
yesNoPickerBox3.Value = _appSession?.HideOnExecute ?? true;
|
yesNoPickerBox3.Value = _appSession?.HideOnExecute ?? true;
|
||||||
@ -58,24 +55,24 @@ namespace RokettoLaunch.Forms
|
|||||||
|
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
ThKeyCodeTextBox.Results results1 = new ThKeyCodeTextBox.Results();
|
RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox.Results results1 = new RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox.Results();
|
||||||
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
||||||
flowLayoutPanel1 = new FlowLayoutPanel();
|
flowLayoutPanel1 = new FlowLayoutPanel();
|
||||||
togglePanel1 = new TTogglePanel();
|
togglePanel1 = new TTogglePanel();
|
||||||
yesNoPickerBox1 = new ThYesNoPickerBox();
|
yesNoPickerBox1 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox();
|
||||||
numericBox1 = new ThNumericBox();
|
numericBox1 = new RyzStudio.Windows.ThemedForms.T4NumericBox();
|
||||||
label2 = new Label();
|
label2 = new Label();
|
||||||
label4 = new Label();
|
label4 = new Label();
|
||||||
togglePanel2 = new TTogglePanel();
|
togglePanel2 = new TTogglePanel();
|
||||||
label6 = new Label();
|
label6 = new Label();
|
||||||
yesNoPickerBox4 = new ThYesNoPickerBox();
|
yesNoPickerBox4 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox();
|
||||||
textBox1 = new ThKeyCodeTextBox();
|
textBox1 = new RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox();
|
||||||
yesNoPickerBox2 = new ThYesNoPickerBox();
|
yesNoPickerBox2 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox();
|
||||||
label3 = new Label();
|
label3 = new Label();
|
||||||
label1 = new Label();
|
label1 = new Label();
|
||||||
togglePanel3 = new TTogglePanel();
|
togglePanel3 = new TTogglePanel();
|
||||||
label7 = new Label();
|
label7 = new Label();
|
||||||
yesNoPickerBox3 = new ThYesNoPickerBox();
|
yesNoPickerBox3 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox();
|
||||||
flowLayoutPanel1.SuspendLayout();
|
flowLayoutPanel1.SuspendLayout();
|
||||||
togglePanel1.SuspendLayout();
|
togglePanel1.SuspendLayout();
|
||||||
togglePanel2.SuspendLayout();
|
togglePanel2.SuspendLayout();
|
||||||
|
|||||||
340
MainForm.cs
340
MainForm.cs
@ -10,9 +10,9 @@ using RokettoLaunch.DTOs.SaveFile;
|
|||||||
using RokettoLaunch.Forms;
|
using RokettoLaunch.Forms;
|
||||||
using RokettoLaunch.Windows.Forms;
|
using RokettoLaunch.Windows.Forms;
|
||||||
using RyzStudio;
|
using RyzStudio;
|
||||||
|
using RyzStudio.Services;
|
||||||
|
using RyzStudio.Windows.FontForms.TextBox;
|
||||||
using RyzStudio.Windows.Forms;
|
using RyzStudio.Windows.Forms;
|
||||||
using RyzStudio.Windows.ThemedForms;
|
|
||||||
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
|
|
||||||
|
|
||||||
namespace RokettoLaunch
|
namespace RokettoLaunch
|
||||||
{
|
{
|
||||||
@ -49,15 +49,23 @@ namespace RokettoLaunch
|
|||||||
{
|
{
|
||||||
base.OnShown(e);
|
base.OnShown(e);
|
||||||
|
|
||||||
var args = WinApplication.GetCommandLine();
|
var args = this.GetCommandLine();
|
||||||
|
|
||||||
|
string jsonfigFilename = null;
|
||||||
|
if (!args.TryGetValue("open", out jsonfigFilename))
|
||||||
|
{
|
||||||
|
if (!args.TryGetValue("o", out jsonfigFilename))
|
||||||
|
{
|
||||||
|
jsonfigFilename = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
string jsonfigFilename = args.Where(x => (x.Key.Equals("o") || x.Key.Equals("open"))).Select(x => x.Value).FirstOrDefault();
|
|
||||||
if (string.IsNullOrWhiteSpace(jsonfigFilename))
|
if (string.IsNullOrWhiteSpace(jsonfigFilename))
|
||||||
{
|
{
|
||||||
jsonfigFilename = Path.ChangeExtension(Application.ExecutablePath, "jsonfig");
|
jsonfigFilename = Path.ChangeExtension(Application.ExecutablePath, "jsonfig");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(jsonfigFilename) && File.Exists(jsonfigFilename))
|
if (File.Exists(jsonfigFilename))
|
||||||
{
|
{
|
||||||
await _fileSessionManager.OpenSession(jsonfigFilename);
|
await _fileSessionManager.OpenSession(jsonfigFilename);
|
||||||
}
|
}
|
||||||
@ -66,7 +74,7 @@ namespace RokettoLaunch
|
|||||||
//await _fileSessionManager.NewSession();
|
//await _fileSessionManager.NewSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
UIControl.SetFocus(this);
|
UIControl.Invoke(this, (x) => this.Focus());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async override void OnFormClosing(FormClosingEventArgs e)
|
protected async override void OnFormClosing(FormClosingEventArgs e)
|
||||||
@ -95,7 +103,7 @@ namespace RokettoLaunch
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((this.CurrentSession?.ShowToggleHotkey ?? new ThKeyCodeTextBox.Results()).Key != Keys.None)
|
if ((this.CurrentSession?.ShowToggleHotkey ?? new T4KeyTextBox.Results()).Key != Keys.None)
|
||||||
{
|
{
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
RyzStudio.Runtime.InteropServices.User32.UnregisterHotKey((IntPtr)Handle, 1);
|
RyzStudio.Runtime.InteropServices.User32.UnregisterHotKey((IntPtr)Handle, 1);
|
||||||
@ -149,17 +157,17 @@ namespace RokettoLaunch
|
|||||||
{
|
{
|
||||||
if (!this.CurrentSession.StartPosition.IsEmpty)
|
if (!this.CurrentSession.StartPosition.IsEmpty)
|
||||||
{
|
{
|
||||||
UIControl.SetLocation(this, this.CurrentSession.StartPosition);
|
UIControl.Invoke(this, (x) => this.Location = this.CurrentSession.StartPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.CurrentSession.Width > 0)
|
if (this.CurrentSession.Width > 0)
|
||||||
{
|
{
|
||||||
UIControl.SetClientWidth(this, this.CurrentSession.Width);
|
UIControl.Invoke(this, (x) => this.Width = this.CurrentSession.Width);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.CurrentSession.Height > 0)
|
if (this.CurrentSession.Height > 0)
|
||||||
{
|
{
|
||||||
UIControl.SetClientHeight(this, this.CurrentSession.Height);
|
UIControl.Invoke(this, (x) => this.Height = this.CurrentSession.Height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +188,7 @@ namespace RokettoLaunch
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
UIControl.SetTopMost(this, this.CurrentSession.AlwaysOnTop);
|
UIControl.Invoke(this, (x) => this.TopMost = this.CurrentSession.AlwaysOnTop);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainMenuStrip_MenuActivate(object sender, EventArgs e)
|
private void MainMenuStrip_MenuActivate(object sender, EventArgs e)
|
||||||
@ -381,7 +389,7 @@ namespace RokettoLaunch
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void AboutToolStripMenuItem_Click(object sender, EventArgs e)
|
private void AboutToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var form = new RyzStudio.Windows.ThemedForms.AboutForm();
|
var form = new RyzStudio.Forms.T3AboutForm();
|
||||||
form.ProductURL = AppResource.AppProductURL;
|
form.ProductURL = AppResource.AppProductURL;
|
||||||
form.AuthorURL = AppResource.AppAuthorURL;
|
form.AuthorURL = AppResource.AppAuthorURL;
|
||||||
form.CompanyURL = AppResource.AppCompanyURL;
|
form.CompanyURL = AppResource.AppCompanyURL;
|
||||||
@ -425,7 +433,7 @@ namespace RokettoLaunch
|
|||||||
// Enforce minimum number of rows
|
// Enforce minimum number of rows
|
||||||
this.CurrentSession.TilesPerRow = Math.Max(this.CurrentSession.TilesPerRow, TileLayoutPanel.MIN_COLUMNS);
|
this.CurrentSession.TilesPerRow = Math.Max(this.CurrentSession.TilesPerRow, TileLayoutPanel.MIN_COLUMNS);
|
||||||
|
|
||||||
UIControl.Clear(flowLayoutPanel1);
|
UIControl.Invoke(flowLayoutPanel1, (x) => flowLayoutPanel1.Controls.Clear());
|
||||||
|
|
||||||
AddGroupToolStripMenuItem_Click(null, null);
|
AddGroupToolStripMenuItem_Click(null, null);
|
||||||
|
|
||||||
@ -490,7 +498,7 @@ namespace RokettoLaunch
|
|||||||
this.CurrentSession.Width = this.DisplayRectangle.Width;
|
this.CurrentSession.Width = this.DisplayRectangle.Width;
|
||||||
this.CurrentSession.Height = this.DisplayRectangle.Height;
|
this.CurrentSession.Height = this.DisplayRectangle.Height;
|
||||||
|
|
||||||
var result = GenericResult.Create();
|
var result = MethodResult.Create();
|
||||||
|
|
||||||
switch (Path.GetExtension(filename?.ToLower()?.Trim() ?? string.Empty))
|
switch (Path.GetExtension(filename?.ToLower()?.Trim() ?? string.Empty))
|
||||||
{
|
{
|
||||||
@ -511,34 +519,34 @@ namespace RokettoLaunch
|
|||||||
result = await RyzStudio.IO.Compression.ZFile.WriteFile(filename, "Document.json", this.CurrentSession);
|
result = await RyzStudio.IO.Compression.ZFile.WriteFile(filename, "Document.json", this.CurrentSession);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
result = GenericResult.Fault("Format not supported");
|
result = MethodResult.Error("Format not supported");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.IsSuccess)
|
if (result.Success)
|
||||||
{
|
{
|
||||||
if (showNotices)
|
if (showNotices)
|
||||||
{
|
{
|
||||||
ThMessageBox.Show(this, "Session saved!", "Save session", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
RyzStudio.Forms.T3MessageBox.Show(this, "Session saved!", "Save session", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (showNotices)
|
if (showNotices)
|
||||||
{
|
{
|
||||||
ThMessageBox.Show(this, "Session saved!", "Save session");
|
RyzStudio.Forms.T3MessageBox.Show(this, "Session saved!", "Save session");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isBusy = false;
|
isBusy = false;
|
||||||
|
|
||||||
return result.IsSuccess;
|
return result.Success;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<bool> fileSessionManager_OnClearSession(FileSessionManager sender)
|
private async Task<bool> fileSessionManager_OnClearSession(FileSessionManager sender)
|
||||||
{
|
{
|
||||||
UIControl.Clear(flowLayoutPanel1);
|
UIControl.Invoke(flowLayoutPanel1, (x) => flowLayoutPanel1.Controls.Clear());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -550,13 +558,13 @@ namespace RokettoLaunch
|
|||||||
switch (sender.SessionState)
|
switch (sender.SessionState)
|
||||||
{
|
{
|
||||||
case FileSessionManager.SessionStateEnum.New:
|
case FileSessionManager.SessionStateEnum.New:
|
||||||
UIControl.SetText(this, "New Session - " + Application.ProductName);
|
this.SetText("New Session - " + Application.ProductName);
|
||||||
break;
|
break;
|
||||||
case FileSessionManager.SessionStateEnum.Open:
|
case FileSessionManager.SessionStateEnum.Open:
|
||||||
UIControl.SetText(this, Path.GetFileNameWithoutExtension(filename) + " - " + Application.ProductName);
|
this.SetText(Path.GetFileNameWithoutExtension(filename) + " - " + Application.ProductName);
|
||||||
break;
|
break;
|
||||||
case FileSessionManager.SessionStateEnum.Close:
|
case FileSessionManager.SessionStateEnum.Close:
|
||||||
UIControl.SetText(this, Application.ProductName);
|
this.SetText(Application.ProductName);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -575,7 +583,7 @@ namespace RokettoLaunch
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void AddTileToolStripMenuItem_Click(object sender, EventArgs e)
|
private void AddTileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripMenuItem)sender);
|
var panel = ((ToolStripMenuItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||||
if (panel == null)
|
if (panel == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -586,32 +594,35 @@ namespace RokettoLaunch
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == panel.ToggleControlId.Value).FirstOrDefault();
|
AddNewTile(panel.ToggleControlId.Value, (TileLayoutPanel)panel.ToggleControl);
|
||||||
if (groupInfo == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var newTileInfo = new App4Options.Item()
|
//var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == panel.ToggleControlId.Value).FirstOrDefault();
|
||||||
{
|
//if (groupInfo == null)
|
||||||
Id = Guid.NewGuid(),
|
//{
|
||||||
Title = "New Tile",
|
// return;
|
||||||
IsGroup = false,
|
//}
|
||||||
Position = new Point(-1, -1)
|
|
||||||
};
|
|
||||||
|
|
||||||
newTileInfo = groupInfo.AddItem(newTileInfo);
|
//var newTileInfo = new App4Options.Item()
|
||||||
|
//{
|
||||||
|
// Id = Guid.NewGuid(),
|
||||||
|
// Title = "New Tile",
|
||||||
|
// IsGroup = false,
|
||||||
|
// Position = new Point(-1, -1)
|
||||||
|
//};
|
||||||
|
|
||||||
// Update table layout
|
//newTileInfo = groupInfo.AddItem(newTileInfo);
|
||||||
var newTilePanel = CreateTile(newTileInfo);
|
|
||||||
|
|
||||||
var tableLayout = (TileLayoutPanel)panel.ToggleControl;
|
//// Update table layout
|
||||||
tableLayout.AddTilePanel(newTilePanel, newTileInfo.Position.X, newTileInfo.Position.Y);
|
//var newTilePanel = CreateTile(newTileInfo);
|
||||||
tableLayout.SetGridSize(groupInfo.GridSize);
|
|
||||||
|
//var tableLayout = (TileLayoutPanel)panel.ToggleControl;
|
||||||
|
//tableLayout.AddTilePanel(newTilePanel, newTileInfo.Position.X, newTileInfo.Position.Y);
|
||||||
|
//tableLayout.SetGridSize(groupInfo.GridSize);
|
||||||
|
|
||||||
_fileSessionManager.HasChanged = true;
|
_fileSessionManager.HasChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add Folder
|
/// Add Folder
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -619,7 +630,7 @@ namespace RokettoLaunch
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void AddFolderToolStripMenuItem_Click(object sender, EventArgs e)
|
private void AddFolderToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripMenuItem)sender);
|
var panel = ((ToolStripMenuItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||||
if (panel == null)
|
if (panel == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -663,7 +674,7 @@ namespace RokettoLaunch
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void EditGroupToolStripMenuItem_Click(object sender, EventArgs e)
|
private void EditGroupToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripMenuItem)sender);
|
var panel = ((ToolStripMenuItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||||
if (panel == null)
|
if (panel == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -707,7 +718,7 @@ namespace RokettoLaunch
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private async void toolStripMenuItem5_Click(object sender, EventArgs e)
|
private async void toolStripMenuItem5_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripMenuItem)sender);
|
var panel = ((ToolStripMenuItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||||
if (panel == null)
|
if (panel == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -745,19 +756,19 @@ namespace RokettoLaunch
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void MoveTopToolStripMenuItem_Click(object sender, EventArgs e)
|
private void MoveTopToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripDropDownItem)sender);
|
var panel = ((ToolStripDropDownItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||||
if (panel == null)
|
if (panel == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move header
|
// Move header
|
||||||
UIControl.MoveTop(flowLayoutPanel1, panel);
|
flowLayoutPanel1.MoveTop(panel);
|
||||||
|
|
||||||
// Move sidecar
|
// Move sidecar
|
||||||
if (panel.ToggleControl != null)
|
if (panel.ToggleControl != null)
|
||||||
{
|
{
|
||||||
UIControl.MoveNext(flowLayoutPanel1, panel, panel.ToggleControl);
|
flowLayoutPanel1.MoveNext(panel, panel.ToggleControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move group
|
// Move group
|
||||||
@ -780,19 +791,19 @@ namespace RokettoLaunch
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void MoveUpToolStripMenuItem_Click(object sender, EventArgs e)
|
private void MoveUpToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripDropDownItem)sender);
|
var panel = ((ToolStripDropDownItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||||
if (panel == null)
|
if (panel == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move header
|
// Move header
|
||||||
UIControl.MovePos(flowLayoutPanel1, panel, -2);
|
flowLayoutPanel1.MovePos(panel, -2);
|
||||||
|
|
||||||
// Move sidecar
|
// Move sidecar
|
||||||
if (panel.ToggleControl != null)
|
if (panel.ToggleControl != null)
|
||||||
{
|
{
|
||||||
UIControl.MoveNext(flowLayoutPanel1, panel, panel.ToggleControl);
|
flowLayoutPanel1.MoveNext(panel, panel.ToggleControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move group
|
// Move group
|
||||||
@ -815,19 +826,19 @@ namespace RokettoLaunch
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void MoveDownToolStripMenuItem_Click(object sender, EventArgs e)
|
private void MoveDownToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripDropDownItem)sender);
|
var panel = ((ToolStripDropDownItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||||
if (panel == null)
|
if (panel == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move header
|
// Move header
|
||||||
UIControl.MovePos(flowLayoutPanel1, panel, 3);
|
flowLayoutPanel1.MovePos(panel, 3);
|
||||||
|
|
||||||
// Move sidecar
|
// Move sidecar
|
||||||
if (panel.ToggleControl != null)
|
if (panel.ToggleControl != null)
|
||||||
{
|
{
|
||||||
UIControl.MovePos(flowLayoutPanel1, panel.ToggleControl, 3);
|
flowLayoutPanel1.MovePos(panel.ToggleControl, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move group
|
// Move group
|
||||||
@ -850,19 +861,19 @@ namespace RokettoLaunch
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void MoveBottomToolStripMenuItem_Click(object sender, EventArgs e)
|
private void MoveBottomToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripDropDownItem)sender);
|
var panel = ((ToolStripDropDownItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||||
if (panel == null)
|
if (panel == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move header
|
// Move header
|
||||||
UIControl.MoveBottom(flowLayoutPanel1, panel);
|
flowLayoutPanel1.MoveBottom(panel);
|
||||||
|
|
||||||
// Move sidecar
|
// Move sidecar
|
||||||
if (panel.ToggleControl != null)
|
if (panel.ToggleControl != null)
|
||||||
{
|
{
|
||||||
UIControl.MoveNext(flowLayoutPanel1, panel, panel.ToggleControl);
|
flowLayoutPanel1.MoveNext(panel, panel.ToggleControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move group
|
// Move group
|
||||||
@ -892,7 +903,7 @@ namespace RokettoLaunch
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripMenuItem)sender);
|
var panel = ((ToolStripMenuItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||||
if (panel?.Parent == null)
|
if (panel?.Parent == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -929,7 +940,7 @@ namespace RokettoLaunch
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void EditTileToolStripMenuItem_Click(object sender, EventArgs e)
|
private void EditTileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var tilePanel = UIControl.GetOwner<TilePanel>((ToolStripMenuItem)sender);
|
var tilePanel = ((ToolStripMenuItem)sender).GetOwner<TilePanel>();
|
||||||
|
|
||||||
var tileInfo = this.GetTileInfo(tilePanel);
|
var tileInfo = this.GetTileInfo(tilePanel);
|
||||||
if (tileInfo == null)
|
if (tileInfo == null)
|
||||||
@ -976,7 +987,7 @@ namespace RokettoLaunch
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private async void CopyToTileToolStripMenuItem_Click(object sender, EventArgs e)
|
private async void CopyToTileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var tilePanel = UIControl.GetOwner<TilePanel>((ToolStripMenuItem)sender);
|
var tilePanel = ((ToolStripMenuItem)sender).GetOwner<TilePanel>();
|
||||||
|
|
||||||
var tileInfo = this.GetTileInfo(tilePanel);
|
var tileInfo = this.GetTileInfo(tilePanel);
|
||||||
if (tileInfo == null)
|
if (tileInfo == null)
|
||||||
@ -1009,8 +1020,6 @@ namespace RokettoLaunch
|
|||||||
var tableLayout = (TileLayoutPanel)headers[n].ToggleControl;
|
var tableLayout = (TileLayoutPanel)headers[n].ToggleControl;
|
||||||
tableLayout.AddTilePanel(newTilePanel, newTileInfo.Position.X, newTileInfo.Position.Y);
|
tableLayout.AddTilePanel(newTilePanel, newTileInfo.Position.X, newTileInfo.Position.Y);
|
||||||
tableLayout.SetGridSize(this.CurrentSession.Groups[n].GridSize);
|
tableLayout.SetGridSize(this.CurrentSession.Groups[n].GridSize);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1027,7 +1036,7 @@ namespace RokettoLaunch
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void RemoveTileToolStripMenuItem_Click(object sender, EventArgs e)
|
private void RemoveTileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var tilePanel = UIControl.GetOwner<TilePanel>((ToolStripMenuItem)sender);
|
var tilePanel = ((ToolStripMenuItem)sender).GetOwner<TilePanel>();
|
||||||
|
|
||||||
var tileInfo = this.GetTileInfo(tilePanel);
|
var tileInfo = this.GetTileInfo(tilePanel);
|
||||||
if (tileInfo == null)
|
if (tileInfo == null)
|
||||||
@ -1056,6 +1065,32 @@ namespace RokettoLaunch
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
private TilePanel AddNewTile(Guid groupId, TileLayoutPanel tableLayout)
|
||||||
|
{
|
||||||
|
var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == groupId).FirstOrDefault();
|
||||||
|
if (groupInfo == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
tableLayout.AddTilePanel(newTilePanel, newTileInfo.Position.X, newTileInfo.Position.Y);
|
||||||
|
tableLayout.SetGridSize(groupInfo.GridSize);
|
||||||
|
|
||||||
|
return newTilePanel;
|
||||||
|
}
|
||||||
|
|
||||||
private void AddGroup(App4Options.Group groupInfo)
|
private void AddGroup(App4Options.Group groupInfo)
|
||||||
{
|
{
|
||||||
@ -1067,8 +1102,8 @@ namespace RokettoLaunch
|
|||||||
header.ToggleControl = tableLayout;
|
header.ToggleControl = tableLayout;
|
||||||
header.IsOpen = groupInfo.IsOpen;
|
header.IsOpen = groupInfo.IsOpen;
|
||||||
|
|
||||||
UIControl.Add(flowLayoutPanel1, header);
|
UIControl.Invoke(flowLayoutPanel1, (x) => flowLayoutPanel1.Controls.Add(header));
|
||||||
UIControl.Add(flowLayoutPanel1, tableLayout);
|
UIControl.Invoke(flowLayoutPanel1, (x) => flowLayoutPanel1.Controls.Add(tableLayout));
|
||||||
|
|
||||||
foreach (var item in groupInfo.Items ?? new List<App4Options.Item>())
|
foreach (var item in groupInfo.Items ?? new List<App4Options.Item>())
|
||||||
{
|
{
|
||||||
@ -1105,10 +1140,33 @@ namespace RokettoLaunch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ConvertToFolder(App4Options.Item tileInfo)
|
||||||
|
{
|
||||||
|
if (tileInfo.IsGroup)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var newTileInfo = tileInfo.CopyOf(false);
|
||||||
|
|
||||||
|
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();
|
||||||
|
tileInfo.Items.Add(newTileInfo);
|
||||||
|
|
||||||
|
tileInfo.ResolvePaths();
|
||||||
|
}
|
||||||
|
|
||||||
private TileLayoutPanel CreateTable(Size gridSize)
|
private TileLayoutPanel CreateTable(Size gridSize)
|
||||||
{
|
{
|
||||||
var layoutPanel = new TileLayoutPanel();
|
var layoutPanel = new TileLayoutPanel();
|
||||||
layoutPanel.DragDrop += LayoutPanel_DragDrop;
|
layoutPanel.DragDrop += LayoutPanel_TileDragDrop;
|
||||||
|
layoutPanel.DragDrop += LayoutPanel_FileDragDrop;
|
||||||
layoutPanel.SetGridSize(gridSize);
|
layoutPanel.SetGridSize(gridSize);
|
||||||
|
|
||||||
return layoutPanel;
|
return layoutPanel;
|
||||||
@ -1222,8 +1280,13 @@ namespace RokettoLaunch
|
|||||||
return contextMenu;
|
return contextMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void LayoutPanel_DragDrop(object sender, DragEventArgs e)
|
private async void LayoutPanel_TileDragDrop(object sender, DragEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (e.Effect != DragDropEffects.Move)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!e.Data.TryGetData<TilePanel>(out var tilePanel))
|
if (!e.Data.TryGetData<TilePanel>(out var tilePanel))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -1260,6 +1323,72 @@ namespace RokettoLaunch
|
|||||||
_fileSessionManager.HasChanged = true;
|
_fileSessionManager.HasChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void LayoutPanel_FileDragDrop(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Effect != DragDropEffects.Link)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var fileList = e.Data.GetData(DataFormats.FileDrop) as string[];
|
||||||
|
if (fileList == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fileList.Length <= 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var tableLayout = (sender as TileLayoutPanel);
|
||||||
|
if (tableLayout == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tableLayout.GroupId == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var newTilePanel = AddNewTile(tableLayout.GroupId, tableLayout);
|
||||||
|
var tileInfo = this.CurrentSession.FindById(newTilePanel.TileId);
|
||||||
|
|
||||||
|
if (fileList.Length <= 1)
|
||||||
|
{
|
||||||
|
tileInfo.IsGroup = false;
|
||||||
|
tileInfo.TargetPath = fileList[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, fileList.ToList(), false);
|
||||||
|
|
||||||
|
tileInfo.ResolvePaths();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.UpdateTile(newTilePanel, tileInfo);
|
||||||
|
|
||||||
|
_fileSessionManager.HasChanged = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void TilePanel_MouseClick(object sender, MouseEventArgs e)
|
private void TilePanel_MouseClick(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
@ -1306,60 +1435,59 @@ namespace RokettoLaunch
|
|||||||
var tileInfo = this.CurrentSession.FindById(sender.TileId);
|
var tileInfo = this.CurrentSession.FindById(sender.TileId);
|
||||||
|
|
||||||
// Append
|
// Append
|
||||||
if (keys.HasFlag(Keys.Shift))
|
if (keys.HasFlag(Keys.Shift) || ((Control.ModifierKeys & Keys.Shift) == Keys.Shift))
|
||||||
{
|
{
|
||||||
if (tileInfo.IsGroup)
|
if (tileInfo.IsGroup)
|
||||||
{
|
{
|
||||||
this.AddToFolder(tileInfo, paths, true);
|
if (MessageBox.Show("Do you want to add shortcut to the folder?", "Add Item", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
AddToFolder(tileInfo, paths, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var newTileInfo = tileInfo.CopyOf();
|
if (MessageBox.Show("Do you want to convert this shortcut to a folder, then add shortcut to the folder?", "Add Item (Convert)", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||||
|
{
|
||||||
tileInfo.Title = "New Folder";
|
ConvertToFolder(tileInfo);
|
||||||
tileInfo.IsGroup = true;
|
AddToFolder(tileInfo, paths, true);
|
||||||
tileInfo.TargetPath = string.Empty;
|
}
|
||||||
tileInfo.StartPath = string.Empty;
|
|
||||||
tileInfo.Argument = string.Empty;
|
|
||||||
tileInfo.RunAsAdmin = false;
|
|
||||||
|
|
||||||
tileInfo.Items.Clear();
|
|
||||||
tileInfo.Items.Add(newTileInfo);
|
|
||||||
|
|
||||||
this.AddToFolder(tileInfo, paths, true);
|
|
||||||
|
|
||||||
tileInfo.ResolvePaths();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (paths.Count <= 1)
|
if (paths.Count <= 1)
|
||||||
{
|
{
|
||||||
tileInfo.IsGroup = false;
|
if (MessageBox.Show("Do you want to replace this shortcut?", "Replace Item", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||||
tileInfo.TargetPath = paths[0];
|
{
|
||||||
tileInfo.StartPath = string.Empty;
|
tileInfo.IsGroup = false;
|
||||||
tileInfo.Argument = string.Empty;
|
tileInfo.TargetPath = paths[0];
|
||||||
tileInfo.RunAsAdmin = false;
|
tileInfo.StartPath = string.Empty;
|
||||||
|
tileInfo.Argument = string.Empty;
|
||||||
|
tileInfo.RunAsAdmin = false;
|
||||||
|
|
||||||
tileInfo.Items.Clear();
|
tileInfo.Items.Clear();
|
||||||
tileInfo.ResolvePaths();
|
tileInfo.ResolvePaths();
|
||||||
|
|
||||||
tileInfo.Title = RyzStudio.IO.File.GetName(tileInfo.ResolvedTargetPath);
|
tileInfo.Title = RyzStudio.IO.File.GetName(tileInfo.ResolvedTargetPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tileInfo.Title = "New Folder";
|
if (MessageBox.Show("Do you want to replace this shortcut with a folder?", "Replace Item (Folder)", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||||
tileInfo.IsGroup = true;
|
{
|
||||||
tileInfo.TargetPath = string.Empty;
|
tileInfo.Title = "New Folder";
|
||||||
tileInfo.StartPath = string.Empty;
|
tileInfo.IsGroup = true;
|
||||||
tileInfo.Argument = string.Empty;
|
tileInfo.TargetPath = string.Empty;
|
||||||
tileInfo.RunAsAdmin = false;
|
tileInfo.StartPath = string.Empty;
|
||||||
|
tileInfo.Argument = string.Empty;
|
||||||
|
tileInfo.RunAsAdmin = false;
|
||||||
|
|
||||||
tileInfo.Items.Clear();
|
tileInfo.Items.Clear();
|
||||||
|
|
||||||
this.AddToFolder(tileInfo, paths, false);
|
this.AddToFolder(tileInfo, paths, false);
|
||||||
|
|
||||||
tileInfo.ResolvePaths();
|
tileInfo.ResolvePaths();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1381,6 +1509,16 @@ namespace RokettoLaunch
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(model.TargetPath))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!RyzStudio.IO.File.IsAccessible(model.TargetPath))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.CurrentSession.HideOnExecute)
|
if (this.CurrentSession.HideOnExecute)
|
||||||
{
|
{
|
||||||
this.Visible = false;
|
this.Visible = false;
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
<Copyright>Ray Lam</Copyright>
|
<Copyright>Ray Lam</Copyright>
|
||||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
||||||
<FileVersion>1.0.0.0</FileVersion>
|
<FileVersion>1.0.0.0</FileVersion>
|
||||||
<Version>0.4.1.0217</Version>
|
<Version>0.4.2.013</Version>
|
||||||
<EnableNETAnalyzers>False</EnableNETAnalyzers>
|
<EnableNETAnalyzers>False</EnableNETAnalyzers>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<PackageIcon>icon-128.png</PackageIcon>
|
<PackageIcon>icon-128.png</PackageIcon>
|
||||||
@ -47,6 +47,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="UIResource.Designer.cs" />
|
<Compile Remove="UIResource.Designer.cs" />
|
||||||
<Compile Remove="Windows\Forms\TileContainer.cs" />
|
<Compile Remove="Windows\Forms\TileContainer.cs" />
|
||||||
|
<Compile Remove="Windows\Forms\TileForms\TileContainer.cs" />
|
||||||
<Compile Remove="Windows\Forms\TilePanelLayout.cs" />
|
<Compile Remove="Windows\Forms\TilePanelLayout.cs" />
|
||||||
<Compile Remove="Windows\Forms\TilePanelLayout.Designer.cs" />
|
<Compile Remove="Windows\Forms\TilePanelLayout.Designer.cs" />
|
||||||
<Compile Remove="Windows\GridTableLayout.cs" />
|
<Compile Remove="Windows\GridTableLayout.cs" />
|
||||||
@ -64,6 +65,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Remove="UIResource.resx" />
|
<EmbeddedResource Remove="UIResource.resx" />
|
||||||
<EmbeddedResource Remove="Windows\Forms\TileContainer.resx" />
|
<EmbeddedResource Remove="Windows\Forms\TileContainer.resx" />
|
||||||
|
<EmbeddedResource Remove="Windows\Forms\TileForms\TileContainer.resx" />
|
||||||
<EmbeddedResource Remove="Windows\Forms\TilePanelLayout.resx" />
|
<EmbeddedResource Remove="Windows\Forms\TilePanelLayout.resx" />
|
||||||
<EmbeddedResource Remove="Windows\GridTableLayout.resx" />
|
<EmbeddedResource Remove="Windows\GridTableLayout.resx" />
|
||||||
<EmbeddedResource Remove="Windows\TileGridPanel.resx" />
|
<EmbeddedResource Remove="Windows\TileGridPanel.resx" />
|
||||||
@ -79,8 +81,9 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="RyzStudio" Version="10.1.0.128" />
|
<PackageReference Include="RyzStudio" Version="10.1.1.261" />
|
||||||
<PackageReference Include="RyzStudio.Windows.Forms" Version="10.1.0.140" />
|
<PackageReference Include="RyzStudio.Windows.Forms" Version="10.3.0.41" />
|
||||||
|
<PackageReference Include="RyzStudio.Windows.Forms.Themed" Version="10.3.0.41" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Update="AppResource.Designer.cs">
|
<Compile Update="AppResource.Designer.cs">
|
||||||
|
|||||||
55
Windows/Forms/TileForms/DefaultVisualStyle.cs
Normal file
55
Windows/Forms/TileForms/DefaultVisualStyle.cs
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
using System.Drawing;
|
||||||
|
using RyzStudio.Drawing;
|
||||||
|
|
||||||
|
namespace RyzStudio.Windows.TileForms
|
||||||
|
{
|
||||||
|
public class DefaultVisualStyle
|
||||||
|
{
|
||||||
|
//private static FontProvider _fontProvider;
|
||||||
|
|
||||||
|
//public static FontProvider FontProvider
|
||||||
|
//{
|
||||||
|
// get
|
||||||
|
// {
|
||||||
|
// if (_fontProvider == null)
|
||||||
|
// {
|
||||||
|
// _fontProvider = new FontProvider();
|
||||||
|
// _fontProvider.AddFont(Resource2.RyzStudio8);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return _fontProvider;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
//public static FontFamily[] Fonts
|
||||||
|
//{
|
||||||
|
// get
|
||||||
|
// {
|
||||||
|
// return FontProvider.Collection.Families;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
public class StyleSet
|
||||||
|
{
|
||||||
|
public BorderStyle Border { get; set; } = new BorderStyle();
|
||||||
|
|
||||||
|
public Color BackColour { get; set; }
|
||||||
|
|
||||||
|
public Color ForeColour { get; set; }
|
||||||
|
|
||||||
|
//public Color IconColour { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static StyleSet Default = new StyleSet()
|
||||||
|
{
|
||||||
|
Border = BorderStyle.Create(1, Color.FromArgb(204, 206, 218), 0, 2),
|
||||||
|
BackColour = Color.FromArgb(250, 250, 250),
|
||||||
|
ForeColour = Color.FromArgb(99, 105, 119),
|
||||||
|
//IconColour = Color.FromArgb(86, 86, 149)
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
43
Windows/Forms/TileForms/Tile.Designer.cs
generated
Normal file
43
Windows/Forms/TileForms/Tile.Designer.cs
generated
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
namespace RyzStudio.Windows.TileForms
|
||||||
|
{
|
||||||
|
partial class Tile
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Component Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// Tile
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||||
|
Name = "Tile";
|
||||||
|
Size = new System.Drawing.Size(82, 81);
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
130
Windows/Forms/TileForms/Tile.cs
Normal file
130
Windows/Forms/TileForms/Tile.cs
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
using System.ComponentModel;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace RyzStudio.Windows.TileForms
|
||||||
|
{
|
||||||
|
public partial class Tile : RyzStudio.Windows.Forms.TUserControl
|
||||||
|
{
|
||||||
|
private int _imageLeft = 0;
|
||||||
|
private int _imageTop = 11;
|
||||||
|
private int _labelMargin = 3;
|
||||||
|
private int _labelTop = 47;
|
||||||
|
private Rectangle _labelRectangle = new Rectangle();
|
||||||
|
|
||||||
|
private string _title = "";
|
||||||
|
private Image _largeIcon = null;
|
||||||
|
|
||||||
|
|
||||||
|
public Tile()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
this.AutoScaleMode = AutoScaleMode.None;
|
||||||
|
this.BackColor = DefaultVisualStyle.Default.BackColour;
|
||||||
|
this.DoubleBuffered = true;
|
||||||
|
this.Font = new Font(this.Font.FontFamily, 8.25F);
|
||||||
|
this.ForeColor = DefaultVisualStyle.Default.ForeColour;
|
||||||
|
//this.Size = new Size(70, 70);
|
||||||
|
|
||||||
|
this.EnableMovable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region encapsulated properties
|
||||||
|
|
||||||
|
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||||
|
public override bool AutoSize { get => base.AutoSize; set => base.AutoSize = false; }
|
||||||
|
|
||||||
|
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||||
|
public new AutoScaleMode AutoScaleMode { get => base.AutoScaleMode; set => base.AutoScaleMode = AutoScaleMode.None; }
|
||||||
|
|
||||||
|
//[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||||
|
//public new Padding Margin { get => base.Margin; set => base.Margin = new Padding(0); }
|
||||||
|
|
||||||
|
//[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||||
|
//public new Padding Padding { get => base.Padding; set => base.Padding = new Padding(0); }
|
||||||
|
|
||||||
|
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||||
|
public override Size MaximumSize { get => base.MaximumSize; set => this.Size = value; }
|
||||||
|
|
||||||
|
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||||
|
public override Size MinimumSize { get => base.MinimumSize; set => this.Size = value; }
|
||||||
|
|
||||||
|
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||||
|
public new Size Size { get => base.Size; set => base.MaximumSize = base.MinimumSize = base.Size = value; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region public properties
|
||||||
|
|
||||||
|
[Category("Appearance"), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public Image LargeIcon
|
||||||
|
{
|
||||||
|
get => _largeIcon;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_largeIcon = value;
|
||||||
|
|
||||||
|
if (_largeIcon == null)
|
||||||
|
{
|
||||||
|
_imageLeft = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_imageLeft = (this.Width - _largeIcon.Width) / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Appearance"), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public string Title
|
||||||
|
{
|
||||||
|
get => _title;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_title = value;
|
||||||
|
|
||||||
|
_labelRectangle = new Rectangle(_labelMargin, _labelTop, (this.Width - (_labelMargin * 2)), (this.Height - _labelTop - 1));
|
||||||
|
|
||||||
|
this.Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Behaviour"), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public ContextMenuStrip LeftContextMenuStrip { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
protected override void OnPaint(PaintEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnPaint(e);
|
||||||
|
|
||||||
|
Graphics g = e.Graphics;
|
||||||
|
|
||||||
|
if (this.LargeIcon != null)
|
||||||
|
{
|
||||||
|
g.DrawImage(this.LargeIcon, new Point(_imageLeft, _imageTop));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(this.Title))
|
||||||
|
{
|
||||||
|
TextRenderer.DrawText(e.Graphics, this.Title, this.Font, _labelRectangle, this.ForeColor, TextFormatFlags.HorizontalCenter | TextFormatFlags.NoPadding | TextFormatFlags.EndEllipsis);
|
||||||
|
}
|
||||||
|
|
||||||
|
g.DrawRectangle(new Pen(DefaultVisualStyle.Default.Border.Colour, DefaultVisualStyle.Default.Border.Width), new Rectangle(this.DisplayRectangle.X, this.DisplayRectangle.Y, (this.DisplayRectangle.Width - 1), (this.DisplayRectangle.Height - 1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnMouseClick(MouseEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnMouseClick(e);
|
||||||
|
|
||||||
|
if (e.Button == MouseButtons.Left)
|
||||||
|
{
|
||||||
|
this.LeftContextMenuStrip?.Show(this, e.Location);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
120
Windows/Forms/TileForms/Tile.resx
Normal file
120
Windows/Forms/TileForms/Tile.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
311
Windows/Forms/TileForms/TileContainer.cs
Normal file
311
Windows/Forms/TileForms/TileContainer.cs
Normal file
@ -0,0 +1,311 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using RyzStudio.Windows.Forms;
|
||||||
|
|
||||||
|
namespace RyzStudio.Windows.TileForms
|
||||||
|
{
|
||||||
|
public class TileContainer : RyzStudio.Windows.Forms.TTogglePanel
|
||||||
|
{
|
||||||
|
public TileContainer()
|
||||||
|
{
|
||||||
|
this.AllowDrop = true;
|
||||||
|
this.ForeColor = Color.FromArgb(31, 31, 31);
|
||||||
|
this.HeaderPadding = new Padding(10, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private const int PADDING_BOTTOM = 10;
|
||||||
|
|
||||||
|
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public Size TileSize { get; set; } = new Size(70, 70);
|
||||||
|
|
||||||
|
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public int TileMargin { get; set; } = 3;
|
||||||
|
|
||||||
|
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public bool AutoSizeHeight { get; set; } = false;
|
||||||
|
|
||||||
|
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public List<Tuple<System.Windows.Forms.Control, Point>> TileCollection { get; set; } = new List<Tuple<System.Windows.Forms.Control, Point>>();
|
||||||
|
|
||||||
|
public int ColumnCount
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.TileCollection.Count <= 0)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (this.TileCollection?.Max(x => x.Item2.X) ?? 0) + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int RowCount
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.TileCollection.Count <= 0)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (this.TileCollection?.Max(x => x.Item2.Y) ?? 0) + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Size HotRectangle
|
||||||
|
{
|
||||||
|
get => new Size((this.ContentRectangle.Width - SystemInformation.VerticalScrollBarWidth), this.ContentRectangle.Height);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Size GridSize
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var tileWidth = TileSize.Width + TileMargin;
|
||||||
|
var tileHeight = TileSize.Height + TileMargin;
|
||||||
|
|
||||||
|
var columns = (int)Math.Floor(decimal.Divide(this.HotRectangle.Width, tileWidth));
|
||||||
|
var rows = (int)Math.Floor(decimal.Divide(this.HotRectangle.Height, tileHeight));
|
||||||
|
|
||||||
|
return new Size(columns, rows);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected override void OnControlAdded(ControlEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnControlAdded(e);
|
||||||
|
|
||||||
|
if (e.Control == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(e.Control is Tile))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var newTile = (Tile)e.Control;
|
||||||
|
newTile.OnMoved += (object sender, EventArgs e) =>
|
||||||
|
{
|
||||||
|
var control = (System.Windows.Forms.Control)sender;
|
||||||
|
|
||||||
|
var coord = this.GetCoord(control);
|
||||||
|
coord = this.ValidateCoord(coord);
|
||||||
|
|
||||||
|
MoveTile(control, coord);
|
||||||
|
};
|
||||||
|
|
||||||
|
var coord = GetCoord(e.Control);
|
||||||
|
|
||||||
|
MoveTile(e.Control, coord);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnControlRemoved(ControlEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnControlRemoved(e);
|
||||||
|
|
||||||
|
var n = this.TileCollection.FindIndex(x => x.Item1 == e.Control);
|
||||||
|
|
||||||
|
this.TileCollection.RemoveAt(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void Add(Control control, int x, int y)
|
||||||
|
{
|
||||||
|
var pos = GetLocation(new Point(x, y));
|
||||||
|
|
||||||
|
control.Location = pos;
|
||||||
|
|
||||||
|
UIControl.Invoke(this, (x) => this.Controls.Add(control));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddRow()
|
||||||
|
{
|
||||||
|
var gridSize = this.GridSize;
|
||||||
|
|
||||||
|
this.AutoSize(gridSize.Width, (gridSize.Height + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveRow()
|
||||||
|
{
|
||||||
|
var gridSize = this.GridSize;
|
||||||
|
var minGridSize = this.GetMinGridSize();
|
||||||
|
|
||||||
|
var y = Math.Max((gridSize.Height - 1), minGridSize.Height);
|
||||||
|
|
||||||
|
this.AutoSize(gridSize.Width, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public new void AutoSize(int x, int y)
|
||||||
|
{
|
||||||
|
var tileWidth = TileSize.Width + TileMargin;
|
||||||
|
var tileHeight = TileSize.Height + TileMargin;
|
||||||
|
|
||||||
|
var w = (tileWidth * x) + this.ContentRectangle.Left + SystemInformation.VerticalScrollBarWidth;
|
||||||
|
var h = (tileHeight * y) + this.ContentRectangle.Top;
|
||||||
|
h += PADDING_BOTTOM;
|
||||||
|
|
||||||
|
this.ExpandedHeight = h;
|
||||||
|
|
||||||
|
UIControl.Invoke(this, (x) => this.Size = new Size(w, h));
|
||||||
|
|
||||||
|
this.IsOpen = this.IsOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
if (this.TileCollection == null)
|
||||||
|
{
|
||||||
|
this.TileCollection = new List<Tuple<System.Windows.Forms.Control, Point>>();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Controls.Clear();
|
||||||
|
this.TileCollection.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Point GetCoord(System.Windows.Forms.Control control)
|
||||||
|
{
|
||||||
|
var tileWidth = TileSize.Width + TileMargin;
|
||||||
|
var tileHeight = TileSize.Height + TileMargin;
|
||||||
|
|
||||||
|
var x = control.Left - this.ContentRectangle.Left;
|
||||||
|
var y = control.Top - this.ContentRectangle.Top;
|
||||||
|
|
||||||
|
var colX = (int)Math.Floor(decimal.Divide(x, tileWidth));
|
||||||
|
var colY = (int)Math.Floor(decimal.Divide(y, tileHeight));
|
||||||
|
|
||||||
|
colX = Math.Max(colX, 0);
|
||||||
|
colY = Math.Max(colY, 0);
|
||||||
|
|
||||||
|
return new Point(colX, colY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Size GetMinGridSize()
|
||||||
|
{
|
||||||
|
var x = Math.Max(this.ColumnCount, 1);
|
||||||
|
var y = Math.Max(this.RowCount, 1);
|
||||||
|
|
||||||
|
return new Size(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Point GetNextCoord()
|
||||||
|
{
|
||||||
|
var y = Math.Max(this.RowCount, 1) - 1;
|
||||||
|
var x = -1;
|
||||||
|
|
||||||
|
if (this.TileCollection.Count > 0)
|
||||||
|
{
|
||||||
|
x = (this.TileCollection?.Where(x => x.Item2.Y == y)?.Max(x => x.Item2.X) ?? 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return GetNextCoord(new Point(x, y));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Point GetNextCoord(Point coord)
|
||||||
|
{
|
||||||
|
var gridSize = this.GridSize;
|
||||||
|
|
||||||
|
var x = (coord.X + 1);
|
||||||
|
var y = coord.Y;
|
||||||
|
|
||||||
|
if (x >= gridSize.Width)
|
||||||
|
{
|
||||||
|
x = 0;
|
||||||
|
y++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Point(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public new void Invalidate()
|
||||||
|
{
|
||||||
|
base.Invalidate();
|
||||||
|
|
||||||
|
if (this.TileCollection == null)
|
||||||
|
{
|
||||||
|
this.TileCollection = new List<Tuple<System.Windows.Forms.Control, Point>>();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.TileCollection.Clear();
|
||||||
|
|
||||||
|
foreach (var item in this.Controls)
|
||||||
|
{
|
||||||
|
var control = (System.Windows.Forms.Control)item;
|
||||||
|
var coord = GetCoord(control);
|
||||||
|
|
||||||
|
MoveTile(control, coord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void MoveTile(System.Windows.Forms.Control control, Point newCoord)
|
||||||
|
{
|
||||||
|
var n = this.TileCollection.FindIndex(x => x.Item1 == control);
|
||||||
|
if (n < 0)
|
||||||
|
{
|
||||||
|
// Add to collection
|
||||||
|
this.TileCollection.Add(new Tuple<System.Windows.Forms.Control, Point>(control, newCoord));
|
||||||
|
|
||||||
|
n = this.TileCollection.FindIndex(x => x.Item1 == control);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.TileCollection[n] = new Tuple<Control, Point>(control, newCoord);
|
||||||
|
|
||||||
|
var newLocation = GetLocation(newCoord);
|
||||||
|
control.Location = new Point(newLocation.X, newLocation.Y);
|
||||||
|
|
||||||
|
// Auto-resize for height
|
||||||
|
if (this.AutoSizeHeight)
|
||||||
|
{
|
||||||
|
var gridSize = this.GridSize;
|
||||||
|
var newHeight = (this.TileCollection?.Max(x => x.Item2.Y) ?? 0) + 1;
|
||||||
|
|
||||||
|
this.AutoSize(gridSize.Width, Math.Max(gridSize.Height, newHeight));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle displaced tile
|
||||||
|
var duplicateTile = this.TileCollection.Where(x => ((x.Item1 != control) && (x.Item2 == newCoord))).FirstOrDefault();
|
||||||
|
if (duplicateTile != null)
|
||||||
|
{
|
||||||
|
var nextCoord = GetNextCoord(newCoord);
|
||||||
|
|
||||||
|
MoveTile(duplicateTile.Item1, nextCoord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Point ValidateCoord(Point coord)
|
||||||
|
{
|
||||||
|
var gridSize = this.GridSize;
|
||||||
|
|
||||||
|
var x = coord.X;
|
||||||
|
var y = coord.Y;
|
||||||
|
|
||||||
|
if (x >= gridSize.Width)
|
||||||
|
{
|
||||||
|
x = 0;
|
||||||
|
y++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Point(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected Point GetLocation(Point coord)
|
||||||
|
{
|
||||||
|
var tileWidth = TileSize.Width + TileMargin;
|
||||||
|
var tileHeight = TileSize.Height + TileMargin;
|
||||||
|
|
||||||
|
var posX = (coord.X * tileWidth) + this.ContentRectangle.Left;
|
||||||
|
var posY = (coord.Y * tileHeight) + this.ContentRectangle.Top;
|
||||||
|
|
||||||
|
return new Point(posX, posY);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
120
Windows/Forms/TileForms/TileContainer.resx
Normal file
120
Windows/Forms/TileForms/TileContainer.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
@ -22,6 +22,13 @@ namespace RokettoLaunch.Windows.Forms
|
|||||||
this.RowCount = 0;
|
this.RowCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//protected override void OnDragOver(DragEventArgs e)
|
||||||
|
//{
|
||||||
|
// base.OnDragDrop(e);
|
||||||
|
|
||||||
|
// e.Effect = (e.Data.GetDataPresent(DataFormats.FileDrop)) ? DragDropEffects.Link : DragDropEffects.None;
|
||||||
|
//}
|
||||||
|
|
||||||
protected override void OnDragEnter(DragEventArgs e)
|
protected override void OnDragEnter(DragEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnDragEnter(e);
|
base.OnDragEnter(e);
|
||||||
@ -30,6 +37,14 @@ namespace RokettoLaunch.Windows.Forms
|
|||||||
{
|
{
|
||||||
e.Effect = DragDropEffects.Move;
|
e.Effect = DragDropEffects.Move;
|
||||||
}
|
}
|
||||||
|
else if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||||
|
{
|
||||||
|
e.Effect = DragDropEffects.Link;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e.Effect = DragDropEffects.None;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -39,7 +54,7 @@ namespace RokettoLaunch.Windows.Forms
|
|||||||
|
|
||||||
public void AddTilePanel(TilePanel tilePanel, int x, int y)
|
public void AddTilePanel(TilePanel tilePanel, int x, int y)
|
||||||
{
|
{
|
||||||
UIControl.Add(this, tilePanel, x, y);
|
UIControl.Invoke(this, (_) => this.Controls.Add(tilePanel, x, y));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetGridSize(Size gridSize)
|
public void SetGridSize(Size gridSize)
|
||||||
|
|||||||
@ -42,7 +42,14 @@ namespace RokettoLaunch.Windows.Forms
|
|||||||
{
|
{
|
||||||
base.OnDragDrop(e);
|
base.OnDragDrop(e);
|
||||||
|
|
||||||
e.Effect = (e.Data.GetDataPresent(DataFormats.FileDrop)) ? DragDropEffects.Link : DragDropEffects.None;
|
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||||
|
{
|
||||||
|
e.Effect = ((Control.ModifierKeys & Keys.Shift) == Keys.Shift) ? DragDropEffects.Copy : DragDropEffects.Link;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e.Effect = DragDropEffects.None;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDragDrop(DragEventArgs e)
|
protected override void OnDragDrop(DragEventArgs e)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user