Open Enhanced Document from Procedure or Procedure from Enhanced Document
Added new feature to keep Background Document and Deviation Documents in Sync as the user moves through the procedure. Support ReadOnly steps for Enhanced Documents linked steps.
This commit is contained in:
parent
551b71e525
commit
a87decdbe3
@ -48,6 +48,12 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
public partial class DisplayTabControl : UserControl
|
public partial class DisplayTabControl : UserControl
|
||||||
{
|
{
|
||||||
|
public event ItemSelectedChangedEvent OpenEnhancedDocument;
|
||||||
|
public void OnOpenEnhancedDocument(ItemSelectedChangedEventArgs args)
|
||||||
|
{
|
||||||
|
if (OpenEnhancedDocument != null)
|
||||||
|
OpenEnhancedDocument(this, args);
|
||||||
|
}
|
||||||
public event DisplayTabControlStatusEvent StatusChanged;
|
public event DisplayTabControlStatusEvent StatusChanged;
|
||||||
public void ONStatusChanged(object Sender, DisplayTabControlStatusEventArgs args)
|
public void ONStatusChanged(object Sender, DisplayTabControlStatusEventArgs args)
|
||||||
{
|
{
|
||||||
@ -92,8 +98,18 @@ namespace Volian.Controls.Library
|
|||||||
public Dictionary<int, string> ItemsChangeIds = null;
|
public Dictionary<int, string> ItemsChangeIds = null;
|
||||||
private ItemInfo _MyItemInfo = null;
|
private ItemInfo _MyItemInfo = null;
|
||||||
private EditItem _MyEditItem = null;
|
private EditItem _MyEditItem = null;
|
||||||
|
|
||||||
|
public EditItem MyEditItem
|
||||||
|
{
|
||||||
|
get { return _MyEditItem; }
|
||||||
|
set { _MyEditItem = value; }
|
||||||
|
}
|
||||||
private StepRTB _MyStepRTB = null;
|
private StepRTB _MyStepRTB = null;
|
||||||
private bool _RibbonExpanded=true;
|
private bool _RibbonExpanded=true;
|
||||||
|
public StepRTB MyStepRTB
|
||||||
|
{
|
||||||
|
get { return _MyStepRTB; }
|
||||||
|
}
|
||||||
public bool RibbonExpanded
|
public bool RibbonExpanded
|
||||||
{
|
{
|
||||||
get { return _RibbonExpanded; }
|
get { return _RibbonExpanded; }
|
||||||
@ -453,11 +469,11 @@ namespace Volian.Controls.Library
|
|||||||
break;
|
break;
|
||||||
case ItemInfo.EAddpingPart.Replace:
|
case ItemInfo.EAddpingPart.Replace:
|
||||||
EditItem ei = edtitm.PasteReplace(copyStartID);
|
EditItem ei = edtitm.PasteReplace(copyStartID);
|
||||||
if (ei.MyItemInfo.ItemID != edtitm.MyItemInfo.ItemID)
|
if (ei.MyItemInfo.ItemID != edtitm.MyItemInfo.ItemID)
|
||||||
{
|
{
|
||||||
edtitm.Dispose();
|
edtitm.Dispose();
|
||||||
MyCopyStep = ei.MyItemInfo;
|
MyCopyStep = ei.MyItemInfo;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return false; ;
|
return false; ;
|
||||||
@ -807,6 +823,22 @@ namespace Volian.Controls.Library
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="myItemInfo"></param>
|
/// <param name="myItemInfo"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
public bool IsItemInfoProcedureOpen(ItemInfo ii)
|
||||||
|
{
|
||||||
|
ItemInfo proc = ii.MyProcedure; // Find procedure Item
|
||||||
|
if (dicEnhancedDocuments.ContainsKey(ii.MyProcedure.MyDocVersion))
|
||||||
|
{
|
||||||
|
frmEnhanced frm = dicEnhancedDocuments[ii.MyProcedure.MyDocVersion];
|
||||||
|
string key = "Item - " + proc.ItemID.ToString();
|
||||||
|
if (frm.MyDisplayTabClntrol._MyDisplayTabItems.ContainsKey(key))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// return true;
|
||||||
|
//return false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public Dictionary<DocVersionInfo, frmEnhanced> dicEnhancedDocuments = new Dictionary<DocVersionInfo, frmEnhanced>();
|
||||||
|
|
||||||
private DisplayTabItem OpenStepTabPage(ItemInfo myItemInfo)
|
private DisplayTabItem OpenStepTabPage(ItemInfo myItemInfo)
|
||||||
{
|
{
|
||||||
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
|
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
|
||||||
@ -840,9 +872,19 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
pg.SelectedItemInfo = myItemInfo; // Select the item
|
pg.SelectedItemInfo = myItemInfo; // Select the item
|
||||||
|
//StepConfig sc = new StepConfig(myItemInfo.MyContent.Config);
|
||||||
|
//if (sc.Step_SourceToBackground != null || sc.Step_SourceToDeviation != null)
|
||||||
|
// pg.MyStepTabPanel.MyStepTabRibbon.btnEnhancedDocSync.Visible = true;
|
||||||
|
//else
|
||||||
|
// pg.MyStepTabPanel.MyStepTabRibbon.btnEnhancedDocSync.Visible = false;
|
||||||
return pg;
|
return pg;
|
||||||
}
|
}
|
||||||
|
private bool _SyncEnhancedDocuments;
|
||||||
|
public bool SyncEnhancedDocuments
|
||||||
|
{
|
||||||
|
get { return _SyncEnhancedDocuments; }
|
||||||
|
set { _SyncEnhancedDocuments = value; }
|
||||||
|
}
|
||||||
public void HandleChangeId(ItemInfo myItemInfo, DisplayTabItem pg)
|
public void HandleChangeId(ItemInfo myItemInfo, DisplayTabItem pg)
|
||||||
{
|
{
|
||||||
if (myItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds)
|
if (myItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds)
|
||||||
@ -855,8 +897,8 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
if (!Volian.Base.Library.VlnSettings.GetCommandFlag("NOCHGID"))
|
if (!Volian.Base.Library.VlnSettings.GetCommandFlag("NOCHGID"))
|
||||||
{
|
{
|
||||||
dlgChgId dlgCI = new dlgChgId(this); //, null);
|
dlgChgId dlgCI = new dlgChgId(this); //, null);
|
||||||
dlgCI.ShowDialog(this);
|
dlgCI.ShowDialog(this);
|
||||||
}
|
}
|
||||||
ItemsChangeIds.Add(myItemInfo.MyProcedure.ItemID, ChgId);
|
ItemsChangeIds.Add(myItemInfo.MyProcedure.ItemID, ChgId);
|
||||||
SetChangeId(ChgId, pg, myItemInfo);
|
SetChangeId(ChgId, pg, myItemInfo);
|
||||||
|
@ -172,7 +172,7 @@ namespace Volian.Controls.Library
|
|||||||
// for hls in background documents - without this, the tab gets overwritten by the rtb.
|
// for hls in background documents - without this, the tab gets overwritten by the rtb.
|
||||||
if (MyItemInfo.FormatStepData == null || MyItemInfo.FormatStepData.TabData.IdentEdit.Contains("{Section Prefix}") || !MyItemInfo.IsHigh ||
|
if (MyItemInfo.FormatStepData == null || MyItemInfo.FormatStepData.TabData.IdentEdit.Contains("{Section Prefix}") || !MyItemInfo.IsHigh ||
|
||||||
(MyItemInfo.IsHigh && MyItemInfo.FormatStepData.PageBreakOnStep))
|
(MyItemInfo.IsHigh && MyItemInfo.FormatStepData.PageBreakOnStep))
|
||||||
_MyStepRTB.Left = lblTab.Left + lblTab.Width;
|
_MyStepRTB.Left = lblTab.Left + lblTab.Width;
|
||||||
_MyStepRTB.Width = Width - _MyStepRTB.Left - RTBMargin - CheckOffMargin;
|
_MyStepRTB.Width = Width - _MyStepRTB.Left - RTBMargin - CheckOffMargin;
|
||||||
}
|
}
|
||||||
_TabFormat = value;
|
_TabFormat = value;
|
||||||
@ -410,11 +410,53 @@ namespace Volian.Controls.Library
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
|
private bool _ProcessingEnter = false;
|
||||||
private void _StepRTB_Enter(object sender, EventArgs e)
|
private void _StepRTB_Enter(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (MyStepPanel.DisplayItemChanging) return;
|
if (MyStepPanel.DisplayItemChanging) return;
|
||||||
//vlnStackTrace.ShowStack("_StepRTB_Enter {0}",this.MyID);
|
//vlnStackTrace.ShowStack("_StepRTB_Enter {0}",this.MyID);
|
||||||
MyStepPanel.SelectedEditItem = this;
|
MyStepPanel.SelectedEditItem = this;
|
||||||
|
if (MyStepPanel.MyStepTabPanel.MyDisplayTabControl.SyncEnhancedDocuments)
|
||||||
|
{
|
||||||
|
if (!_ProcessingEnter)
|
||||||
|
{
|
||||||
|
_ProcessingEnter = true;
|
||||||
|
DisplayTabItem dti = null;
|
||||||
|
StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config);
|
||||||
|
if (sc.Step_SourceToBackground != null && sc.Step_SourceToDeviation != null)
|
||||||
|
{
|
||||||
|
ItemInfo bii = ItemInfo.Get(int.Parse(sc.Step_SourceToBackground));
|
||||||
|
if (MyStepPanel.MyStepTabPanel.MyDisplayTabControl.IsItemInfoProcedureOpen(bii))
|
||||||
|
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnOpenEnhancedDocument(new ItemSelectedChangedEventArgs(bii));
|
||||||
|
// dti = MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(bii);
|
||||||
|
ItemInfo dii = ItemInfo.Get(int.Parse(sc.Step_SourceToDeviation));
|
||||||
|
if (MyStepPanel.MyStepTabPanel.MyDisplayTabControl.IsItemInfoProcedureOpen(dii))
|
||||||
|
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnOpenEnhancedDocument(new ItemSelectedChangedEventArgs(dii));
|
||||||
|
//dti = MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(dii);
|
||||||
|
if (dti != null)
|
||||||
|
dti.MyStepTabPanel.MyDisplayTabControl.OpenItem(this.MyItemInfo);
|
||||||
|
}
|
||||||
|
else if (sc.Step_SourceToBackground != null && sc.Step_SourceToDeviation == null)
|
||||||
|
{
|
||||||
|
ItemInfo bii = ItemInfo.Get(int.Parse(sc.Step_SourceToBackground));
|
||||||
|
if (MyStepPanel.MyStepTabPanel.MyDisplayTabControl.IsItemInfoProcedureOpen(bii))
|
||||||
|
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnOpenEnhancedDocument(new ItemSelectedChangedEventArgs(bii));
|
||||||
|
//dti = MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(bii);
|
||||||
|
if (dti != null)
|
||||||
|
dti.MyStepTabPanel.MyDisplayTabControl.OpenItem(this.MyItemInfo);
|
||||||
|
}
|
||||||
|
else if (sc.Step_SourceToBackground == null && sc.Step_SourceToDeviation != null)
|
||||||
|
{
|
||||||
|
ItemInfo dii = ItemInfo.Get(int.Parse(sc.Step_SourceToDeviation));
|
||||||
|
if (MyStepPanel.MyStepTabPanel.MyDisplayTabControl.IsItemInfoProcedureOpen(dii))
|
||||||
|
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnOpenEnhancedDocument(new ItemSelectedChangedEventArgs(dii));
|
||||||
|
//dti = MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(dii);
|
||||||
|
if (dti != null)
|
||||||
|
dti.MyStepTabPanel.MyDisplayTabControl.OpenItem(this.MyItemInfo);
|
||||||
|
}
|
||||||
|
_ProcessingEnter = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Pass the AttachmentClick event to the StepPanel control.
|
/// Pass the AttachmentClick event to the StepPanel control.
|
||||||
@ -676,6 +718,7 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
if (MyStepRTB.ReadOnly) return;
|
if (MyStepRTB.ReadOnly) return;
|
||||||
if (!MyStepRTB.ActiveMode) return;
|
if (!MyStepRTB.ActiveMode) return;
|
||||||
|
if (MyStepRTB.IsExperimenting) return;
|
||||||
if (MyStepRTB.MyItemInfo.MyContent.Number != null && !MyStepRTB.IsDirty && MyStepRTB.Text.Contains("(Resolved Transition Text)") == false) return;
|
if (MyStepRTB.MyItemInfo.MyContent.Number != null && !MyStepRTB.IsDirty && MyStepRTB.Text.Contains("(Resolved Transition Text)") == false) return;
|
||||||
bool success = MyStepRTB.OrigDisplayText.Save((RichTextBox)MyStepRTB);
|
bool success = MyStepRTB.OrigDisplayText.Save((RichTextBox)MyStepRTB);
|
||||||
if (success)
|
if (success)
|
||||||
|
@ -303,6 +303,12 @@ namespace Volian.Controls.Library
|
|||||||
get { return OrigRTF != Rtf; }
|
get { return OrigRTF != Rtf; }
|
||||||
}
|
}
|
||||||
private bool _InitializingRTB;
|
private bool _InitializingRTB;
|
||||||
|
private bool _IsExperimenting = false;
|
||||||
|
public bool IsExperimenting
|
||||||
|
{
|
||||||
|
get { return _IsExperimenting; }
|
||||||
|
set { _IsExperimenting = value; }
|
||||||
|
}
|
||||||
private IContainer _Container = null;
|
private IContainer _Container = null;
|
||||||
private string _MyClassName=string.Empty;
|
private string _MyClassName=string.Empty;
|
||||||
public string MyClassName
|
public string MyClassName
|
||||||
@ -416,6 +422,7 @@ namespace Volian.Controls.Library
|
|||||||
// RefreshDisplay is used to update the rtb for an entire Item as defined by MyItemInfo.
|
// RefreshDisplay is used to update the rtb for an entire Item as defined by MyItemInfo.
|
||||||
public void RefreshDisplay(bool activeMode)
|
public void RefreshDisplay(bool activeMode)
|
||||||
{
|
{
|
||||||
|
if (IsExperimenting) return;
|
||||||
ActiveMode = activeMode;
|
ActiveMode = activeMode;
|
||||||
OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(true));
|
OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(true));
|
||||||
_InitializingRTB = true;
|
_InitializingRTB = true;
|
||||||
@ -445,6 +452,12 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
RTBAPI.SetLineSpacing(this, RTBAPI.ParaSpacing.PFS_EXACT);
|
RTBAPI.SetLineSpacing(this, RTBAPI.ParaSpacing.PFS_EXACT);
|
||||||
bool readOnlyStep = MyItemInfo == null || MyItemInfo.FormatStepData == null ? false : MyItemInfo.FormatStepData.ReadOnly;
|
bool readOnlyStep = MyItemInfo == null || MyItemInfo.FormatStepData == null ? false : MyItemInfo.FormatStepData.ReadOnly;
|
||||||
|
if (!readOnlyStep)
|
||||||
|
{
|
||||||
|
StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config);
|
||||||
|
if (sc.Step_BackgroundToSource != null || sc.Step_DeviationToSource != null)
|
||||||
|
readOnlyStep = true;
|
||||||
|
}
|
||||||
ReadOnly = readOnlyStep || VwMode == E_ViewMode.View || ActiveMode == false;
|
ReadOnly = readOnlyStep || VwMode == E_ViewMode.View || ActiveMode == false;
|
||||||
AddRtfText(vlntxt.StartText);
|
AddRtfText(vlntxt.StartText);
|
||||||
//AddRtfStyles();
|
//AddRtfStyles();
|
||||||
@ -481,25 +494,25 @@ namespace Volian.Controls.Library
|
|||||||
|
|
||||||
// this line of code was moved before the find for the indent so that
|
// this line of code was moved before the find for the indent so that
|
||||||
// the window gets resized if the indent changes the height, i.e. more line(s) in window.
|
// the window gets resized if the indent changes the height, i.e. more line(s) in window.
|
||||||
AddEventHandlers();
|
AddEventHandlers();
|
||||||
//if (MyItemInfo.InList(186722)) Console.WriteLine("here");
|
//if (MyItemInfo.InList(186722)) Console.WriteLine("here");
|
||||||
if ((indchar = Find(indentToken, indchar, RichTextBoxFinds.None)) >= 0)
|
if ((indchar = Find(indentToken, indchar, RichTextBoxFinds.None)) >= 0)
|
||||||
{
|
{
|
||||||
int nindents = 0;
|
int nindents = 0;
|
||||||
while ((indchar = Find(indentToken, indchar, RichTextBoxFinds.None)) >= 0)
|
while ((indchar = Find(indentToken, indchar, RichTextBoxFinds.None)) >= 0)
|
||||||
{
|
{
|
||||||
nindents++;
|
nindents++;
|
||||||
Point indent = GetPositionFromCharIndex(indchar);
|
Point indent = GetPositionFromCharIndex(indchar);
|
||||||
SelectionHangingIndent = indent.X;
|
SelectionHangingIndent = indent.X;
|
||||||
|
|
||||||
// RHM 02/20/2013
|
// RHM 02/20/2013
|
||||||
// The following line attempts to remove the indent character for display purposes.
|
// The following line attempts to remove the indent character for display purposes.
|
||||||
// However, if the indent is followed immediately by an RO or Transition the
|
// However, if the indent is followed immediately by an RO or Transition the
|
||||||
// RichTextBox will not allow the character to be removed this way and the RichTextBox
|
// RichTextBox will not allow the character to be removed this way and the RichTextBox
|
||||||
// will beep. So, to keep from going in an infintie loop, the value of indchar is incremented.
|
// will beep. So, to keep from going in an infintie loop, the value of indchar is incremented.
|
||||||
SelectedRtf = SelectedRtf.Replace(@"\'05", "");
|
SelectedRtf = SelectedRtf.Replace(@"\'05","");
|
||||||
indchar++;// Don't so the same one twice.
|
indchar ++;// Don't so the same one twice.
|
||||||
}
|
}
|
||||||
if (MyItemInfo != null && MyItemInfo.ActiveFormat != null
|
if (MyItemInfo != null && MyItemInfo.ActiveFormat != null
|
||||||
&& MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.DontResetIndentOnNewline)
|
&& MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.DontResetIndentOnNewline)
|
||||||
{
|
{
|
||||||
@ -734,7 +747,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
void StepRTB_SelectionChanged(object sender, EventArgs e)
|
void StepRTB_SelectionChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (_InitializingRTB) return;
|
if (_InitializingRTB || _IsExperimenting) return;
|
||||||
HandleSelectionChange();
|
HandleSelectionChange();
|
||||||
}
|
}
|
||||||
private bool _MouseDown = false;
|
private bool _MouseDown = false;
|
||||||
@ -1384,7 +1397,7 @@ namespace Volian.Controls.Library
|
|||||||
#region TextAndContentsEvents
|
#region TextAndContentsEvents
|
||||||
void StepRTB_TextChanged(object sender, EventArgs e)
|
void StepRTB_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (_InitializingRTB) return;
|
if (_InitializingRTB || _IsExperimenting) return;
|
||||||
// Was setting _IsDirty to true here, but this was getting called from
|
// Was setting _IsDirty to true here, but this was getting called from
|
||||||
// 'dotnetbar' when text was NOT Changed. So _IsDirty was made into
|
// 'dotnetbar' when text was NOT Changed. So _IsDirty was made into
|
||||||
// a property and compared original rtf versus current richtextbox's
|
// a property and compared original rtf versus current richtextbox's
|
||||||
@ -1892,57 +1905,57 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (e.KeyCode)
|
switch (e.KeyCode)
|
||||||
{
|
{
|
||||||
case Keys.X: //ctrl-X
|
case Keys.X: //ctrl-X
|
||||||
case Keys.C: //ctrl-C
|
case Keys.C: //ctrl-C
|
||||||
// handle the clipboard copy and cut when a Transition or RO is selected
|
// handle the clipboard copy and cut when a Transition or RO is selected
|
||||||
// For now, we are coping/cutting just the displayed text to the clipboard (like 16-bit VE-PROMS)
|
// For now, we are coping/cutting just the displayed text to the clipboard (like 16-bit VE-PROMS)
|
||||||
string ts = GetSelectedDisplayableText();
|
string ts = GetSelectedDisplayableText();
|
||||||
if (ts != null && ts != "") Clipboard.SetText(GetSelectedDisplayableText());
|
if (ts != null && ts != "") Clipboard.SetText(GetSelectedDisplayableText());
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
e.SuppressKeyPress = true;
|
e.SuppressKeyPress = true;
|
||||||
if (ts != null && ts != "" && e.KeyCode == Keys.X) // cut to clipboard - delete the selected text
|
if (ts != null && ts != "" && e.KeyCode == Keys.X) // cut to clipboard - delete the selected text
|
||||||
HandleDeleteKeyWithSelectedText(e, null);
|
HandleDeleteKeyWithSelectedText(e, null);
|
||||||
break;
|
break;
|
||||||
case Keys.V:
|
case Keys.V:
|
||||||
// NOTE that if in a Properties Dialog StepRTB (for numbers and titles) or in a Procedure Specific
|
// NOTE that if in a Properties Dialog StepRTB (for numbers and titles) or in a Procedure Specific
|
||||||
// Information (PSI) Dialog, i.e. any non-EditItem/Step editor field, the following code is run
|
// Information (PSI) Dialog, i.e. any non-EditItem/Step editor field, the following code is run
|
||||||
// for the ctrl-V. For EditItems & Grid cells, the code in StepTabRibbon's btnPaste_Click is
|
// for the ctrl-V. For EditItems & Grid cells, the code in StepTabRibbon's btnPaste_Click is
|
||||||
// run. The way this occurs is that in the designer for StepTabRibbon (StepTabRibbon.designer.cs),
|
// run. The way this occurs is that in the designer for StepTabRibbon (StepTabRibbon.designer.cs),
|
||||||
// the line of code:
|
// the line of code:
|
||||||
// this.btnPaste.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlV);
|
// this.btnPaste.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlV);
|
||||||
// maps the Ctrl-V to btnPaste for those StepRTB's that are associated with the StepTabRibbon, i.e.
|
// maps the Ctrl-V to btnPaste for those StepRTB's that are associated with the StepTabRibbon, i.e.
|
||||||
// EditItems & Grid cells.
|
// EditItems & Grid cells.
|
||||||
IDataObject iData = Clipboard.GetDataObject();
|
IDataObject iData = Clipboard.GetDataObject();
|
||||||
if (!iData.GetDataPresent(DataFormats.Text) && !iData.GetDataPresent(DataFormats.Rtf))
|
if (!iData.GetDataPresent(DataFormats.Text) && !iData.GetDataPresent(DataFormats.Rtf))
|
||||||
{
|
{
|
||||||
MessageBox.Show("Cannot paste, text has special characters or symbols that will not paste correctly.");
|
MessageBox.Show("Cannot paste, text has special characters or symbols that will not paste correctly.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// if contains bad rtf (from Word), paste as text, otherwise, do the paste here.
|
// if contains bad rtf (from Word), paste as text, otherwise, do the paste here.
|
||||||
if (!PasteRtfAsText(true)) Paste();
|
if (!PasteRtfAsText(true)) Paste();
|
||||||
if (SelectionLength == 0) SelectionFont = MyStyleFont.WindowsFont;
|
if (SelectionLength == 0) SelectionFont = MyStyleFont.WindowsFont;
|
||||||
}
|
}
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
return;
|
return;
|
||||||
case Keys.Home:
|
case Keys.Home:
|
||||||
StepRTB_HomeEndPressed(e);
|
StepRTB_HomeEndPressed(e);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
break;
|
break;
|
||||||
case Keys.End:
|
case Keys.End:
|
||||||
StepRTB_HomeEndPressed(e);
|
StepRTB_HomeEndPressed(e);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
break;
|
break;
|
||||||
// 16bit Proms used 'ctrl-enter' for Hard returns. 32bit Proms uses 'shift-enter'
|
// 16bit Proms used 'ctrl-enter' for Hard returns. 32bit Proms uses 'shift-enter'
|
||||||
// because the richtextbox does this by default. Also Word uses 'shift-enter'
|
// because the richtextbox does this by default. Also Word uses 'shift-enter'
|
||||||
// for Hard return. And Word uses 'ctrl-enter' for inserting of page break. So
|
// for Hard return. And Word uses 'ctrl-enter' for inserting of page break. So
|
||||||
// 'ctrl-enter' for 32bit will insert page break
|
// 'ctrl-enter' for 32bit will insert page break
|
||||||
case Keys.Enter:
|
case Keys.Enter:
|
||||||
OnInsertPgBrk(this, new EventArgs());
|
OnInsertPgBrk(this, new EventArgs());
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
break;
|
break;
|
||||||
// The following keys are supported in underlying RTB (with ctrl key), but PROMS should not
|
// The following keys are supported in underlying RTB (with ctrl key), but PROMS should not
|
||||||
// do anything for that functionality:
|
// do anything for that functionality:
|
||||||
case Keys.R: // Right Align text
|
case Keys.R: // Right Align text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user