C2026-043-Tech-Debt_v1 - Stash 1
This commit is contained in:
@@ -1,11 +1,5 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Controls.Library;
|
||||
using System.Windows.Forms;
|
||||
using JR.Utils.GUI.Forms;
|
||||
|
||||
@@ -14,45 +8,28 @@ namespace Volian.Controls.Library
|
||||
public partial class StepTabPanel : DevComponents.DotNetBar.PanelDockContainer
|
||||
{
|
||||
#region Private Fields
|
||||
private DisplayTabControl _MyDisplayTabControl;
|
||||
private StepTabRibbon _MyStepTabRibbon;
|
||||
public StepTabRibbon MyStepTabRibbon
|
||||
{
|
||||
get { return _MyStepTabRibbon; }
|
||||
set { _MyStepTabRibbon = value; }
|
||||
}
|
||||
private StepPanel _MyStepPanel;
|
||||
private DisplayTabItem _MyDisplayTabItem;
|
||||
#endregion
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Container
|
||||
/// </summary>
|
||||
public DisplayTabControl MyDisplayTabControl
|
||||
{
|
||||
get { return _MyDisplayTabControl; }
|
||||
//set { _MyDisplayTabControl = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// StepPanel contained in this control.
|
||||
/// </summary>
|
||||
public Volian.Controls.Library.StepPanel MyStepPanel
|
||||
{
|
||||
get { return _MyStepPanel; }
|
||||
//set { _MyStepPanel = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// related DisplayTabItem
|
||||
/// </summary>
|
||||
public DisplayTabItem MyDisplayTabItem
|
||||
{
|
||||
get { return _MyDisplayTabItem; }
|
||||
set { _MyDisplayTabItem = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Currently Selected ItemInfo
|
||||
/// </summary>
|
||||
public ItemInfo SelectedItemInfo
|
||||
private readonly DisplayTabControl _MyDisplayTabControl;
|
||||
|
||||
public StepTabRibbon MyStepTabRibbon { get; set; }
|
||||
private StepPanel _MyStepPanel;
|
||||
#endregion
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Container
|
||||
/// </summary>
|
||||
public DisplayTabControl MyDisplayTabControl => _MyDisplayTabControl;
|
||||
/// <summary>
|
||||
/// StepPanel contained in this control.
|
||||
/// </summary>
|
||||
public Volian.Controls.Library.StepPanel MyStepPanel => _MyStepPanel;
|
||||
/// <summary>
|
||||
/// related DisplayTabItem
|
||||
/// </summary>
|
||||
public DisplayTabItem MyDisplayTabItem { get; set; }
|
||||
/// <summary>
|
||||
/// Currently Selected ItemInfo
|
||||
/// </summary>
|
||||
public ItemInfo SelectedItemInfo
|
||||
{
|
||||
get { return _MyStepPanel.SelectedItemInfo; }
|
||||
set
|
||||
@@ -63,22 +40,18 @@ namespace Volian.Controls.Library
|
||||
FlexibleMessageBox.Show("The selected item is not available in the editor. One possible cause is that the data is 'not editable', check the section properties 'Editable Data' checkbox.", "Inaccessible Data", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
return;
|
||||
}
|
||||
if (_MyStepPanel.SelectedEditItem != null)
|
||||
_MyStepPanel.SelectedEditItem.ItemSelect();
|
||||
_MyStepPanel.SelectedEditItem?.ItemSelect();
|
||||
if (!_MyStepPanel.ItemSelectionChangeShown) _MyStepPanel.OnItemSelectedChanged(this, new ItemSelectedChangedEventArgs(_MyStepPanel.SelectedEditItem));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Currently Selected EditItem
|
||||
/// </summary>
|
||||
public EditItem SelectedEditItem
|
||||
{
|
||||
get { return _MyStepPanel.SelectedEditItem; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Procedure ItemInfo
|
||||
/// </summary>
|
||||
public ItemInfo MyProcedureItemInfo
|
||||
/// <summary>
|
||||
/// Currently Selected EditItem
|
||||
/// </summary>
|
||||
public EditItem SelectedEditItem => _MyStepPanel.SelectedEditItem;
|
||||
/// <summary>
|
||||
/// Procedure ItemInfo
|
||||
/// </summary>
|
||||
public ItemInfo MyProcedureItemInfo
|
||||
{
|
||||
get { return _MyStepPanel.MyProcedureItemInfo; }
|
||||
set { _MyStepPanel.MyProcedureItemInfo = value; }
|
||||
@@ -120,14 +93,16 @@ namespace Volian.Controls.Library
|
||||
/// </summary>
|
||||
private void SetupStepTabRibbon()
|
||||
{
|
||||
_MyStepTabRibbon = new StepTabRibbon(_MyDisplayTabControl.IsInEditorialMode);
|
||||
_MyStepTabRibbon.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
_MyStepTabRibbon.Location = new System.Drawing.Point(0, 0);
|
||||
_MyStepTabRibbon.Name = "displayTabRibbon1";
|
||||
//_MyTabRibbon.MyDisplayRTB = null;
|
||||
_MyStepTabRibbon.MyEditItem = null;
|
||||
this.Controls.Add(_MyStepTabRibbon);
|
||||
_MyStepTabRibbon.Expanded = _MyDisplayTabControl.RibbonExpanded;
|
||||
MyStepTabRibbon = new StepTabRibbon(_MyDisplayTabControl.IsInEditorialMode)
|
||||
{
|
||||
Dock = System.Windows.Forms.DockStyle.Top,
|
||||
Location = new System.Drawing.Point(0, 0),
|
||||
Name = "displayTabRibbon1",
|
||||
//_MyTabRibbon.MyDisplayRTB = null;
|
||||
MyEditItem = null
|
||||
};
|
||||
this.Controls.Add(MyStepTabRibbon);
|
||||
MyStepTabRibbon.Expanded = _MyDisplayTabControl.RibbonExpanded;
|
||||
}
|
||||
/// <summary>
|
||||
/// Setup this within control
|
||||
@@ -142,7 +117,6 @@ namespace Volian.Controls.Library
|
||||
/// </summary>
|
||||
private void SetupStepPanel()
|
||||
{
|
||||
//this.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
|
||||
_MyStepPanel = new Volian.Controls.Library.StepPanel(this.components);
|
||||
this.Controls.Add(_MyStepPanel);
|
||||
//
|
||||
@@ -159,101 +133,73 @@ namespace Volian.Controls.Library
|
||||
_MyStepPanel.ItemClick +=new Volian.Controls.Library.StepPanelEvent(_MyStepPanel_ItemClick);
|
||||
_MyStepPanel.AttachmentClicked += new Volian.Controls.Library.StepPanelAttachmentEvent(_MyStepPanel_AttachmentClicked);
|
||||
_MyStepPanel.ItemSelectedChanged += new ItemSelectedChangedEvent(_MyStepPanel_ItemSelectedChanged);
|
||||
//_MyStepPanel.ModeChange += new Volian.Controls.Library.StepPanelModeChangeEvent(_MyStepPanel_ModeChange);
|
||||
_MyStepPanel.TabDisplay += new Volian.Controls.Library.StepPanelTabDisplayEvent(_MyStepPanel_TabDisplay);
|
||||
_MyStepPanel.WordSectionClose += new StepPanelWordSectionCloseEvent(_MyStepPanel_WordSectionClose);
|
||||
_MyStepPanel.WordSectionDeleted += new StepPanelWordSectionDeletedEvent(_MyStepPanel_WordSectionDeleted);
|
||||
_MyStepPanel.ItemPasted += new StepPanelItemPastedEvent(_MyStepPanel_ItemPasted);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
#region Event Handlers
|
||||
private bool _ShowingItem = false;
|
||||
public bool ShowingItem
|
||||
|
||||
#endregion
|
||||
#region Event Handlers
|
||||
public bool ShowingItem { get; set; } = false;
|
||||
/// <summary>
|
||||
/// Occurs when the user clicks on a StepTabPanel
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void StepTabPanel_Enter(object sender, EventArgs e)
|
||||
{
|
||||
get { return _ShowingItem; }
|
||||
set { _ShowingItem = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Occurs when the user clicks on a StepTabPanel
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void StepTabPanel_Enter(object sender, EventArgs e)
|
||||
{
|
||||
if (_ShowingItem) return;
|
||||
if (ShowingItem) return;
|
||||
// B2019-029: added to save a dirty annotation when the btnsave was not clicked (user just moves to another steprtb but had added annotationi text):
|
||||
if (MyDisplayTabControl.MyAnnotationDetails.AnnotationDirty) MyDisplayTabControl.MyAnnotationDetails.SaveAnnotation();
|
||||
_ShowingItem = true;
|
||||
//if (ItemSelected != null)
|
||||
ShowingItem = true;
|
||||
_MyStepPanel.ItemShow();
|
||||
if (_MyStepPanel.MyStepTabPanel != null) // B2014-024 if MyStepTabPanel is null then we are in the process of closing the procedure in that step panel
|
||||
_MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetUpdRoValBtn(_MyStepPanel.MyStepTabPanel.MyStepTabRibbon.NewerRoFst());
|
||||
_ShowingItem = false;
|
||||
// B2014-024 if MyStepTabPanel is null then we are in the process of closing the procedure in that step panel
|
||||
_MyStepPanel.MyStepTabPanel?.MyStepTabRibbon.SetUpdRoValBtn(_MyStepPanel.MyStepTabPanel.MyStepTabRibbon.NewerRoFst());
|
||||
ShowingItem = false;
|
||||
_MyDisplayTabControl.SelectedDisplayTabItem = MyDisplayTabItem;
|
||||
}
|
||||
/// <summary>
|
||||
/// Occurs when the cursor moves onto or off of a link
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
void _MyStepPanel_LinkActiveChanged(object sender, StepPanelLinkEventArgs args)
|
||||
/// <summary>
|
||||
/// Occurs when the cursor moves onto or off of a link
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
void _MyStepPanel_LinkActiveChanged(object sender, StepPanelLinkEventArgs args) => _MyDisplayTabControl.OnLinkActiveChanged(sender, args);
|
||||
/// <summary>
|
||||
/// Occurs when the user chooses to add a transition
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
void _MyStepPanel_LinkInsertTran(object sender, StepPanelLinkEventArgs args) => _MyDisplayTabControl.OnLinkInsertTran(sender, args);
|
||||
/// <summary>
|
||||
/// Occurs when the user chooses to add an RO
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
void _MyStepPanel_LinkInsertRO(object sender, StepPanelLinkEventArgs args) => _MyDisplayTabControl.OnLinkInsertRO(sender, args);
|
||||
/// <summary>
|
||||
/// Occurs when the user chosses to modify a transition
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
void _MyStepPanel_LinkModifyTran(object sender, StepPanelLinkEventArgs args) => _MyDisplayTabControl.OnLinkModifyTran(sender, args);
|
||||
/// <summary>
|
||||
/// Occurs when the user chooses to Modify an RO
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
void _MyStepPanel_LinkModifyRO(object sender, StepPanelLinkEventArgs args) => _MyDisplayTabControl.OnLinkModifyRO(sender, args);
|
||||
/// <summary>
|
||||
/// Occurs when the Selected Item changes
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
void _MyStepPanel_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args)
|
||||
{
|
||||
_MyDisplayTabControl.OnLinkActiveChanged(sender, args);
|
||||
}
|
||||
/// <summary>
|
||||
/// Occurs when the user chooses to add a transition
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
void _MyStepPanel_LinkInsertTran(object sender, StepPanelLinkEventArgs args)
|
||||
{
|
||||
_MyDisplayTabControl.OnLinkInsertTran(sender, args);
|
||||
}
|
||||
/// <summary>
|
||||
/// Occurs when the user chooses to add an RO
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
void _MyStepPanel_LinkInsertRO(object sender, StepPanelLinkEventArgs args)
|
||||
{
|
||||
_MyDisplayTabControl.OnLinkInsertRO(sender, args);
|
||||
}
|
||||
/// <summary>
|
||||
/// Occurs when the user chosses to modify a transition
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
void _MyStepPanel_LinkModifyTran(object sender, StepPanelLinkEventArgs args)
|
||||
{
|
||||
_MyDisplayTabControl.OnLinkModifyTran(sender, args);
|
||||
}
|
||||
/// <summary>
|
||||
/// Occurs when the user chooses to Modify an RO
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
void _MyStepPanel_LinkModifyRO(object sender, StepPanelLinkEventArgs args)
|
||||
{
|
||||
_MyDisplayTabControl.OnLinkModifyRO(sender, args);
|
||||
}
|
||||
/// <summary>
|
||||
/// Occurs when the Selected Item changes
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
void _MyStepPanel_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args)
|
||||
{
|
||||
_MyStepTabRibbon.MyEditItem = args.MyEditItem;
|
||||
MyStepTabRibbon.MyEditItem = args.MyEditItem;
|
||||
_MyDisplayTabControl.OnItemSelectedChanged(sender, args);
|
||||
}
|
||||
// Occurs when the Mode Changes
|
||||
//void _MyStepPanel_ModeChange(object sender, StepRTBModeChangeEventArgs args)
|
||||
//{
|
||||
// _MyDisplayTabControl.OnModeChange(sender, args);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when the user clicks on the Attachment Expander
|
||||
/// </summary>
|
||||
@@ -302,27 +248,12 @@ namespace Volian.Controls.Library
|
||||
else
|
||||
Console.WriteLine("Bring Up roeditor"); //TODO: Need to bring up roeditor or infopanel
|
||||
}
|
||||
void _MyStepPanel_TabDisplay(object sender, StepPanelTabDisplayEventArgs args)
|
||||
{
|
||||
_MyDisplayTabControl.OnPanelTabDisplay(sender, args);
|
||||
}
|
||||
void _MyStepPanel_WordSectionClose(object sender, WordSectionEventArgs args)
|
||||
{
|
||||
_MyDisplayTabControl.OnWordSectionClose(sender, args);
|
||||
}
|
||||
void _MyStepPanel_WordSectionDeleted(object sender, WordSectionEventArgs args)
|
||||
{
|
||||
_MyDisplayTabControl.OnWordSectionDeleted(sender, args);
|
||||
}
|
||||
void _MyStepPanel_ItemPasted(object sender, vlnTreeItemInfoPasteEventArgs args)
|
||||
{
|
||||
_MyDisplayTabControl.OnItemPaste(sender, args);
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("StepTabPanel Procedure Item {0} {1}",
|
||||
MyDisplayTabItem.MyItemInfo.ItemID, MyDisplayTabItem.MyItemInfo.DisplayNumber);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
void _MyStepPanel_TabDisplay(object sender, StepPanelTabDisplayEventArgs args) => _MyDisplayTabControl.OnPanelTabDisplay(sender, args);
|
||||
void _MyStepPanel_WordSectionClose(object sender, WordSectionEventArgs args) => _MyDisplayTabControl.OnWordSectionClose(sender, args);
|
||||
void _MyStepPanel_WordSectionDeleted(object sender, WordSectionEventArgs args) => _MyDisplayTabControl.OnWordSectionDeleted(sender, args);
|
||||
void _MyStepPanel_ItemPasted(object sender, vlnTreeItemInfoPasteEventArgs args) => _MyDisplayTabControl.OnItemPaste(sender, args);
|
||||
public override string ToString() => string.Format("StepTabPanel Procedure Item {0} {1}",
|
||||
MyDisplayTabItem.MyItemInfo.ItemID, MyDisplayTabItem.MyItemInfo.DisplayNumber);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user