Skip to content

Commit c636811

Browse files
authored
Fix LT-22560: Add Help option to Media line in Analyze (#950)
1 parent 01051b7 commit c636811

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

Src/LexText/Interlinear/InterlinDocRootSiteBase.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ protected virtual ContextMenuStrip MakeContextMenu(int ilineChoice)
519519
// (separator)
520520
// 5) Add Line > (submenu of currently hidden lines)
521521
// 6) Configure Interlinear...
522+
// 7) Help
522523

523524
if (Vc != null && Vc.LineChoices != null && !isRibbonMenu) // just to be safe; shouldn't happen
524525
{
@@ -554,14 +555,31 @@ protected virtual ContextMenuStrip MakeContextMenu(int ilineChoice)
554555
menu.Items.Add(addLineSubMenu);
555556
}
556557

557-
// 6) Last, but not least, add a link to the Configure Interlinear dialog
558+
// 6) Add a link to the Configure Interlinear dialog
558559
var configLink = new ToolStripMenuItem(ITextStrings.ksConfigureLinkText);
559560
configLink.Click += new EventHandler(configLink_Click); // TODO: Figure out how to pass more parameters
560561
menu.Items.Add(configLink);
561562

563+
// 7) Add Help.
564+
if (Vc != null && Vc.LineChoices != null && !isRibbonMenu)
565+
{
566+
if (Vc.LineChoices.EnabledLineSpecs[ilineChoice].Flid == InterlinLineChoices.kflidMedia)
567+
{
568+
ImageCollection smallImages = m_propertyTable.GetValue<ImageCollection>("smallImages");
569+
Image imgHelp = smallImages.GetImage("Help");
570+
menu.Items.Add(new ToolStripMenuItem("Help...", null, this.OnMediaHelp));
571+
}
572+
}
573+
562574
return menu;
563575
}
564576

577+
public void OnMediaHelp(object sender, EventArgs args)
578+
{
579+
CheckDisposed();
580+
ShowHelp.ShowHelpTopic(m_propertyTable.GetValue<IHelpTopicProvider>("HelpTopicProvider"), "khtpField-Interlinear-Media");
581+
}
582+
565583
private void AddHideLineMenuItem(ContextMenuStrip menu,
566584
InterlinLineChoices curLineChoices, int ilineChoice)
567585
{

0 commit comments

Comments
 (0)