diff --git a/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Controls/Multimedia/Audio/Synthesized/PianoRoll/PianoRollControl.Designer.cs b/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Controls/Multimedia/Audio/Synthesized/PianoRoll/PianoRollControl.Designer.cs index 89e6b769..e5b3d2d5 100644 --- a/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Controls/Multimedia/Audio/Synthesized/PianoRoll/PianoRollControl.Designer.cs +++ b/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Controls/Multimedia/Audio/Synthesized/PianoRoll/PianoRollControl.Designer.cs @@ -28,7 +28,16 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.txtLyric = new System.Windows.Forms.TextBox(); + this.mnuContext = new AwesomeControls.CommandBars.CBContextMenu(this.components); + this.mnuContextCut = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuContextCopy = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuContextPaste = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuContextDelete = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuContextSep1 = new System.Windows.Forms.ToolStripSeparator(); + this.mnuContextProperties = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuContext.SuspendLayout(); this.SuspendLayout(); // // txtLyric @@ -42,12 +51,72 @@ this.txtLyric.Visible = false; this.txtLyric.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtLyric_KeyDown); // + // mnuContext + // + this.mnuContext.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mnuContextCut, + this.mnuContextCopy, + this.mnuContextPaste, + this.mnuContextDelete, + this.mnuContextSep1, + this.mnuContextProperties}); + this.mnuContext.Name = "mnuContext"; + this.mnuContext.Size = new System.Drawing.Size(194, 120); + this.mnuContext.Opening += new System.ComponentModel.CancelEventHandler(this.mnuContext_Opening); + // + // mnuContextCut + // + this.mnuContextCut.Name = "mnuContextCut"; + this.mnuContextCut.ShortcutKeyDisplayString = "Ctrl+X"; + this.mnuContextCut.Size = new System.Drawing.Size(193, 22); + this.mnuContextCut.Text = "Cu&t"; + this.mnuContextCut.Click += new System.EventHandler(this.mnuContextCut_Click); + // + // mnuContextCopy + // + this.mnuContextCopy.Name = "mnuContextCopy"; + this.mnuContextCopy.ShortcutKeyDisplayString = "Ctrl+C"; + this.mnuContextCopy.Size = new System.Drawing.Size(193, 22); + this.mnuContextCopy.Text = "&Copy"; + this.mnuContextCopy.Click += new System.EventHandler(this.mnuContextCopy_Click); + // + // mnuContextPaste + // + this.mnuContextPaste.Name = "mnuContextPaste"; + this.mnuContextPaste.ShortcutKeyDisplayString = "Ctrl+V"; + this.mnuContextPaste.Size = new System.Drawing.Size(193, 22); + this.mnuContextPaste.Text = "&Paste"; + this.mnuContextPaste.Click += new System.EventHandler(this.mnuContextPaste_Click); + // + // mnuContextDelete + // + this.mnuContextDelete.Name = "mnuContextDelete"; + this.mnuContextDelete.ShortcutKeyDisplayString = "Del"; + this.mnuContextDelete.Size = new System.Drawing.Size(193, 22); + this.mnuContextDelete.Text = "&Delete"; + this.mnuContextDelete.Click += new System.EventHandler(this.mnuContextDelete_Click); + // + // mnuContextSep1 + // + this.mnuContextSep1.Name = "mnuContextSep1"; + this.mnuContextSep1.Size = new System.Drawing.Size(190, 6); + // + // mnuContextProperties + // + this.mnuContextProperties.Name = "mnuContextProperties"; + this.mnuContextProperties.ShortcutKeyDisplayString = "Alt+Enter"; + this.mnuContextProperties.Size = new System.Drawing.Size(193, 22); + this.mnuContextProperties.Text = "P&roperties..."; + this.mnuContextProperties.Click += new System.EventHandler(this.mnuContextProperties_Click); + // // PianoRollControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ContextMenuStrip = this.mnuContext; this.Controls.Add(this.txtLyric); this.Name = "PianoRollControl"; + this.mnuContext.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -56,5 +125,12 @@ #endregion private System.Windows.Forms.TextBox txtLyric; + private AwesomeControls.CommandBars.CBContextMenu mnuContext; + private System.Windows.Forms.ToolStripMenuItem mnuContextCut; + private System.Windows.Forms.ToolStripMenuItem mnuContextCopy; + private System.Windows.Forms.ToolStripMenuItem mnuContextPaste; + private System.Windows.Forms.ToolStripMenuItem mnuContextDelete; + private System.Windows.Forms.ToolStripSeparator mnuContextSep1; + private System.Windows.Forms.ToolStripMenuItem mnuContextProperties; } } diff --git a/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Controls/Multimedia/Audio/Synthesized/PianoRoll/PianoRollControl.cs b/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Controls/Multimedia/Audio/Synthesized/PianoRoll/PianoRollControl.cs index 676c1c03..39b16f4f 100644 --- a/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Controls/Multimedia/Audio/Synthesized/PianoRoll/PianoRollControl.cs +++ b/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Controls/Multimedia/Audio/Synthesized/PianoRoll/PianoRollControl.cs @@ -364,5 +364,53 @@ namespace UniversalEditor.Controls.Multimedia.Audio.Synthesized.PianoRoll txtLyric.Enabled = false; } } + + public void Delete() + { + while (mvarSelectedCommands.Count > 0) + { + mvarCommands.Remove(mvarSelectedCommands[0]); + } + } + + private void mnuContextCut_Click(object sender, EventArgs e) + { + + } + + private void mnuContextCopy_Click(object sender, EventArgs e) + { + + } + private void mnuContextPaste_Click(object sender, EventArgs e) + { + IDataObject data = Clipboard.GetDataObject(); + if (data != null) + { + string[] formats = data.GetFormats(); + } + } + + private void mnuContextDelete_Click(object sender, EventArgs e) + { + Delete(); + } + + private void mnuContextProperties_Click(object sender, EventArgs e) + { + + } + + private void mnuContext_Opening(object sender, CancelEventArgs e) + { + bool enableCmds = (mvarSelectedCommands.Count > 0); + mnuContextCut.Enabled = enableCmds; + mnuContextCopy.Enabled = enableCmds; + // mnuContextPaste.Enabled = Clipboard.ContainsData(...); + mnuContextPaste.Enabled = false; + mnuContextDelete.Enabled = enableCmds; + mnuContextProperties.Enabled = enableCmds; + } + } } diff --git a/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Controls/Multimedia/Audio/Synthesized/PianoRoll/PianoRollControl.resx b/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Controls/Multimedia/Audio/Synthesized/PianoRoll/PianoRollControl.resx index 1af7de15..cfefec93 100644 --- a/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Controls/Multimedia/Audio/Synthesized/PianoRoll/PianoRollControl.resx +++ b/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Controls/Multimedia/Audio/Synthesized/PianoRoll/PianoRollControl.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Editors/Multimedia/Audio/Synthesized/SynthesizedAudioEditor.cs b/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Editors/Multimedia/Audio/Synthesized/SynthesizedAudioEditor.cs index ad35ad6a..e598ad7a 100644 --- a/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Editors/Multimedia/Audio/Synthesized/SynthesizedAudioEditor.cs +++ b/CSharp/Engines/WindowsForms/Plugins/UniversalEditor.Plugins.Multimedia.UserInterface.WindowsForms/Editors/Multimedia/Audio/Synthesized/SynthesizedAudioEditor.cs @@ -122,10 +122,7 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized #region Editor Commands public override void Delete() { - while (pnlPianoRoll.SelectedCommands.Count > 0) - { - pnlPianoRoll.Commands.Remove(pnlPianoRoll.SelectedCommands[0]); - } + pnlPianoRoll.Delete(); } #endregion #endregion