From b8bb92cfaa9093a945891f75f859fcbe5357e2cd Mon Sep 17 00:00:00 2001 From: Jsj Date: Wed, 26 Mar 2008 18:32:53 +0000 Subject: [PATCH] hide various items not needed at this time --- .../frmFolderProperties.cs | 185 +++++++++++++++--- .../frmProcedureProperties.Designer.cs | 147 +++++++------- .../frmProcedureProperties.cs | 123 +++++++++++- .../frmProcedureProperties.resx | 3 + 4 files changed, 348 insertions(+), 110 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmFolderProperties.cs b/PROMS/VEPROMS User Interface/frmFolderProperties.cs index 44916922..b80bc359 100644 --- a/PROMS/VEPROMS User Interface/frmFolderProperties.cs +++ b/PROMS/VEPROMS User Interface/frmFolderProperties.cs @@ -33,10 +33,10 @@ namespace VEPROMS private string _DefaultFormatColumns = null; private bool _Initializing = false; private FolderConfig _FolderConfig; - private string _ROcolor; - private string _TransColor; - private string _EditBckgndColor; - private string _ViewBckgndColor; + //private string _ROcolor; + //private string _TransColor; + //private string _EditBckgndColor; + //private string _ViewBckgndColor; public frmFolderProperties(FolderConfig folderConfig) { @@ -200,29 +200,33 @@ namespace VEPROMS // Assign the data sources to the combo boxes ppCmbxChangeBarType.DataSource = EnumDetail.Details(); ppCmbxChangeBarType.DisplayMember = "Name"; - //ppCmbxChgBarPos.DisplayMember = "Description"; ppCmbxChangeBarType.ValueMember = "EValue"; ppCmbxChangeBarType.SelectedValue = -1; ppCmbxChgBarPos.DataSource = EnumDetail.Details(); ppCmbxChgBarPos.DisplayMember = "Name"; ppCmbxChgBarPos.ValueMember = "EValue"; + ppCmbxChgBarPos.SelectedValue = -1; ppCmbxChgBarTxtType.DataSource = EnumDetail.Details(); ppCmbxChgBarTxtType.DisplayMember = "Name"; ppCmbxChgBarTxtType.ValueMember = "EValue"; + ppCmbxChgBarTxtType.SelectedValue = -1; ppCmbxPagination.DataSource = EnumDetail.Details(); ppCmbxPagination.DisplayMember = "Name"; ppCmbxPagination.ValueMember = "EValue"; + ppCmbxPagination.SelectedValue = -1; ppCmbxWatermark.DataSource = EnumDetail.Details(); ppCmbxWatermark.DisplayMember = "Name"; ppCmbxWatermark.ValueMember = "EValue"; + ppCmbxWatermark.SelectedValue = -1; ppCmbxStpEditorCols.DataSource = EnumDetail.Details(); ppCmbxStpEditorCols.DisplayMember = "Name"; ppCmbxStpEditorCols.ValueMember = "EValue"; + ppCmbxStpEditorCols.SelectedValue = -1; ppCbShwDefSettings.Visible = true; // display check box for showing default values } @@ -280,11 +284,22 @@ namespace VEPROMS /// EventArgs private void ppCmbxGrphFileExt_SelectedValueChanged(object sender, EventArgs e) { - ProcessCmbxSelectedValueChange(ppCmbxGrphFileExt, _DefaultROGraficFileExtension, ppBtnDefaultGrfExt, ppLblGraphicFileExtDefault); + if (!_Initializing) + ProcessCmbxSelectedValueChange(ppCmbxGrphFileExt, _DefaultROGraficFileExtension, ppBtnDefaultGrfExt, ppLblGraphicFileExtDefault); } + /// + /// Reset to the parent setting. + /// Find the parent setting and assign it to _FolderConfig.Graphics_defaultext. + /// This will force the database to be updated. + /// + /// + /// private void ppBtnDefaultGrfExt_Click(object sender, EventArgs e) { + // Compare parent setting with current setting + if (_DefaultROGraficFileExtension.Equals(_FolderConfig.Graphics_defaultext)) + _FolderConfig.Graphics_defaultext = _DefaultROGraficFileExtension;// this will force a database update (write) ppCmbxGrphFileExt.SelectedIndex = -1; //reset to the default Graphic File Extension setting } @@ -295,11 +310,22 @@ namespace VEPROMS /// EventArgs private void ppCmbxDefROPrefix_SelectedValueChanged(object sender, EventArgs e) { - ProcessCmbxSelectedValueChange(ppCmbxDefROPrefix, _DefaultROPrefix, ppBtnDefaultROPrefix, ppLblROPrefixDefault); + if (!_Initializing) + ProcessCmbxSelectedValueChange(ppCmbxDefROPrefix, _DefaultROPrefix, ppBtnDefaultROPrefix, ppLblROPrefixDefault); } + /// + /// Reset to the parent setting. + /// Find the parent setting and assign it to _FolderConfig.Default_SPPrefix. + /// This will force the database to be updated. + /// + /// + /// private void ppBtnDefaultROPrefix_Click(object sender, EventArgs e) { + // Compare parent setting with current setting + if ( _DefaultROPrefix.Equals(_FolderConfig.Default_SPPrefix)) + _FolderConfig.Default_SPPrefix = _DefaultROPrefix;// this will force a database update (write) ppCmbxDefROPrefix.SelectedIndex = -1; //reset to the default RO Prefix setting } @@ -310,11 +336,22 @@ namespace VEPROMS /// EventArgs private void ppCmbxDefImgPrefix_SelectedValueChanged(object sender, EventArgs e) { - ProcessCmbxSelectedValueChange(ppCmbxDefImgPrefix, _DefaultImagePrefix, ppBtnDefaultImgPrefix, ppLblImagePrefixDefault); + if (!_Initializing) + ProcessCmbxSelectedValueChange(ppCmbxDefImgPrefix, _DefaultImagePrefix, ppBtnDefaultImgPrefix, ppLblImagePrefixDefault); } + /// + /// Reset to the parent setting. + /// Find the parent setting and assign it to _FolderConfig.Default_IMPrefix. + /// This will force the database to be updated. + /// + /// + /// private void ppBtnDefaultImgPrefix_Click(object sender, EventArgs e) { + // Compare parent setting with current setting + if (_DefaultImagePrefix.Equals(_FolderConfig.Default_IMPrefix)) + _FolderConfig.Default_IMPrefix = _DefaultImagePrefix;// this will force a database update (write) ppCmbxDefImgPrefix.SelectedIndex = -1; //reset to the default Image Prefix setting } @@ -387,13 +424,27 @@ namespace VEPROMS /// EventArgs private void ppCmbxPagination_SelectedValueChanged(object sender, EventArgs e) { - //ProcessCmbxSelectedValueChange(ppCmbxPagination, _DefaultPagination, ppBtnDefPagination, ppLblPaginationDefault); - FolderConfig.PrintPagination pgtn = (FolderConfig.PrintPagination)Enum.Parse(typeof(FolderConfig.PrintPagination), _DefaultPagination); - ProcessCmbxSelectionEnumChanged(ppCmbxPagination, pgtn, ppBtnDefPagination, ppLblPaginationDefault); + if (!_Initializing) + { + FolderConfig.PrintPagination pgtn = (FolderConfig.PrintPagination)Enum.Parse(typeof(FolderConfig.PrintPagination), _DefaultPagination); + ProcessCmbxSelectionEnumChanged(ppCmbxPagination, pgtn, ppBtnDefPagination, ppLblPaginationDefault); + } } + /// + /// Reset to the parent setting. + /// Find the parent setting and assign it to _FolderConfig.Print_Pagination. + /// This will force the database to be updated. + /// + /// + /// private void ppBtnDefPagination_Click(object sender, EventArgs e) { + // Get the parent setting + FolderConfig.PrintPagination pgtn = (FolderConfig.PrintPagination)Enum.Parse(typeof(FolderConfig.PrintPagination), _DefaultPagination); + // Compare parent setting with current setting + if (pgtn != _FolderConfig.Print_Pagination) + _FolderConfig.Print_Pagination = pgtn; // this will force a database update (write) ppCmbxPagination.SelectedIndex = -1; //reset to the default Pagination setting } @@ -404,11 +455,27 @@ namespace VEPROMS /// EventArgs private void ppCmbxWatermark_SelectedValueChanged(object sender, EventArgs e) { - FolderConfig.PrintWatermark wtr = (FolderConfig.PrintWatermark)Enum.Parse(typeof(FolderConfig.PrintWatermark), _DefaultWatermark); - ProcessCmbxSelectionEnumChanged(ppCmbxWatermark, wtr, ppBtnDefWatermark, ppLblWatermarkDefault); + if (!_Initializing) + { + FolderConfig.PrintWatermark wtr = (FolderConfig.PrintWatermark)Enum.Parse(typeof(FolderConfig.PrintWatermark), _DefaultWatermark); + ProcessCmbxSelectionEnumChanged(ppCmbxWatermark, wtr, ppBtnDefWatermark, ppLblWatermarkDefault); + } } + + /// + /// Reset to the parent setting. + /// Find the parent setting and assign it to _FolderConfig.Print_Watermark. + /// This will force the database to be updated. + /// + /// + /// private void ppBtnDefWatermark_Click(object sender, EventArgs e) { + // Get the parent setting + FolderConfig.PrintWatermark wtr = (FolderConfig.PrintWatermark)Enum.Parse(typeof(FolderConfig.PrintWatermark), _DefaultWatermark); + // Compare parent setting with current setting + if (wtr != _FolderConfig.Print_Watermark) + _FolderConfig.Print_Watermark = wtr; // this will force a database update (write) ppCmbxWatermark.SelectedIndex = -1; //reset to the default Watermark setting } @@ -419,8 +486,11 @@ namespace VEPROMS /// EventArgs private void ppChbxDisAutoDuplex_CheckedChanged(object sender, EventArgs e) { - ppBtnDeftDisAutoDuplx.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (_DefaultDisableDuplex != ppChbxDisAutoDuplex.Checked); - ppLblAutoDuplexDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDeftDisAutoDuplx.Visible; + if (!_Initializing) + { + ppBtnDeftDisAutoDuplx.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (_DefaultDisableDuplex != ppChbxDisAutoDuplex.Checked); + ppLblAutoDuplexDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDeftDisAutoDuplx.Visible; + } } #endregion @@ -458,7 +528,8 @@ namespace VEPROMS /// EventArgs private void ppCmbxFormat_SelectedValueChanged(object sender, EventArgs e) { - ProcessCmbxSelectedValueChange(ppCmbxFormat, _DefaultFormatName, ppBtnDefaultFmt, ppLblFormatDefault); + if (!_Initializing) + ProcessCmbxSelectedValueChange(ppCmbxFormat, _DefaultFormatName, ppBtnDefaultFmt, ppLblFormatDefault); } private void ppBtnDefaultFmt_Click(object sender, EventArgs e) @@ -496,16 +567,21 @@ namespace VEPROMS } } + /// + /// Reset to the parent setting. + /// Find the parent setting and assign it to _FolderConfig.PrintChangeBar. + /// This will force the database to be updated. + /// + /// + /// private void ppBtnDefaultChgBar_Click(object sender, EventArgs e) { - // Find the parent setting and assign it to _FolderConfig.PrintChangeBar. This will force the database - // to be updated. Prior to adding this logic, if we were saving a setting identical to the parent setting, - // the database was not being updated, because it didn't see it as being different. - // + // Get the parent setting FolderConfig.PrintChangeBar pcb = (FolderConfig.PrintChangeBar)Enum.Parse(typeof(FolderConfig.PrintChangeBar), _DefaultChgBarType); + // Compare parent setting with current setting if (pcb!= _FolderConfig.Print_ChangeBar) - _FolderConfig.Print_ChangeBar = pcb; // t - ppCmbxChangeBarType.SelectedIndex = -1; //reset to the default Change Bar setting + _FolderConfig.Print_ChangeBar = pcb; // this will force a database update (write) + ppCmbxChangeBarType.SelectedIndex = -1; //reset combo box to the default Change Bar setting } /// @@ -515,12 +591,27 @@ namespace VEPROMS /// EventArgs private void ppCmbxChgBarPos_SelectedValueChanged(object sender, EventArgs e) { - FolderConfig.PrintChangeBarLoc cbl = (FolderConfig.PrintChangeBarLoc)Enum.Parse(typeof(FolderConfig.PrintChangeBarLoc), _DefaultChgBarLoc); - ProcessCmbxSelectionEnumChanged(ppCmbxChgBarPos, cbl, ppBtnDefaultCbPos, ppLblChgBarPosDefault); + if (!_Initializing) + { + FolderConfig.PrintChangeBarLoc cbl = (FolderConfig.PrintChangeBarLoc)Enum.Parse(typeof(FolderConfig.PrintChangeBarLoc), _DefaultChgBarLoc); + ProcessCmbxSelectionEnumChanged(ppCmbxChgBarPos, cbl, ppBtnDefaultCbPos, ppLblChgBarPosDefault); + } } + /// + /// Reset to the parent setting. + /// Find the parent setting and assign it to _FolderConfig.Print_ChangeBarLoc. + /// This will force the database to be updated. + /// + /// + /// private void ppCmbxChgBarPos_Click(object sender, EventArgs e) { + // Get the parent setting + FolderConfig.PrintChangeBarLoc cbl = (FolderConfig.PrintChangeBarLoc)Enum.Parse(typeof(FolderConfig.PrintChangeBarLoc), _DefaultChgBarLoc); + // Compare parent setting with current setting + if (cbl != _FolderConfig.Print_ChangeBarLoc) + _FolderConfig.Print_ChangeBarLoc = cbl; // this will force a database update (write) ppCmbxChgBarPos.SelectedIndex = -1; //reset to the default Change Bar Position setting } @@ -531,13 +622,28 @@ namespace VEPROMS /// EventArgs private void ppCmbxChgBarTxtType_SelectedValueChanged(object sender, EventArgs e) { - FolderConfig.PrintChangeBarText cbt = (FolderConfig.PrintChangeBarText)Enum.Parse(typeof(FolderConfig.PrintChangeBarText), _DefaultChgBarText); - ProcessCmbxSelectionEnumChanged(ppCmbxChgBarTxtType, cbt, ppBtnDefCbTxtTyp, ppLblChgBarTxtTypeDefault); - setEnabledUserSpecifiedChgBarText(); + if (!_Initializing) + { + FolderConfig.PrintChangeBarText cbt = (FolderConfig.PrintChangeBarText)Enum.Parse(typeof(FolderConfig.PrintChangeBarText), _DefaultChgBarText); + ProcessCmbxSelectionEnumChanged(ppCmbxChgBarTxtType, cbt, ppBtnDefCbTxtTyp, ppLblChgBarTxtTypeDefault); + setEnabledUserSpecifiedChgBarText(); + } } + /// + /// Reset to the parent setting. + /// Find the parent setting and assign it to _FolderConfig.Print_ChangeBarText. + /// This will force the database to be updated. + /// + /// + /// private void ppBtnDefCbTxtTyp_Click(object sender, EventArgs e) { + // Get the parent setting + FolderConfig.PrintChangeBarText cbt = (FolderConfig.PrintChangeBarText)Enum.Parse(typeof(FolderConfig.PrintChangeBarText), _DefaultChgBarText); + // Compare parent setting with current setting + if (cbt != _FolderConfig.Print_ChangeBarText) + _FolderConfig.Print_ChangeBarText = cbt; // this will force a database update (write) ppCmbxChgBarTxtType.SelectedIndex = -1; //reset to the default Change Bar Text Type setting } @@ -562,7 +668,8 @@ namespace VEPROMS /// EventArgs private void ppTxbxChangeBarUserMsgOne_TextChanged(object sender, EventArgs e) { - ppBtnDefCbTxt1.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppTxbxChangeBarUserMsgOne.Text != null); + if (!_Initializing) + ppBtnDefCbTxt1.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppTxbxChangeBarUserMsgOne.Text != null); } /// @@ -572,7 +679,8 @@ namespace VEPROMS /// EventArgs private void ppTxbxChangeBarUserMsgTwo_TextChanged(object sender, EventArgs e) { - ppBtnDefCbTxt2.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppTxbxChgBarUserMsgTwo.Text != null); + if (!_Initializing) + ppBtnDefCbTxt2.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppTxbxChgBarUserMsgTwo.Text != null); } #endregion @@ -752,12 +860,27 @@ namespace VEPROMS /// EventArgs private void ppCmbxStpEditorCols_SelectedValueChanged(object sender, EventArgs e) { - FolderConfig.FormatColumns fcl = (FolderConfig.FormatColumns)Enum.Parse(typeof(FolderConfig.FormatColumns), _DefaultFormatColumns); - ProcessCmbxSelectionEnumChanged(ppCmbxStpEditorCols, fcl, ppBtnDefEdCols, ppLblStpEditorColsDefault); + if (!_Initializing) + { + FolderConfig.FormatColumns fcl = (FolderConfig.FormatColumns)Enum.Parse(typeof(FolderConfig.FormatColumns), _DefaultFormatColumns); + ProcessCmbxSelectionEnumChanged(ppCmbxStpEditorCols, fcl, ppBtnDefEdCols, ppLblStpEditorColsDefault); + } } + /// + /// Reset to the parent setting. + /// Find the parent setting and assign it to _FolderConfig.Format_Columns. + /// This will force the database to be updated. + /// + /// + /// private void ppBtnDefEdCols_Click(object sender, EventArgs e) { + // Get the parent setting + FolderConfig.FormatColumns fcl = (FolderConfig.FormatColumns)Enum.Parse(typeof(FolderConfig.FormatColumns), _DefaultFormatColumns); + // Compare parent setting with current setting + if (fcl != _FolderConfig.Format_Columns) + _FolderConfig.Format_Columns = fcl; // this will force a database update (write) ppCmbxStpEditorCols.SelectedIndex = -1; //reset to the default Step Editor Columns setting } diff --git a/PROMS/VEPROMS User Interface/frmProcedureProperties.Designer.cs b/PROMS/VEPROMS User Interface/frmProcedureProperties.Designer.cs index 2f38fbbd..d157a4d4 100644 --- a/PROMS/VEPROMS User Interface/frmProcedureProperties.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmProcedureProperties.Designer.cs @@ -152,6 +152,8 @@ namespace VEPROMS this.btnFmtStngs = new DevComponents.DotNetBar.ButtonX(); this.btnGeneral = new DevComponents.DotNetBar.ButtonX(); this.tcProcProp = new DevComponents.DotNetBar.TabControl(); + this.tabControlPanel1 = new DevComponents.DotNetBar.TabControlPanel(); + this.tiGeneral = new DevComponents.DotNetBar.TabItem(this.components); this.tabControlPanel4 = new DevComponents.DotNetBar.TabControlPanel(); this.tiViewStngs = new DevComponents.DotNetBar.TabItem(this.components); this.tabControlPanel3 = new DevComponents.DotNetBar.TabControlPanel(); @@ -159,8 +161,6 @@ namespace VEPROMS this.tiOutputStngs = new DevComponents.DotNetBar.TabItem(this.components); this.tabControlPanel2 = new DevComponents.DotNetBar.TabControlPanel(); this.tiFmtStngs = new DevComponents.DotNetBar.TabItem(this.components); - this.tabControlPanel1 = new DevComponents.DotNetBar.TabControlPanel(); - this.tiGeneral = new DevComponents.DotNetBar.TabItem(this.components); ((System.ComponentModel.ISupportInitialize)(this.procedureConfigBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.formatInfoListBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ppNumUpDwnOvrdPrnPenWidth)).BeginInit(); @@ -176,11 +176,11 @@ namespace VEPROMS this.panProcBtns.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tcProcProp)).BeginInit(); this.tcProcProp.SuspendLayout(); + this.tabControlPanel1.SuspendLayout(); this.tabControlPanel4.SuspendLayout(); this.tabControlPanel3.SuspendLayout(); this.ppGrpbxPrnAdj.SuspendLayout(); this.tabControlPanel2.SuspendLayout(); - this.tabControlPanel1.SuspendLayout(); this.SuspendLayout(); // // ppBtnCancel @@ -210,20 +210,22 @@ namespace VEPROMS this.ppDtTmLastApprv.CustomFormat = "MM\'/\'dd\'/\'yyyy hh\':\'mm:ss tt"; this.ppDtTmLastApprv.Enabled = false; this.ppDtTmLastApprv.Format = System.Windows.Forms.DateTimePickerFormat.Custom; - this.ppDtTmLastApprv.Location = new System.Drawing.Point(454, 125); + this.ppDtTmLastApprv.Location = new System.Drawing.Point(458, 141); this.ppDtTmLastApprv.Name = "ppDtTmLastApprv"; this.ppDtTmLastApprv.Size = new System.Drawing.Size(172, 22); this.ppDtTmLastApprv.TabIndex = 56; + this.ppDtTmLastApprv.Visible = false; // // ppDtTmLastMod // this.ppDtTmLastMod.CustomFormat = "MM\'/\'dd\'/\'yyyy hh\':\'mm:ss tt"; this.ppDtTmLastMod.Enabled = false; this.ppDtTmLastMod.Format = System.Windows.Forms.DateTimePickerFormat.Custom; - this.ppDtTmLastMod.Location = new System.Drawing.Point(128, 125); + this.ppDtTmLastMod.Location = new System.Drawing.Point(132, 141); this.ppDtTmLastMod.Name = "ppDtTmLastMod"; this.ppDtTmLastMod.Size = new System.Drawing.Size(172, 22); this.ppDtTmLastMod.TabIndex = 55; + this.ppDtTmLastMod.Visible = false; // // ppBtnDefEdCols // @@ -273,45 +275,49 @@ namespace VEPROMS // ppTxtBxUserID // this.ppTxtBxUserID.Enabled = false; - this.ppTxtBxUserID.Location = new System.Drawing.Point(128, 164); + this.ppTxtBxUserID.Location = new System.Drawing.Point(132, 180); this.ppTxtBxUserID.Name = "ppTxtBxUserID"; this.ppTxtBxUserID.Size = new System.Drawing.Size(154, 22); this.ppTxtBxUserID.TabIndex = 12; + this.ppTxtBxUserID.Visible = false; // // label21 // this.label21.AutoSize = true; this.label21.BackColor = System.Drawing.Color.Transparent; - this.label21.Location = new System.Drawing.Point(67, 167); + this.label21.Location = new System.Drawing.Point(71, 183); this.label21.Name = "label21"; this.label21.Size = new System.Drawing.Size(55, 17); this.label21.TabIndex = 11; this.label21.Text = "User ID"; + this.label21.Visible = false; // // label4 // this.label4.AutoSize = true; this.label4.BackColor = System.Drawing.Color.Transparent; - this.label4.Location = new System.Drawing.Point(348, 128); + this.label4.Location = new System.Drawing.Point(352, 144); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(100, 17); this.label4.TabIndex = 6; this.label4.Text = "Last Approved"; + this.label4.Visible = false; // // label3 // this.label3.AutoSize = true; this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Location = new System.Drawing.Point(30, 128); + this.label3.Location = new System.Drawing.Point(34, 144); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(92, 17); this.label3.TabIndex = 4; this.label3.Text = "Last Modified"; + this.label3.Visible = false; // // ppRTxtTitle // this.ppRTxtTitle.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.procedureConfigBindingSource, "Title", true)); - this.ppRTxtTitle.Location = new System.Drawing.Point(85, 47); + this.ppRTxtTitle.Location = new System.Drawing.Point(89, 63); this.ppRTxtTitle.Name = "ppRTxtTitle"; this.ppRTxtTitle.Size = new System.Drawing.Size(541, 60); this.ppRTxtTitle.TabIndex = 3; @@ -324,7 +330,7 @@ namespace VEPROMS // ppRTxtNumber // this.ppRTxtNumber.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.procedureConfigBindingSource, "Number", true)); - this.ppRTxtNumber.Location = new System.Drawing.Point(85, 8); + this.ppRTxtNumber.Location = new System.Drawing.Point(89, 24); this.ppRTxtNumber.Multiline = false; this.ppRTxtNumber.Name = "ppRTxtNumber"; this.ppRTxtNumber.Size = new System.Drawing.Size(159, 22); @@ -335,17 +341,18 @@ namespace VEPROMS // this.label2.AutoSize = true; this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.Location = new System.Drawing.Point(44, 49); + this.label2.Location = new System.Drawing.Point(48, 65); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(35, 17); this.label2.TabIndex = 1; this.label2.Text = "Title"; + this.label2.Visible = false; // // label1 // this.label1.AutoSize = true; this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Location = new System.Drawing.Point(21, 11); + this.label1.Location = new System.Drawing.Point(25, 27); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(58, 17); this.label1.TabIndex = 0; @@ -1000,7 +1007,7 @@ namespace VEPROMS this.versionsPropChangeBarPositionCombo.FormattingEnabled = true; this.versionsPropChangeBarPositionCombo.Location = new System.Drawing.Point(86, 39); this.versionsPropChangeBarPositionCombo.Name = "versionsPropChangeBarPositionCombo"; - this.versionsPropChangeBarPositionCombo.Size = new System.Drawing.Size(248, 25); + this.versionsPropChangeBarPositionCombo.Size = new System.Drawing.Size(248, 24); this.versionsPropChangeBarPositionCombo.TabIndex = 10; // // label12 @@ -1017,7 +1024,7 @@ namespace VEPROMS this.versionsPropChangeBarTextTypeCombo.FormattingEnabled = true; this.versionsPropChangeBarTextTypeCombo.Location = new System.Drawing.Point(86, 82); this.versionsPropChangeBarTextTypeCombo.Name = "versionsPropChangeBarTextTypeCombo"; - this.versionsPropChangeBarTextTypeCombo.Size = new System.Drawing.Size(248, 25); + this.versionsPropChangeBarTextTypeCombo.Size = new System.Drawing.Size(248, 24); this.versionsPropChangeBarTextTypeCombo.TabIndex = 7; // // versionsPropPaginationCombo @@ -1025,7 +1032,7 @@ namespace VEPROMS this.versionsPropPaginationCombo.FormattingEnabled = true; this.versionsPropPaginationCombo.Location = new System.Drawing.Point(120, 81); this.versionsPropPaginationCombo.Name = "versionsPropPaginationCombo"; - this.versionsPropPaginationCombo.Size = new System.Drawing.Size(165, 25); + this.versionsPropPaginationCombo.Size = new System.Drawing.Size(165, 24); this.versionsPropPaginationCombo.TabIndex = 24; // // label16 @@ -1042,7 +1049,7 @@ namespace VEPROMS this.versionsPropWatermarkCombo.FormattingEnabled = true; this.versionsPropWatermarkCombo.Location = new System.Drawing.Point(427, 81); this.versionsPropWatermarkCombo.Name = "versionsPropWatermarkCombo"; - this.versionsPropWatermarkCombo.Size = new System.Drawing.Size(178, 25); + this.versionsPropWatermarkCombo.Size = new System.Drawing.Size(178, 24); this.versionsPropWatermarkCombo.TabIndex = 22; // // label17 @@ -1059,7 +1066,7 @@ namespace VEPROMS this.versionsPropDefaultFormatCombo.FormattingEnabled = true; this.versionsPropDefaultFormatCombo.Location = new System.Drawing.Point(26, 34); this.versionsPropDefaultFormatCombo.Name = "versionsPropDefaultFormatCombo"; - this.versionsPropDefaultFormatCombo.Size = new System.Drawing.Size(526, 25); + this.versionsPropDefaultFormatCombo.Size = new System.Drawing.Size(526, 24); this.versionsPropDefaultFormatCombo.TabIndex = 20; // // label10 @@ -1081,7 +1088,7 @@ namespace VEPROMS "Override Format Defined Change Bars"}); this.versionsPropChangeBarTypeCombo.Location = new System.Drawing.Point(119, 126); this.versionsPropChangeBarTypeCombo.Name = "versionsPropChangeBarTypeCombo"; - this.versionsPropChangeBarTypeCombo.Size = new System.Drawing.Size(293, 25); + this.versionsPropChangeBarTypeCombo.Size = new System.Drawing.Size(293, 24); this.versionsPropChangeBarTypeCombo.TabIndex = 4; // // label11 @@ -1526,6 +1533,7 @@ namespace VEPROMS this.btnVwStngs.Size = new System.Drawing.Size(165, 23); this.btnVwStngs.TabIndex = 3; this.btnVwStngs.Text = "View Settings"; + this.btnVwStngs.Visible = false; this.btnVwStngs.Click += new System.EventHandler(this.btnVwStngs_Click); // // btnOutputStngs @@ -1571,9 +1579,9 @@ namespace VEPROMS this.tcProcProp.BackColor = System.Drawing.Color.Transparent; this.tcProcProp.CanReorderTabs = true; this.tcProcProp.Controls.Add(this.tabControlPanel1); + this.tcProcProp.Controls.Add(this.tabControlPanel2); this.tcProcProp.Controls.Add(this.tabControlPanel4); this.tcProcProp.Controls.Add(this.tabControlPanel3); - this.tcProcProp.Controls.Add(this.tabControlPanel2); this.tcProcProp.Location = new System.Drawing.Point(180, 7); this.tcProcProp.Name = "tcProcProp"; this.tcProcProp.SelectedTabFont = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold); @@ -1585,10 +1593,47 @@ namespace VEPROMS this.tcProcProp.Tabs.Add(this.tiGeneral); this.tcProcProp.Tabs.Add(this.tiFmtStngs); this.tcProcProp.Tabs.Add(this.tiOutputStngs); - this.tcProcProp.Tabs.Add(this.tiViewStngs); this.tcProcProp.TabsVisible = false; this.tcProcProp.Text = "tabControl2"; // + // tabControlPanel1 + // + this.tabControlPanel1.Controls.Add(this.ppDtTmLastApprv); + this.tabControlPanel1.Controls.Add(this.label1); + this.tabControlPanel1.Controls.Add(this.ppDtTmLastMod); + this.tabControlPanel1.Controls.Add(this.label2); + this.tabControlPanel1.Controls.Add(this.ppBtnDefEdCols); + this.tabControlPanel1.Controls.Add(this.ppRTxtNumber); + this.tabControlPanel1.Controls.Add(this.ppLblStpEditorColsDefault); + this.tabControlPanel1.Controls.Add(this.ppRTxtTitle); + this.tabControlPanel1.Controls.Add(this.label43); + this.tabControlPanel1.Controls.Add(this.label3); + this.tabControlPanel1.Controls.Add(this.ppCmbxStpEditorCols); + this.tabControlPanel1.Controls.Add(this.label4); + this.tabControlPanel1.Controls.Add(this.ppTxtBxUserID); + this.tabControlPanel1.Controls.Add(this.label21); + this.tabControlPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControlPanel1.Location = new System.Drawing.Point(0, 24); + this.tabControlPanel1.Name = "tabControlPanel1"; + this.tabControlPanel1.Padding = new System.Windows.Forms.Padding(1); + this.tabControlPanel1.Size = new System.Drawing.Size(672, 332); + this.tabControlPanel1.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247))))); + this.tabControlPanel1.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(195)))), ((int)(((byte)(195)))), ((int)(((byte)(195))))); + this.tabControlPanel1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; + this.tabControlPanel1.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(70)))), ((int)(((byte)(70))))); + this.tabControlPanel1.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) + | DevComponents.DotNetBar.eBorderSide.Bottom))); + this.tabControlPanel1.Style.GradientAngle = 90; + this.tabControlPanel1.TabIndex = 1; + this.tabControlPanel1.TabItem = this.tiGeneral; + this.tabControlPanel1.Enter += new System.EventHandler(this.tabpage_Enter); + // + // tiGeneral + // + this.tiGeneral.AttachedControl = this.tabControlPanel1; + this.tiGeneral.Name = "tiGeneral"; + this.tiGeneral.Text = "General"; + // // tabControlPanel4 // this.tabControlPanel4.Controls.Add(this.ppCkLstApplicabilityDesinations); @@ -1601,10 +1646,10 @@ namespace VEPROMS this.tabControlPanel4.Name = "tabControlPanel4"; this.tabControlPanel4.Padding = new System.Windows.Forms.Padding(1); this.tabControlPanel4.Size = new System.Drawing.Size(672, 332); - this.tabControlPanel4.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); - this.tabControlPanel4.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); + this.tabControlPanel4.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247))))); + this.tabControlPanel4.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(195)))), ((int)(((byte)(195)))), ((int)(((byte)(195))))); this.tabControlPanel4.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tabControlPanel4.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); + this.tabControlPanel4.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(70)))), ((int)(((byte)(70))))); this.tabControlPanel4.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) | DevComponents.DotNetBar.eBorderSide.Bottom))); this.tabControlPanel4.Style.GradientAngle = 90; @@ -1636,10 +1681,10 @@ namespace VEPROMS this.tabControlPanel3.Name = "tabControlPanel3"; this.tabControlPanel3.Padding = new System.Windows.Forms.Padding(1); this.tabControlPanel3.Size = new System.Drawing.Size(672, 332); - this.tabControlPanel3.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); - this.tabControlPanel3.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); + this.tabControlPanel3.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247))))); + this.tabControlPanel3.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(195)))), ((int)(((byte)(195)))), ((int)(((byte)(195))))); this.tabControlPanel3.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tabControlPanel3.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); + this.tabControlPanel3.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(70)))), ((int)(((byte)(70))))); this.tabControlPanel3.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) | DevComponents.DotNetBar.eBorderSide.Bottom))); this.tabControlPanel3.Style.GradientAngle = 90; @@ -1708,10 +1753,10 @@ namespace VEPROMS this.tabControlPanel2.Name = "tabControlPanel2"; this.tabControlPanel2.Padding = new System.Windows.Forms.Padding(1); this.tabControlPanel2.Size = new System.Drawing.Size(672, 332); - this.tabControlPanel2.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); - this.tabControlPanel2.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); + this.tabControlPanel2.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247))))); + this.tabControlPanel2.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(195)))), ((int)(((byte)(195)))), ((int)(((byte)(195))))); this.tabControlPanel2.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tabControlPanel2.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); + this.tabControlPanel2.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(70)))), ((int)(((byte)(70))))); this.tabControlPanel2.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) | DevComponents.DotNetBar.eBorderSide.Bottom))); this.tabControlPanel2.Style.GradientAngle = 90; @@ -1725,44 +1770,6 @@ namespace VEPROMS this.tiFmtStngs.Name = "tiFmtStngs"; this.tiFmtStngs.Text = "Format Settings"; // - // tabControlPanel1 - // - this.tabControlPanel1.Controls.Add(this.ppDtTmLastApprv); - this.tabControlPanel1.Controls.Add(this.label1); - this.tabControlPanel1.Controls.Add(this.ppDtTmLastMod); - this.tabControlPanel1.Controls.Add(this.label2); - this.tabControlPanel1.Controls.Add(this.ppBtnDefEdCols); - this.tabControlPanel1.Controls.Add(this.ppRTxtNumber); - this.tabControlPanel1.Controls.Add(this.ppLblStpEditorColsDefault); - this.tabControlPanel1.Controls.Add(this.ppRTxtTitle); - this.tabControlPanel1.Controls.Add(this.label43); - this.tabControlPanel1.Controls.Add(this.label3); - this.tabControlPanel1.Controls.Add(this.ppCmbxStpEditorCols); - this.tabControlPanel1.Controls.Add(this.label4); - this.tabControlPanel1.Controls.Add(this.ppTxtBxUserID); - this.tabControlPanel1.Controls.Add(this.label21); - this.tabControlPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControlPanel1.Location = new System.Drawing.Point(0, 24); - this.tabControlPanel1.Name = "tabControlPanel1"; - this.tabControlPanel1.Padding = new System.Windows.Forms.Padding(1); - this.tabControlPanel1.Size = new System.Drawing.Size(672, 332); - this.tabControlPanel1.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); - this.tabControlPanel1.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); - this.tabControlPanel1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tabControlPanel1.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); - this.tabControlPanel1.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tabControlPanel1.Style.GradientAngle = 90; - this.tabControlPanel1.TabIndex = 1; - this.tabControlPanel1.TabItem = this.tiGeneral; - this.tabControlPanel1.Enter += new System.EventHandler(this.tabpage_Enter); - // - // tiGeneral - // - this.tiGeneral.AttachedControl = this.tabControlPanel1; - this.tiGeneral.Name = "tiGeneral"; - this.tiGeneral.Text = "General"; - // // frmProcedureProperties // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); @@ -1803,6 +1810,8 @@ namespace VEPROMS this.panProcBtns.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.tcProcProp)).EndInit(); this.tcProcProp.ResumeLayout(false); + this.tabControlPanel1.ResumeLayout(false); + this.tabControlPanel1.PerformLayout(); this.tabControlPanel4.ResumeLayout(false); this.tabControlPanel4.PerformLayout(); this.tabControlPanel3.ResumeLayout(false); @@ -1811,8 +1820,6 @@ namespace VEPROMS this.ppGrpbxPrnAdj.PerformLayout(); this.tabControlPanel2.ResumeLayout(false); this.tabControlPanel2.PerformLayout(); - this.tabControlPanel1.ResumeLayout(false); - this.tabControlPanel1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); diff --git a/PROMS/VEPROMS User Interface/frmProcedureProperties.cs b/PROMS/VEPROMS User Interface/frmProcedureProperties.cs index 74aa2e80..1be099e7 100644 --- a/PROMS/VEPROMS User Interface/frmProcedureProperties.cs +++ b/PROMS/VEPROMS User Interface/frmProcedureProperties.cs @@ -135,26 +135,32 @@ namespace VEPROMS 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; } @@ -220,14 +226,15 @@ namespace VEPROMS /// Enable or disable the user specified change bar options base on the type /// of change bar selected. /// - private void setEnabledUserSpecifiedChgBarCombos() + private void setEnabledUserSpecifiedChgBarCombos(ProcedureConfig.PrintChangeBar pcb) { ppGpbxUserSpecCB.Enabled = ppCmbxChgBarPos.Enabled = ppCmbxChgBarTxtType.Enabled = ppBtnDefaultCbPos.Enabled = ppBtnDefCbTxtTyp.Enabled = (ppCmbxChangeBarType.SelectedValue != null && - ppCmbxChangeBarType.SelectedValue.Equals(ProcedureConfig.PrintChangeBar.WithUserSpecified)); + ppCmbxChangeBarType.SelectedValue.Equals(ProcedureConfig.PrintChangeBar.WithUserSpecified)) || + (ppCmbxChangeBarType.SelectedValue == null && pcb.Equals(DocVersionConfig.PrintChangeBar.WithUserSpecified)); } /// @@ -237,12 +244,28 @@ namespace VEPROMS /// EventArgs private void ppCmbxChangeBarType_SelectedValueChanged(object sender, EventArgs e) { - ProcessCmbxSelectedValueChange(ppCmbxChangeBarType, _DefaultChgBarType, ppBtnDefaultChgBar, ppLblChangeBarTypeDefault); - setEnabledUserSpecifiedChgBarCombos(); + if (!_Initializing) + { + ProcedureConfig.PrintChangeBar pcb = (ProcedureConfig.PrintChangeBar)Enum.Parse(typeof(ProcedureConfig.PrintChangeBar), _DefaultChgBarType); + ProcessCmbxSelectionEnumChanged(ppCmbxChangeBarType, pcb, ppBtnDefaultChgBar, ppLblChangeBarTypeDefault); + setEnabledUserSpecifiedChgBarCombos(pcb); + } } + /// + /// 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 + ProcedureConfig.PrintChangeBar pcb = (ProcedureConfig.PrintChangeBar)Enum.Parse(typeof(ProcedureConfig.PrintChangeBar), _DefaultChgBarType); + // Compare parent setting with current setting + 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 } @@ -253,11 +276,27 @@ namespace VEPROMS /// EventArgs private void ppCmbxChgBarPos_SelectedValueChanged(object sender, EventArgs e) { - ProcessCmbxSelectedValueChange(ppCmbxChgBarPos, _DefaultChgBarLoc, ppBtnDefaultCbPos, ppLblChgBarPosDefault); + if (!_Initializing) + { + ProcedureConfig.PrintChangeBarLoc cbl = (ProcedureConfig.PrintChangeBarLoc)Enum.Parse(typeof(ProcedureConfig.PrintChangeBarLoc), _DefaultChgBarLoc); + ProcessCmbxSelectionEnumChanged(ppCmbxChgBarPos, cbl, ppBtnDefaultCbPos, ppLblChgBarPosDefault); + } } + /// + /// 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 + ProcedureConfig.PrintChangeBarLoc cbl = (ProcedureConfig.PrintChangeBarLoc)Enum.Parse(typeof(ProcedureConfig.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 } @@ -268,12 +307,28 @@ namespace VEPROMS /// EventArgs private void ppCmbxChgBarTxtType_SelectedValueChanged(object sender, EventArgs e) { - ProcessCmbxSelectedValueChange(ppCmbxChgBarTxtType, _DefaultChgBarText, ppBtnDefCbTxtTyp, ppLblChgBarTxtTypeDefault); - setEnabledUserSpecifiedChgBarText(); + if (!_Initializing) + { + ProcedureConfig.PrintChangeBarText cbt = (ProcedureConfig.PrintChangeBarText)Enum.Parse(typeof(ProcedureConfig.PrintChangeBarText), _DefaultChgBarText); + ProcessCmbxSelectionEnumChanged(ppCmbxChgBarTxtType, cbt, ppBtnDefCbTxtTyp, ppLblChgBarTxtTypeDefault); + setEnabledUserSpecifiedChgBarText(); + } } + /// + /// 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 + ProcedureConfig.PrintChangeBarText cbt = (ProcedureConfig.PrintChangeBarText)Enum.Parse(typeof(ProcedureConfig.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 } @@ -312,11 +367,27 @@ namespace VEPROMS /// EventArgs private void ppCmbxPagination_SelectedValueChanged(object sender, EventArgs e) { - ProcessCmbxSelectedValueChange(ppCmbxPagination, _DefaultPagination, ppBtnDefPagination, ppLblPaginationDefault); + if (!_Initializing) + { + ProcedureConfig.PrintPagination pgtn = (ProcedureConfig.PrintPagination)Enum.Parse(typeof(ProcedureConfig.PrintPagination), _DefaultPagination); + ProcessCmbxSelectionEnumChanged(ppCmbxPagination, pgtn, ppBtnDefPagination, ppLblPaginationDefault); + } } + /// + /// 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 + ProcedureConfig.PrintPagination pgtn = (ProcedureConfig.PrintPagination)Enum.Parse(typeof(ProcedureConfig.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 } @@ -327,11 +398,27 @@ namespace VEPROMS /// EventArgs private void ppCmbxWatermark_SelectedValueChanged(object sender, EventArgs e) { - ProcessCmbxSelectedValueChange(ppCmbxWatermark, _DefaultWatermark, ppBtnDefWatermark, ppLblWatermarkDefault); + if (!_Initializing) + { + ProcedureConfig.PrintWatermark wtr = (ProcedureConfig.PrintWatermark)Enum.Parse(typeof(ProcedureConfig.PrintWatermark), _DefaultWatermark); + ProcessCmbxSelectionEnumChanged(ppCmbxWatermark, wtr, ppBtnDefWatermark, ppLblWatermarkDefault); + } } + /// + /// 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 + ProcedureConfig.PrintWatermark wtr = (ProcedureConfig.PrintWatermark)Enum.Parse(typeof(ProcedureConfig.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 } @@ -425,6 +512,24 @@ namespace VEPROMS } } + /// + /// 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)) + { + button.Focus(); + button.PerformClick(); + } + button.Visible = (cmbx.SelectedValue != null); + deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible; + } /// /// Process a change in the combo box selection /// diff --git a/PROMS/VEPROMS User Interface/frmProcedureProperties.resx b/PROMS/VEPROMS User Interface/frmProcedureProperties.resx index ef9b9bc1..6d772ea8 100644 --- a/PROMS/VEPROMS User Interface/frmProcedureProperties.resx +++ b/PROMS/VEPROMS User Interface/frmProcedureProperties.resx @@ -126,6 +126,9 @@ 520, 17 + + 752, 17 + Allows you to specify the default format to use for this procedure.