This commit is contained in:
@@ -37,7 +37,8 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
//Console.WriteLine(string.Format("StepTabRibbon: In set of MyStepRTB, Selected Text = {0}", MyStepRTB.SelectedText));
|
||||
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit);
|
||||
_MyStepRTB.KeyDown += new KeyEventHandler(MyStepRTB_SelectionChanged);
|
||||
//_MyStepRTB.KeyDown += new KeyEventHandler(MyStepRTB_SelectionChanged);
|
||||
_MyStepRTB.KeyUp += new KeyEventHandler(MyStepRTB_SelectionChanged);
|
||||
_MyStepRTB.MouseUp += new MouseEventHandler(MyStepRTB_SelectionChanged);
|
||||
_MyStepRTB.Leave += new EventHandler(MyStepRTB_Leave);
|
||||
_MyStepRTB.LinkChanged += new StepRTBLinkEvent(_MyStepRTB_LinkChanged);
|
||||
@@ -64,7 +65,7 @@ namespace Volian.Controls.Library
|
||||
// to name button use unicode rather than desc, desc may have spaces or odd chars
|
||||
btn.Name = "btn" + sym.Unicode.ToString();
|
||||
btn.Tooltip = sym.Desc;
|
||||
btn.Tag = string.Format(@"\u{0}", sym.Unicode);
|
||||
btn.Tag = string.Format(@"{0}", sym.Unicode);
|
||||
btn.FontBold = true;
|
||||
btn.Click += new System.EventHandler(btnSym_Click);
|
||||
galleryContainerSymbols.SubItems.Add(btn);
|
||||
@@ -73,7 +74,7 @@ namespace Volian.Controls.Library
|
||||
// to name button use unicode rather than desc, desc may have spaces or odd chars
|
||||
btnCM.Name = "btnCM" + sym.Unicode.ToString();
|
||||
btnCM.Tooltip = sym.Desc;
|
||||
btnCM.Tag = string.Format(@"\u{0}", sym.Unicode);
|
||||
btnCM.Tag = string.Format(@"{0}", sym.Unicode);
|
||||
btnCM.FontBold = true;
|
||||
btnCM.Click += new System.EventHandler(btnSym_Click);
|
||||
galleryContainerSymbolsCM.SubItems.Add(btnCM);
|
||||
@@ -221,6 +222,9 @@ namespace Volian.Controls.Library
|
||||
btnChgTyp.Enabled = false;
|
||||
btnInsHLS.Enabled = btnInsCaut.Enabled = btnInsNote.Enabled = btnInsRNO.Enabled = btnInsFig.Enabled =
|
||||
btnInsTable.Enabled = btnInsSubstep.Enabled = btnInsBefore.Enabled = btnInsAfter.Enabled = false;
|
||||
// if on a procedure or section title, don't allow for insert of ROs or Transitions:
|
||||
// disable buttons. Info panels for ROs and Transitions are made invisible in frmVEPROMS.cs
|
||||
btnInsTrans.Enabled = btnCMTransition.Enabled = btnInsRO.Enabled = btnCMRO.Enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -260,6 +264,8 @@ namespace Volian.Controls.Library
|
||||
if (btnInsFig.Enabled) GalleryForSubTypes(_MyStepItem.MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Fig, sd, btnInsFig, (int)E_FromType.Table);
|
||||
if (btnInsTable.Enabled) GalleryForSubTypes(_MyStepItem.MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Table, sd, btnInsTable, (int)E_FromType.Table);
|
||||
if (btnInsSubstep.Enabled) GalleryForSubTypes(_MyStepItem.MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Substep, sd, btnInsSubstep, (int)E_FromType.Step);
|
||||
|
||||
btnInsTrans.Enabled = btnCMTransition.Enabled = btnInsRO.Enabled = btnCMRO.Enabled = true;
|
||||
}
|
||||
/// <summary>
|
||||
/// set up a gallery of step types whose parent are defined by input StepData. Can be below
|
||||
@@ -324,7 +330,7 @@ namespace Volian.Controls.Library
|
||||
private void btnSym_Click(object sender, EventArgs e)
|
||||
{
|
||||
DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender;
|
||||
_MyStepRTB.InsertSymbol((string)b.Tag);
|
||||
_MyStepRTB.InsertSymbol(Convert.ToInt32(b.Tag));
|
||||
}
|
||||
private void btnInsPgBrk_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -335,6 +341,14 @@ namespace Volian.Controls.Library
|
||||
cfg.Step_ManualPagebreak = !cfg.Step_ManualPagebreak;
|
||||
btnInsPgBrk.Checked = cfg.Step_ManualPagebreak;
|
||||
}
|
||||
private void btnIndent_Click(object sender, EventArgs e)
|
||||
{
|
||||
_MyStepRTB.InsertIndent();
|
||||
}
|
||||
private void btnCMIndent_Click(object sender, EventArgs e)
|
||||
{
|
||||
_MyStepRTB.InsertIndent();
|
||||
}
|
||||
#endregion
|
||||
#region Home Tab
|
||||
private void btnPaste_Click(object sender, EventArgs e)
|
||||
@@ -344,6 +358,7 @@ namespace Volian.Controls.Library
|
||||
_MyStepRTB.SelectedRtf = myDO.GetData(DataFormats.Rtf).ToString();
|
||||
else if (myDO.GetDataPresent(DataFormats.Text))
|
||||
_MyStepRTB.SelectedText = myDO.GetData(DataFormats.Text).ToString();
|
||||
if (_MyStepRTB.SelectionLength == 0) _MyStepRTB.SelectionFont = _MyStepRTB.MyStyleFont.WindowsFont;
|
||||
}
|
||||
private void btnCut_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -424,11 +439,24 @@ namespace Volian.Controls.Library
|
||||
private void btnRedo_Click(object sender, EventArgs e)
|
||||
{
|
||||
_MyStepRTB.Redo();
|
||||
btnCMUndo.Enabled = btnUndo.Enabled = _MyStepRTB.CanUndo;
|
||||
btnCMRedo.Enabled = btnRedo.Enabled = _MyStepRTB.CanRedo;
|
||||
}
|
||||
|
||||
private void btnUndo_Click(object sender, EventArgs e)
|
||||
{
|
||||
_MyStepRTB.Undo();
|
||||
if (_MyStepRTB.WasXDelete && (_MyStepRTB.Text[_MyStepRTB.SelectionStart - 1] == 'X'))
|
||||
{
|
||||
_MyStepRTB.Undo();
|
||||
_MyStepRTB.WasXDelete = false;
|
||||
|
||||
// only allow one of these - not best case, but at least can get
|
||||
// one undo
|
||||
_MyStepRTB.ClearUndo();
|
||||
}
|
||||
btnCMRedo.Enabled = btnRedo.Enabled = _MyStepRTB.CanRedo;
|
||||
btnCMUndo.Enabled = btnUndo.Enabled = _MyStepRTB.CanUndo;
|
||||
}
|
||||
private void btnGoTo_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -487,6 +515,14 @@ namespace Volian.Controls.Library
|
||||
foreach (StepItem itm in list)
|
||||
OutputAllChildren(itm);
|
||||
}
|
||||
|
||||
private void btnCMToggle_Click(object sender, EventArgs e)
|
||||
{
|
||||
MyStepRTB.ToggleViewEdit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endregion
|
||||
}
|
||||
|
Reference in New Issue
Block a user