Added "Insert line" context menu in list view when no subtitle is loaded

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@240 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2011-01-12 05:49:45 +00:00
parent 364bada948
commit aab5a30d6c
5 changed files with 37 additions and 8 deletions

View File

@ -316,6 +316,8 @@
this.textBoxSource = new System.Windows.Forms.TextBox();
this.panelVideoPlayer = new System.Windows.Forms.Panel();
this.mediaPlayer = new Nikse.SubtitleEdit.Controls.VideoPlayerContainer();
this.contextMenuStripEmpty = new System.Windows.Forms.ContextMenuStrip(this.components);
this.insertLineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.statusStrip1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
@ -349,6 +351,7 @@
((System.ComponentModel.ISupportInitialize)(this.numericUpDownDuration)).BeginInit();
this.tabPage2.SuspendLayout();
this.panelVideoPlayer.SuspendLayout();
this.contextMenuStripEmpty.SuspendLayout();
this.SuspendLayout();
//
// statusStrip1
@ -3125,6 +3128,20 @@
this.mediaPlayer.DragDrop += new System.Windows.Forms.DragEventHandler(this.mediaPlayer_DragDrop);
this.mediaPlayer.DragEnter += new System.Windows.Forms.DragEventHandler(this.mediaPlayer_DragEnter);
//
// contextMenuStripEmpty
//
this.contextMenuStripEmpty.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.insertLineToolStripMenuItem});
this.contextMenuStripEmpty.Name = "contextMenuStripEmpty";
this.contextMenuStripEmpty.Size = new System.Drawing.Size(126, 26);
//
// insertLineToolStripMenuItem
//
this.insertLineToolStripMenuItem.Name = "insertLineToolStripMenuItem";
this.insertLineToolStripMenuItem.Size = new System.Drawing.Size(125, 22);
this.insertLineToolStripMenuItem.Text = "Insert line";
this.insertLineToolStripMenuItem.Click += new System.EventHandler(this.insertLineToolStripMenuItem_Click);
//
// Main
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -3192,6 +3209,7 @@
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.panelVideoPlayer.ResumeLayout(false);
this.contextMenuStripEmpty.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@ -3485,6 +3503,8 @@
private System.Windows.Forms.ToolStripButton toolStripButtonLockCenter;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemInsertSubtitle;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemAutoSplitLongLines;
private System.Windows.Forms.ContextMenuStrip contextMenuStripEmpty;
private System.Windows.Forms.ToolStripMenuItem insertLineToolStripMenuItem;
}
}

View File

@ -602,9 +602,10 @@ namespace Nikse.SubtitleEdit.Forms
toolStripButtonHelp.ToolTipText = _language.Menu.ToolBar.Help;
toolStripButtonToogleWaveForm.ToolTipText = _language.Menu.ToolBar.ShowHideWaveForm;
toolStripButtonToogleVideo.ToolTipText = _language.Menu.ToolBar.ShowHideVideo;
toolStripMenuItemDelete.Text = _language.Menu.ContextMenu.Delete;
insertLineToolStripMenuItem.Text = _language.Menu.ContextMenu.InsertFirstLine;
toolStripMenuItemInsertBefore.Text = _language.Menu.ContextMenu.InsertBefore;
toolStripMenuItemInsertAfter.Text = _language.Menu.ContextMenu.InsertAfter;
toolStripMenuItemInsertSubtitle.Text = _language.Menu.ContextMenu.InsertSubtitleAfter;
@ -2905,6 +2906,7 @@ namespace Nikse.SubtitleEdit.Forms
{
if (SubtitleListview1.SelectedItems.Count == 0)
{
contextMenuStripEmpty.Show(MousePosition.X, MousePosition.Y);
e.Cancel = true;
}
else
@ -8119,6 +8121,11 @@ namespace Nikse.SubtitleEdit.Forms
RestoreSubtitleListviewIndexes();
}
}
}
private void insertLineToolStripMenuItem_Click(object sender, EventArgs e)
{
InsertBefore();
}
}

View File

@ -580,9 +580,6 @@
<metadata name="toolStripWaveControls.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>449, 58</value>
</metadata>
<metadata name="toolStripWaveControls.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>449, 58</value>
</metadata>
<data name="toolStripButtonWaveFormZoomOut.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
@ -654,17 +651,20 @@
<value>840, 56</value>
</metadata>
<metadata name="timerAutoContinue.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 95</value>
<value>1177, 56</value>
</metadata>
<metadata name="timerStillTyping.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>173, 95</value>
<value>1333, 56</value>
</metadata>
<metadata name="timerWaveForm.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>310, 95</value>
<value>1470, 56</value>
</metadata>
<metadata name="contextMenuStripWaveForm.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 56</value>
</metadata>
<metadata name="contextMenuStripEmpty.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>994, 56</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAkAMDAQAAEABABoBgAAlgAAACAgEAABAAQA6AIAAP4GAAAQEBAAAQAEACgBAADmCQAAMDAAAAEA

View File

@ -802,6 +802,7 @@ namespace Nikse.SubtitleEdit.Logic
Paste = "Paste",
Delete = "Delete",
SelectAll = "Select all",
InsertFirstLine = "Insert line",
InsertBefore = "Insert before",
InsertAfter = "Insert after",
InsertSubtitleAfter = "Insert subtitle after this line...",
@ -835,7 +836,7 @@ namespace Nikse.SubtitleEdit.Logic
UndoChangesInEditPanel = "Undo changes in edit panel",
Previous = "< Prev",
Next = "Next >",
AutoBreak = "Auto br",
AutoBreak = "Auto &br",
Unbreak = "Unbreak"
},

View File

@ -723,6 +723,7 @@
public string Paste { get; set; }
public string Delete { get; set; }
public string SelectAll { get; set; }
public string InsertFirstLine { get; set; }
public string InsertBefore { get; set; }
public string InsertAfter { get; set; }
public string InsertSubtitleAfter { get; set; }