Added toolbar

This commit is contained in:
Ray 2021-11-15 22:58:04 +00:00
parent 185d9aa253
commit 17bd46c9cd
4 changed files with 129 additions and 12 deletions

106
MainForm.Designer.cs generated
View File

@ -57,7 +57,6 @@
this.viewHelpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.viewHelpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem16 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItem16 = new System.Windows.Forms.ToolStripSeparator();
this.aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.treeView1 = new RyzStudio.Windows.Forms.BookmarkTreeView();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.rootContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.rootContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.addPageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.addPageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -86,10 +85,19 @@
this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripSeparator();
this.moveUpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.moveUpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.moveDownToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.moveDownToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
this.treeView1 = new RyzStudio.Windows.Forms.BookmarkTreeView();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.rootContextMenu.SuspendLayout(); this.rootContextMenu.SuspendLayout();
this.folderContextMenu.SuspendLayout(); this.folderContextMenu.SuspendLayout();
this.pageContextMenu.SuspendLayout(); this.pageContextMenu.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// saveFileDialog1 // saveFileDialog1
@ -306,15 +314,6 @@
this.aboutToolStripMenuItem1.Text = "&About"; this.aboutToolStripMenuItem1.Text = "&About";
this.aboutToolStripMenuItem1.Click += new System.EventHandler(this.aboutToolStripMenuItem1_Click); this.aboutToolStripMenuItem1.Click += new System.EventHandler(this.aboutToolStripMenuItem1_Click);
// //
// treeView1
//
this.treeView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeView1.Location = new System.Drawing.Point(0, 24);
this.treeView1.Name = "treeView1";
this.treeView1.Size = new System.Drawing.Size(300, 556);
this.treeView1.TabIndex = 3;
//
// openFileDialog1 // openFileDialog1
// //
this.openFileDialog1.DefaultExt = "jsnx"; this.openFileDialog1.DefaultExt = "jsnx";
@ -526,6 +525,81 @@
this.moveDownToolStripMenuItem1.Text = "Move &Down"; this.moveDownToolStripMenuItem1.Text = "Move &Down";
this.moveDownToolStripMenuItem1.Click += new System.EventHandler(this.moveDownToolStripMenuItem1_Click); this.moveDownToolStripMenuItem1.Click += new System.EventHandler(this.moveDownToolStripMenuItem1_Click);
// //
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButton1,
this.toolStripButton2,
this.toolStripSeparator3,
this.toolStripButton3,
this.toolStripSeparator4,
this.toolStripButton4});
this.toolStrip1.Location = new System.Drawing.Point(0, 24);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(300, 25);
this.toolStrip1.TabIndex = 4;
this.toolStrip1.Text = "toolStrip1";
//
// toolStripButton1
//
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton1.Image = global::BookmarkManager.UIResource.file2;
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
this.toolStripButton1.Text = "toolStripButton1";
this.toolStripButton1.ToolTipText = "New";
this.toolStripButton1.Click += new System.EventHandler(this.newToolStripMenuItem_Click);
//
// toolStripButton2
//
this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton2.Image = global::BookmarkManager.UIResource.folder2;
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton2.Name = "toolStripButton2";
this.toolStripButton2.Size = new System.Drawing.Size(23, 22);
this.toolStripButton2.Text = "Open";
this.toolStripButton2.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
//
// toolStripButton3
//
this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton3.Image = global::BookmarkManager.UIResource.disk2;
this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton3.Name = "toolStripButton3";
this.toolStripButton3.Size = new System.Drawing.Size(23, 22);
this.toolStripButton3.Text = "Save";
this.toolStripButton3.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25);
//
// toolStripButton4
//
this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton4.Image = global::BookmarkManager.UIResource.search2;
this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton4.Name = "toolStripButton4";
this.toolStripButton4.Size = new System.Drawing.Size(23, 22);
this.toolStripButton4.Text = "Find";
this.toolStripButton4.Click += new System.EventHandler(this.findToolStripMenuItem_Click);
//
// treeView1
//
this.treeView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeView1.Location = new System.Drawing.Point(0, 49);
this.treeView1.Name = "treeView1";
this.treeView1.Size = new System.Drawing.Size(300, 531);
this.treeView1.TabIndex = 5;
//
// MainForm // MainForm
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@ -533,6 +607,7 @@
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.ClientSize = new System.Drawing.Size(300, 580); this.ClientSize = new System.Drawing.Size(300, 580);
this.Controls.Add(this.treeView1); this.Controls.Add(this.treeView1);
this.Controls.Add(this.toolStrip1);
this.Controls.Add(this.menuStrip1); this.Controls.Add(this.menuStrip1);
this.DoubleBuffered = true; this.DoubleBuffered = true;
this.ForeColor = System.Drawing.SystemColors.ControlText; this.ForeColor = System.Drawing.SystemColors.ControlText;
@ -545,6 +620,8 @@
this.rootContextMenu.ResumeLayout(false); this.rootContextMenu.ResumeLayout(false);
this.folderContextMenu.ResumeLayout(false); this.folderContextMenu.ResumeLayout(false);
this.pageContextMenu.ResumeLayout(false); this.pageContextMenu.ResumeLayout(false);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -576,7 +653,6 @@
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem findToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem findToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private RyzStudio.Windows.Forms.BookmarkTreeView treeView1;
private System.Windows.Forms.OpenFileDialog openFileDialog1; private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.ContextMenuStrip rootContextMenu; private System.Windows.Forms.ContextMenuStrip rootContextMenu;
private System.Windows.Forms.ToolStripMenuItem addPageToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem addPageToolStripMenuItem;
@ -607,6 +683,14 @@
private System.Windows.Forms.ToolStripMenuItem moveDownToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem moveDownToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem9; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem9;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripButton toolStripButton1;
private System.Windows.Forms.ToolStripButton toolStripButton2;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripButton toolStripButton3;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripButton toolStripButton4;
private RyzStudio.Windows.Forms.BookmarkTreeView treeView1;
} }
} }

