Fixed code so that Right-Click is accounted for before going to an enhanced document

This commit is contained in:
Rich
2016-01-28 16:18:13 +00:00
parent 3d38002678
commit b087ce9996
3 changed files with 10 additions and 9 deletions

View File

@@ -119,14 +119,14 @@ namespace Volian.Controls.Library
#region Save ROs from Word Document jcb 20121221
private string MyLookupData;
private Dictionary<string, string> MyAvailableROs;
public void SetContextMenu()
public void SetContextMenu(object sender)
{
AddEnhancedDocumentMenu(btnCMRtfEdit);
AddEnhancedDocumentMenu(btnCMRtfEdit, sender);
AddWROContext(btnCMRtfEdit);
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit);
}
private void AddEnhancedDocumentMenu(DevComponents.DotNetBar.ButtonItem myButtonItem)
private void AddEnhancedDocumentMenu(DevComponents.DotNetBar.ButtonItem myButtonItem, object sender)
{
// get a list of all of the current enhanced buttons that been defined for context menu
List<string> unusedEnhancedButtons = new List<string>();
@@ -136,7 +136,8 @@ namespace Volian.Controls.Library
// for all enhanced documents, get the list of buttons as they should be for the
// selected step
StepConfig sc = new StepConfig(_MyStepRTB.MyItemInfo.MyContent.Config);
StepRTB myStepRTB = sender as StepRTB ?? _MyStepRTB;
StepConfig sc = new StepConfig(myStepRTB.MyItemInfo.MyContent.Config);
DVEnhancedDocuments dveds = MyItemInfo.MyDocVersion.DocVersionConfig.MyEnhancedDocuments;
foreach(EnhancedDocument ed in sc.MyEnhancedDocuments)
{
@@ -412,9 +413,9 @@ namespace Volian.Controls.Library
if (rtabTableGridTools.Visible)
_ContextMenuBar.SetContextMenuEx(MyFlexGrid, btnCMGrid);
}
public void OpenContextMenu(Point loc)
public void OpenContextMenu(Point loc, object sender)
{
AddEnhancedDocumentMenu(btnCMRtfEdit);
AddEnhancedDocumentMenu(btnCMRtfEdit,sender);
btnCMRtfEdit.Popup(loc);
}
private int _MyLastFormatID = -1;