From 3a46cb8580f50fb7282d6505a1516d50c6659c70 Mon Sep 17 00:00:00 2001 From: Kathy Date: Tue, 8 Feb 2011 11:25:03 +0000 Subject: [PATCH] --- .../frmProcedureProperties.Designer.cs | 6 - .../frmProcedureProperties.cs | 1418 +++++++++-------- .../frmSectionProperties.Designer.cs | 6 - .../frmSectionProperties.cs | 23 +- .../frmVEPROMS.Designer.cs | 87 +- PROMS/VEPROMS User Interface/frmVEPROMS.cs | 84 +- 6 files changed, 846 insertions(+), 778 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmProcedureProperties.Designer.cs b/PROMS/VEPROMS User Interface/frmProcedureProperties.Designer.cs index 7d3f4bbc..7d6446db 100644 --- a/PROMS/VEPROMS User Interface/frmProcedureProperties.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmProcedureProperties.Designer.cs @@ -1554,20 +1554,17 @@ namespace VEPROMS // ppProcNumStpRTB // this.ppProcNumStpRTB.AdjustSize = new System.Drawing.Size(0, 0); - this.ppProcNumStpRTB.BeingDisposed = false; this.ppProcNumStpRTB.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.ppProcNumStpRTB.CheckAbove = "|?????????"; this.ppProcNumStpRTB.CheckBelow = "|?"; this.ppProcNumStpRTB.CheckLeft = "-?????????"; this.ppProcNumStpRTB.CheckRight = "-??"; this.ppProcNumStpRTB.ContentsRectangle = new System.Drawing.Rectangle(89, 29, 149, 16); - this.ppProcNumStpRTB.EpMode = VEPROMS.CSLA.Library.E_EditPrintMode.Edit; this.ppProcNumStpRTB.FieldToEdit = Volian.Controls.Library.E_FieldToEdit.StepText; this.ppProcNumStpRTB.Location = new System.Drawing.Point(89, 29); this.ppProcNumStpRTB.MyClassName = "RichEdit20W"; this.ppProcNumStpRTB.MyItemInfo = null; this.ppProcNumStpRTB.MyLinkText = null; - this.ppProcNumStpRTB.MyRTBItem = null; this.ppProcNumStpRTB.Name = "ppProcNumStpRTB"; this.ppProcNumStpRTB.ProcessKeystrokes = true; this.ppProcNumStpRTB.RTBRangeStatus = Volian.Controls.Library.StepRTB.RangeStatus.NoContainedLinks; @@ -1583,21 +1580,18 @@ namespace VEPROMS // ppProcTitleStpRTB // this.ppProcTitleStpRTB.AdjustSize = new System.Drawing.Size(0, 0); - this.ppProcTitleStpRTB.BeingDisposed = false; this.ppProcTitleStpRTB.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.ppProcTitleStpRTB.CheckAbove = "|?????????"; this.ppProcTitleStpRTB.CheckBelow = "|?"; this.ppProcTitleStpRTB.CheckLeft = "-?????????"; this.ppProcTitleStpRTB.CheckRight = "-??"; this.ppProcTitleStpRTB.ContentsRectangle = new System.Drawing.Rectangle(89, 65, 535, 16); - this.ppProcTitleStpRTB.EpMode = VEPROMS.CSLA.Library.E_EditPrintMode.Edit; this.ppProcTitleStpRTB.FieldToEdit = Volian.Controls.Library.E_FieldToEdit.StepText; this.ppProcTitleStpRTB.Location = new System.Drawing.Point(89, 65); this.ppProcTitleStpRTB.MinimumSize = new System.Drawing.Size(539, 59); this.ppProcTitleStpRTB.MyClassName = "RichEdit20W"; this.ppProcTitleStpRTB.MyItemInfo = null; this.ppProcTitleStpRTB.MyLinkText = null; - this.ppProcTitleStpRTB.MyRTBItem = null; this.ppProcTitleStpRTB.Name = "ppProcTitleStpRTB"; this.ppProcTitleStpRTB.ProcessKeystrokes = true; this.ppProcTitleStpRTB.RTBRangeStatus = Volian.Controls.Library.StepRTB.RangeStatus.NoContainedLinks; diff --git a/PROMS/VEPROMS User Interface/frmProcedureProperties.cs b/PROMS/VEPROMS User Interface/frmProcedureProperties.cs index 26559b0a..6fce98c6 100644 --- a/PROMS/VEPROMS User Interface/frmProcedureProperties.cs +++ b/PROMS/VEPROMS User Interface/frmProcedureProperties.cs @@ -14,712 +14,720 @@ using Volian.Controls.Library; namespace VEPROMS { - public partial class frmProcedureProperties : DevComponents.DotNetBar.Office2007Form - { - private bool _Initializing = false; - private string _DefaultFormatName = null; - //private string _DefaultPagination = null; - private string _DefaultWatermark = null; - private string _DefaultChgBarType = null; - private string _DefaultChgBarLoc = null; - private string _DefaultChgBarText = null; - private string _DefaultChgBarUsrMsg1 = null; - private string _DefaultChgBarUsrMsg2 = null; - private string _DefaultFormatColumns = null; - private bool _DefaultDisableDuplex = false; - private ProcedureConfig _ProcedureConfig; - private StepTabRibbon _MyStepTabRibbon; + public partial class frmProcedureProperties : DevComponents.DotNetBar.Office2007Form + { + private bool _Initializing = false; + private string _DefaultFormatName = null; + //private string _DefaultPagination = null; + private string _DefaultWatermark = null; + private string _DefaultChgBarType = null; + private string _DefaultChgBarLoc = null; + private string _DefaultChgBarText = null; + private string _DefaultChgBarUsrMsg1 = null; + private string _DefaultChgBarUsrMsg2 = null; + private string _DefaultFormatColumns = null; + private bool _DefaultDisableDuplex = false; + private ProcedureConfig _ProcedureConfig; + private StepTabRibbon _MyStepTabRibbon; - public frmProcedureProperties(ProcedureConfig procedureConfig) - { - _ProcedureConfig = procedureConfig; - _Initializing = true; - InitializeComponent(); - btnGeneral.PerformClick(); // always start with General tab or button - _Initializing = false; - // build the title bar caption - //this.Text = string.Format("{0} {1} Properties", procedureConfig.Number, procedureConfig.Title); - ItemInfo itmInfo = ItemInfo.Get(_ProcedureConfig.MyProcedure.ItemID); - this.Text = string.Format("{0} {1} Properties", itmInfo.DisplayNumber, itmInfo.DisplayText); - ppProcTitleStpRTB.FieldToEdit = E_FieldToEdit.Text; - ppProcTitleStpRTB.BorderStyle = BorderStyle.Fixed3D; - ppProcTitleStpRTB.ViewRTB = false; - ppProcTitleStpRTB.MyItemInfo = itmInfo; - ppProcNumStpRTB.FieldToEdit = E_FieldToEdit.Number; - ppProcNumStpRTB.BorderStyle = BorderStyle.Fixed3D; - ppProcNumStpRTB.ViewRTB = false; - ppProcNumStpRTB.MyItemInfo = itmInfo; + public frmProcedureProperties(ProcedureConfig procedureConfig) + { + _ProcedureConfig = procedureConfig; + _Initializing = true; + InitializeComponent(); + btnGeneral.PerformClick(); // always start with General tab or button + _Initializing = false; + // build the title bar caption + //this.Text = string.Format("{0} {1} Properties", procedureConfig.Number, procedureConfig.Title); + ItemInfo itmInfo = ItemInfo.Get(_ProcedureConfig.MyProcedure.ItemID); + this.Text = string.Format("{0} {1} Properties", itmInfo.DisplayNumber, itmInfo.DisplayText); + ppProcTitleStpRTB.FieldToEdit = E_FieldToEdit.Text; + ppProcTitleStpRTB.BorderStyle = BorderStyle.Fixed3D; + ppProcTitleStpRTB.MyItemInfo = itmInfo; + ppProcTitleStpRTB.RefreshDisplay(true); + ppProcNumStpRTB.FieldToEdit = E_FieldToEdit.Number; + ppProcNumStpRTB.BorderStyle = BorderStyle.Fixed3D; + ppProcNumStpRTB.MyItemInfo = itmInfo; + ppProcNumStpRTB.RefreshDisplay(true); - _MyStepTabRibbon = new StepTabRibbon(); - //_MyStepTabRibbon.Dock = System.Windows.Forms.DockStyle.Top; - //_MyStepTabRibbon.Location = new System.Drawing.Point(0, 0); - _MyStepTabRibbon.Name = "displayTabRibbon1"; - _MyStepTabRibbon.Visible = false; - //defaultSettingsVisiblity(); + _MyStepTabRibbon = new StepTabRibbon(); + //_MyStepTabRibbon.Dock = System.Windows.Forms.DockStyle.Top; + //_MyStepTabRibbon.Location = new System.Drawing.Point(0, 0); + _MyStepTabRibbon.Name = "displayTabRibbon1"; + _MyStepTabRibbon.Visible = false; + //defaultSettingsVisiblity(); + } + + private void ppBtnOK_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.OK; + procedureConfigBindingSource.EndEdit(); + // Save Default settings for User + // + // Save whether we should display the default values on this property page + Settings.Default.ShowDefaultProcedureProp = ppCbShwDefSettings.Checked; + Settings.Default.Save(); + _ProcedureConfig.MyProcedure.Save().Dispose(); + SaveText(ppProcTitleStpRTB); + SaveText(ppProcNumStpRTB); + this.Close(); + } + public void SaveText(StepRTB myStepRTB) + { + if (myStepRTB.ReadOnly) return; + if (!myStepRTB.ActiveMode) return; + if (!myStepRTB.IsDirty && myStepRTB.Text.Contains("(Resolved Transition Text)") == false) return; + bool success = myStepRTB.OrigDisplayText.Save((RichTextBox)myStepRTB); + if (success) + { + myStepRTB.FindAllLinks(); + myStepRTB.OrigRTF = myStepRTB.Rtf; + myStepRTB.ClearUndo(); + } + } + private void ppBtnCancel_Click(object sender, EventArgs e) + { + procedureConfigBindingSource.CancelEdit(); + this.Close(); + } + + /// + /// Use the ParentLookup to grab the default values + /// - set the watermark property (where applicable) of the control with that value + /// - set the default setting labels with that value + /// ** the default setting labels appear when the Show Default Values checkbox is checked by the user. + /// + private void FindDefaultValues() + { + _ProcedureConfig.ParentLookup = true; + // Get the default format name + _DefaultFormatName = _ProcedureConfig.DefaultFormatSelection; + SetupDefault(_DefaultFormatName, ppLblFormatDefault, ppCmbxFormat); + + // Get the default Change Bar Type + _DefaultChgBarType = _ProcedureConfig.Print_ChangeBar.ToString(); + SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_ChangeBar), ppLblChangeBarTypeDefault, ppCmbxChangeBarType); + + // Get the default Change Bar Location + _DefaultChgBarLoc = _ProcedureConfig.Print_ChangeBarLoc.ToString(); + SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_ChangeBarLoc), ppLblChgBarPosDefault, ppCmbxChgBarPos); + + // Get the default Change Bar text + _DefaultChgBarText = _ProcedureConfig.Print_ChangeBarText.ToString(); + SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_ChangeBarText), ppLblChgBarTxtTypeDefault, ppCmbxChgBarTxtType); + + // Get the default User Change Bar Message 1 + _DefaultChgBarUsrMsg1 = _ProcedureConfig.Print_UserCBMess1; + if (!(_DefaultChgBarUsrMsg1.Equals(""))) + ppLblChgBarUserMsgOneDefault.Text = string.Format("({0})", _DefaultChgBarUsrMsg1); + + // Get the default User Change Bar Message 2 + _DefaultChgBarUsrMsg2 = _ProcedureConfig.Print_UserCBMess2; + if (!(_DefaultChgBarUsrMsg2.Equals(""))) + ppLblChgBarUserMsgTwoDefault.Text = string.Format("({0})", _DefaultChgBarUsrMsg2); + + // Get the default Print Pagination + //_DefaultPagination = _ProcedureConfig.Print_Pagination.ToString(); + //SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_Pagination), ppLblPaginationDefault, ppCmbxPagination); + + // Get the default Watermark + _DefaultWatermark = _ProcedureConfig.Print_Watermark.ToString(); + SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_Watermark), ppLblWatermarkDefault, ppCmbxWatermark); + + // Get the default Format Columns + _DefaultFormatColumns = _ProcedureConfig.Format_Columns.ToString(); + SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Format_Columns), ppLblStpEditorColsDefault, ppCmbxStpEditorCols); + + // Get the default Disable Duplex + _DefaultDisableDuplex = _ProcedureConfig.Print_DisableDuplex; + ppLblAutoDuplexDefault.Text = string.Format("(Duplex {0})", (_DefaultDisableDuplex) ? "OFF" : "ON"); + + + _ProcedureConfig.ParentLookup = false; + } + + private void frmProcedureProperties_Load(object sender, EventArgs e) + { + _Initializing = true; + procedureConfigBindingSource.DataSource = _ProcedureConfig; + + //formatInfoListBindingSource.DataSource = FormatInfoList.Get(); + + ppCmbxFormat.DataSource = null; + ppCmbxFormat.DisplayMember = "FullName"; + ppCmbxFormat.ValueMember = "FullName"; + ppCmbxFormat.DataSource = FormatInfoList.SortedFormatInfoList; + + // Get the saved settings for this user + // + // This setting tells us if we should display the default values on this property page + ppCbShwDefSettings.Checked = (Settings.Default["ShowDefaultProcedureProp"] != null) ? Settings.Default.ShowDefaultProcedureProp : false; + + // Get the User's property page style "PropPageStyle" (this is a system wide user setting) + // 1 - Button Dialog (default) + // 2 - Tab Dialog + if ((int)Settings.Default["PropPageStyle"] == (int)PropPgStyle.Tab) + { + tcProcProp.TabsVisible = true; + panProcBtns.Visible = false; + this.Width -= panProcBtns.Width; + } + + // Get the default values for the property page information + FindDefaultValues(); + + // Assign the data sources to the combo boxes + ppCmbxChgBarPos.DataSource = EnumDetail.Details(); + ppCmbxChgBarPos.DisplayMember = "Description"; + ppCmbxChgBarPos.ValueMember = "EValue"; + ppCmbxChgBarPos.SelectedIndex = -1; + + ppCmbxChgBarTxtType.DataSource = EnumDetail.Details(); + ppCmbxChgBarTxtType.DisplayMember = "Description"; + ppCmbxChgBarTxtType.ValueMember = "EValue"; + ppCmbxChgBarTxtType.SelectedIndex = -1; + + ppCmbxChangeBarType.DataSource = EnumDetail.Details(); + ppCmbxChangeBarType.DisplayMember = "Description"; + ppCmbxChangeBarType.ValueMember = "EValue"; + ppCmbxChangeBarType.SelectedIndex = -1; + + //ppCmbxPagination.DataSource = EnumDetail.Details(); + //ppCmbxPagination.DisplayMember = "Description"; + //ppCmbxPagination.ValueMember = "EValue"; + //ppCmbxPagination.SelectedIndex = -1; + + ppCmbxWatermark.DataSource = EnumDetail.Details(); + ppCmbxWatermark.DisplayMember = "Description"; + ppCmbxWatermark.ValueMember = "EValue"; + ppCmbxWatermark.SelectedIndex = -1; + + ppCmbxStpEditorCols.DataSource = EnumDetail.Details(); + ppCmbxStpEditorCols.DisplayMember = "Description"; + ppCmbxStpEditorCols.ValueMember = "EValue"; + ppCmbxStpEditorCols.SelectedIndex = -1; + + _Initializing = false; + } + + #region General tab + + /// + /// This is the General button used on the button interface design + /// + /// object + /// EventArgs + private void btnGeneral_Click(object sender, EventArgs e) + { + ProcessButtonClick(tiGeneral, btnGeneral); + } + + /// + /// Selection in Default Column Mode combo box changed. + /// + /// object + /// EventArgs + private void ppCmbxStpEditorCols_SelectedValueChanged(object sender, EventArgs e) + { + if (!_Initializing) + { + FormatColumns fc = (FormatColumns)Enum.Parse(typeof(FormatColumns), _DefaultFormatColumns); + ProcessCmbxSelectionEnumChanged(ppCmbxStpEditorCols, fc, ppBtnDefEdCols, ppLblStpEditorColsDefault); + //if ((ppCmbxStpEditorCols.SelectedIndex != -1) && ppCmbxStpEditorCols.SelectedValue.Equals(fc)) + //{ + // ppBtnDefEdCols.Focus(); + // ppBtnDefEdCols.PerformClick(); + //} + //ppBtnDefEdCols.Visible = ppCmbxStpEditorCols.SelectedValue != null; + //ppLblStpEditorColsDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefEdCols.Visible; + //tcpGeneral.Focus(); + } + } + #endregion + + #region Format Settings tab + + /// + /// This is the Format Settings button used on the button interface design + /// + /// object + /// EventArgs + private void btnFmtStngs_Click(object sender, EventArgs e) + { + ProcessButtonClick(tiFmtStngs, btnFmtStngs); + } + + private void ppBtnDefaultFmt_Click(object sender, EventArgs e) + { + ppCmbxFormat.SelectedIndex = -1; //reset to the default Format setting + //tcpFormatSettings.Focus(); + } + + /// + /// Selection in Format combo box changed. + /// + /// object + /// EventArgs + private void ppCmbxFormat_SelectedValueChanged(object sender, EventArgs e) + { + ProcessCmbxSelectedValueChange(ppCmbxFormat, _DefaultFormatName, ppBtnDefaultFmt, ppLblFormatDefault); + } + + /// + /// Enable or disable the user specified change bar options base on the type + /// of change bar selected. + /// + private void setEnabledUserSpecifiedChgBarCombos(PrintChangeBar pcb) + { + //ppGpbxUserSpecCB.Enabled = + //ppCmbxChgBarPos.Enabled = + //ppCmbxChgBarTxtType.Enabled = + //ppBtnDefaultCbPos.Enabled = + //ppBtnDefCbTxtTyp.Enabled = (ppCmbxChangeBarType.SelectedValue != null && + // ppCmbxChangeBarType.SelectedValue.Equals(ProcedureConfig.PrintChangeBar.WithUserSpecified)) || + // (ppCmbxChangeBarType.SelectedValue == null && pcb.Equals(DocVersionConfig.PrintChangeBar.WithUserSpecified)); + + ppGpbxUserSpecCB.Enabled = (ppCmbxChangeBarType.SelectedValue != null && + ppCmbxChangeBarType.SelectedValue.Equals(PrintChangeBar.WithUserSpecified)) || + (ppCmbxChangeBarType.SelectedValue == null && pcb.Equals(PrintChangeBar.WithUserSpecified)); + } + + /// + /// Selection in Change Bar combo box changed. + /// + /// object + /// EventArgs + private void ppCmbxChangeBarType_SelectedValueChanged(object sender, EventArgs e) + { + //Console.WriteLine("### SelectedValueChanged"); + if (!_Initializing) + { + PrintChangeBar pcb = (PrintChangeBar)Enum.Parse(typeof(PrintChangeBar), _DefaultChgBarType); + ProcessCmbxSelectionEnumChanged(ppCmbxChangeBarType, pcb, ppBtnDefaultChgBar, ppLblChangeBarTypeDefault); + setEnabledUserSpecifiedChgBarCombos(pcb); + //tcpFormatSettings.Focus(); + } + } + + /// + /// Reset to the parent setting. + /// Find the parent setting and assign it to _ProcedureConfig.PrintChangeBar. + /// This will force the database to be updated. + /// + /// + /// + private void ppBtnDefaultChgBar_Click(object sender, EventArgs e) + { + // Get the parent setting + PrintChangeBar pcb = (PrintChangeBar)Enum.Parse(typeof(PrintChangeBar), _DefaultChgBarType); + // Compare parent setting with current setting + //_Initializing = true; + if (pcb != _ProcedureConfig.Print_ChangeBar) + _ProcedureConfig.Print_ChangeBar = pcb; // this will force a database update (write) + ppCmbxChangeBarType.SelectedIndex = -1; //reset to the default Change Bar setting + //_Initializing = false; + //tcpFormatSettings.Focus(); + } + + /// + /// Selection in Change Bar Position combo box changed. + /// + /// object + /// EventArgs + private void ppCmbxChgBarPos_SelectedValueChanged(object sender, EventArgs e) + { + if (!_Initializing) + { + PrintChangeBarLoc cbl = (PrintChangeBarLoc)Enum.Parse(typeof(PrintChangeBarLoc), _DefaultChgBarLoc); + ProcessCmbxSelectionEnumChanged(ppCmbxChgBarPos, cbl, ppBtnDefaultCbPos, ppLblChgBarPosDefault); + //tcpFormatSettings.Focus(); + } + } + + /// + /// Reset to the parent setting. + /// Find the parent setting and assign it to _ProcedureConfig.Print_ChangeBarLoc. + /// This will force the database to be updated. + /// + /// + /// + private void ppBtnDefaultCbPos_Click(object sender, EventArgs e) + { + // Get the parent setting + PrintChangeBarLoc cbl = (PrintChangeBarLoc)Enum.Parse(typeof(PrintChangeBarLoc), _DefaultChgBarLoc); + // Compare parent setting with current setting + if (cbl != _ProcedureConfig.Print_ChangeBarLoc) + _ProcedureConfig.Print_ChangeBarLoc = cbl; // this will force a database update (write) + ppCmbxChgBarPos.SelectedIndex = -1; //reset to the default Change Bar Position setting + //tcpFormatSettings.Focus(); + } + + /// + /// Selection in Change Bar Text Type combo box changed. + /// + /// object + /// EventArgs + private void ppCmbxChgBarTxtType_SelectedValueChanged(object sender, EventArgs e) + { + if (!_Initializing) + { + PrintChangeBarText cbt = (PrintChangeBarText)Enum.Parse(typeof(PrintChangeBarText), _DefaultChgBarText); + ProcessCmbxSelectionEnumChanged(ppCmbxChgBarTxtType, cbt, ppBtnDefCbTxtTyp, ppLblChgBarTxtTypeDefault); + setEnabledUserSpecifiedChgBarText(); + //tcpFormatSettings.Focus(); + } + } + + /// + /// Reset to the parent setting. + /// Find the parent setting and assign it to _ProcedureConfig.Print_ChangeBarText. + /// This will force the database to be updated. + /// + /// + /// + private void ppBtnDefCbTxtTyp_Click(object sender, EventArgs e) + { + // Get the parent setting + PrintChangeBarText cbt = (PrintChangeBarText)Enum.Parse(typeof(PrintChangeBarText), _DefaultChgBarText); + // Compare parent setting with current setting + if (cbt != _ProcedureConfig.Print_ChangeBarText) + _ProcedureConfig.Print_ChangeBarText = cbt; // this will force a database update (write) + ppCmbxChgBarTxtType.SelectedIndex = -1; //reset to the default Change Bar Text Type setting + //tcpFormatSettings.Focus(); + } + + /// + /// Enable or disable the user specified change bar text based on the selected + /// change bar text type (selected in the user specific change bar grouping) + /// + private void setEnabledUserSpecifiedChgBarText() + { + //ppGpbxUserSpecTxt.Enabled = + //ppTxbxChangeBarUserMsgOne.Enabled = + //ppTxbxChgBarUserMsgTwo.Enabled = + //ppBtnDefCbTxt1.Enabled = + //ppBtnDefCbTxt2.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null && + //ppCmbxChgBarTxtType.SelectedValue.Equals(ProcedureConfig.PrintChangeBarText.UserDef)); + + // This string is used to check against our default setting to see if User Defined Changebar Text is active + string decUserDef = PrintChangeBarText.UserDef.ToString(); + + ppGpbxUserSpecTxt.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null && + ppCmbxChgBarTxtType.SelectedValue.Equals(PrintChangeBarText.UserDef)) || + (ppCmbxChgBarTxtType.SelectedIndex == -1 && _DefaultChgBarText.Equals(decUserDef)); + + } + + #endregion + + #region Output Settings tab + + /// + /// This is the Output Settings button used on the button interface design + /// + /// object + /// EventArgs + private void btnOutputStngs_Click(object sender, EventArgs e) + { + ProcessButtonClick(tiOutputStngs, btnOutputStngs); + } + + /// + /// Selection in Pagination combo box changed. + /// + /// object + /// EventArgs + //private void ppCmbxPagination_SelectedValueChanged(object sender, EventArgs e) + //{ + // if (!_Initializing) + // { + // PrintPagination pgtn = (PrintPagination)Enum.Parse(typeof(PrintPagination), _DefaultPagination); + // ProcessCmbxSelectionEnumChanged(ppCmbxPagination, pgtn, ppBtnDefPagination, ppLblPaginationDefault); + // //tcpOutputSettings.Focus(); + // } + //} + + /// + /// Reset to the parent setting. + /// Find the parent setting and assign it to _ProcedureConfig.Print_Pagination. + /// This will force the database to be updated. + /// + /// + /// + //private void ppBtnDefPagination_Click(object sender, EventArgs e) + //{ + // // Get the parent setting + // PrintPagination pgtn = (PrintPagination)Enum.Parse(typeof(PrintPagination), _DefaultPagination); + // // Compare parent setting with current setting + // if (pgtn != _ProcedureConfig.Print_Pagination) + // _ProcedureConfig.Print_Pagination = pgtn; // this will force a database update (write) + // ppCmbxPagination.SelectedIndex = -1; //reset to the default Pagination setting + // //tcpOutputSettings.Focus(); + //} + + /// + /// Selection in Watermark combo box changed. + /// + /// object + /// EventArgs + private void ppCmbxWatermark_SelectedValueChanged(object sender, EventArgs e) + { + if (!_Initializing) + { + PrintWatermark wtr = (PrintWatermark)Enum.Parse(typeof(PrintWatermark), _DefaultWatermark); + ProcessCmbxSelectionEnumChanged(ppCmbxWatermark, wtr, ppBtnDefWatermark, ppLblWatermarkDefault); + //tcpOutputSettings.Focus(); + } + } + + /// + /// Reset to the parent setting. + /// Find the parent setting and assign it to _ProcedureConfig.Print_Watermark. + /// This will force the database to be updated. + /// + /// + /// + private void ppBtnDefWatermark_Click(object sender, EventArgs e) + { + // Get the parent setting + PrintWatermark wtr = (PrintWatermark)Enum.Parse(typeof(PrintWatermark), _DefaultWatermark); + // Compare parent setting with current setting + if (wtr != _ProcedureConfig.Print_Watermark) + _ProcedureConfig.Print_Watermark = wtr; // this will force a database update (write) + ppCmbxWatermark.SelectedIndex = -1; //reset to the default Watermark setting + } + + #endregion + + #region View Settings tab + + ///// + ///// This is the View Settings button used on the button interface design + ///// + ///// object + ///// EventArgs + //private void btnVwStngs_Click(object sender, EventArgs e) + //{ + // ProcessButtonClick(tiViewStngs, btnVwStngs); + //} + #endregion + + #region Generic functions used on this property page + + /// + /// Determines what labels (showing default values) are visable on the property pages + /// + private void defaultSettingsVisiblity() + { + ppLblDefSettingsInfo.Visible = ppCbShwDefSettings.Checked; + + ppLblWatermarkDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefWatermark.Visible; + //ppLblPaginationDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefPagination.Visible; + ppLblStpEditorColsDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefEdCols.Visible; + ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible; + ppLblChangeBarTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultChgBar.Visible; + ppLblChgBarPosDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultCbPos.Visible; + ppLblChgBarTxtTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxtTyp.Visible; + ppLblChgBarUserMsgOneDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt1.Visible; + ppLblChgBarUserMsgTwoDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt2.Visible; + ppLblAutoDuplexDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDeftDisAutoDuplx.Visible; + } + + /// + /// Select the corresponding tab and set the button's state to checked + /// + /// Property Page Tab + /// Corresponding Property Page Button + private void ProcessButtonClick(TabItem tab, ButtonX button) + { + ClearAllCheckedButtons(); + tcProcProp.SelectedTab = tab; + button.Checked = true; + } + + /// + /// For the Button Interface property page style, when a button is selected (pressed), + /// it will remain in the checked state even when a different button is selected. Thus + /// we must clear the checked state of the buttons when a button is selected, then set + /// the newly selected button's state to checked. + /// + private void ClearAllCheckedButtons() + { + btnGeneral.Checked = false; + btnFmtStngs.Checked = false; + btnOutputStngs.Checked = false; + //btnVwStngs.Checked = false; + } + + /// + /// This is a generic Enter Event function for use with all of the property page tabs. + /// Found that the visiblity value of buttons is not recorded until the property page in which it resides is diplayed. + /// Thus we need to call defaultSettingVisiblity() to check and set visiblity states. + /// + /// type object + /// type EventArgs + private void tabpage_Enter(object sender, EventArgs e) + { + // Show or hide the labels containing the default values + //if (!_Initializing) + defaultSettingsVisiblity(); + } + + /// + /// Set the watermark and default label + /// + /// The default text + /// Label that displays the current default when view defaults is set + /// Combo box with a watermark property + private static void SetupDefault(string defaultText, Label lbl, ComboBoxEx cmbo) + { + if (defaultText != null && !(defaultText.Equals(""))) + { + string deftext = string.Format("{0}", defaultText); + lbl.Text = deftext; + cmbo.WatermarkText = deftext; + } + } + + /// + /// Process a change in the enum combo box selection + /// + /// Combo Box Name + /// the default enum value + /// button to reset to default value + /// label containing the default + private void ProcessCmbxSelectionEnumChanged(ComboBoxEx cmbx, object enumval, ButtonX button, Label deflabel) + { + if ((cmbx.SelectedIndex != -1) && + cmbx.SelectedValue.Equals(enumval)) + { + _Initializing = true; + button.Visible = true; + button.Focus(); + button.PerformClick(); + cmbx.SelectedIndex = -1; // This will hide the Default button + _Initializing = false; + } + button.Visible = (cmbx.SelectedValue != null); + deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible; + } + /// + /// Process a change in the combo box selection + /// + /// Combo Box Name + /// string containing default text + /// button to reset to default value + /// label containing the default + private void ProcessCmbxSelectedValueChange(ComboBoxEx cmbx, string defstr, ButtonX button, Label deflabel) + { + if ((cmbx.SelectedIndex != -1) && defstr != null && defstr.Equals(cmbx.SelectedValue)) + { + button.Visible = true; + button.Focus(); + button.PerformClick(); + } + button.Visible = cmbx.SelectedValue != null; + deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible; + } + #endregion + + private void ppProcTitleStpRTB_Enter(object sender, EventArgs e) + { + _MyStepTabRibbon.MyStepRTB = ppProcTitleStpRTB; + } + + private void ppProcNumStpRTB_Enter(object sender, EventArgs e) + { + _MyStepTabRibbon.MyStepRTB = ppProcNumStpRTB; + } + + private void ppBtnDefCbTxt1_Click(object sender, EventArgs e) + { + // Compare default setting with current setting + // Reset with the default and hide the default button and label + if (_DefaultChgBarUsrMsg1 != _ProcedureConfig.Print_UserCBMess1) + { + _ProcedureConfig.Print_UserCBMess1 = _DefaultChgBarUsrMsg1; + ppLblChgBarUserMsgOneDefault.Visible = false; + ppBtnDefCbTxt1.Visible = false; + //tcpFormatSettings.Focus(); + } + + } + + private void ppBtnDefCbTxt2_Click(object sender, EventArgs e) + { + // Compare default setting with current setting + // Reset with the default and hide the default button and label + if (_DefaultChgBarUsrMsg2 != _ProcedureConfig.Print_UserCBMess2) + { + _ProcedureConfig.Print_UserCBMess2 = _DefaultChgBarUsrMsg2; + ppLblChgBarUserMsgTwoDefault.Visible = false; + ppBtnDefCbTxt2.Visible = false; + //tcpFormatSettings.Focus(); + } + } + + private void ppBtnDefEdCols_Click(object sender, EventArgs e) + { + // Get the parent setting + FormatColumns fc = (FormatColumns)Enum.Parse(typeof(FormatColumns), _DefaultFormatColumns); + if (fc != _ProcedureConfig.Format_Columns) + _ProcedureConfig.Format_Columns = fc; // this will force a database update (write) + ppCmbxStpEditorCols.SelectedIndex = -1; //reset to the default + //tcpGeneral.Focus(); + } + + private void ppBtnDefWatermark_Click_1(object sender, EventArgs e) + { + // Get the parent setting + PrintWatermark wtr = (PrintWatermark)Enum.Parse(typeof(PrintWatermark), _DefaultWatermark); + // Compare parent setting with current setting + if (wtr != _ProcedureConfig.Print_Watermark) + _ProcedureConfig.Print_Watermark = wtr; // this will force a database update (write) + ppCmbxWatermark.SelectedIndex = -1; + //tcpOutputSettings.Focus(); + } + + private void ppBtnDeftDisAutoDuplx_Click(object sender, EventArgs e) + { + ppChbxDisAutoDuplex.Checked = _DefaultDisableDuplex; + _ProcedureConfig.Print_DisableDuplex = ppChbxDisAutoDuplex.Checked; + ppBtnDeftDisAutoDuplx.Visible = false; + ppLblAutoDuplexDefault.Visible = false; + //tcpOutputSettings.Focus(); + } + + private void ppTxbxChangeBarUserMsgOne_TextChanged(object sender, EventArgs e) + { + ppBtnDefCbTxt1.Visible = ((ppTxbxChangeBarUserMsgOne.Text != null) && !ppTxbxChangeBarUserMsgOne.Text.Equals(_DefaultChgBarUsrMsg1)); + ppLblChgBarUserMsgOneDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt1.Visible; + //tcpOutputSettings.Focus(); + } + + private void ppTxbxChgBarUserMsgTwo_TextChanged(object sender, EventArgs e) + { + ppBtnDefCbTxt2.Visible = ((ppTxbxChgBarUserMsgTwo.Text != null) && !ppTxbxChgBarUserMsgTwo.Text.Equals(_DefaultChgBarUsrMsg2)); + ppLblChgBarUserMsgTwoDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt2.Visible; + //tcpOutputSettings.Focus(); + } + + private void ppChbxDisAutoDuplex_CheckedChanged(object sender, EventArgs e) + { + + if (!_Initializing) + { + _ProcedureConfig.Print_DisableDuplex = ppChbxDisAutoDuplex.Checked; + ppBtnDeftDisAutoDuplx.Visible = _DefaultDisableDuplex != ppChbxDisAutoDuplex.Checked; + ppLblAutoDuplexDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDeftDisAutoDuplx.Visible; + //tcpOutputSettings.Focus(); + } + } + + private void frmProcedureProperties_Shown(object sender, EventArgs e) + { + ppProcNumStpRTB.Focus(); + + } } - - private void ppBtnOK_Click(object sender, EventArgs e) - { - DialogResult = DialogResult.OK; - procedureConfigBindingSource.EndEdit(); - // Save Default settings for User - // - // Save whether we should display the default values on this property page - Settings.Default.ShowDefaultProcedureProp = ppCbShwDefSettings.Checked; - Settings.Default.Save(); - _ProcedureConfig.MyProcedure.Save().Dispose(); - ppProcTitleStpRTB.SaveText(); - ppProcNumStpRTB.SaveText(); - this.Close(); - } - - private void ppBtnCancel_Click(object sender, EventArgs e) - { - procedureConfigBindingSource.CancelEdit(); - this.Close(); - } - - /// - /// Use the ParentLookup to grab the default values - /// - set the watermark property (where applicable) of the control with that value - /// - set the default setting labels with that value - /// ** the default setting labels appear when the Show Default Values checkbox is checked by the user. - /// - private void FindDefaultValues() - { - _ProcedureConfig.ParentLookup = true; - // Get the default format name - _DefaultFormatName = _ProcedureConfig.DefaultFormatSelection; - SetupDefault(_DefaultFormatName, ppLblFormatDefault, ppCmbxFormat); - - // Get the default Change Bar Type - _DefaultChgBarType = _ProcedureConfig.Print_ChangeBar.ToString(); - SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_ChangeBar), ppLblChangeBarTypeDefault, ppCmbxChangeBarType); - - // Get the default Change Bar Location - _DefaultChgBarLoc = _ProcedureConfig.Print_ChangeBarLoc.ToString(); - SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_ChangeBarLoc), ppLblChgBarPosDefault, ppCmbxChgBarPos); - - // Get the default Change Bar text - _DefaultChgBarText = _ProcedureConfig.Print_ChangeBarText.ToString(); - SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_ChangeBarText), ppLblChgBarTxtTypeDefault, ppCmbxChgBarTxtType); - - // Get the default User Change Bar Message 1 - _DefaultChgBarUsrMsg1 = _ProcedureConfig.Print_UserCBMess1; - if (!(_DefaultChgBarUsrMsg1.Equals(""))) - ppLblChgBarUserMsgOneDefault.Text = string.Format("({0})", _DefaultChgBarUsrMsg1); - - // Get the default User Change Bar Message 2 - _DefaultChgBarUsrMsg2 = _ProcedureConfig.Print_UserCBMess2; - if (!(_DefaultChgBarUsrMsg2.Equals(""))) - ppLblChgBarUserMsgTwoDefault.Text = string.Format("({0})", _DefaultChgBarUsrMsg2); - - // Get the default Print Pagination - //_DefaultPagination = _ProcedureConfig.Print_Pagination.ToString(); - //SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_Pagination), ppLblPaginationDefault, ppCmbxPagination); - - // Get the default Watermark - _DefaultWatermark = _ProcedureConfig.Print_Watermark.ToString(); - SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_Watermark), ppLblWatermarkDefault, ppCmbxWatermark); - - // Get the default Format Columns - _DefaultFormatColumns = _ProcedureConfig.Format_Columns.ToString(); - SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Format_Columns), ppLblStpEditorColsDefault, ppCmbxStpEditorCols); - - // Get the default Disable Duplex - _DefaultDisableDuplex = _ProcedureConfig.Print_DisableDuplex; - ppLblAutoDuplexDefault.Text = string.Format("(Duplex {0})", (_DefaultDisableDuplex) ? "OFF" : "ON"); - - - _ProcedureConfig.ParentLookup = false; - } - - private void frmProcedureProperties_Load(object sender, EventArgs e) - { - _Initializing = true; - procedureConfigBindingSource.DataSource = _ProcedureConfig; - - //formatInfoListBindingSource.DataSource = FormatInfoList.Get(); - - ppCmbxFormat.DataSource = null; - ppCmbxFormat.DisplayMember = "FullName"; - ppCmbxFormat.ValueMember = "FullName"; - ppCmbxFormat.DataSource = FormatInfoList.SortedFormatInfoList; - - // Get the saved settings for this user - // - // This setting tells us if we should display the default values on this property page - ppCbShwDefSettings.Checked = (Settings.Default["ShowDefaultProcedureProp"] != null) ? Settings.Default.ShowDefaultProcedureProp : false; - - // Get the User's property page style "PropPageStyle" (this is a system wide user setting) - // 1 - Button Dialog (default) - // 2 - Tab Dialog - if ((int)Settings.Default["PropPageStyle"] == (int)PropPgStyle.Tab) - { - tcProcProp.TabsVisible = true; - panProcBtns.Visible = false; - this.Width -= panProcBtns.Width; - } - - // Get the default values for the property page information - FindDefaultValues(); - - // Assign the data sources to the combo boxes - ppCmbxChgBarPos.DataSource = EnumDetail.Details(); - ppCmbxChgBarPos.DisplayMember = "Description"; - ppCmbxChgBarPos.ValueMember = "EValue"; - ppCmbxChgBarPos.SelectedIndex = -1; - - ppCmbxChgBarTxtType.DataSource = EnumDetail.Details(); - ppCmbxChgBarTxtType.DisplayMember = "Description"; - ppCmbxChgBarTxtType.ValueMember = "EValue"; - ppCmbxChgBarTxtType.SelectedIndex = -1; - - ppCmbxChangeBarType.DataSource = EnumDetail.Details(); - ppCmbxChangeBarType.DisplayMember = "Description"; - ppCmbxChangeBarType.ValueMember = "EValue"; - ppCmbxChangeBarType.SelectedIndex = -1; - - //ppCmbxPagination.DataSource = EnumDetail.Details(); - //ppCmbxPagination.DisplayMember = "Description"; - //ppCmbxPagination.ValueMember = "EValue"; - //ppCmbxPagination.SelectedIndex = -1; - - ppCmbxWatermark.DataSource = EnumDetail.Details(); - ppCmbxWatermark.DisplayMember = "Description"; - ppCmbxWatermark.ValueMember = "EValue"; - ppCmbxWatermark.SelectedIndex = -1; - - ppCmbxStpEditorCols.DataSource = EnumDetail.Details(); - ppCmbxStpEditorCols.DisplayMember = "Description"; - ppCmbxStpEditorCols.ValueMember = "EValue"; - ppCmbxStpEditorCols.SelectedIndex = -1; - - _Initializing = false; - } - - #region General tab - - /// - /// This is the General button used on the button interface design - /// - /// object - /// EventArgs - private void btnGeneral_Click(object sender, EventArgs e) - { - ProcessButtonClick(tiGeneral, btnGeneral); - } - - /// - /// Selection in Default Column Mode combo box changed. - /// - /// object - /// EventArgs - private void ppCmbxStpEditorCols_SelectedValueChanged(object sender, EventArgs e) - { - if (!_Initializing) - { - FormatColumns fc = (FormatColumns)Enum.Parse(typeof(FormatColumns), _DefaultFormatColumns); - ProcessCmbxSelectionEnumChanged(ppCmbxStpEditorCols, fc, ppBtnDefEdCols, ppLblStpEditorColsDefault); - //if ((ppCmbxStpEditorCols.SelectedIndex != -1) && ppCmbxStpEditorCols.SelectedValue.Equals(fc)) - //{ - // ppBtnDefEdCols.Focus(); - // ppBtnDefEdCols.PerformClick(); - //} - //ppBtnDefEdCols.Visible = ppCmbxStpEditorCols.SelectedValue != null; - //ppLblStpEditorColsDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefEdCols.Visible; - //tcpGeneral.Focus(); - } - } - #endregion - - #region Format Settings tab - - /// - /// This is the Format Settings button used on the button interface design - /// - /// object - /// EventArgs - private void btnFmtStngs_Click(object sender, EventArgs e) - { - ProcessButtonClick(tiFmtStngs, btnFmtStngs); - } - - private void ppBtnDefaultFmt_Click(object sender, EventArgs e) - { - ppCmbxFormat.SelectedIndex = -1; //reset to the default Format setting - //tcpFormatSettings.Focus(); - } - - /// - /// Selection in Format combo box changed. - /// - /// object - /// EventArgs - private void ppCmbxFormat_SelectedValueChanged(object sender, EventArgs e) - { - ProcessCmbxSelectedValueChange(ppCmbxFormat, _DefaultFormatName, ppBtnDefaultFmt, ppLblFormatDefault); - } - - /// - /// Enable or disable the user specified change bar options base on the type - /// of change bar selected. - /// - private void setEnabledUserSpecifiedChgBarCombos(PrintChangeBar pcb) - { - //ppGpbxUserSpecCB.Enabled = - //ppCmbxChgBarPos.Enabled = - //ppCmbxChgBarTxtType.Enabled = - //ppBtnDefaultCbPos.Enabled = - //ppBtnDefCbTxtTyp.Enabled = (ppCmbxChangeBarType.SelectedValue != null && - // ppCmbxChangeBarType.SelectedValue.Equals(ProcedureConfig.PrintChangeBar.WithUserSpecified)) || - // (ppCmbxChangeBarType.SelectedValue == null && pcb.Equals(DocVersionConfig.PrintChangeBar.WithUserSpecified)); - - ppGpbxUserSpecCB.Enabled = (ppCmbxChangeBarType.SelectedValue != null && - ppCmbxChangeBarType.SelectedValue.Equals(PrintChangeBar.WithUserSpecified)) || - (ppCmbxChangeBarType.SelectedValue == null && pcb.Equals(PrintChangeBar.WithUserSpecified)); - } - - /// - /// Selection in Change Bar combo box changed. - /// - /// object - /// EventArgs - private void ppCmbxChangeBarType_SelectedValueChanged(object sender, EventArgs e) - { - //Console.WriteLine("### SelectedValueChanged"); - if (!_Initializing) - { - PrintChangeBar pcb = (PrintChangeBar)Enum.Parse(typeof(PrintChangeBar), _DefaultChgBarType); - ProcessCmbxSelectionEnumChanged(ppCmbxChangeBarType, pcb, ppBtnDefaultChgBar, ppLblChangeBarTypeDefault); - setEnabledUserSpecifiedChgBarCombos(pcb); - //tcpFormatSettings.Focus(); - } - } - - /// - /// Reset to the parent setting. - /// Find the parent setting and assign it to _ProcedureConfig.PrintChangeBar. - /// This will force the database to be updated. - /// - /// - /// - private void ppBtnDefaultChgBar_Click(object sender, EventArgs e) - { - // Get the parent setting - PrintChangeBar pcb = (PrintChangeBar)Enum.Parse(typeof(PrintChangeBar), _DefaultChgBarType); - // Compare parent setting with current setting - //_Initializing = true; - if (pcb != _ProcedureConfig.Print_ChangeBar) - _ProcedureConfig.Print_ChangeBar = pcb; // this will force a database update (write) - ppCmbxChangeBarType.SelectedIndex = -1; //reset to the default Change Bar setting - //_Initializing = false; - //tcpFormatSettings.Focus(); - } - - /// - /// Selection in Change Bar Position combo box changed. - /// - /// object - /// EventArgs - private void ppCmbxChgBarPos_SelectedValueChanged(object sender, EventArgs e) - { - if (!_Initializing) - { - PrintChangeBarLoc cbl = (PrintChangeBarLoc)Enum.Parse(typeof(PrintChangeBarLoc), _DefaultChgBarLoc); - ProcessCmbxSelectionEnumChanged(ppCmbxChgBarPos, cbl, ppBtnDefaultCbPos, ppLblChgBarPosDefault); - //tcpFormatSettings.Focus(); - } - } - - /// - /// Reset to the parent setting. - /// Find the parent setting and assign it to _ProcedureConfig.Print_ChangeBarLoc. - /// This will force the database to be updated. - /// - /// - /// - private void ppBtnDefaultCbPos_Click(object sender, EventArgs e) - { - // Get the parent setting - PrintChangeBarLoc cbl = (PrintChangeBarLoc)Enum.Parse(typeof(PrintChangeBarLoc), _DefaultChgBarLoc); - // Compare parent setting with current setting - if (cbl != _ProcedureConfig.Print_ChangeBarLoc) - _ProcedureConfig.Print_ChangeBarLoc = cbl; // this will force a database update (write) - ppCmbxChgBarPos.SelectedIndex = -1; //reset to the default Change Bar Position setting - //tcpFormatSettings.Focus(); - } - - /// - /// Selection in Change Bar Text Type combo box changed. - /// - /// object - /// EventArgs - private void ppCmbxChgBarTxtType_SelectedValueChanged(object sender, EventArgs e) - { - if (!_Initializing) - { - PrintChangeBarText cbt = (PrintChangeBarText)Enum.Parse(typeof(PrintChangeBarText), _DefaultChgBarText); - ProcessCmbxSelectionEnumChanged(ppCmbxChgBarTxtType, cbt, ppBtnDefCbTxtTyp, ppLblChgBarTxtTypeDefault); - setEnabledUserSpecifiedChgBarText(); - //tcpFormatSettings.Focus(); - } - } - - /// - /// Reset to the parent setting. - /// Find the parent setting and assign it to _ProcedureConfig.Print_ChangeBarText. - /// This will force the database to be updated. - /// - /// - /// - private void ppBtnDefCbTxtTyp_Click(object sender, EventArgs e) - { - // Get the parent setting - PrintChangeBarText cbt = (PrintChangeBarText)Enum.Parse(typeof(PrintChangeBarText), _DefaultChgBarText); - // Compare parent setting with current setting - if (cbt != _ProcedureConfig.Print_ChangeBarText) - _ProcedureConfig.Print_ChangeBarText = cbt; // this will force a database update (write) - ppCmbxChgBarTxtType.SelectedIndex = -1; //reset to the default Change Bar Text Type setting - //tcpFormatSettings.Focus(); - } - - /// - /// Enable or disable the user specified change bar text based on the selected - /// change bar text type (selected in the user specific change bar grouping) - /// - private void setEnabledUserSpecifiedChgBarText() - { - //ppGpbxUserSpecTxt.Enabled = - //ppTxbxChangeBarUserMsgOne.Enabled = - //ppTxbxChgBarUserMsgTwo.Enabled = - //ppBtnDefCbTxt1.Enabled = - //ppBtnDefCbTxt2.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null && - //ppCmbxChgBarTxtType.SelectedValue.Equals(ProcedureConfig.PrintChangeBarText.UserDef)); - - // This string is used to check against our default setting to see if User Defined Changebar Text is active - string decUserDef = PrintChangeBarText.UserDef.ToString(); - - ppGpbxUserSpecTxt.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null && - ppCmbxChgBarTxtType.SelectedValue.Equals(PrintChangeBarText.UserDef)) || - (ppCmbxChgBarTxtType.SelectedIndex == -1 && _DefaultChgBarText.Equals(decUserDef)); - - } - - #endregion - - #region Output Settings tab - - /// - /// This is the Output Settings button used on the button interface design - /// - /// object - /// EventArgs - private void btnOutputStngs_Click(object sender, EventArgs e) - { - ProcessButtonClick(tiOutputStngs, btnOutputStngs); - } - - /// - /// Selection in Pagination combo box changed. - /// - /// object - /// EventArgs - //private void ppCmbxPagination_SelectedValueChanged(object sender, EventArgs e) - //{ - // if (!_Initializing) - // { - // PrintPagination pgtn = (PrintPagination)Enum.Parse(typeof(PrintPagination), _DefaultPagination); - // ProcessCmbxSelectionEnumChanged(ppCmbxPagination, pgtn, ppBtnDefPagination, ppLblPaginationDefault); - // //tcpOutputSettings.Focus(); - // } - //} - - /// - /// Reset to the parent setting. - /// Find the parent setting and assign it to _ProcedureConfig.Print_Pagination. - /// This will force the database to be updated. - /// - /// - /// - //private void ppBtnDefPagination_Click(object sender, EventArgs e) - //{ - // // Get the parent setting - // PrintPagination pgtn = (PrintPagination)Enum.Parse(typeof(PrintPagination), _DefaultPagination); - // // Compare parent setting with current setting - // if (pgtn != _ProcedureConfig.Print_Pagination) - // _ProcedureConfig.Print_Pagination = pgtn; // this will force a database update (write) - // ppCmbxPagination.SelectedIndex = -1; //reset to the default Pagination setting - // //tcpOutputSettings.Focus(); - //} - - /// - /// Selection in Watermark combo box changed. - /// - /// object - /// EventArgs - private void ppCmbxWatermark_SelectedValueChanged(object sender, EventArgs e) - { - if (!_Initializing) - { - PrintWatermark wtr = (PrintWatermark)Enum.Parse(typeof(PrintWatermark), _DefaultWatermark); - ProcessCmbxSelectionEnumChanged(ppCmbxWatermark, wtr, ppBtnDefWatermark, ppLblWatermarkDefault); - //tcpOutputSettings.Focus(); - } - } - - /// - /// Reset to the parent setting. - /// Find the parent setting and assign it to _ProcedureConfig.Print_Watermark. - /// This will force the database to be updated. - /// - /// - /// - private void ppBtnDefWatermark_Click(object sender, EventArgs e) - { - // Get the parent setting - PrintWatermark wtr = (PrintWatermark)Enum.Parse(typeof(PrintWatermark), _DefaultWatermark); - // Compare parent setting with current setting - if (wtr != _ProcedureConfig.Print_Watermark) - _ProcedureConfig.Print_Watermark = wtr; // this will force a database update (write) - ppCmbxWatermark.SelectedIndex = -1; //reset to the default Watermark setting - } - - #endregion - - #region View Settings tab - - ///// - ///// This is the View Settings button used on the button interface design - ///// - ///// object - ///// EventArgs - //private void btnVwStngs_Click(object sender, EventArgs e) - //{ - // ProcessButtonClick(tiViewStngs, btnVwStngs); - //} - #endregion - - #region Generic functions used on this property page - - /// - /// Determines what labels (showing default values) are visable on the property pages - /// - private void defaultSettingsVisiblity() - { - ppLblDefSettingsInfo.Visible = ppCbShwDefSettings.Checked; - - ppLblWatermarkDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefWatermark.Visible; - //ppLblPaginationDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefPagination.Visible; - ppLblStpEditorColsDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefEdCols.Visible; - ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible; - ppLblChangeBarTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultChgBar.Visible; - ppLblChgBarPosDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultCbPos.Visible; - ppLblChgBarTxtTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxtTyp.Visible; - ppLblChgBarUserMsgOneDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt1.Visible; - ppLblChgBarUserMsgTwoDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt2.Visible; - ppLblAutoDuplexDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDeftDisAutoDuplx.Visible; - } - - /// - /// Select the corresponding tab and set the button's state to checked - /// - /// Property Page Tab - /// Corresponding Property Page Button - private void ProcessButtonClick(TabItem tab, ButtonX button) - { - ClearAllCheckedButtons(); - tcProcProp.SelectedTab = tab; - button.Checked = true; - } - - /// - /// For the Button Interface property page style, when a button is selected (pressed), - /// it will remain in the checked state even when a different button is selected. Thus - /// we must clear the checked state of the buttons when a button is selected, then set - /// the newly selected button's state to checked. - /// - private void ClearAllCheckedButtons() - { - btnGeneral.Checked = false; - btnFmtStngs.Checked = false; - btnOutputStngs.Checked = false; - //btnVwStngs.Checked = false; - } - - /// - /// This is a generic Enter Event function for use with all of the property page tabs. - /// Found that the visiblity value of buttons is not recorded until the property page in which it resides is diplayed. - /// Thus we need to call defaultSettingVisiblity() to check and set visiblity states. - /// - /// type object - /// type EventArgs - private void tabpage_Enter(object sender, EventArgs e) - { - // Show or hide the labels containing the default values - //if (!_Initializing) - defaultSettingsVisiblity(); - } - - /// - /// Set the watermark and default label - /// - /// The default text - /// Label that displays the current default when view defaults is set - /// Combo box with a watermark property - private static void SetupDefault(string defaultText, Label lbl, ComboBoxEx cmbo) - { - if (defaultText != null && !(defaultText.Equals(""))) - { - string deftext = string.Format("{0}", defaultText); - lbl.Text = deftext; - cmbo.WatermarkText = deftext; - } - } - - /// - /// Process a change in the enum combo box selection - /// - /// Combo Box Name - /// the default enum value - /// button to reset to default value - /// label containing the default - private void ProcessCmbxSelectionEnumChanged(ComboBoxEx cmbx, object enumval, ButtonX button, Label deflabel) - { - if ((cmbx.SelectedIndex != -1) && - cmbx.SelectedValue.Equals(enumval)) - { - _Initializing = true; - button.Visible = true; - button.Focus(); - button.PerformClick(); - cmbx.SelectedIndex = -1; // This will hide the Default button - _Initializing = false; - } - button.Visible = (cmbx.SelectedValue != null); - deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible; - } - /// - /// Process a change in the combo box selection - /// - /// Combo Box Name - /// string containing default text - /// button to reset to default value - /// label containing the default - private void ProcessCmbxSelectedValueChange(ComboBoxEx cmbx, string defstr, ButtonX button, Label deflabel) - { - if ((cmbx.SelectedIndex != -1) && defstr != null && defstr.Equals(cmbx.SelectedValue)) - { - button.Visible = true; - button.Focus(); - button.PerformClick(); - } - button.Visible = cmbx.SelectedValue != null; - deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible; - } - #endregion - - private void ppProcTitleStpRTB_Enter(object sender, EventArgs e) - { - _MyStepTabRibbon.MyStepRTB = ppProcTitleStpRTB; - } - - private void ppProcNumStpRTB_Enter(object sender, EventArgs e) - { - _MyStepTabRibbon.MyStepRTB = ppProcNumStpRTB; - } - - private void ppBtnDefCbTxt1_Click(object sender, EventArgs e) - { - // Compare default setting with current setting - // Reset with the default and hide the default button and label - if (_DefaultChgBarUsrMsg1 != _ProcedureConfig.Print_UserCBMess1) - { - _ProcedureConfig.Print_UserCBMess1 = _DefaultChgBarUsrMsg1; - ppLblChgBarUserMsgOneDefault.Visible = false; - ppBtnDefCbTxt1.Visible = false; - //tcpFormatSettings.Focus(); - } - - } - - private void ppBtnDefCbTxt2_Click(object sender, EventArgs e) - { - // Compare default setting with current setting - // Reset with the default and hide the default button and label - if (_DefaultChgBarUsrMsg2 != _ProcedureConfig.Print_UserCBMess2) - { - _ProcedureConfig.Print_UserCBMess2 = _DefaultChgBarUsrMsg2; - ppLblChgBarUserMsgTwoDefault.Visible = false; - ppBtnDefCbTxt2.Visible = false; - //tcpFormatSettings.Focus(); - } - } - - private void ppBtnDefEdCols_Click(object sender, EventArgs e) - { - // Get the parent setting - FormatColumns fc = (FormatColumns)Enum.Parse(typeof(FormatColumns), _DefaultFormatColumns); - if (fc != _ProcedureConfig.Format_Columns) - _ProcedureConfig.Format_Columns = fc; // this will force a database update (write) - ppCmbxStpEditorCols.SelectedIndex = -1; //reset to the default - //tcpGeneral.Focus(); - } - - private void ppBtnDefWatermark_Click_1(object sender, EventArgs e) - { - // Get the parent setting - PrintWatermark wtr = (PrintWatermark)Enum.Parse(typeof(PrintWatermark), _DefaultWatermark); - // Compare parent setting with current setting - if (wtr != _ProcedureConfig.Print_Watermark) - _ProcedureConfig.Print_Watermark = wtr; // this will force a database update (write) - ppCmbxWatermark.SelectedIndex = -1; - //tcpOutputSettings.Focus(); - } - - private void ppBtnDeftDisAutoDuplx_Click(object sender, EventArgs e) - { - ppChbxDisAutoDuplex.Checked = _DefaultDisableDuplex; - _ProcedureConfig.Print_DisableDuplex = ppChbxDisAutoDuplex.Checked; - ppBtnDeftDisAutoDuplx.Visible = false; - ppLblAutoDuplexDefault.Visible = false; - //tcpOutputSettings.Focus(); - } - - private void ppTxbxChangeBarUserMsgOne_TextChanged(object sender, EventArgs e) - { - ppBtnDefCbTxt1.Visible = ((ppTxbxChangeBarUserMsgOne.Text != null) && !ppTxbxChangeBarUserMsgOne.Text.Equals(_DefaultChgBarUsrMsg1)); - ppLblChgBarUserMsgOneDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt1.Visible; - //tcpOutputSettings.Focus(); - } - - private void ppTxbxChgBarUserMsgTwo_TextChanged(object sender, EventArgs e) - { - ppBtnDefCbTxt2.Visible = ((ppTxbxChgBarUserMsgTwo.Text != null) && !ppTxbxChgBarUserMsgTwo.Text.Equals(_DefaultChgBarUsrMsg2)); - ppLblChgBarUserMsgTwoDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt2.Visible; - //tcpOutputSettings.Focus(); - } - - private void ppChbxDisAutoDuplex_CheckedChanged(object sender, EventArgs e) - { - - if (!_Initializing) - { - _ProcedureConfig.Print_DisableDuplex = ppChbxDisAutoDuplex.Checked; - ppBtnDeftDisAutoDuplx.Visible = _DefaultDisableDuplex != ppChbxDisAutoDuplex.Checked; - ppLblAutoDuplexDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDeftDisAutoDuplx.Visible; - //tcpOutputSettings.Focus(); - } - } - - private void frmProcedureProperties_Shown(object sender, EventArgs e) - { - ppProcNumStpRTB.Focus(); - - } - - - - - } } \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.Designer.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.Designer.cs index 6479cde0..7e1967b6 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.Designer.cs @@ -804,21 +804,18 @@ namespace VEPROMS // ppSectNumberStpRTB // this.ppSectNumberStpRTB.AdjustSize = new System.Drawing.Size(0, 0); - this.ppSectNumberStpRTB.BeingDisposed = false; this.ppSectNumberStpRTB.BorderStyle = System.Windows.Forms.BorderStyle.None; this.ppSectNumberStpRTB.CheckAbove = "|?????????"; this.ppSectNumberStpRTB.CheckBelow = "|?"; this.ppSectNumberStpRTB.CheckLeft = "-?????????"; this.ppSectNumberStpRTB.CheckRight = "-??"; this.ppSectNumberStpRTB.ContentsRectangle = new System.Drawing.Rectangle(85, 12, 159, 16); - this.ppSectNumberStpRTB.EpMode = VEPROMS.CSLA.Library.E_EditPrintMode.Edit; this.ppSectNumberStpRTB.FieldToEdit = Volian.Controls.Library.E_FieldToEdit.StepText; this.ppSectNumberStpRTB.Location = new System.Drawing.Point(85, 12); this.ppSectNumberStpRTB.MinimumSize = new System.Drawing.Size(159, 18); this.ppSectNumberStpRTB.MyClassName = "RichEdit20W"; this.ppSectNumberStpRTB.MyItemInfo = null; this.ppSectNumberStpRTB.MyLinkText = null; - this.ppSectNumberStpRTB.MyRTBItem = null; this.ppSectNumberStpRTB.Name = "ppSectNumberStpRTB"; this.ppSectNumberStpRTB.ProcessKeystrokes = true; this.ppSectNumberStpRTB.RTBRangeStatus = Volian.Controls.Library.StepRTB.RangeStatus.NoContainedLinks; @@ -834,21 +831,18 @@ namespace VEPROMS // ppSectTitleStpRTB // this.ppSectTitleStpRTB.AdjustSize = new System.Drawing.Size(0, 0); - this.ppSectTitleStpRTB.BeingDisposed = false; this.ppSectTitleStpRTB.BorderStyle = System.Windows.Forms.BorderStyle.None; this.ppSectTitleStpRTB.CheckAbove = "|?????????"; this.ppSectTitleStpRTB.CheckBelow = "|?"; this.ppSectTitleStpRTB.CheckLeft = "-?????????"; this.ppSectTitleStpRTB.CheckRight = "-??"; this.ppSectTitleStpRTB.ContentsRectangle = new System.Drawing.Rectangle(85, 60, 541, 16); - this.ppSectTitleStpRTB.EpMode = VEPROMS.CSLA.Library.E_EditPrintMode.Edit; this.ppSectTitleStpRTB.FieldToEdit = Volian.Controls.Library.E_FieldToEdit.StepText; this.ppSectTitleStpRTB.Location = new System.Drawing.Point(85, 60); this.ppSectTitleStpRTB.MinimumSize = new System.Drawing.Size(541, 61); this.ppSectTitleStpRTB.MyClassName = "RichEdit20W"; this.ppSectTitleStpRTB.MyItemInfo = null; this.ppSectTitleStpRTB.MyLinkText = null; - this.ppSectTitleStpRTB.MyRTBItem = null; this.ppSectTitleStpRTB.Name = "ppSectTitleStpRTB"; this.ppSectTitleStpRTB.ProcessKeystrokes = true; this.ppSectTitleStpRTB.RTBRangeStatus = Volian.Controls.Library.StepRTB.RangeStatus.NoContainedLinks; diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.cs index d17f1c3a..86ba8592 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.cs @@ -42,14 +42,13 @@ namespace VEPROMS this.Text = string.Format("{0} Properties", ii.DisplayText); ppSectTitleStpRTB.FieldToEdit = E_FieldToEdit.Text; ppSectTitleStpRTB.BorderStyle = BorderStyle.Fixed3D; - ppSectTitleStpRTB.ViewRTB = false; ppSectTitleStpRTB.MyItemInfo = ii; + ppSectTitleStpRTB.RefreshDisplay(true); ppSectNumberStpRTB.FieldToEdit = E_FieldToEdit.Number; ppSectNumberStpRTB.BorderStyle = BorderStyle.Fixed3D; - ppSectNumberStpRTB.ViewRTB = false; ppSectNumberStpRTB.MyItemInfo = ii; - + ppSectNumberStpRTB.RefreshDisplay(true); _MyStepTabRibbon = new StepTabRibbon(); //_MyStepTabRibbon.Dock = System.Windows.Forms.DockStyle.Top; //_MyStepTabRibbon.Location = new System.Drawing.Point(0, 0); @@ -85,12 +84,24 @@ namespace VEPROMS Document.Delete(_DocumentToDelete.DocID); _DocumentToDelete = null; } - - ppSectNumberStpRTB.SaveText(); - ppSectTitleStpRTB.SaveText(); + SaveText(ppSectNumberStpRTB); + SaveText(ppSectTitleStpRTB); mySection.Dispose(); this.Close(); } + public void SaveText(StepRTB myStepRTB) + { + if (myStepRTB.ReadOnly) return; + if (!myStepRTB.ActiveMode) return; + if (!myStepRTB.IsDirty && myStepRTB.Text.Contains("(Resolved Transition Text)") == false) return; + bool success = myStepRTB.OrigDisplayText.Save((RichTextBox)myStepRTB); + if (success) + { + myStepRTB.FindAllLinks(); + myStepRTB.OrigRTF = myStepRTB.Rtf; + myStepRTB.ClearUndo(); + } + } private static void FinishSectionSave(Section section) { ItemInfo sectinfo = ItemInfo.Get(section.ItemID); diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs index 60f4b445..a52f0dd9 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs @@ -69,6 +69,7 @@ namespace VEPROMS this.btnItemInfo = new DevComponents.DotNetBar.ButtonItem(); this.lblItemID = new DevComponents.DotNetBar.LabelItem(); this.lblResolution = new DevComponents.DotNetBar.LabelItem(); + this.btnEditItem = new DevComponents.DotNetBar.ButtonItem(); this.epAnnotations = new DevComponents.DotNetBar.ExpandablePanel(); this.ctrlAnnotationDetails = new Volian.Controls.Library.AnnotationDetails(); this.btnAnnoDetailsPushPin = new DevComponents.DotNetBar.ButtonX(); @@ -152,6 +153,21 @@ namespace VEPROMS this.qatCustomizeItem1}); this.ribbonControl1.Size = new System.Drawing.Size(1185, 56); this.ribbonControl1.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; + this.ribbonControl1.SystemText.MaximizeRibbonText = "&Maximize the Ribbon"; + this.ribbonControl1.SystemText.MinimizeRibbonText = "Mi&nimize the Ribbon"; + this.ribbonControl1.SystemText.QatAddItemText = "&Add to Quick Access Toolbar"; + this.ribbonControl1.SystemText.QatCustomizeMenuLabel = "Customize Quick Access Toolbar"; + this.ribbonControl1.SystemText.QatCustomizeText = "&Customize Quick Access Toolbar..."; + this.ribbonControl1.SystemText.QatDialogAddButton = "&Add >>"; + this.ribbonControl1.SystemText.QatDialogCancelButton = "Cancel"; + this.ribbonControl1.SystemText.QatDialogCaption = "Customize Quick Access Toolbar"; + this.ribbonControl1.SystemText.QatDialogCategoriesLabel = "&Choose commands from:"; + this.ribbonControl1.SystemText.QatDialogOkButton = "OK"; + this.ribbonControl1.SystemText.QatDialogPlacementCheckbox = "&Place Quick Access Toolbar below the Ribbon"; + this.ribbonControl1.SystemText.QatDialogRemoveButton = "&Remove"; + this.ribbonControl1.SystemText.QatPlaceAboveRibbonText = "&Place Quick Access Toolbar above the Ribbon"; + this.ribbonControl1.SystemText.QatPlaceBelowRibbonText = "&Place Quick Access Toolbar below the Ribbon"; + this.ribbonControl1.SystemText.QatRemoveItemText = "&Remove from Quick Access Toolbar"; this.ribbonControl1.TabGroupHeight = 14; this.ribbonControl1.TabIndex = 0; this.ribbonControl1.Text = "ribbonControl1"; @@ -420,10 +436,11 @@ namespace VEPROMS this.labelItem11, this.btnItemInfo, this.lblItemID, - this.lblResolution}); - this.bottomBar.Location = new System.Drawing.Point(5, 634); + this.lblResolution, + this.btnEditItem}); + this.bottomBar.Location = new System.Drawing.Point(5, 624); this.bottomBar.Name = "bottomBar"; - this.bottomBar.Size = new System.Drawing.Size(1185, 25); + this.bottomBar.Size = new System.Drawing.Size(1185, 29); this.bottomBar.Stretch = true; this.bottomBar.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; this.bottomBar.TabIndex = 1; @@ -436,7 +453,7 @@ namespace VEPROMS this.cmbFont.FormattingEnabled = true; this.cmbFont.Location = new System.Drawing.Point(1013, 0); this.cmbFont.Name = "cmbFont"; - this.cmbFont.Size = new System.Drawing.Size(172, 23); + this.cmbFont.Size = new System.Drawing.Size(172, 28); this.cmbFont.TabIndex = 0; this.cmbFont.SelectedIndexChanged += new System.EventHandler(this.cmbFont_SelectedIndexChanged); // @@ -512,6 +529,13 @@ namespace VEPROMS this.lblResolution.Text = "Edit"; this.lblResolution.Click += new System.EventHandler(this.lblResolution_Click); // + // btnEditItem + // + this.btnEditItem.ForeColor = System.Drawing.Color.Blue; + this.btnEditItem.Name = "btnEditItem"; + this.btnEditItem.Text = "EditItem"; + this.btnEditItem.Click += new System.EventHandler(this.btnEditItem_Click); + // // epAnnotations // this.epAnnotations.CanvasColor = System.Drawing.SystemColors.Control; @@ -523,7 +547,7 @@ namespace VEPROMS this.epAnnotations.Expanded = false; this.epAnnotations.ExpandedBounds = new System.Drawing.Rectangle(4, 544, 1187, 202); this.epAnnotations.ExpandOnTitleClick = true; - this.epAnnotations.Location = new System.Drawing.Point(5, 608); + this.epAnnotations.Location = new System.Drawing.Point(5, 598); this.epAnnotations.Name = "epAnnotations"; this.epAnnotations.Size = new System.Drawing.Size(1185, 26); this.epAnnotations.Style.Alignment = System.Drawing.StringAlignment.Center; @@ -556,7 +580,7 @@ namespace VEPROMS this.ctrlAnnotationDetails.CurrentAnnotation = null; this.ctrlAnnotationDetails.Dock = System.Windows.Forms.DockStyle.Fill; this.ctrlAnnotationDetails.Location = new System.Drawing.Point(0, 26); - this.ctrlAnnotationDetails.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.ctrlAnnotationDetails.Margin = new System.Windows.Forms.Padding(2); this.ctrlAnnotationDetails.Name = "ctrlAnnotationDetails"; this.ctrlAnnotationDetails.Size = new System.Drawing.Size(1185, 0); this.ctrlAnnotationDetails.TabIndex = 15; @@ -568,7 +592,6 @@ namespace VEPROMS this.btnAnnoDetailsPushPin.AutoCheckOnClick = true; this.btnAnnoDetailsPushPin.BackColor = System.Drawing.Color.Transparent; this.btnAnnoDetailsPushPin.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.btnAnnoDetailsPushPin.CallBasePaintBackground = true; this.btnAnnoDetailsPushPin.ColorTable = DevComponents.DotNetBar.eButtonColor.Flat; this.btnAnnoDetailsPushPin.FocusCuesEnabled = false; this.btnAnnoDetailsPushPin.Image = ((System.Drawing.Image)(resources.GetObject("btnAnnoDetailsPushPin.Image"))); @@ -594,7 +617,7 @@ namespace VEPROMS this.epProcedures.ExpandOnTitleClick = true; this.epProcedures.Location = new System.Drawing.Point(5, 57); this.epProcedures.Name = "epProcedures"; - this.epProcedures.Size = new System.Drawing.Size(30, 551); + this.epProcedures.Size = new System.Drawing.Size(30, 541); this.epProcedures.Style.Alignment = System.Drawing.StringAlignment.Center; this.epProcedures.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; this.epProcedures.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; @@ -640,7 +663,7 @@ namespace VEPROMS this.infoPanel.ExpandOnTitleClick = true; this.infoPanel.Location = new System.Drawing.Point(927, 57); this.infoPanel.Name = "infoPanel"; - this.infoPanel.Size = new System.Drawing.Size(230, 551); + this.infoPanel.Size = new System.Drawing.Size(230, 541); this.infoPanel.Style.Alignment = System.Drawing.StringAlignment.Center; this.infoPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; this.infoPanel.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; @@ -666,15 +689,15 @@ namespace VEPROMS // this.infoTabs.BackColor = System.Drawing.Color.Transparent; this.infoTabs.CanReorderTabs = true; - this.infoTabs.Controls.Add(this.infotabControlPanelTags); this.infoTabs.Controls.Add(this.infotabControlPanelTransitions); + this.infoTabs.Controls.Add(this.infotabControlPanelTags); this.infoTabs.Controls.Add(this.infotabControlPanelRO); this.infoTabs.Dock = System.Windows.Forms.DockStyle.Fill; this.infoTabs.Location = new System.Drawing.Point(0, 26); this.infoTabs.Name = "infoTabs"; this.infoTabs.SelectedTabFont = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Bold); this.infoTabs.SelectedTabIndex = 0; - this.infoTabs.Size = new System.Drawing.Size(230, 525); + this.infoTabs.Size = new System.Drawing.Size(230, 515); this.infoTabs.TabAlignment = DevComponents.DotNetBar.eTabStripAlignment.Right; this.infoTabs.TabIndex = 1; this.infoTabs.TabLayoutType = DevComponents.DotNetBar.eTabLayoutType.FixedWithNavigationBox; @@ -692,7 +715,7 @@ namespace VEPROMS this.infotabControlPanelTags.Location = new System.Drawing.Point(0, 0); this.infotabControlPanelTags.Name = "infotabControlPanelTags"; this.infotabControlPanelTags.Padding = new System.Windows.Forms.Padding(1); - this.infotabControlPanelTags.Size = new System.Drawing.Size(203, 525); + this.infotabControlPanelTags.Size = new System.Drawing.Size(203, 515); this.infotabControlPanelTags.Style.BackColor1.Color = System.Drawing.SystemColors.Control; this.infotabControlPanelTags.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; this.infotabControlPanelTags.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Top) @@ -710,7 +733,7 @@ namespace VEPROMS this.panelEx1.Dock = System.Windows.Forms.DockStyle.Fill; this.panelEx1.Location = new System.Drawing.Point(1, 1); this.panelEx1.Name = "panelEx1"; - this.panelEx1.Size = new System.Drawing.Size(201, 523); + this.panelEx1.Size = new System.Drawing.Size(201, 513); this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center; this.panelEx1.Style.BackColor1.Color = System.Drawing.Color.Transparent; this.panelEx1.Style.BackColor2.Color = System.Drawing.Color.SlateGray; @@ -722,12 +745,15 @@ namespace VEPROMS // displayTags // this.displayTags.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.displayTags.CurItemInfo = null; this.displayTags.Dock = System.Windows.Forms.DockStyle.Top; + this.displayTags.IsVisible = false; this.displayTags.Location = new System.Drawing.Point(0, 0); - this.displayTags.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.displayTags.Margin = new System.Windows.Forms.Padding(2); this.displayTags.MinimumSize = new System.Drawing.Size(100, 630); - this.displayTags.MyRTB = null; + this.displayTags.MyEditItem = null; this.displayTags.Name = "displayTags"; + this.displayTags.NotVisibleEditItem = null; this.displayTags.Size = new System.Drawing.Size(201, 630); this.displayTags.TabIndex = 0; // @@ -746,7 +772,7 @@ namespace VEPROMS this.infotabControlPanelTransitions.Location = new System.Drawing.Point(0, 0); this.infotabControlPanelTransitions.Name = "infotabControlPanelTransitions"; this.infotabControlPanelTransitions.Padding = new System.Windows.Forms.Padding(1); - this.infotabControlPanelTransitions.Size = new System.Drawing.Size(203, 525); + this.infotabControlPanelTransitions.Size = new System.Drawing.Size(203, 515); this.infotabControlPanelTransitions.Style.BackColor1.Color = System.Drawing.SystemColors.Control; this.infotabControlPanelTransitions.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; this.infotabControlPanelTransitions.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Top) @@ -768,7 +794,7 @@ namespace VEPROMS this.displayTransition.MyRTB = null; this.displayTransition.Name = "displayTransition"; this.displayTransition.RangeColor = System.Drawing.Color.LightGray; - this.displayTransition.Size = new System.Drawing.Size(201, 523); + this.displayTransition.Size = new System.Drawing.Size(201, 513); this.displayTransition.TabIndex = 0; // // infotabTransition @@ -786,7 +812,7 @@ namespace VEPROMS this.infotabControlPanelRO.Location = new System.Drawing.Point(0, 0); this.infotabControlPanelRO.Name = "infotabControlPanelRO"; this.infotabControlPanelRO.Padding = new System.Windows.Forms.Padding(1); - this.infotabControlPanelRO.Size = new System.Drawing.Size(203, 525); + this.infotabControlPanelRO.Size = new System.Drawing.Size(203, 515); this.infotabControlPanelRO.Style.BackColor1.Color = System.Drawing.SystemColors.Control; this.infotabControlPanelRO.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; this.infotabControlPanelRO.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Top) @@ -807,7 +833,7 @@ namespace VEPROMS this.displayRO.MyRTB = null; this.displayRO.Name = "displayRO"; this.displayRO.ProgressBar = null; - this.displayRO.Size = new System.Drawing.Size(201, 523); + this.displayRO.Size = new System.Drawing.Size(201, 513); this.displayRO.TabControl = null; this.displayRO.TabIndex = 0; // @@ -862,7 +888,7 @@ namespace VEPROMS this.expandableSplitter1.HotGripLightColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; this.expandableSplitter1.Location = new System.Drawing.Point(35, 57); this.expandableSplitter1.Name = "expandableSplitter1"; - this.expandableSplitter1.Size = new System.Drawing.Size(3, 551); + this.expandableSplitter1.Size = new System.Drawing.Size(3, 541); this.expandableSplitter1.Style = DevComponents.DotNetBar.eSplitterStyle.Office2007; this.expandableSplitter1.TabIndex = 5; this.expandableSplitter1.TabStop = false; @@ -894,7 +920,7 @@ namespace VEPROMS this.expandableSplitter2.HotGripDarkColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; this.expandableSplitter2.HotGripLightColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(208)))), ((int)(((byte)(213))))); this.expandableSplitter2.HotGripLightColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; - this.expandableSplitter2.Location = new System.Drawing.Point(38, 605); + this.expandableSplitter2.Location = new System.Drawing.Point(38, 595); this.expandableSplitter2.Name = "expandableSplitter2"; this.expandableSplitter2.Size = new System.Drawing.Size(889, 3); this.expandableSplitter2.Style = DevComponents.DotNetBar.eSplitterStyle.Office2007; @@ -930,7 +956,7 @@ namespace VEPROMS this.expandableSplitter3.HotGripLightColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; this.expandableSplitter3.Location = new System.Drawing.Point(924, 57); this.expandableSplitter3.Name = "expandableSplitter3"; - this.expandableSplitter3.Size = new System.Drawing.Size(3, 548); + this.expandableSplitter3.Size = new System.Drawing.Size(3, 538); this.expandableSplitter3.Style = DevComponents.DotNetBar.eSplitterStyle.Office2007; this.expandableSplitter3.TabIndex = 7; this.expandableSplitter3.TabStop = false; @@ -956,7 +982,7 @@ namespace VEPROMS this.toolsPanel.ExpandOnTitleClick = true; this.toolsPanel.Location = new System.Drawing.Point(1160, 57); this.toolsPanel.Name = "toolsPanel"; - this.toolsPanel.Size = new System.Drawing.Size(30, 551); + this.toolsPanel.Size = new System.Drawing.Size(30, 541); this.toolsPanel.Style.Alignment = System.Drawing.StringAlignment.Center; this.toolsPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; this.toolsPanel.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; @@ -1079,9 +1105,9 @@ namespace VEPROMS // this.displayBookMarks.Dock = System.Windows.Forms.DockStyle.Fill; this.displayBookMarks.Location = new System.Drawing.Point(0, 0); - this.displayBookMarks.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.displayBookMarks.Margin = new System.Windows.Forms.Padding(2); this.displayBookMarks.MyDisplayTabControl = null; - this.displayBookMarks.MyRTB = null; + this.displayBookMarks.MyEditItem = null; this.displayBookMarks.Name = "displayBookMarks"; this.displayBookMarks.Size = new System.Drawing.Size(1, 603); this.displayBookMarks.TabIndex = 0; @@ -1158,7 +1184,7 @@ namespace VEPROMS this.expandableSplitter4.HotGripLightColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; this.expandableSplitter4.Location = new System.Drawing.Point(1157, 57); this.expandableSplitter4.Name = "expandableSplitter4"; - this.expandableSplitter4.Size = new System.Drawing.Size(3, 551); + this.expandableSplitter4.Size = new System.Drawing.Size(3, 541); this.expandableSplitter4.Style = DevComponents.DotNetBar.eSplitterStyle.Office2007; this.expandableSplitter4.TabIndex = 3; this.expandableSplitter4.TabStop = false; @@ -1179,12 +1205,12 @@ namespace VEPROMS this.tc.Dock = System.Windows.Forms.DockStyle.Fill; this.tc.ForeColor = System.Drawing.SystemColors.ControlText; this.tc.Location = new System.Drawing.Point(38, 57); - this.tc.Margin = new System.Windows.Forms.Padding(4); + this.tc.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tc.MyCopyStep = null; this.tc.Name = "tc"; this.tc.RibbonExpanded = true; this.tc.SelectedDisplayTabItem = null; - this.tc.Size = new System.Drawing.Size(886, 548); + this.tc.Size = new System.Drawing.Size(886, 538); this.tc.TabIndex = 8; this.tc.PanelTabDisplay += new Volian.Controls.Library.StepPanelTabDisplayEvent(this.tc_PanelTabDisplay); this.tc.WordSectionClose += new Volian.Controls.Library.StepPanelWordSectionCloseEvent(this.tc_WordSectionClose); @@ -1196,10 +1222,10 @@ namespace VEPROMS // // frmVEPROMS // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScroll = true; - this.ClientSize = new System.Drawing.Size(1195, 661); + this.ClientSize = new System.Drawing.Size(1195, 655); this.Controls.Add(this.tc); this.Controls.Add(this.expandableSplitter3); this.Controls.Add(this.expandableSplitter2); @@ -1347,6 +1373,7 @@ namespace VEPROMS private DevComponents.DotNetBar.LabelItem lblItemID; private System.Windows.Forms.ComboBox cmbFont; private DevComponents.DotNetBar.LabelItem lblResolution; + private DevComponents.DotNetBar.ButtonItem btnEditItem; } } diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index 55da3ac6..be5419df 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -259,6 +259,12 @@ namespace VEPROMS SetupButtons(); displayBookMarks.MyDisplayTabControl = tc; // allows bookmark selection to bring up steps/docs office2007StartButton1.MouseDown +=new MouseEventHandler(office2007StartButton1_MouseDown); + displayRO.EnabledChanged += new EventHandler(displayRO_EnabledChanged); + } + + void displayRO_EnabledChanged(object sender, EventArgs e) + { + Console.WriteLine("here"); } void _MyMRIList_AfterRemove(object sender) @@ -822,7 +828,7 @@ namespace VEPROMS displayRO.Mydvi = SelectedDVI; displayRO.MyROFST = SelectedROFst; - displayRO.MyRTB = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedRTBItem.MyStepRTB; + displayRO.MyRTB = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; displayRO.TabControl = tc; displayRO.ProgressBar = bottomProgBar; @@ -833,7 +839,7 @@ namespace VEPROMS { if (tc == null || tc.SelectedDisplayTabItem == null) return; if (SelectedStepTabPanel == null) return; - displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedRTBItem.MyStepRTB; + displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; //displayTransition.RangeColor = global::VEPROMS.Properties.Settings.Default.TransitionRangeColor; displayTransition.CurTrans = null; } @@ -865,7 +871,7 @@ namespace VEPROMS { infoPanel.Expanded = true; infoTabs.SelectedTab = infotabTags; - displayTags.MyRTB = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedRTBItem.MyStepRTB; + displayTags.MyEditItem = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem; } #endregion #region InfoTabBookMarks @@ -873,7 +879,7 @@ namespace VEPROMS { infoPanel.Expanded = true; infoTabs.SelectedTab = infotabTags; - displayTags.MyRTB = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedRTBItem.MyStepRTB; + displayTags.MyEditItem = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem; } #endregion #region PanelSupport @@ -954,9 +960,13 @@ namespace VEPROMS this.lblEditView.Text = args.ViewMode == E_ViewMode.Edit ? "Edit" : "View"; } private ItemInfo _CurrentItem = null; + private StepRTB _LastStepRTB = null; private void tc_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args) { - + if (_LastStepRTB != null && !_LastStepRTB.Disposing) + _LastStepRTB.EditModeChanged -= new StepRTBEvent(_LastStepRTB_EditModeChanged); + _LastStepRTB = args != null && args.MyEditItem != null ? args.MyEditItem.MyStepRTB : null; + if (_LastStepRTB != null) _LastStepRTB.EditModeChanged += new StepRTBEvent(_LastStepRTB_EditModeChanged); lblEditView.Text = " "; if (args == null) { @@ -981,18 +991,18 @@ namespace VEPROMS _CurrentItem = args.MyItemInfo; } //vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem); - if (args.MyRTBItem == null) + if (args.MyEditItem == null) { infotabTransition.Visible = false; infotabRO.Visible = true; displayRO.MyRTB = null; infotabTags.Visible = false; - displayBookMarks.MyRTB = null; + displayBookMarks.MyEditItem = null; //vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem); } else { - if (args.MyRTBItem.MyItemInfo.IsSection || args.MyRTBItem.MyItemInfo.IsProcedure) + if (args.MyEditItem.MyItemInfo.IsSection || args.MyEditItem.MyItemInfo.IsProcedure) { infotabRO.Visible = infotabTransition.Visible = false; infotabTags.Visible = false; @@ -1000,36 +1010,54 @@ namespace VEPROMS } else { - infotabRO.Visible = infotabTransition.Visible = infotabTags.Visible = true; + infotabTags.Visible = true; + if (_LastStepRTB != null) + { + infotabRO.Visible = infotabTransition.Visible = true; + displayRO.Enabled = displayTransition.Enabled = _LastStepRTB.EditMode; + } + else + infotabRO.Visible = infotabTransition.Visible = false; + // When infotabTags is set to Visible, the matching panel also needs to be set to visible // the other panels will appear as they are selected by the user. infotabControlPanelTags.Visible = true; displayTags.IsVisible = true; } // When infotabTags is set to Visible, it is given focus. The next line returns focus to the StepRTB - args.MyRTBItem.MyStepRTB.Focus(); - displayTransition.MyRTB = args.MyRTBItem.MyStepRTB; - displayRO.MyRTB = args.MyRTBItem.MyStepRTB; - displayTags.MyRTB = args.MyRTBItem.MyStepRTB; - displayBookMarks.MyRTB = args.MyRTBItem.MyStepRTB; + args.MyEditItem.SetFocus(); + displayTransition.MyRTB = args.MyEditItem.MyStepRTB; + displayRO.MyRTB = args.MyEditItem.MyStepRTB; + displayTags.MyEditItem = args.MyEditItem; + displayBookMarks.MyEditItem = args.MyEditItem; displayRO.ProgressBar = bottomProgBar; - lblEditView.Text = args.MyRTBItem.MyStepRTB.ViewRTB ? "View" : "Edit"; + lblEditView.Text = args.MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit ? "Edit" : "View" ; _CurrentItem.Deleted += new ItemInfoEvent(_CurrentItem_Deleted); - dlgFindReplace.MyRTBItem = args.MyRTBItem; - SpellChecker.MyRTBItem = args.MyRTBItem; - } - if (args.MyRTBItem != null) - { - SelectedStepTabPanel = args.MyRTBItem.MyStepPanel.MyStepTabPanel; - //SelectedStepTabPanel = ((DisplayTabItem)tc.SelectedDisplayTabItem).MyStepTabPanel; + dlgFindReplace.MyEditItem = args.MyEditItem; + SpellChecker.MyEditItem = args.MyEditItem; } + if (args.MyEditItem != null) + SelectedStepTabPanel = args.MyEditItem.MyStepPanel.MyStepTabPanel; + else + SelectedDVI = args.MyItemInfo.ActiveParent.ActiveParent as DocVersionInfo; } ctrlAnnotationDetails.UpdateAnnotationGrid(_CurrentItem); AnnotationPanelView(); btnPrint.Enabled = (_CurrentItem != null); } + void _LastStepRTB_EditModeChanged(object sender, EventArgs args) + { + if (_LastStepRTB.EditMode) // going into edit mode in a cell of the grid. + displayRO.Enabled = displayTransition.Enabled = _LastStepRTB.EditMode; + else // going out of edit mode in a cell of the grid. + { + if (!_LastStepRTB.Parent.Focused && (infotabRO.IsSelected || infotabTransition.IsSelected)) return; + displayRO.Enabled = displayTransition.Enabled = _LastStepRTB.EditMode; + } + } + void _CurrentItem_Deleted(object sender) { //displayBookMarks.DeleteItemBookMarkPanel(_CurrentItem); @@ -1073,7 +1101,7 @@ namespace VEPROMS infoTabs.SelectedTab = infotabTransition; if (SelectedStepTabPanel == null) return; //displayTransition.RangeColor = global::VEPROMS.Properties.Settings.Default.TransitionRangeColor; - displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedRTBItem.MyStepRTB; + displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; displayTransition.CurTrans = args.MyLinkText.MyTransitionInfo; } private void tc_LinkModifyRO(object sender, StepPanelLinkEventArgs args) @@ -1083,7 +1111,7 @@ namespace VEPROMS if (SelectedStepTabPanel == null) return; displayRO.MyROFST = SelectedROFst; - displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedRTBItem.MyStepRTB; + displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo; displayRO.Mydvi = SelectedDVI; displayRO.ProgressBar = bottomProgBar; @@ -1272,7 +1300,7 @@ namespace VEPROMS #region PanelEvents private void infoPanel_Click(object sender, EventArgs e) { - displayTags.MyRTB = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedRTBItem.MyStepRTB; + displayTags.MyEditItem = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem; } //private void tv_SectionShouldClose(object sender, vlnTreeSectionInfoEventArgs args) //{ @@ -1429,5 +1457,11 @@ namespace VEPROMS _MyMRIList.Refresh(); SetupMRU(); } + + private void btnEditItem_Click(object sender, EventArgs e) + { + frmPropGrid pg = new frmPropGrid(tc.SelectedDisplayTabItem.MyStepTabPanel.SelectedEditItem, "EditItem"); + pg.Show(); + } } }