View File

@ -160,9 +160,11 @@ namespace FizzyLauncher
ThreadControl.SetEnable(closeToolStripMenuItem, false); ThreadControl.SetEnable(closeToolStripMenuItem, false);
ThreadControl.SetEnable(saveToolStripMenuItem, false); ThreadControl.SetEnable(saveToolStripMenuItem, false);
ThreadControl.SetEnable(toolStripButton3, false);
ThreadControl.SetEnable(saveAsToolStripMenuItem, false); ThreadControl.SetEnable(saveAsToolStripMenuItem, false);
ThreadControl.SetEnable(findToolStripMenuItem, false); ThreadControl.SetEnable(findToolStripMenuItem, false);
ThreadControl.SetEnable(toolStripButton4, false);
ThreadControl.SetEnable(toolStripMenuItem9, false); ThreadControl.SetEnable(toolStripMenuItem9, false);
@ -174,9 +176,11 @@ namespace FizzyLauncher
ThreadControl.SetEnable(closeToolStripMenuItem, true); ThreadControl.SetEnable(closeToolStripMenuItem, true);
ThreadControl.SetEnable(saveToolStripMenuItem, true); ThreadControl.SetEnable(saveToolStripMenuItem, true);
ThreadControl.SetEnable(toolStripButton3, true);
ThreadControl.SetEnable(saveAsToolStripMenuItem, true); ThreadControl.SetEnable(saveAsToolStripMenuItem, true);
ThreadControl.SetEnable(findToolStripMenuItem, true); ThreadControl.SetEnable(findToolStripMenuItem, true);
ThreadControl.SetEnable(toolStripButton4, true);
ThreadControl.SetEnable(toolStripMenuItem9, true); ThreadControl.SetEnable(toolStripMenuItem9, true);
@ -190,9 +194,11 @@ namespace FizzyLauncher
ThreadControl.SetEnable(closeToolStripMenuItem, true); ThreadControl.SetEnable(closeToolStripMenuItem, true);
ThreadControl.SetEnable(saveToolStripMenuItem, false); ThreadControl.SetEnable(saveToolStripMenuItem, false);
ThreadControl.SetEnable(toolStripButton3, false);
ThreadControl.SetEnable(saveAsToolStripMenuItem, true); ThreadControl.SetEnable(saveAsToolStripMenuItem, true);
ThreadControl.SetEnable(findToolStripMenuItem, true); ThreadControl.SetEnable(findToolStripMenuItem, true);
ThreadControl.SetEnable(toolStripButton4, true);
ThreadControl.SetEnable(toolStripMenuItem9, true); ThreadControl.SetEnable(toolStripMenuItem9, true);
@ -769,7 +775,10 @@ namespace FizzyLauncher
private void treeView1_OnNodeChanged(object sender, EventArgs e) private void treeView1_OnNodeChanged(object sender, EventArgs e)
{ {
ThreadControl.SetEnable(saveToolStripMenuItem, (treeView1.HasChanged && ApplicationMode == AppMode.Open)); bool state = (treeView1.HasChanged && ApplicationMode == AppMode.Open);
ThreadControl.SetEnable(saveToolStripMenuItem, state);
ThreadControl.SetEnable(toolStripButton3, state);
} }
protected string BuildOpenFileSupportedFiles(List<string> supportList) protected string BuildOpenFileSupportedFiles(List<string> supportList)

View File

@ -75,6 +75,9 @@
<metadata name="pageContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="pageContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1137, 17</value> <value>1137, 17</value>
</metadata> </metadata>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1290, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>

View File

@ -552,6 +552,27 @@ namespace RyzStudio.Windows.Forms
} }
} }
public static void SetEnable(ToolStripButton control, bool value)
{
if (control.GetCurrentParent() == null)
{
control.Enabled = value;
return;
}
if (control.GetCurrentParent().InvokeRequired)
{
control.GetCurrentParent().Invoke(new MethodInvoker(() =>
{
control.Enabled = value;
}));
}
else
{
control.Enabled = value;
}
}
public static void SetFocus(Control control) public static void SetFocus(Control control)
{ {
if (control.InvokeRequired) if (control.InvokeRequired)