From 10898f5d90f3df181333123d33b8ce8128682a92 Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 13 Nov 2009 16:13:30 +0000 Subject: [PATCH] --- PROMS/Volian.Controls.Library/StepTabPanel.cs | 12 +++++ .../Volian.Controls.Library/StepTabRibbon.cs | 47 ++++++++++++++++-- .../StepTabRibbon.designer.cs | Bin 192480 -> 199646 bytes 3 files changed, 56 insertions(+), 3 deletions(-) diff --git a/PROMS/Volian.Controls.Library/StepTabPanel.cs b/PROMS/Volian.Controls.Library/StepTabPanel.cs index 6e771ebe..c1b6df81 100644 --- a/PROMS/Volian.Controls.Library/StepTabPanel.cs +++ b/PROMS/Volian.Controls.Library/StepTabPanel.cs @@ -140,7 +140,11 @@ namespace Volian.Controls.Library _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); } + + #endregion #region Event Handlers private bool _ShowingItem = false; @@ -266,6 +270,14 @@ namespace Volian.Controls.Library { _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); + } #endregion } } diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index cca90635..f0bbaf10 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -257,6 +257,8 @@ namespace Volian.Controls.Library btnCMHardSpace.Enabled = btnInsHrdSpc.Enabled = setting; btnCMSymbol.Enabled = btnSymbols.Enabled = setting; btnIndent.Enabled = setting; + btnDelelete.Enabled = btnDelStep.Enabled = setting; + btnInsAftH.Enabled = btnInsBefH.Enabled = setting; } private void SetButtonAndMenuEnabling() { @@ -272,6 +274,7 @@ namespace Volian.Controls.Library else { SetButtonMenuEnabledDisabled(true); + if (_MyStepRTB.SelectionFont != null) { btnCMBold.Checked = btnBold.Checked = RTBAPI.IsBold(_MyStepRTB); @@ -317,8 +320,8 @@ namespace Volian.Controls.Library btnInsPgBrk.Enabled = MyItemInfo.IsHigh; btnEditMode.Checked = btnCMEditMode1.Checked = MyStepItem.MyStepPanel.PanelViewEditMode != E_ViewMode.View; - // if on procedure or section 'change type' & 'insert' buttons should be disabled. + if (MyItemInfo.IsProcedure) btnDelelete.Enabled = btnDelStep.Enabled = false; if (MyItemInfo.IsProcedure || MyItemInfo.IsSection) { btnChgTyp.Enabled = false; @@ -327,6 +330,7 @@ namespace Volian.Controls.Library // 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; + btnInsAftH.Enabled = btnInsBefH.Enabled = false; this.Refresh(); return; } @@ -345,8 +349,8 @@ namespace Volian.Controls.Library btnInsFig.Enabled = (actable & E_AccStep.AddingTable) > 0; btnInsTable.Enabled = (actable & E_AccStep.AddingTable) > 0; btnInsSubstep.Enabled = (actable & E_AccStep.AddingSub) > 0; - btnInsBefore.Enabled = (actable & E_AccStep.AddingPrev) > 0; - btnInsAfter.Enabled = (actable & E_AccStep.AddingNext) > 0; + btnInsBefore.Enabled = btnInsBefH.Enabled = (actable & E_AccStep.AddingPrev) > 0; + btnInsAfter.Enabled = btnInsAftH.Enabled = (actable & E_AccStep.AddingNext) > 0; btnInsHLS.SubItems.Clear(); btnInsCaut.SubItems.Clear(); @@ -728,6 +732,43 @@ namespace Volian.Controls.Library MyStepItem.MyStepPanel.OnTabDisplay(sender, args); } + private void btnDelStep_Click(object sender, EventArgs e) + { + SectionInfo si = MyStepItem.MyItemInfo as SectionInfo; + if (si != null) + { + string msg = si.HasChildren ? "Are you sure you want to delete this section and its steps?" : "Are you sure you want to delete this section?"; + DialogResult result = MessageBox.Show(msg, "Verify Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + if (result == DialogResult.Yes) + { + if (!si.IsStepSection) + { + WordSectionEventArgs args = new WordSectionEventArgs(si); + MyStepItem.MyStepPanel.OnWordSectionClose(sender, args); + } + MyStepItem.RemoveItem(); + if (!si.IsStepSection) + { + WordSectionEventArgs args = new WordSectionEventArgs(si); + MyStepItem.MyStepPanel.OnWordSectionDeleted(sender, args); + } + } + return; + } + StepInfo stpi = MyStepItem.MyItemInfo as StepInfo; + if (stpi == null) // not sure that it will every get here! + { + MessageBox.Show("Unknown type, cannot delete!"); + return; + } + string msgs = stpi.HasChildren ? "Are you sure you want to delete this step and its substeps?" : "Are you sure you want to delete this step?"; + DialogResult results = MessageBox.Show(msgs, "Verify Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + if (results == DialogResult.Yes) + { + MyStepItem.RemoveItem(); + } + } + } public enum E_FieldToEdit { StepText, Text, Number }; diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs index ee9597229b48156209dfcb91783fa498644e0576..c8da55c5bc53ea3c2dd0fa576d879634f1407a97 100644 GIT binary patch delta 1574 zcmZWpZA?>V6z+L}+SO9qg2fL;TOf!AYm0oen;{H|8xS)P+y?|KBt){Hw!q9J+koN7 z<_{*Eh2zLv2K-pE4=i5HRkt6IY|fd8x@=-h21U%qbb(^_V`IbZy&p0=e%##iKKFb) z@43%8q3N|#WC-eY7;>~?C{2gAGV>{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