This commit is contained in:
Nikolaj Olsson 2018-12-29 22:09:29 +01:00
parent 7fe3856d45
commit b797ba0b6c
3 changed files with 68 additions and 67 deletions

View File

@ -4094,6 +4094,7 @@
this.pictureBoxBookmark.TabIndex = 41;
this.pictureBoxBookmark.TabStop = false;
this.pictureBoxBookmark.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pictureBoxBookmark_MouseClick);
this.pictureBoxBookmark.MouseEnter += new System.EventHandler(this.pictureBoxBookmark_MouseEnter);
//
// labelSingleLine
//

View File

@ -23633,69 +23633,69 @@ namespace Nikse.SubtitleEdit.Forms
}
}
}
else if (e.Button == MouseButtons.Right)
}
private void pictureBoxBookmark_MouseEnter(object sender, EventArgs e)
{
if (_bookmarkContextMenu != null)
return;
_bookmarkContextMenu = new ContextMenu();
// edit bookmark
var menuItem = new MenuItem(Configuration.Settings.Language.Main.Menu.ContextMenu.EditBookmark);
menuItem.Click += (sender2, e2) =>
{
if (_bookmarkContextMenu == null)
var p1 = _subtitle.GetParagraphOrDefault(_subtitleListViewIndex);
if (p1 != null)
{
_bookmarkContextMenu = new ContextMenu();
// edit bookmark
var menuItem = new MenuItem(Configuration.Settings.Language.Main.Menu.ContextMenu.EditBookmark);
menuItem.Click += (sender2, e2) =>
using (var form = new BookmarkAdd(p1))
{
var p1 = _subtitle.GetParagraphOrDefault(_subtitleListViewIndex);
if (p1 != null)
var result = form.ShowDialog(this);
if (result == DialogResult.OK)
{
using (var form = new BookmarkAdd(p1))
{
var result = form.ShowDialog(this);
if (result == DialogResult.OK)
{
p1.Bookmark = form.Comment;
SubtitleListview1.ShowState(_subtitleListViewIndex, p1);
ShowHideBookmark(p1);
SubtitleListview1.StateImageList = _subtitle != null && _subtitle.Paragraphs.Any(p => p.Bookmark != null) ? imageListBookmarks : null;
}
}
}
};
_bookmarkContextMenu.MenuItems.Add(menuItem);
// remove bookmark
menuItem = new MenuItem(Configuration.Settings.Language.Main.Menu.ContextMenu.RemoveBookmark);
menuItem.Click += (sender2, e2) =>
{
var p2 = _subtitle.GetParagraphOrDefault(_subtitleListViewIndex);
if (p2 != null)
{
p2.Bookmark = null;
SubtitleListview1.ShowState(_subtitleListViewIndex, p2);
ShowHideBookmark(p2);
p1.Bookmark = form.Comment;
SubtitleListview1.ShowState(_subtitleListViewIndex, p1);
ShowHideBookmark(p1);
SubtitleListview1.StateImageList = _subtitle != null && _subtitle.Paragraphs.Any(p => p.Bookmark != null) ? imageListBookmarks : null;
}
};
_bookmarkContextMenu.MenuItems.Add(menuItem);
_bookmarkContextMenu.MenuItems.Add("-");
// go to bookmark
menuItem = new MenuItem(Configuration.Settings.Language.Settings.GoToBookmark);
menuItem.Click += (sender2, e2) => { GoToBookmark(); };
_bookmarkContextMenu.MenuItems.Add(menuItem);
// clear all bookmarks
menuItem = new MenuItem(Configuration.Settings.Language.Settings.ClearBookmarks);
menuItem.Click += (sender2, e2) => { ClearBookmarks(); };
_bookmarkContextMenu.MenuItems.Add(menuItem);
pictureBoxBookmark.ContextMenu = _bookmarkContextMenu;
_bookmarkContextMenu.Show(pictureBoxBookmark, new Point(pictureBoxBookmark.Width - 3, pictureBoxBookmark.Height - 3));
}
}
else
};
_bookmarkContextMenu.MenuItems.Add(menuItem);
// remove bookmark
menuItem = new MenuItem(Configuration.Settings.Language.Main.Menu.ContextMenu.RemoveBookmark);
menuItem.Click += (sender2, e2) =>
{
var p2 = _subtitle.GetParagraphOrDefault(_subtitleListViewIndex);
if (p2 != null)
{
_bookmarkContextMenu.Show(pictureBoxBookmark, new Point(Cursor.Position.X - 3, Cursor.Position.Y - 3));
p2.Bookmark = null;
SubtitleListview1.ShowState(_subtitleListViewIndex, p2);
ShowHideBookmark(p2);
SubtitleListview1.StateImageList = _subtitle != null && _subtitle.Paragraphs.Any(p => p.Bookmark != null) ? imageListBookmarks : null;
}
}
};
_bookmarkContextMenu.MenuItems.Add(menuItem);
_bookmarkContextMenu.MenuItems.Add("-");
// go to bookmark
menuItem = new MenuItem(Configuration.Settings.Language.Settings.GoToBookmark);
menuItem.Click += (sender2, e2) => { GoToBookmark(); };
_bookmarkContextMenu.MenuItems.Add(menuItem);
// clear all bookmarks
menuItem = new MenuItem(Configuration.Settings.Language.Settings.ClearBookmarks);
menuItem.Click += (sender2, e2) =>
{
ClearBookmarks();
};
_bookmarkContextMenu.MenuItems.Add(menuItem);
pictureBoxBookmark.ContextMenu = _bookmarkContextMenu;
}
}
}

View File

@ -463,18 +463,18 @@
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALnSURBVFhHtZfPaxNBFMdHs7/GpPsjOz0KXvXg2YPevXj3
4B/gxbsHoUerWBEUGrAFLcVWa5qEIigWg6dSqqDQltKKaXazggfxUhH80fW9MAnb2Vew2ewXvqd5b98n
b/bNTthh2rDKccRFym3NvSBDSDUMJ6Y8xpgmQ/5Pb0yXBOiYflWGkKKKo48MsAQAO5afAljn4k/LdE7J
sJSo4ugjA4wZzv6yQXch5P6EDEuJKo4eCGBOs+M20YXIFN/XGSvJ0AOiiqMHAqjpdtw0vDQAODBHr8nQ
A6KKowcCwMTpgk0CRJa3DQ89LsP7Ugv3PDDAFGzDmkmPZMdwL8nwvtTCPQ8M8BS2YUZzSIDAEssyvC+1
cM8DA6BvF0biTeJgqnKxH+ruWZnSVbJo0pkAJrWReFGnuxBa/pRM6SpZNOlMADPwHtyBLnymRpI7P7dZ
aVSm5QOA4zgOAK8OOZg6lrgh09gCxCYL95wJAH0PAO6DoeAvFSDSnS9wMBmY9wi6lczrOTMAjiN2IeTl
uRQAOLTcK5j3AGKSeT1nBsBx7AJo5XMkgCneYd4tiFkktiEzABrHEdciw1+hINqadx4h8aVVc4cCgOOI
a4EuLlMAcFd4jgAYp+YOBQB/Ga414WER9wMVAO8K+A5gp3BykrlDAcCHymUWWt51FQD9GkYVuzCbBwBa
LrOA2eUtXvqhAuzCYYWHVkXZh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