C2022-003-Change-Textboxes-to-RTF-3
This commit is contained in:
@@ -188,7 +188,6 @@ namespace Volian.Controls.Library
|
||||
this.tabSearchTypes.Controls.Add(this.tabControlPanel5);
|
||||
this.tabSearchTypes.Controls.Add(this.tabControlPanel2);
|
||||
this.tabSearchTypes.Controls.Add(this.tabControlPanel3);
|
||||
this.tabSearchTypes.Controls.Add(this.tabControlPanel1);
|
||||
this.tabSearchTypes.Controls.Add(this.contextMenuBar1);
|
||||
this.tabSearchTypes.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.tabSearchTypes.Location = new System.Drawing.Point(0, 0);
|
||||
@@ -983,7 +982,6 @@ namespace Volian.Controls.Library
|
||||
this.tabControlPanel1.Controls.Add(this.lblSrchIncTran);
|
||||
this.tabControlPanel1.Controls.Add(this.groupBox1);
|
||||
this.tabControlPanel1.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.tabControlPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tabControlPanel1.Location = new System.Drawing.Point(0, 34);
|
||||
this.tabControlPanel1.Name = "tabControlPanel1";
|
||||
this.tabControlPanel1.Padding = new System.Windows.Forms.Padding(1);
|
||||
@@ -997,6 +995,8 @@ namespace Volian.Controls.Library
|
||||
this.tabControlPanel1.Style.GradientAngle = 90;
|
||||
this.tabControlPanel1.TabIndex = 17;
|
||||
this.tabControlPanel1.TabItem = this.tabIncTrans;
|
||||
this.tabControlPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(( System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.tabControlPanel1.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
//
|
||||
// btnTranCvtSelToTxt
|
||||
//
|
||||
@@ -1732,6 +1732,12 @@ namespace Volian.Controls.Library
|
||||
this.Controls.Add(this.xpStepTypes);
|
||||
this.Controls.Add(this.xpSetToSearch);
|
||||
this.Controls.Add(this.tabSearchTypes);
|
||||
this.Controls.Add(this.tabControlPanel1);
|
||||
//B2025-056 Click on Incoming Transitions
|
||||
// This needs to be part of overall control
|
||||
// since if it is part of tabSearchTypes,
|
||||
// then when that is disabled, buttons on
|
||||
// this will be also
|
||||
this.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.Name = "DisplaySearch";
|
||||
this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
|
||||
|
||||
@@ -1857,14 +1857,15 @@ namespace Volian.Controls.Library
|
||||
lbSrchResultsIncTrans.Enabled = false;
|
||||
lbSrchResultsIncTrans.UseWaitCursor = true;
|
||||
}
|
||||
ListBox mylb = sender as ListBox;
|
||||
//B2025-056 Click on Incoming Transitions
|
||||
// Clicking on Incoming Transitions
|
||||
// will now open that item
|
||||
ListBox mylb_lbSrchResults = sender as ListBox;
|
||||
ListBoxAdv mylb_lbSrchResultsIncTrans = sender as ListBoxAdv;
|
||||
|
||||
// If the list is being refreshed, then set the selection index to -1 (no selection)
|
||||
// B2022-044: don't set selection to top of list (commented out/changed if)
|
||||
//if (mylb != null && _SearchResults.RefreshingList && mylb.SelectedIndex != -1)
|
||||
// //mylb.SelectedIndex = -1;
|
||||
//else
|
||||
if (mylb != null && !_SearchResults.RefreshingList)
|
||||
if ((mylb_lbSrchResults != null || mylb_lbSrchResultsIncTrans != null) && !_SearchResults.RefreshingList)
|
||||
{
|
||||
_ItemInfo = (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4]) ? lbSrchResultsIncTrans.SelectedValue as ItemInfo : lbSrchResults.SelectedValue as ItemInfo;
|
||||
if ((tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[1]) && (_ItemInfo != null))
|
||||
|
||||
@@ -11,6 +11,7 @@ using DevComponents.DotNetBar;
|
||||
using JR.Utils.GUI.Forms;
|
||||
using Volian.Base.Library;
|
||||
using Microsoft.Win32;
|
||||
using System.Linq;
|
||||
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
@@ -261,24 +262,45 @@ namespace Volian.Controls.Library
|
||||
get { return _ChgId; }
|
||||
set { _ChgId = value; }
|
||||
}
|
||||
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
public bool EditorialChange
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_ChgId == null) return true;
|
||||
if (_ChgId == "") return true;
|
||||
if (_ChgId.ToUpper() == "EC") return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Events
|
||||
/// <summary>
|
||||
/// This event is raised when a the "Tab" of a DisplayItem is clicked with a mouse.
|
||||
/// So far this has just been used for demo purposes. It could be used to select a
|
||||
/// step and it's children for the purpose of copying.
|
||||
/// </summary>
|
||||
public event StepPanelEvent ItemClick;
|
||||
if (_ChgId.ToUpper() == "EC") { return true;}
|
||||
|
||||
return IsInEditorialMode;
|
||||
}
|
||||
}
|
||||
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// property to hold if button in ribbon is toggled on or off
|
||||
public bool IsInEditorialMode { get; set; } = false;
|
||||
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// This is used when button in the ribbon is toggled on/off
|
||||
// It iterates through all previously opened tabs
|
||||
// and updates the "Editorial Mode" button
|
||||
// and background color to match those of the current tab
|
||||
public void SetEdititorialModeForAllTabs(bool mode)
|
||||
{
|
||||
foreach (DisplayTabItem tabItem in _MyDisplayTabItems.Values.Where(tabItem => tabItem.MyStepTabPanel != null))
|
||||
{
|
||||
tabItem.MyStepTabPanel.MyStepTabRibbon.SetEditorialMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region Events
|
||||
/// <summary>
|
||||
/// This event is raised when a the "Tab" of a DisplayItem is clicked with a mouse.
|
||||
/// So far this has just been used for demo purposes. It could be used to select a
|
||||
/// step and it's children for the purpose of copying.
|
||||
/// </summary>
|
||||
public event StepPanelEvent ItemClick;
|
||||
/// <summary>
|
||||
/// Checks to see if the ItemClick event is handled and launches it
|
||||
/// </summary>
|
||||
@@ -581,7 +603,10 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
ItemInfo myItemInfo = myItemInfo2;
|
||||
|
||||
if (myItemInfo.MyDocVersion == null) // bug fix: B2016-108 disconnected data will not have a MyDocVersion
|
||||
bool viewonlymode = false;
|
||||
|
||||
//B2025-046 Remember Tabs failing when swapping versions of PROMS
|
||||
if (myItemInfo?.MyDocVersion == null) // bug fix: B2016-108 disconnected data will not have a MyDocVersion
|
||||
{
|
||||
FlexibleMessageBox.Show(this, "Possible disconnected item", "Item Not Found");
|
||||
return null;
|
||||
@@ -597,8 +622,20 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
if (!MySessionInfo.CanCheckOutItem(myItemInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message))
|
||||
{
|
||||
FlexibleMessageBox.Show(this, message, "Procedure Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
return null;
|
||||
DisplayTabItem dti = MyBar?.Items?.OfType<DisplayTabItem>().FirstOrDefault(x => x.MyItemInfo?.ItemID == myItemInfo.MyProcedure.ItemID);
|
||||
|
||||
//C2019-036 View Only mode work with Checked Out Procedures
|
||||
//shouldn't prompt - should just auto put in view only if already in open tab
|
||||
//in view only
|
||||
if (
|
||||
(dti != null && dti.MyStepTabPanel.MyStepPanel.VwMode == E_ViewMode.View)
|
||||
||
|
||||
(SeparateWindows && VersionID == myItemInfo.MyDocVersion.VersionID)
|
||||
|| //to handle special case where item will be opened in a separate window
|
||||
MessageBox.Show(this, message, "Procedure Already Checked Out", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
|
||||
viewonlymode = true;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -659,7 +696,7 @@ namespace Volian.Controls.Library
|
||||
// C2023-016 if a Word section and doing Find/Replace don't open Word section, position to section title in step editor instead
|
||||
if (myItemInfo.MyContent.MyEntry == null || doingFindReplace) // If it is not a Word document open in step editor
|
||||
{
|
||||
return OpenStepTabPage(myItemInfo, setFocus);
|
||||
return OpenStepTabPage(myItemInfo, setFocus, viewonlymode);
|
||||
}
|
||||
else // Otherwise open it in the Word editor
|
||||
{
|
||||
@@ -1155,7 +1192,7 @@ namespace Volian.Controls.Library
|
||||
//}
|
||||
//public Dictionary<DocVersionInfo, frmEnhanced> dicEnhancedDocuments = new Dictionary<DocVersionInfo, frmEnhanced>();
|
||||
|
||||
private DisplayTabItem OpenStepTabPage(ItemInfo myItemInfo, bool setFocus)
|
||||
private DisplayTabItem OpenStepTabPage(ItemInfo myItemInfo, bool setFocus, bool viewonlymode = false)
|
||||
{
|
||||
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
|
||||
string key = "Item - " + proc.ItemID.ToString();
|
||||
@@ -1174,7 +1211,7 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
else // If not already open, create a new Page
|
||||
{
|
||||
pg = new DisplayTabItem(this.components, this, proc, key); // Open a new Procedure Tab
|
||||
pg = new DisplayTabItem(this.components, this, proc, key, viewonlymode); // Open a new Procedure Tab
|
||||
_MyDisplayTabItems.Add(key, pg);
|
||||
if (setFocus)
|
||||
{
|
||||
|
||||
@@ -98,13 +98,18 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
#endregion
|
||||
#region Constructors
|
||||
public DisplayTabItem(IContainer container, DisplayTabControl myDisplayTabControl, ItemInfo myItemInfo, string myKey)
|
||||
public DisplayTabItem(IContainer container, DisplayTabControl myDisplayTabControl, ItemInfo myItemInfo, string myKey, bool viewonlymode = false)
|
||||
{
|
||||
_MyItemInfo = myItemInfo;
|
||||
if (MyItemInfo.MyContent.MyEntry == null)
|
||||
OwnerID = myDisplayTabControl.MySessionInfo.CheckOutItem(myItemInfo.MyProcedure.ItemID, CheckOutType.Procedure);
|
||||
else
|
||||
OwnerID = myDisplayTabControl.MySessionInfo.CheckOutItem(myItemInfo.MyContent.MyEntry.DocID, CheckOutType.Document);
|
||||
//C2019-036 View Only mode work with Checked Out Procedures
|
||||
//don't want to check out if opening in View Only Mode Due to someone else having it checked out
|
||||
if (!viewonlymode)
|
||||
{
|
||||
if (MyItemInfo.MyContent.MyEntry == null)
|
||||
OwnerID = myDisplayTabControl.MySessionInfo.CheckOutItem(myItemInfo.MyProcedure.ItemID, CheckOutType.Procedure);
|
||||
else
|
||||
OwnerID = myDisplayTabControl.MySessionInfo.CheckOutItem(myItemInfo.MyContent.MyEntry.DocID, CheckOutType.Document);
|
||||
}
|
||||
//Console.WriteLine("DisplayTabItem");
|
||||
_MyKey = myKey;
|
||||
_MyDisplayTabControl = myDisplayTabControl;
|
||||
@@ -112,7 +117,7 @@ namespace Volian.Controls.Library
|
||||
InitializeComponent();
|
||||
this.Click += new EventHandler(DisplayTabItem_Click);
|
||||
if (myItemInfo.MyContent.MyEntry == null)
|
||||
SetupStepTabPanel();
|
||||
SetupStepTabPanel(viewonlymode);
|
||||
else
|
||||
SetupDSOTabPanel();
|
||||
SetupSecurity(myItemInfo);
|
||||
@@ -128,7 +133,37 @@ namespace Volian.Controls.Library
|
||||
private bool MesssageShown = false;
|
||||
public void SetupSecurity(ItemInfo myItem)
|
||||
{
|
||||
UserInfo ui = UserInfo.GetByUserID(OwnerInfo.Get(OwnerID).SessionUserID);
|
||||
//C2019-036 View Only mode work with Checked Out Procedures
|
||||
//is in View Only Mode, so do not set up the Security
|
||||
if (OwnerID == 0)
|
||||
{
|
||||
|
||||
UserInfo uiViewOnly = UserInfo.GetByUserID(Base.Library.VlnSettings.UserID);
|
||||
if (uiViewOnly.IsAdministrator())
|
||||
{
|
||||
MyUserRole = $"{Base.Library.VlnSettings.UserID} - Administrator";
|
||||
}
|
||||
else if (uiViewOnly.IsSetAdministrator(myItem.MyDocVersion))
|
||||
{
|
||||
MyUserRole = $"{Base.Library.VlnSettings.UserID} - Set Administrator";
|
||||
}
|
||||
else if (uiViewOnly.IsWriter(myItem.MyDocVersion))
|
||||
{
|
||||
MyUserRole = $"{Base.Library.VlnSettings.UserID} - Writer";
|
||||
}
|
||||
else if (uiViewOnly.IsROEditor(myItem.MyDocVersion))
|
||||
{
|
||||
MyUserRole = $"{Base.Library.VlnSettings.UserID} - RO Editor";
|
||||
}
|
||||
else
|
||||
{
|
||||
MyUserRole = $"{Base.Library.VlnSettings.UserID} - Reviewer";
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
UserInfo ui = UserInfo.GetByUserID(OwnerInfo.Get(OwnerID).SessionUserID);
|
||||
|
||||
if (ui == null)
|
||||
{
|
||||
@@ -246,7 +281,7 @@ namespace Volian.Controls.Library
|
||||
/// <summary>
|
||||
/// Creates and sets-up a StepTabPanel
|
||||
/// </summary>
|
||||
private void SetupStepTabPanel()
|
||||
private void SetupStepTabPanel(bool viewonlymode = false)
|
||||
{
|
||||
((System.ComponentModel.ISupportInitialize)(_MyDisplayTabControl.MyBar)).BeginInit();
|
||||
_MyDisplayTabControl.MyBar.SuspendLayout();
|
||||
@@ -276,7 +311,7 @@ namespace Volian.Controls.Library
|
||||
_MyDisplayTabControl.MyBar.ResumeLayout(false);
|
||||
DocVersionInfo dvi = _MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo; //MyRTBItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo;
|
||||
if (dvi == null) return;
|
||||
if (dvi.VersionType > 127)
|
||||
if (dvi.VersionType > 127 || viewonlymode)
|
||||
MyStepTabPanel.MyStepPanel.VwMode = E_ViewMode.View;
|
||||
// C2021 - 027: Procedure level PC/PC - add _MyIteminfo to argument list
|
||||
if (dvi.MultiUnitCount > 1)
|
||||
|
||||
@@ -201,11 +201,15 @@ namespace Volian.Controls.Library
|
||||
/// </summary>
|
||||
public ItemInfo MyItemInfo
|
||||
{
|
||||
get { return _MyItemInfo; }
|
||||
get
|
||||
{
|
||||
ToolTipOnOff(); //B2025-050 Show the tooltip based on User Options Settings
|
||||
return _MyItemInfo;
|
||||
}
|
||||
set
|
||||
{
|
||||
_MyItemInfo = value;
|
||||
if (VlnSettings.StepTypeToolType) SetToolTip(_MyItemInfo.ToolTip);
|
||||
SetToolTip(_MyItemInfo.ToolTip); // B2025-050 always set tooltip text. This method will also show the tooltip based on User Options Settings
|
||||
ChangeBar = _MyItemInfo.HasChangeBar;
|
||||
CheckOff co = _MyItemInfo.GetCheckOffStep();
|
||||
if (co != null && co.UIMark != null)
|
||||
@@ -2977,6 +2981,8 @@ namespace Volian.Controls.Library
|
||||
public abstract void SetText();
|
||||
public abstract void SetExpandAndExpander(ItemInfo itemInfo);
|
||||
public abstract void SaveCurrentAndContents();
|
||||
public abstract void ToolTipOnOff();
|
||||
|
||||
#endregion
|
||||
private int SupInfoTopOffset
|
||||
{
|
||||
|
||||
@@ -462,8 +462,12 @@ namespace Volian.Controls.Library
|
||||
DevComponents.DotNetBar.SuperTooltipInfo tpi = new DevComponents.DotNetBar.SuperTooltipInfo("", "", tip, null, null, DevComponents.DotNetBar.eTooltipColor.Lemon);
|
||||
_MyToolTip.MinimumTooltipSize = new Size(0, 24);
|
||||
_MyToolTip.TooltipDuration = 3;
|
||||
//_MyToolTip.SetSuperTooltip(MyStepRTB, tpi);
|
||||
_MyToolTip.SetSuperTooltip(MyFlexGrid, tpi);
|
||||
ToolTipOnOff(); // B2025-050 Show the tooltip based on User Options Settings
|
||||
}
|
||||
public override void ToolTipOnOff()
|
||||
{
|
||||
_MyToolTip.Enabled = VlnSettings.StepTypeToolTip; // B2025-XXX Show the tooltip based on User Options Settings
|
||||
}
|
||||
private bool DoNotRefresh = false;
|
||||
public override void RefreshContent()
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using JR.Utils.GUI.Forms;
|
||||
using Volian.Base.Library;
|
||||
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
@@ -78,7 +79,7 @@ namespace Volian.Controls.Library
|
||||
/// <summary>
|
||||
/// Left edge of the PictureBox
|
||||
/// </summary>
|
||||
public override int ContentLeft
|
||||
override public int ContentLeft
|
||||
{
|
||||
get { return Left + _MyPictureBox.Left; }
|
||||
}
|
||||
@@ -95,8 +96,14 @@ namespace Volian.Controls.Library
|
||||
_MyToolTip.MinimumTooltipSize = new Size(0, 24);
|
||||
_MyToolTip.TooltipDuration = 3;
|
||||
_MyToolTip.SetSuperTooltip(MyPictureBox, tpi);
|
||||
ToolTipOnOff(); // B2025-050 Show the tooltip based on User Options Settings
|
||||
}
|
||||
public override void RefreshContent()
|
||||
public override void ToolTipOnOff()
|
||||
{
|
||||
_MyToolTip.Enabled = VlnSettings.StepTypeToolTip; // B2025-XXX Show the tooltip based on User Options Settings
|
||||
}
|
||||
|
||||
override public void RefreshContent()
|
||||
{
|
||||
IdentifyMe(false);
|
||||
RefreshDisplay(false);
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Base.Library;
|
||||
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
@@ -133,6 +134,11 @@ namespace Volian.Controls.Library
|
||||
_MyToolTip.MinimumTooltipSize = new Size(0, 24);
|
||||
_MyToolTip.TooltipDuration = 3;
|
||||
_MyToolTip.SetSuperTooltip(MyStepRTB, tpi);
|
||||
ToolTipOnOff(); // B2025-050 Show the tooltip based on User Options Settings
|
||||
}
|
||||
public override void ToolTipOnOff()
|
||||
{
|
||||
_MyToolTip.Enabled = VlnSettings.StepTypeToolTip; // B2025-XXX Show the tooltip based on User Options Settings
|
||||
}
|
||||
public override void RefreshContent()
|
||||
{
|
||||
@@ -793,27 +799,41 @@ namespace Volian.Controls.Library
|
||||
// if the plant has the change id option, the change id was entered when the program started.
|
||||
// this should be saved for every piece of edited data. Note that the set of config
|
||||
// item Step_MultipleChangeID has the save built in to it.
|
||||
if (sc == null) sc = new StepConfig();
|
||||
if (MyStepRTB.MyItemInfo.IsStep &&
|
||||
MyStepRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds
|
||||
&& !this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.EditorialChange)
|
||||
{
|
||||
//StepConfig sc = MyStepRTB.MyItemInfo.MyConfig as StepConfig;
|
||||
if (sc == null) sc = new StepConfig();
|
||||
sc.Step_ChangeID = this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.ChgId;
|
||||
//if (MyStepRTB.MyItemInfo.MyConfig == null) itm.MyContent.Config = sc.ToString();
|
||||
}
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// if in Editorial Mode, treat it the same as if the ChangeIds are set in the Format file
|
||||
if (MyStepPanel.MyStepTabPanel.MyDisplayTabControl.IsInEditorialMode && !existingChangeBar)
|
||||
{
|
||||
sc.Step_ChangeIDEditorialMode = Volian.Base.Library.VlnSettings.UserID;
|
||||
}
|
||||
else
|
||||
{
|
||||
sc.Step_ChangeIDEditorialMode = null;
|
||||
}
|
||||
// B2020-017: If making an editorial change, clear the Change id. Having the change id on
|
||||
// was adding/printing a change bar.
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// if in Editorial Mode, treat it the same as if the ChangeIds are set in the Format file
|
||||
if (MyStepRTB.MyItemInfo.IsStep &&
|
||||
MyStepRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds
|
||||
&& this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.EditorialChange
|
||||
&& hasChangeBar == false)
|
||||
(MyStepRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds
|
||||
|| MyStepPanel.MyStepTabPanel.MyDisplayTabControl.IsInEditorialMode
|
||||
)
|
||||
&& MyStepPanel.MyStepTabPanel.MyDisplayTabControl.EditorialChange
|
||||
&& !hasChangeBar)
|
||||
{
|
||||
if (sc == null) sc = new StepConfig();
|
||||
sc.Step_ChangeID = null;
|
||||
}
|
||||
// B2015-024 Have Spell Checker text changes be an editorial change (not assign a change bar but keep existing change bar)
|
||||
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.EditData.EditoralSpellCheck)
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// if in Editorial Mode, treat it the same as if the Rditorial SprllCheck flag is set in the Format file
|
||||
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.EditData.EditoralSpellCheck || this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.IsInEditorialMode)
|
||||
{
|
||||
if (StepRTB.DidEditorialSpellCheck)
|
||||
{
|
||||
|
||||
@@ -97,6 +97,11 @@ namespace Volian.Controls.Library
|
||||
_MyToolTip.MinimumTooltipSize = new Size(0, 24);
|
||||
_MyToolTip.TooltipDuration = 3;
|
||||
_MyToolTip.SetSuperTooltip(MyStepRTB, tpi);
|
||||
ToolTipOnOff(); // B2025-050 Show the tooltip based on User Options Settings
|
||||
}
|
||||
public override void ToolTipOnOff()
|
||||
{
|
||||
_MyToolTip.Enabled = VlnSettings.StepTypeToolTip; // B2025-XXX Show the tooltip based on User Options Settings
|
||||
}
|
||||
public override void RefreshContent()
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Drawing;
|
||||
using System.Text.RegularExpressions;
|
||||
using Volian.Base.Library;
|
||||
using JR.Utils.GUI.Forms;
|
||||
using System.Linq;
|
||||
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
@@ -386,6 +387,26 @@ namespace Volian.Controls.Library
|
||||
// The following line expands the items needed to display SelectedItemInfo
|
||||
ExpandAsNeeded(myItemInfo);
|
||||
}
|
||||
|
||||
//C2019-036 View Only mode work with Checked Out Procedures
|
||||
public void ResetAll()
|
||||
{
|
||||
List<int> itemIDs = Controls.OfType<RTBItem>().Where(t => t?.MyItemInfo?.ActiveParent != null && t.MyItemInfo.ActiveParent.GetType() == typeof(ItemInfo)).Select(x => (x.MyItemInfo.ActiveParent as ItemInfo).ItemID).Distinct().ToList();
|
||||
|
||||
foreach (int itemID in itemIDs)
|
||||
{
|
||||
ItemInfo.ResetParts(itemID);
|
||||
}
|
||||
|
||||
// The following line actually reloads the procedure item
|
||||
MyProcedureItemInfo = ItemInfo.Get(MyProcedureItemInfo.ItemID, true);
|
||||
MyProcedureItemInfo.RefreshConfig();
|
||||
ContentInfo.Refresh(Content.Get(MyProcedureItemInfo.MyContent.ContentID, true));
|
||||
|
||||
// The following line expands the items needed to display SelectedItemInfo
|
||||
ExpandAsNeeded(SelectedItemInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Currently selected StepRTB
|
||||
/// </summary>
|
||||
@@ -650,8 +671,13 @@ namespace Volian.Controls.Library
|
||||
/// </summary>
|
||||
public Color ActiveColor
|
||||
{
|
||||
get { return _ActiveColor; }
|
||||
set { _ActiveColor = value; }
|
||||
get {
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// if in Editorial Mode, use LightGreen background
|
||||
_ActiveColor = MyStepTabPanel != null && MyStepTabPanel.MyDisplayTabControl.IsInEditorialMode ? Color.LightGreen : Color.SkyBlue;
|
||||
return _ActiveColor;
|
||||
}
|
||||
set { _ActiveColor = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or Sets the Annotation backcolor for StepRTBs in the Panel
|
||||
|
||||
@@ -3764,7 +3764,12 @@ namespace Volian.Controls.Library
|
||||
public bool SpellCheckNext()
|
||||
{
|
||||
int nBad = C1SpellChecker2.CheckControl(this, false, MySpellCheckDlg);
|
||||
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.EditData.EditoralSpellCheck)
|
||||
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// if in Editorial Mode, treat it the same as if the EditorialSpellCheck flag is set in the Format file
|
||||
bool editorialmode = (this.Parent.Parent.Parent as StepTabPanel).MyDisplayTabControl.IsInEditorialMode;
|
||||
|
||||
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.EditData.EditoralSpellCheck || editorialmode)
|
||||
DidEditorialSpellCheck = MySpellCheckDlg.DidCorrectSpelling; // B2015-024 spell checker in editoral mode
|
||||
return (nBad >= 0); // nBad = -1 means user pressed Cancel button
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace Volian.Controls.Library
|
||||
/// </summary>
|
||||
private void SetupStepTabRibbon()
|
||||
{
|
||||
_MyStepTabRibbon = new StepTabRibbon();
|
||||
_MyStepTabRibbon = new StepTabRibbon(_MyDisplayTabControl.IsInEditorialMode);
|
||||
_MyStepTabRibbon.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
_MyStepTabRibbon.Location = new System.Drawing.Point(0, 0);
|
||||
_MyStepTabRibbon.Name = "displayTabRibbon1";
|
||||
|
||||
@@ -16,6 +16,8 @@ using DevComponents.DotNetBar;
|
||||
using Microsoft.Win32;
|
||||
using System.Diagnostics;
|
||||
using JR.Utils.GUI.Forms;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
@@ -959,6 +961,11 @@ namespace Volian.Controls.Library
|
||||
// //SetButtonAndMenuEnabling(false);
|
||||
//}
|
||||
private Bitmap createTextBitmap(char ch)
|
||||
{
|
||||
return createTextBitmap(ch, new Font("FreeMono", 18, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel));
|
||||
}
|
||||
|
||||
private Bitmap createTextBitmap(char ch, Font objFont)
|
||||
{
|
||||
string txt = string.Format("{0}", ch);
|
||||
Bitmap objBmpImage = new Bitmap(1, 1);
|
||||
@@ -969,8 +976,6 @@ namespace Volian.Controls.Library
|
||||
// Create the Font object for the image text drawing.
|
||||
// later on, we could add logic to use either FreeMono or Arial Unicode MS based on the format being used
|
||||
// but for now, we are going to use FreeMono to create the symbol list
|
||||
Font objFont = new Font("FreeMono", 18, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
|
||||
//Font objFont = new Font("Arial Unicode MS", 18, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
|
||||
|
||||
// Create a graphics object to measure the text's width and height.
|
||||
Graphics objGraphics = Graphics.FromImage(objBmpImage);
|
||||
@@ -990,7 +995,6 @@ namespace Volian.Controls.Library
|
||||
objGraphics.SmoothingMode = SmoothingMode.AntiAlias;
|
||||
objGraphics.TextContrast = 0;
|
||||
objGraphics.TextRenderingHint = TextRenderingHint.AntiAlias;
|
||||
//objGraphics.DrawString(txt, objFont, new SolidBrush(Color.FromArgb(102, 102, 102)), 0, 0);
|
||||
objGraphics.DrawString(txt, objFont, new SolidBrush(Color.Black),0,0);
|
||||
objGraphics.Flush();
|
||||
return (objBmpImage);
|
||||
@@ -1048,7 +1052,7 @@ namespace Volian.Controls.Library
|
||||
// SetButtonAndMenuEnabling(true);
|
||||
//}
|
||||
#region Constructor
|
||||
public StepTabRibbon()
|
||||
public StepTabRibbon(bool? IsInEditorialMode = false)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.btnInsSupInfo.Tag = string.Format("{0} {1}", (int)E_FromTypes.SupInfos, 1040); // Make type of rno (40) & special case 1000
|
||||
@@ -1074,8 +1078,16 @@ namespace Volian.Controls.Library
|
||||
// hide the import from Word file if not running in Debug mode
|
||||
if (!VlnSettings.DebugMode)
|
||||
rbnImpWrd.Visible = false;
|
||||
}
|
||||
void _RibbonControl_SizeChanged(object sender, EventArgs e)
|
||||
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// default Editorial Mode to what is set in the DisplayTabControl
|
||||
SetEditorialMode(IsInEditorialMode != null && (bool) IsInEditorialMode);
|
||||
|
||||
}
|
||||
|
||||
public void SetEditorialMode(bool mode) => btnEditorialMode.Checked = btnCMEditorialMode.Checked = mode;
|
||||
|
||||
void _RibbonControl_SizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.Size = _RibbonControl.Size;
|
||||
}
|
||||
@@ -2112,6 +2124,9 @@ namespace Volian.Controls.Library
|
||||
rtabHome.Select();
|
||||
rtabTableGridTools.Visible = false;
|
||||
SetButtonMenuEnabledDisabledOnStepType(false);
|
||||
//C2019-036 View Only mode work with Checked Out Procedures
|
||||
//Is in View Only Mode so show button as selected
|
||||
btnEditMode.Checked = btnCMEditMode1.Checked = true;
|
||||
this.Refresh();
|
||||
return;
|
||||
}
|
||||
@@ -3178,7 +3193,7 @@ namespace Volian.Controls.Library
|
||||
btnCMRedo.Enabled = btnRedo.Enabled = _MyStepRTB.CanRedo;
|
||||
btnCMUndo.Enabled = btnUndo.Enabled = _MyStepRTB.CanUndo;
|
||||
}
|
||||
private void btnGoTo_Click(object sender, EventArgs e)
|
||||
private void btnGoTo_Click(object sender, EventArgs e)
|
||||
{
|
||||
// if on a transition, go to the selected transition 'to'. If on
|
||||
// a referenced object, bring up ReferencedObject Editor (for now, just put up a message box.
|
||||
@@ -3264,7 +3279,29 @@ namespace Volian.Controls.Library
|
||||
System.Diagnostics.Process.Start(roapp, args);
|
||||
}
|
||||
}
|
||||
private void btnChgTyp_Click(object sender, EventArgs e)
|
||||
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
private void btnEditorialMode_Click(object sender, EventArgs e)
|
||||
{
|
||||
//toggle button is selected
|
||||
SetEditorialMode(!btnEditorialMode.Checked);
|
||||
|
||||
//set the overall flag in the displaytabcontrol
|
||||
StepTabPanel tmp = Parent as StepTabPanel;
|
||||
tmp.MyDisplayTabControl.IsInEditorialMode = btnEditorialMode.Checked;
|
||||
|
||||
//refresh the current item so the background color changes (LightGreen=Editorial Mode, SkyBlue=Normal Selected)
|
||||
if (MyEditItem != null)
|
||||
{
|
||||
_MyEditItem.RefreshContent();
|
||||
Application.DoEvents();
|
||||
}
|
||||
|
||||
//set other preciously opened tabs to match the state of Editorial Mode in the current tab
|
||||
tmp.MyDisplayTabControl.SetEdititorialModeForAllTabs(btnEditorialMode.Checked);
|
||||
}
|
||||
|
||||
private void btnChgTyp_Click(object sender, EventArgs e)
|
||||
{
|
||||
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("Change Step Type");
|
||||
MyEditItem.MyStepPanel.OnTabDisplay(sender, args);
|
||||
@@ -3332,7 +3369,8 @@ namespace Volian.Controls.Library
|
||||
rtabInsert.Visible = false;
|
||||
rtabAdmin.Visible = false;
|
||||
rtabReview.Select();
|
||||
btnCMEditMode1.Enabled = btnEditMode.Enabled = false; // don't allow reviewer toggle out of view mode
|
||||
btnCMEditMode1.Enabled = btnEditMode.Enabled = btnCMEditorialMode.Enabled = false; // don't allow reviewer toggle out of view mode
|
||||
btnCMEditorialMode.Visible = false;
|
||||
}
|
||||
}
|
||||
public void SetupROEditorMode()
|
||||
@@ -3360,10 +3398,43 @@ namespace Volian.Controls.Library
|
||||
public void SetupAdminMode()
|
||||
{
|
||||
}
|
||||
|
||||
//C2019-036 View Only mode work with Checked Out Procedures
|
||||
public event StepTabRibbonEvent EnableDisableStepProperties;
|
||||
private void OnEnableDisableStepProperties(StepTabRibbonEventArgs args)
|
||||
{
|
||||
if (EnableDisableStepProperties != null)
|
||||
EnableDisableStepProperties(this, args);
|
||||
}
|
||||
private void btnToggleEditView_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MyEditItem == null) return;
|
||||
|
||||
//C2019-036 View Only mode work with Checked Out Procedures
|
||||
string message = string.Empty;
|
||||
if (MyEditItem.MyStepPanel.VwMode == E_ViewMode.View && !MySessionInfo.CanCheckOutItem(MyEditItem.MyItemInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message))
|
||||
{
|
||||
//someone else has the procedure checked out so cannot swap out of view only mode
|
||||
message = message.Replace("\r\nWould You like to open the procedure in View Only Mode?", "\r\n\r\nYou will be unable to turn off View Only Mode for this procedure until it is checked in by the user specified above.");
|
||||
MessageBox.Show(this, message, "Procedure Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
else if (MyEditItem.MyStepPanel.VwMode == E_ViewMode.View)
|
||||
{
|
||||
//swapping into edit mode, so check out procedure and Setup Security
|
||||
(this.Parent as StepTabPanel).MyDisplayTabItem.OwnerID = MySessionInfo.CheckOutItem(MyEditItem.MyItemInfo.MyProcedure.ItemID, 0);
|
||||
(this.Parent as StepTabPanel).MyDisplayTabItem.SetupSecurity(MyItemInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
//swapping into View Only mode, so check in procedure
|
||||
OwnerInfo oi = OwnerInfo.GetByItemID(MyEditItem.MyItemInfo.MyProcedure.ItemID, CheckOutType.Procedure);
|
||||
MySessionInfo.CheckInItem(oi.OwnerID);
|
||||
}
|
||||
|
||||
MyEditItem.MyStepPanel.VwMode = MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit ? E_ViewMode.View : E_ViewMode.Edit;
|
||||
//enable / disable the Step Properties Panel based on the ViewMode
|
||||
OnEnableDisableStepProperties(new StepTabRibbonEventArgs(MyEditItem.MyItemInfo, 0, MyEditItem.MyStepPanel.VwMode));
|
||||
MyEditItem.ToggleEditView(MyEditItem.MyStepPanel.VwMode);
|
||||
SetButtonAndMenuEnabling(true);
|
||||
SetStepButtonAndMenuEnabling(true);
|
||||
@@ -3377,7 +3448,62 @@ namespace Volian.Controls.Library
|
||||
// btnEnhancedDocSync.Checked = !btnEnhancedDocSync.Checked;
|
||||
//}
|
||||
|
||||
//C2019-036 View Only mode work with Checked Out Procedures
|
||||
// using a blocking collection to make it thread safe in case someone
|
||||
// spams hitting the refresh button
|
||||
private BlockingCollection<bool> blockingRefreshProcedure = new BlockingCollection<bool>();
|
||||
|
||||
//C2019-036 View Only mode work with Checked Out Procedures
|
||||
private void btnRefreshProcedure_Click(object sender, EventArgs e)
|
||||
{
|
||||
//Consumer
|
||||
Task.Run(() =>
|
||||
{
|
||||
//Blocks until a newRefresh Procedure Run is available
|
||||
while (!blockingRefreshProcedure.IsCompleted)
|
||||
{
|
||||
_ = blockingRefreshProcedure.Take();
|
||||
RefreshProcedure();
|
||||
}
|
||||
});
|
||||
|
||||
//Producer
|
||||
Task.Run(() => { blockingRefreshProcedure.Add(true); });
|
||||
}
|
||||
|
||||
public void RefreshProcedure()
|
||||
{
|
||||
StepTabPanel stab_Panel = Parent as StepTabPanel;
|
||||
|
||||
if (MyEditItem != null)
|
||||
{
|
||||
if (!MyEditItem.MyStepPanel.ContainsFocus)
|
||||
this.Invoke((Action)(() => { MyEditItem.MyStepPanel.Focus(); }));
|
||||
|
||||
E_ViewMode mode = MyEditItem.MyStepPanel.VwMode;
|
||||
Application.DoEvents();
|
||||
this.Invoke((Action)(() => {MyEditItem.MyStepPanel.ResetAll();}));
|
||||
Application.DoEvents();
|
||||
this.Invoke((Action)(() => {MyEditItem.MyStepPanel.Refresh();}));
|
||||
Application.DoEvents();
|
||||
MyEditItem.MyStepPanel.VwMode = mode;
|
||||
Application.DoEvents();
|
||||
}
|
||||
else if (stab_Panel != null)
|
||||
{
|
||||
if (!stab_Panel.MyStepPanel.ContainsFocus)
|
||||
this.Invoke((Action)(() => {stab_Panel.MyStepPanel.Focus();}));
|
||||
|
||||
E_ViewMode mode = stab_Panel.MyStepPanel.VwMode;
|
||||
Application.DoEvents();
|
||||
this.Invoke((Action)(() => {stab_Panel.MyStepPanel.ResetAll();}));
|
||||
Application.DoEvents();
|
||||
this.Invoke((Action)(() => {stab_Panel.MyStepPanel.Refresh();}));
|
||||
Application.DoEvents();
|
||||
stab_Panel.MyStepPanel.VwMode = mode;
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
private void btnROEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (VlnSettings.ReleaseMode.Equals("DEMO"))
|
||||
@@ -4212,15 +4338,19 @@ namespace Volian.Controls.Library
|
||||
if (oring == eEventSource.Keyboard)
|
||||
_OringFlg = 1;
|
||||
|
||||
int selectedSlave = MyItemInfo.MyProcedure.ProcedureConfig.SelectedSlave;
|
||||
if (MyItemInfo == null) return; // if creating a pdf before rtb exists, return;
|
||||
if (MyEditItem != null) MyEditItem.SaveCurrentAndContents();
|
||||
MyItemInfo.MyProcedure.ProcedureConfig.SelectedSlave = selectedSlave;
|
||||
OnPrintRequest(new StepTabRibbonEventArgs(MyItemInfo.MyProcedure, _OringFlg), 0);
|
||||
}
|
||||
|
||||
private void btnPdfQuickCreate_Click(object sender, EventArgs e)
|
||||
{
|
||||
int selectedSlave = MyItemInfo.MyProcedure.ProcedureConfig.SelectedSlave;
|
||||
if (MyItemInfo == null) return; // if creating a pdf before rtb exists, return;
|
||||
if (MyEditItem != null) MyEditItem.SaveCurrentAndContents();
|
||||
MyItemInfo.MyProcedure.ProcedureConfig.SelectedSlave = selectedSlave;
|
||||
OnPrintRequest(new StepTabRibbonEventArgs(MyItemInfo.MyProcedure, _OringFlg), 1);
|
||||
}
|
||||
|
||||
@@ -4883,10 +5013,11 @@ namespace Volian.Controls.Library
|
||||
public class StepTabRibbonEventArgs : EventArgs
|
||||
{
|
||||
public StepTabRibbonEventArgs() { ; }
|
||||
public StepTabRibbonEventArgs(ItemInfo proc, int oringFlg = 0)
|
||||
public StepTabRibbonEventArgs(ItemInfo proc, int oringFlg = 0, E_ViewMode viewMode = E_ViewMode.Edit)
|
||||
{
|
||||
_Proc = proc;
|
||||
OringFlg = oringFlg;
|
||||
ViewMode = viewMode;
|
||||
}
|
||||
private ItemInfo _Proc;
|
||||
|
||||
@@ -4902,6 +5033,9 @@ namespace Volian.Controls.Library
|
||||
get { return _OringFlg; }
|
||||
set { _OringFlg = value; }
|
||||
}
|
||||
|
||||
//C2019-036 View Only mode work with Checked Out Procedures
|
||||
public E_ViewMode ViewMode { get; set; }
|
||||
}
|
||||
public delegate void StepTabRibbonEvent(object sender, StepTabRibbonEventArgs args);
|
||||
|
||||
|
||||
BIN
PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs
generated
BIN
PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs
generated
Binary file not shown.
16
PROMS/Volian.Controls.Library/ToolStripMenuItemwithValue.cs
Normal file
16
PROMS/Volian.Controls.Library/ToolStripMenuItemwithValue.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
//ToolStripMenuItem with Added Value Property
|
||||
public class ToolStripMenuItemwithValue : ToolStripMenuItem
|
||||
{
|
||||
public readonly object Value;
|
||||
|
||||
public ToolStripMenuItemwithValue(string text, object value)
|
||||
{
|
||||
Value = value;
|
||||
Text = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,10 +27,26 @@ namespace Volian.Controls.Library
|
||||
while (MyEditItem.SpellCheckNext())
|
||||
{
|
||||
ItemInfo next = MyEditItem.MyItemInfo.SearchNext;
|
||||
if (next == null || !next.IsStep) // B2016-063 check if next is not a step type instead of specifically a section
|
||||
return; // spell check only current section
|
||||
MyEditItem.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(next);
|
||||
}
|
||||
//C2025-037 Evaluate the way that Spell Check (in step editor sections) is currently closing after one section.
|
||||
|
||||
if (next == null || next.IsProcedure) // B2016-063 check if next is not a step type instead of specifically a section
|
||||
{
|
||||
return; // spell check only current procedure
|
||||
}
|
||||
|
||||
//If it is a word document, find the next non-word document
|
||||
while (next.HasWordContent)
|
||||
{
|
||||
next = next.SearchNext;
|
||||
|
||||
if (next == null || next.IsProcedure) // B2016-063 check if next is not a step type instead of specifically a section
|
||||
{
|
||||
return; // spell check only current procedure
|
||||
}
|
||||
}
|
||||
|
||||
MyEditItem.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(next);
|
||||
}
|
||||
MyEditItem.SetFocus();
|
||||
}
|
||||
|
||||
|
||||
@@ -384,6 +384,9 @@
|
||||
<Compile Include="TablePropertiesControl.Designer.cs">
|
||||
<DependentUpon>TablePropertiesControl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ToolStripMenuItemwithValue.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TransPanel.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
|
||||
@@ -1269,6 +1269,11 @@ namespace Volian.Controls.Library
|
||||
if (ok)
|
||||
if (pia == null && tn.VEObject as StepInfo == null) cm.MenuItems.Add("Properties...", new EventHandler(mi_Click));
|
||||
#endregion
|
||||
#region Refresh_Tree
|
||||
//C2021-035 Add Refresh Tree Option at highest level
|
||||
if (tn == (VETreeNode)Nodes[0])
|
||||
cm.MenuItems.Add("Refresh Tree", new EventHandler(mi_Click));
|
||||
#endregion
|
||||
//_MyLog.WarnFormat("Context Menu 7 - {0}", GC.GetTotalMemory(true));
|
||||
|
||||
if (fi != null && fi.HasWorkingDraft)
|
||||
@@ -2352,6 +2357,10 @@ namespace Volian.Controls.Library
|
||||
case "Print All Approved Procedures": //C2025-017 print all approved procedures
|
||||
OnPrintAllApprovedProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
|
||||
break;
|
||||
//C2021-035 Add Refresh Tree Option at highest level
|
||||
case "Refresh Tree":
|
||||
RefreshTree();
|
||||
break;
|
||||
default:
|
||||
if (mi.Text.StartsWith("Showing Change Bars Starting"))
|
||||
OnSelectDateToStartChangeBars(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
|
||||
@@ -3926,6 +3935,13 @@ namespace Volian.Controls.Library
|
||||
if (Processing != null)
|
||||
Processing(this, new vlnTreeStatusEventArgs(status, message));
|
||||
}
|
||||
//C2021-035 Add Refresh Tree Option at highest level
|
||||
public event vlnTreeViewStatusEvent RefreshFormats;
|
||||
private void OnRefreshFormats(bool status, string message)
|
||||
{
|
||||
if (RefreshFormats != null)
|
||||
RefreshFormats(this, new vlnTreeStatusEventArgs(status, message));
|
||||
}
|
||||
#endregion
|
||||
#region SetLastValuesAndSaveIfChangedStuff
|
||||
private void SetLastValues(VETreeNode node)
|
||||
@@ -4648,6 +4664,36 @@ namespace Volian.Controls.Library
|
||||
if (myFolder.FolderID == ((FolderInfo)obj2).FolderID) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//C2021-035 Add Refresh Tree Option at highest level
|
||||
public void RefreshTree()
|
||||
{
|
||||
//reload the base node
|
||||
VETreeNode tbase = (VETreeNode) Nodes[0];
|
||||
tbase.ChildrenLoaded = false;
|
||||
|
||||
//Refresh the formats
|
||||
OnRefreshFormats(true, "Refreshing Formats");
|
||||
|
||||
//reset the procedure lists so db is re-queried in case they changed
|
||||
//also clear other caches in case added steps / sections / etc...
|
||||
PartInfo.ClearPartInfoCache();
|
||||
ItemInfo.ClearItemInfoCache();
|
||||
DocVersionInfo.ResetAllProcedures();
|
||||
FolderInfo.ClearFolderInfoCache();
|
||||
|
||||
//Refresh the base VEPROMS object
|
||||
var fldr = tbase.VEObject as FolderInfo;
|
||||
if (fldr != null)
|
||||
{
|
||||
Invoke((Action)(() => { tbase.VEObject = FolderInfo.Get(fldr.FolderID); }));
|
||||
}
|
||||
|
||||
//refresh the tree
|
||||
Invoke((Action)(() => { tbase.RefreshNode(); }));
|
||||
this.Invoke((Action)(() => { this.Update(); }));
|
||||
}
|
||||
|
||||
}
|
||||
#region DragHelper
|
||||
public class DragHelper
|
||||
|
||||
Reference in New Issue
Block a user