This commit is contained in:
parent
b1da81e65f
commit
00d13a8dbc
@ -137,6 +137,7 @@ namespace Volian.Controls.Library
|
|||||||
_MyStepPanel.ItemClick +=new Volian.Controls.Library.StepPanelEvent(_MyStepPanel_ItemClick);
|
_MyStepPanel.ItemClick +=new Volian.Controls.Library.StepPanelEvent(_MyStepPanel_ItemClick);
|
||||||
_MyStepPanel.AttachmentClicked += new Volian.Controls.Library.StepPanelAttachmentEvent(_MyStepPanel_AttachmentClicked);
|
_MyStepPanel.AttachmentClicked += new Volian.Controls.Library.StepPanelAttachmentEvent(_MyStepPanel_AttachmentClicked);
|
||||||
_MyStepPanel.ItemSelectedChanged += new ItemSelectedChangedEvent(_MyStepPanel_ItemSelectedChanged);
|
_MyStepPanel.ItemSelectedChanged += new ItemSelectedChangedEvent(_MyStepPanel_ItemSelectedChanged);
|
||||||
|
_MyStepPanel.ModeChange += new Volian.Controls.Library.StepPanelModeChangeEvent(_MyStepPanel_ModeChange);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Event Handlers
|
#region Event Handlers
|
||||||
@ -215,6 +216,12 @@ namespace Volian.Controls.Library
|
|||||||
_MyStepTabRibbon.MyStepItem = args.MyStepItem;
|
_MyStepTabRibbon.MyStepItem = args.MyStepItem;
|
||||||
_MyDisplayTabControl.OnItemSelectedChanged(sender, args);
|
_MyDisplayTabControl.OnItemSelectedChanged(sender, args);
|
||||||
}
|
}
|
||||||
|
// Occurs when the Mode Changes
|
||||||
|
void _MyStepPanel_ModeChange(object sender, StepRTBModeChangeEventArgs args)
|
||||||
|
{
|
||||||
|
_MyDisplayTabControl.OnModeChange(sender, args);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Occurs when the user clicks on the Attachment Expander
|
/// Occurs when the user clicks on the Attachment Expander
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -39,6 +39,7 @@ namespace Volian.Controls.Library
|
|||||||
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit);
|
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit);
|
||||||
//_MyStepRTB.KeyDown += new KeyEventHandler(MyStepRTB_SelectionChanged);
|
//_MyStepRTB.KeyDown += new KeyEventHandler(MyStepRTB_SelectionChanged);
|
||||||
_MyStepRTB.KeyUp += new KeyEventHandler(MyStepRTB_SelectionChanged);
|
_MyStepRTB.KeyUp += new KeyEventHandler(MyStepRTB_SelectionChanged);
|
||||||
|
_MyStepRTB.ModeChange += new StepRTBModeChangeEvent(_MyStepRTB_ModeChange);
|
||||||
_MyStepRTB.MouseUp += new MouseEventHandler(MyStepRTB_SelectionChanged);
|
_MyStepRTB.MouseUp += new MouseEventHandler(MyStepRTB_SelectionChanged);
|
||||||
_MyStepRTB.Leave += new EventHandler(MyStepRTB_Leave);
|
_MyStepRTB.Leave += new EventHandler(MyStepRTB_Leave);
|
||||||
_MyStepRTB.LinkChanged += new StepRTBLinkEvent(_MyStepRTB_LinkChanged);
|
_MyStepRTB.LinkChanged += new StepRTBLinkEvent(_MyStepRTB_LinkChanged);
|
||||||
@ -86,6 +87,11 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _MyStepRTB_ModeChange(object sender, StepRTBModeChangeEventArgs args)
|
||||||
|
{
|
||||||
|
SetButtonAndMenuEnabling();
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructor
|
#region Constructor
|
||||||
public StepTabRibbon()
|
public StepTabRibbon()
|
||||||
@ -171,27 +177,57 @@ namespace Volian.Controls.Library
|
|||||||
btnUnderline.Enabled = btnCMUnderline.Enabled = (!((_MyStepRTB.MyStyleFont.Style & E_Style.Underline) == E_Style.Underline));
|
btnUnderline.Enabled = btnCMUnderline.Enabled = (!((_MyStepRTB.MyStyleFont.Style & E_Style.Underline) == E_Style.Underline));
|
||||||
btnItalics.Enabled = btnCMItalics.Enabled = (!((_MyStepRTB.MyStyleFont.Style & E_Style.Italics) == E_Style.Italics));
|
btnItalics.Enabled = btnCMItalics.Enabled = (!((_MyStepRTB.MyStyleFont.Style & E_Style.Italics) == E_Style.Italics));
|
||||||
}
|
}
|
||||||
|
private void SetButtonMenuEnabledDisabled(bool setting)
|
||||||
|
{
|
||||||
|
btnCMBold.Enabled = btnBold.Enabled = setting;
|
||||||
|
btnCMItalics.Enabled = btnItalics.Enabled = setting;
|
||||||
|
btnCMUnderline.Enabled = btnUnderline.Enabled = setting;
|
||||||
|
btnCMSubscript.Enabled = btnSubscript.Enabled = setting;
|
||||||
|
btnCMSuperscript.Enabled = btnSuperscript.Enabled = setting;
|
||||||
|
btnCMCut.Enabled = btnCMCopy.Enabled = btnCut.Enabled = btnCopy.Enabled = setting;
|
||||||
|
btnCMUndo.Enabled = btnUndo.Enabled = setting;
|
||||||
|
btnCMRedo.Enabled = btnRedo.Enabled = setting;
|
||||||
|
btnCMPaste.Enabled = btnPaste.Enabled = setting;
|
||||||
|
btnInsPgBrk.Enabled = setting;
|
||||||
|
btnChgTyp.Enabled = setting;
|
||||||
|
btnInsHLS.Enabled = btnInsCaut.Enabled = btnInsNote.Enabled = btnInsRNO.Enabled = btnInsFig.Enabled =
|
||||||
|
btnInsTable.Enabled = btnInsSubstep.Enabled = btnInsBefore.Enabled = btnInsAfter.Enabled = setting;
|
||||||
|
btnInsTrans.Enabled = btnCMTransition.Enabled = btnInsRO.Enabled = btnCMRO.Enabled = setting;
|
||||||
|
btnCMChgCase.Enabled = btnChgCase.Enabled = setting;
|
||||||
|
btnCMHardSpace.Enabled = btnInsHrdSpc.Enabled = setting;
|
||||||
|
btnCMSymbol.Enabled = btnSymbols.Enabled = setting;
|
||||||
|
btnIndent.Enabled = setting;
|
||||||
|
}
|
||||||
private void SetButtonAndMenuEnabling()
|
private void SetButtonAndMenuEnabling()
|
||||||
{
|
{
|
||||||
if (_MyStepRTB == null) return;
|
if (_MyStepRTB == null) return;
|
||||||
if (_MyStepRTB.SelectionFont != null)
|
DocVersionInfo dvi = MyStepItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo;
|
||||||
|
if (dvi == null) return;
|
||||||
|
if (dvi.VersionType > 127 || MyStepItem.MyStepPanel.PanelViewEditMode == E_ViewMode.View)
|
||||||
{
|
{
|
||||||
btnCMBold.Checked = btnBold.Checked = RTBAPI.IsBold(_MyStepRTB);
|
SetButtonMenuEnabledDisabled(false);
|
||||||
btnCMItalics.Checked = btnItalics.Checked = RTBAPI.IsItalic(_MyStepRTB);
|
|
||||||
btnCMUnderline.Checked = btnUnderline.Checked = RTBAPI.IsUnderline(_MyStepRTB);
|
|
||||||
btnCMSubscript.Checked = btnSubscript.Checked = RTBAPI.IsSubScript(_MyStepRTB);
|
|
||||||
btnCMSuperscript.Checked = btnSuperscript.Checked = RTBAPI.IsSuperScript(_MyStepRTB);
|
|
||||||
}
|
}
|
||||||
SetButtonForStyle();
|
else
|
||||||
|
{
|
||||||
|
SetButtonMenuEnabledDisabled(true);
|
||||||
|
if (_MyStepRTB.SelectionFont != null)
|
||||||
|
{
|
||||||
|
btnCMBold.Checked = btnBold.Checked = RTBAPI.IsBold(_MyStepRTB);
|
||||||
|
btnCMItalics.Checked = btnItalics.Checked = RTBAPI.IsItalic(_MyStepRTB);
|
||||||
|
btnCMUnderline.Checked = btnUnderline.Checked = RTBAPI.IsUnderline(_MyStepRTB);
|
||||||
|
btnCMSubscript.Checked = btnSubscript.Checked = RTBAPI.IsSubScript(_MyStepRTB);
|
||||||
|
btnCMSuperscript.Checked = btnSuperscript.Checked = RTBAPI.IsSuperScript(_MyStepRTB);
|
||||||
|
}
|
||||||
|
SetButtonForStyle();
|
||||||
|
|
||||||
btnCMCut.Enabled = btnCMCopy.Enabled = btnCut.Enabled = btnCopy.Enabled = _MyStepRTB.SelectionLength > 0;
|
btnCMCut.Enabled = btnCMCopy.Enabled = btnCut.Enabled = btnCopy.Enabled = _MyStepRTB.SelectionLength > 0;
|
||||||
btnCMUndo.Enabled = btnUndo.Enabled = _MyStepRTB.CanUndo;
|
btnCMUndo.Enabled = btnUndo.Enabled = _MyStepRTB.CanUndo;
|
||||||
btnCMRedo.Enabled = btnRedo.Enabled = _MyStepRTB.CanRedo;
|
btnCMRedo.Enabled = btnRedo.Enabled = _MyStepRTB.CanRedo;
|
||||||
|
|
||||||
// for paste, see if there is clipboard data, & if so, of a type we can use.
|
|
||||||
IDataObject iData = Clipboard.GetDataObject();
|
|
||||||
btnCMPaste.Enabled = btnPaste.Enabled = (iData.GetDataPresent(DataFormats.Text) || iData.GetDataPresent(DataFormats.Rtf));
|
|
||||||
|
|
||||||
|
// for paste, see if there is clipboard data, & if so, of a type we can use.
|
||||||
|
IDataObject iData = Clipboard.GetDataObject();
|
||||||
|
btnCMPaste.Enabled = btnPaste.Enabled = (iData.GetDataPresent(DataFormats.Text) || iData.GetDataPresent(DataFormats.Rtf));
|
||||||
|
}
|
||||||
|
|
||||||
// do all Transition and ReferencedObject menu items/buttons based on whether a 'link is selected' and the link type.
|
// do all Transition and ReferencedObject menu items/buttons based on whether a 'link is selected' and the link type.
|
||||||
btnCMGoTo.Enabled = btnGoTo.Enabled = _MyStepRTB.IsSelectionLinked(_MyStepRTB.SelectionStart, _MyStepRTB.SelectionLength); //(_MyStepRTB.MyLinkText != null);
|
btnCMGoTo.Enabled = btnGoTo.Enabled = _MyStepRTB.IsSelectionLinked(_MyStepRTB.SelectionStart, _MyStepRTB.SelectionLength); //(_MyStepRTB.MyLinkText != null);
|
||||||
@ -516,13 +552,12 @@ namespace Volian.Controls.Library
|
|||||||
OutputAllChildren(itm);
|
OutputAllChildren(itm);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnCMToggle_Click(object sender, EventArgs e)
|
private void btnToggleEditView_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MyStepRTB.ToggleViewEdit();
|
|
||||||
|
MyStepRTB.ToggleEditView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
BIN
PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs
generated
BIN
PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs
generated
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user