Added Enhanced Document Menus
SetAdministrator Support for Import and Export Procedure Sets, Import Procedure, Export Procedure Added ROID PDF Destinations to Complete RO Report so that PDF Links can go to a specific Refenced Object in the Complete RO Report PDF. Add PDF Links for Enhanced Documents and Complete RO Report
This commit is contained in:
@@ -121,10 +121,118 @@ namespace Volian.Controls.Library
|
||||
private Dictionary<string, string> MyAvailableROs;
|
||||
public void SetContextMenu()
|
||||
{
|
||||
AddEnhancedDocumentMenu(btnCMRtfEdit);
|
||||
AddWROContext(btnCMRtfEdit);
|
||||
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit);
|
||||
}
|
||||
|
||||
private void AddEnhancedDocumentMenu(DevComponents.DotNetBar.ButtonItem myButtonItem)
|
||||
{
|
||||
DevComponents.DotNetBar.BaseItem btnSourceToBackground = null;
|
||||
DevComponents.DotNetBar.BaseItem btnBackgroundToSource = null;
|
||||
DevComponents.DotNetBar.BaseItem btnSourceToDeviation = null;
|
||||
DevComponents.DotNetBar.BaseItem btnDeviationToSource = null;
|
||||
#region background
|
||||
if (!myButtonItem.SubItems.Contains("btnSourceToBackground"))
|
||||
{
|
||||
btnSourceToBackground = new DevComponents.DotNetBar.ButtonItem("btnSourceToBackground", "Go To Background Document");
|
||||
btnSourceToBackground.Visible = false;
|
||||
btnSourceToBackground.Click += btnSourceToBackground_Click;
|
||||
myButtonItem.SubItems.Add(btnSourceToBackground);
|
||||
}
|
||||
else
|
||||
btnSourceToBackground = myButtonItem.SubItems["btnSourceToBackground"];
|
||||
if (!myButtonItem.SubItems.Contains("btnBackgroundToSource"))
|
||||
{
|
||||
btnBackgroundToSource = new DevComponents.DotNetBar.ButtonItem("btnBackgroundToSource", "Go To Source Document");
|
||||
btnBackgroundToSource.Visible = false;
|
||||
btnBackgroundToSource.Click += btnBackgroundToSource_Click;
|
||||
myButtonItem.SubItems.Add(btnBackgroundToSource);
|
||||
}
|
||||
else
|
||||
btnBackgroundToSource = myButtonItem.SubItems["btnBackgroundToSource"];
|
||||
StepConfig sc = new StepConfig(_MyStepRTB.MyItemInfo.MyContent.Config);
|
||||
if (sc.Step_SourceToBackground != null)
|
||||
{
|
||||
btnSourceToBackground.Tag = sc.Step_SourceToBackground;
|
||||
btnSourceToBackground.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnSourceToBackground.Tag = string.Empty;
|
||||
btnSourceToBackground.Visible = false;
|
||||
}
|
||||
if (sc.Step_BackgroundToSource != null)
|
||||
{
|
||||
btnBackgroundToSource.Tag = sc.Step_BackgroundToSource;
|
||||
btnBackgroundToSource.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnBackgroundToSource.Tag = string.Empty;
|
||||
btnBackgroundToSource.Visible = false;
|
||||
}
|
||||
#endregion
|
||||
#region deviation
|
||||
if (!myButtonItem.SubItems.Contains("btnSourceToDeviation"))
|
||||
{
|
||||
btnSourceToDeviation = new DevComponents.DotNetBar.ButtonItem("btnSourceToDeviation", "Go To Deviation Document");
|
||||
btnSourceToDeviation.Visible = false;
|
||||
btnSourceToDeviation.Click += btnSourceToBackground_Click;
|
||||
myButtonItem.SubItems.Add(btnSourceToDeviation);
|
||||
}
|
||||
else
|
||||
btnSourceToDeviation = myButtonItem.SubItems["btnSourceToDeviation"];
|
||||
if (!myButtonItem.SubItems.Contains("btnDeviationToSource"))
|
||||
{
|
||||
btnDeviationToSource = new DevComponents.DotNetBar.ButtonItem("btnDeviationToSource", "Go To Source Document");
|
||||
btnDeviationToSource.Visible = false;
|
||||
btnDeviationToSource.Click += btnBackgroundToSource_Click;
|
||||
myButtonItem.SubItems.Add(btnDeviationToSource);
|
||||
}
|
||||
else
|
||||
btnDeviationToSource = myButtonItem.SubItems["btnDeviationToSource"];
|
||||
if (sc.Step_SourceToDeviation != null)
|
||||
{
|
||||
btnSourceToDeviation.Tag = sc.Step_SourceToDeviation;
|
||||
btnSourceToDeviation.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnSourceToDeviation.Tag = string.Empty;
|
||||
btnSourceToDeviation.Visible = false;
|
||||
}
|
||||
if (sc.Step_DeviationToSource != null)
|
||||
{
|
||||
btnDeviationToSource.Tag = sc.Step_DeviationToSource;
|
||||
btnDeviationToSource.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnDeviationToSource.Tag = string.Empty;
|
||||
btnDeviationToSource.Visible = false;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
void btnBackgroundToSource_Click(object sender, EventArgs e)
|
||||
{
|
||||
DevComponents.DotNetBar.BaseItem btn = sender as DevComponents.DotNetBar.BaseItem;
|
||||
ItemInfo ii = ItemInfo.Get(int.Parse(btn.Tag.ToString()));
|
||||
StepTabPanel tmp = Parent as StepTabPanel;
|
||||
tmp.MyDisplayTabControl.OpenItem(ii);
|
||||
}
|
||||
|
||||
void btnSourceToBackground_Click(object sender, EventArgs e)
|
||||
{
|
||||
DevComponents.DotNetBar.BaseItem btn = sender as DevComponents.DotNetBar.BaseItem;
|
||||
ItemInfo ii = ItemInfo.Get(int.Parse(btn.Tag.ToString()));
|
||||
//StepTabPanel tmp = Parent as StepTabPanel;
|
||||
//tmp.MyDisplayTabControl.OpenItem(ii);
|
||||
// OpenEnhancedDocument(this, new StepTabRibbonEventArgs(ii));
|
||||
MyEditItem.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnOpenEnhancedDocument(new ItemSelectedChangedEventArgs(ii));
|
||||
}
|
||||
|
||||
#region set up save ro menu jcb 20121221
|
||||
private void AddWROContext(DevComponents.DotNetBar.ButtonItem myButtonItem)
|
||||
{
|
||||
@@ -645,7 +753,12 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
#endregion
|
||||
#region Events
|
||||
|
||||
//public event StepTabRibbonEvent OpenEnhancedDocument;
|
||||
//private void OnOpenEnhancedDocument(StepTabRibbonEventArgs args)
|
||||
//{
|
||||
// if (OpenEnhancedDocument != null)
|
||||
// OpenEnhancedDocument(this, args);
|
||||
//}
|
||||
public event StepTabRibbonEvent PrintRequest;
|
||||
private void OnPrintRequest(StepTabRibbonEventArgs args)
|
||||
{
|
||||
@@ -1921,6 +2034,11 @@ namespace Volian.Controls.Library
|
||||
btnEditMode.Checked = btnCMEditMode1.Checked = MyEditItem.MyStepPanel.VwMode == E_ViewMode.View;
|
||||
MyEditItem.MyStepRTB.SpellCheckContextMenuOn(MyEditItem.MyStepPanel.VwMode != E_ViewMode.View);
|
||||
}
|
||||
//private void btnEnhancedDocSync_Click(object sender, System.EventArgs e)
|
||||
//{
|
||||
// btnEnhancedDocSync.Checked = !btnEnhancedDocSync.Checked;
|
||||
//}
|
||||
|
||||
|
||||
private void btnROEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
@@ -21,7 +21,7 @@ namespace Volian.Controls.Library
|
||||
public delegate void vlnTreeViewEvent(object sender, vlnTreeEventArgs args);
|
||||
public delegate void vlnTreeViewTimeEvent(object sender, vlnTreeTimeEventArgs args);
|
||||
public delegate void vlnTreeViewStatusEvent(object sender, vlnTreeStatusEventArgs args);
|
||||
public delegate ItemInfo vlnTreeViewClipboardStatusEvent(object sender, vlnTreeEventArgs args);
|
||||
public delegate ItemInfo vlnTreeViewClipboardStatusEvent(object sender, vlnTreeEventArgs args);
|
||||
public delegate void vlnTreeViewItemInfoEvent(object sender, vlnTreeItemInfoEventArgs args);
|
||||
public delegate bool vlnTreeViewBoolEvent(object sender, vlnTreeEventArgs args);
|
||||
public delegate bool vlnTreeViewItemInfoDeleteEvent(object sender, vlnTreeItemInfoEventArgs args);
|
||||
@@ -606,7 +606,7 @@ namespace Volian.Controls.Library
|
||||
// add docversion.
|
||||
FolderInfo fi = tn.VEObject as FolderInfo;
|
||||
bool DoSpecificInfo = fi.ActiveFormat.PlantFormat.FormatData.SpecificInfo;
|
||||
if (ui.IsAdministrator())// && fi.MyParent == null) //VEPROMS level
|
||||
if (ui.IsAdministrator() || ui.IsSetAdministrator(fi))// && fi.MyParent == null) //VEPROMS level
|
||||
{
|
||||
if(fi.HasWorkingDraft)
|
||||
cm.MenuItems.Add("Export Procedure Set", new EventHandler(mi_Click));
|
||||
@@ -632,7 +632,7 @@ namespace Volian.Controls.Library
|
||||
else if (tn.VEObject as DocVersionInfo != null) // DocVersions can only contain procs
|
||||
{
|
||||
DocVersionInfo dvi = tn.VEObject as DocVersionInfo;
|
||||
if (ui.IsAdministrator())
|
||||
if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi))
|
||||
{
|
||||
cm.MenuItems.Add("Import Procedure", mi_Click);
|
||||
}
|
||||
@@ -725,7 +725,7 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
ProcedureInfo pri = tn.VEObject as ProcedureInfo;
|
||||
oi = OwnerInfo.GetByItemID(pri.ItemID, CheckOutType.Procedure);
|
||||
if (ui.IsAdministrator())
|
||||
if (ui.IsAdministrator() || ui.IsSetAdministrator(pri.MyDocVersion))
|
||||
{
|
||||
cm.MenuItems.Add("Export Procedure", mi_Click);
|
||||
}
|
||||
@@ -2012,7 +2012,7 @@ namespace Volian.Controls.Library
|
||||
if (!hasMetaSubs) doPseudo = true;
|
||||
}
|
||||
}
|
||||
using (Section section = CreateNewSection())
|
||||
using(Section section = CreateNewSection())
|
||||
{
|
||||
ShowBrokenRules(section.BrokenRulesCollection);
|
||||
SetLastValues(SectionInfo.Get(section.ItemID));
|
||||
@@ -2095,7 +2095,7 @@ namespace Volian.Controls.Library
|
||||
int indx = tvindex + ((newtype == MenuSelections.SectionBefore) ? 0 : 1);
|
||||
if (indx >= par.Nodes.Count || (par.Nodes[indx] as VETreeNode).VEObject.ToString() != _LastSectionInfo.ToString())
|
||||
{
|
||||
tn = new VETreeNode(_LastSectionInfo);
|
||||
tn = new VETreeNode(_LastSectionInfo);
|
||||
par.Nodes.Insert(indx, tn);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user