From 48fd87962275e8f8ecccebdd6bccae9d45eeb0d0 Mon Sep 17 00:00:00 2001 From: Kathy Date: Tue, 16 Nov 2010 17:22:12 +0000 Subject: [PATCH] --- .../frmSectionProperties.Designer.cs | 78 ++++++++++--------- .../frmSectionProperties.cs | 48 ++++++++---- 2 files changed, 76 insertions(+), 50 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.Designer.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.Designer.cs index 32d1784d..6337c66f 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.Designer.cs @@ -92,14 +92,14 @@ namespace VEPROMS this.rbStepSect = new DevComponents.DotNetBar.Controls.CheckBoxX(); this.ppGpbxSignoffCheckoff = new DevComponents.DotNetBar.Controls.GroupPanel(); this.tiFormat = new DevComponents.DotNetBar.TabItem(this.components); + this.tcpLibDoc = new DevComponents.DotNetBar.TabControlPanel(); + this.tiLibDoc = new DevComponents.DotNetBar.TabItem(this.components); this.tcpAutomation = new DevComponents.DotNetBar.TabControlPanel(); this.ppCbLinkWithEnhancedDoc = new System.Windows.Forms.CheckBox(); this.ppCbPlaceKeeper = new System.Windows.Forms.CheckBox(); this.ppCbPrnSecNumTitle = new System.Windows.Forms.CheckBox(); this.ppCbIncTOC = new System.Windows.Forms.CheckBox(); this.tiAutomation = new DevComponents.DotNetBar.TabItem(this.components); - this.tcpLibDoc = new DevComponents.DotNetBar.TabControlPanel(); - this.tiLibDoc = new DevComponents.DotNetBar.TabItem(this.components); this.tabControlPanel4 = new DevComponents.DotNetBar.TabControlPanel(); this.tiViewStnns = new DevComponents.DotNetBar.TabItem(this.components); ((System.ComponentModel.ISupportInitialize)(this.sectionConfigBindingSource)).BeginInit(); @@ -109,8 +109,8 @@ namespace VEPROMS this.tcpGeneral.SuspendLayout(); this.tcpFormat.SuspendLayout(); this.ppGpbxSignoffCheckoff.SuspendLayout(); - this.tcpAutomation.SuspendLayout(); this.tcpLibDoc.SuspendLayout(); + this.tcpAutomation.SuspendLayout(); this.tabControlPanel4.SuspendLayout(); this.SuspendLayout(); // @@ -223,6 +223,7 @@ namespace VEPROMS // ppBtnDefaultFmt // this.ppBtnDefaultFmt.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.ppBtnDefaultFmt.CallBasePaintBackground = true; this.ppBtnDefaultFmt.Location = new System.Drawing.Point(587, 22); this.ppBtnDefaultFmt.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ppBtnDefaultFmt.Name = "ppBtnDefaultFmt"; @@ -360,6 +361,7 @@ namespace VEPROMS // ppBtnCvrtToLibDoc // this.ppBtnCvrtToLibDoc.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.ppBtnCvrtToLibDoc.CallBasePaintBackground = true; this.ppBtnCvrtToLibDoc.Location = new System.Drawing.Point(21, 237); this.ppBtnCvrtToLibDoc.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ppBtnCvrtToLibDoc.Name = "ppBtnCvrtToLibDoc"; @@ -380,7 +382,7 @@ namespace VEPROMS this.ppCmbxLibDoc.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ppCmbxLibDoc.Name = "ppCmbxLibDoc"; this.ppCmbxLibDoc.Size = new System.Drawing.Size(569, 23); - this.superTooltip1.SetSuperTooltip(this.ppCmbxLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Select Library Document", "", "This allows you to select a library document to reference for this section.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(200, 76))); + this.superTooltip1.SetSuperTooltip(this.ppCmbxLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Link to Selected Library Document button", "", "This allows you to select a library document to reference for this section.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(200, 76))); this.ppCmbxLibDoc.TabIndex = 40; this.ppCmbxLibDoc.WatermarkText = "no library document selected"; this.ppCmbxLibDoc.SelectedIndexChanged += new System.EventHandler(this.ppCmbxLibDoc_SelectedIndexChanged); @@ -620,6 +622,7 @@ namespace VEPROMS // ppBtnDefaultPaginationStyle // this.ppBtnDefaultPaginationStyle.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.ppBtnDefaultPaginationStyle.CallBasePaintBackground = true; this.ppBtnDefaultPaginationStyle.Location = new System.Drawing.Point(281, 166); this.ppBtnDefaultPaginationStyle.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ppBtnDefaultPaginationStyle.Name = "ppBtnDefaultPaginationStyle"; @@ -635,6 +638,7 @@ namespace VEPROMS // ppBtnDefaultNumColumns // this.ppBtnDefaultNumColumns.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.ppBtnDefaultNumColumns.CallBasePaintBackground = true; this.ppBtnDefaultNumColumns.Location = new System.Drawing.Point(230, 227); this.ppBtnDefaultNumColumns.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ppBtnDefaultNumColumns.Name = "ppBtnDefaultNumColumns"; @@ -691,6 +695,7 @@ namespace VEPROMS // btnAutomation // this.btnAutomation.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnAutomation.CallBasePaintBackground = true; this.btnAutomation.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnAutomation.Dock = System.Windows.Forms.DockStyle.Top; this.btnAutomation.Location = new System.Drawing.Point(0, 69); @@ -704,6 +709,7 @@ namespace VEPROMS // btnLibDocs // this.btnLibDocs.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnLibDocs.CallBasePaintBackground = true; this.btnLibDocs.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnLibDocs.Dock = System.Windows.Forms.DockStyle.Top; this.btnLibDocs.Location = new System.Drawing.Point(0, 46); @@ -717,6 +723,7 @@ namespace VEPROMS // btnFormat // this.btnFormat.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnFormat.CallBasePaintBackground = true; this.btnFormat.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnFormat.Dock = System.Windows.Forms.DockStyle.Top; this.btnFormat.Location = new System.Drawing.Point(0, 23); @@ -730,6 +737,7 @@ namespace VEPROMS // btnGeneral // this.btnGeneral.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnGeneral.CallBasePaintBackground = true; this.btnGeneral.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnGeneral.Dock = System.Windows.Forms.DockStyle.Top; this.btnGeneral.Location = new System.Drawing.Point(0, 0); @@ -746,9 +754,9 @@ namespace VEPROMS | System.Windows.Forms.AnchorStyles.Right))); this.tcSectionProp.BackColor = System.Drawing.Color.Transparent; this.tcSectionProp.CanReorderTabs = true; + this.tcSectionProp.Controls.Add(this.tcpLibDoc); this.tcSectionProp.Controls.Add(this.tcpGeneral); this.tcSectionProp.Controls.Add(this.tcpFormat); - this.tcSectionProp.Controls.Add(this.tcpLibDoc); this.tcSectionProp.Controls.Add(this.tcpAutomation); this.tcSectionProp.Controls.Add(this.tabControlPanel4); this.tcSectionProp.Location = new System.Drawing.Point(216, 10); @@ -989,6 +997,33 @@ namespace VEPROMS this.tiFormat.Name = "tiFormat"; this.tiFormat.Text = "Format"; // + // tcpLibDoc + // + this.tcpLibDoc.Controls.Add(this.ppBtnCvrtToLibDoc); + this.tcpLibDoc.Controls.Add(this.lblLibraryDocument); + this.tcpLibDoc.Controls.Add(this.ppCmbxLibDoc); + this.tcpLibDoc.Dock = System.Windows.Forms.DockStyle.Fill; + this.tcpLibDoc.Location = new System.Drawing.Point(0, 24); + this.tcpLibDoc.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.tcpLibDoc.Name = "tcpLibDoc"; + this.tcpLibDoc.Padding = new System.Windows.Forms.Padding(1); + this.tcpLibDoc.Size = new System.Drawing.Size(648, 301); + this.tcpLibDoc.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); + this.tcpLibDoc.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); + this.tcpLibDoc.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; + this.tcpLibDoc.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); + this.tcpLibDoc.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) + | DevComponents.DotNetBar.eBorderSide.Bottom))); + this.tcpLibDoc.Style.GradientAngle = 90; + this.tcpLibDoc.TabIndex = 3; + this.tcpLibDoc.TabItem = this.tiLibDoc; + // + // tiLibDoc + // + this.tiLibDoc.AttachedControl = this.tcpLibDoc; + this.tiLibDoc.Name = "tiLibDoc"; + this.tiLibDoc.Text = "Library Document"; + // // tcpAutomation // this.tcpAutomation.Controls.Add(this.ppCbLinkWithEnhancedDoc); @@ -1068,33 +1103,6 @@ namespace VEPROMS this.tiAutomation.Name = "tiAutomation"; this.tiAutomation.Text = "Automation"; // - // tcpLibDoc - // - this.tcpLibDoc.Controls.Add(this.ppBtnCvrtToLibDoc); - this.tcpLibDoc.Controls.Add(this.lblLibraryDocument); - this.tcpLibDoc.Controls.Add(this.ppCmbxLibDoc); - this.tcpLibDoc.Dock = System.Windows.Forms.DockStyle.Fill; - this.tcpLibDoc.Location = new System.Drawing.Point(0, 24); - this.tcpLibDoc.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.tcpLibDoc.Name = "tcpLibDoc"; - this.tcpLibDoc.Padding = new System.Windows.Forms.Padding(1); - this.tcpLibDoc.Size = new System.Drawing.Size(648, 301); - this.tcpLibDoc.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); - this.tcpLibDoc.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); - this.tcpLibDoc.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tcpLibDoc.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); - this.tcpLibDoc.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tcpLibDoc.Style.GradientAngle = 90; - this.tcpLibDoc.TabIndex = 3; - this.tcpLibDoc.TabItem = this.tiLibDoc; - // - // tiLibDoc - // - this.tiLibDoc.AttachedControl = this.tcpLibDoc; - this.tiLibDoc.Name = "tiLibDoc"; - this.tiLibDoc.Text = "Library Document"; - // // tabControlPanel4 // this.tabControlPanel4.Controls.Add(this.ppCkLstApplicabilityDesinations); @@ -1129,7 +1137,7 @@ namespace VEPROMS this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CaptionFont = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ClientSize = new System.Drawing.Size(869, 387); + this.ClientSize = new System.Drawing.Size(865, 383); this.ControlBox = false; this.Controls.Add(this.tcSectionProp); this.Controls.Add(this.panSectBtns); @@ -1159,10 +1167,10 @@ namespace VEPROMS this.tcpFormat.PerformLayout(); this.ppGpbxSignoffCheckoff.ResumeLayout(false); this.ppGpbxSignoffCheckoff.PerformLayout(); - this.tcpAutomation.ResumeLayout(false); - this.tcpAutomation.PerformLayout(); this.tcpLibDoc.ResumeLayout(false); this.tcpLibDoc.PerformLayout(); + this.tcpAutomation.ResumeLayout(false); + this.tcpAutomation.PerformLayout(); this.tabControlPanel4.ResumeLayout(false); this.tabControlPanel4.PerformLayout(); this.ResumeLayout(false); diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.cs index 2d4b6fc7..b57f1abf 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.cs @@ -60,7 +60,9 @@ namespace VEPROMS rbStepSect.Enabled = rbWordSect.Enabled = !(ii.HasWordContent || ii.HasStepContent); // if this has already been set to be a step section, i.e. HasStepContent, disable the libdoc tab - if (ii.HasStepContent) tcpLibDoc.Enabled = false; + // also disable if there is no word content yet - the user may want to change from step type to + // word type, as long as there is no content yet. + if (ii.HasStepContent || !ii.HasWordContent) tcpLibDoc.Enabled = false; } private void btnSectPropOK_Click(object sender, EventArgs e) @@ -83,6 +85,7 @@ namespace VEPROMS Document.Delete(_DocumentToDelete.DocID); _DocumentToDelete = null; } + ppSectNumberStpRTB.SaveText(); ppSectTitleStpRTB.SaveText(); mySection.Dispose(); @@ -241,18 +244,19 @@ namespace VEPROMS ppBtnCvrtToLibDoc.Text = "Convert this Section To A Non-Library Document"; lblLibraryDocument.Text = "Library Document"; superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Non-Library Document", "", "This button will convert the current section from a library document to a non-library document", - null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76))); + null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76))); } else { - ppBtnCvrtToLibDoc.Text = _SectionConfig.MySection.MyContent.MyEntry.MyDocument == null ? "Select Library Document" : "Convert this to a Library Document"; - lblLibraryDocument.Text = "Select Library Document to Link"; - if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument==null) - superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Select Library Document button", "", "This button will attach the current section to a library document, allowing it t" + - "o be shared with other procedures.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76))); - else + if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument == null) + ppBtnCvrtToLibDoc.Visible = false; + else + { + ppBtnCvrtToLibDoc.Text = "Convert this to a Library Document"; + lblLibraryDocument.Text = "Select Library Document"; superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Library Document button", "", "This button will convert the current section to a library document, allowing it t" + - "o be shared with other procedures.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76))); + "o be shared with other procedures.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76))); + } } DocumentInfoList LibDocList = DocumentInfoList.GetLibraries(true); @@ -264,7 +268,7 @@ namespace VEPROMS // see if this lib doc should be the selected index? if (isLib && (LibDocList[i].DocID == _SectionConfig.MySection.MyContent.MyEntry.MyDocument.DocID)) selindx = i; } - if (selindx>-1) ppCmbxLibDoc.SelectedIndex = selindx; + if (selindx > -1) ppCmbxLibDoc.SelectedIndex = selindx; _Initializing = false; } @@ -469,6 +473,7 @@ namespace VEPROMS ppBtnCvrtToLibDoc.Text = "Convert this to a Library Document"; superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Library Document button", "", "This button will convert the current section to a library document, allowing it t" + "o be shared with other procedures.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76))); + return; } // If current section is not a library document, it is either a new section or the user selected the // button to convert it to a library document. Check for this, if new, just attach to document. @@ -507,6 +512,10 @@ namespace VEPROMS ppCmbxLibDocFill(); ppCmbxLibDoc.Enabled = false; } + ppBtnCvrtToLibDoc.Text = "Convert this Section To A Non-Library Document"; + lblLibraryDocument.Text = "Library Document"; + superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Non-Library Document", "", "This button will convert the current section from a library document to a non-library document", + null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76))); } private void ppCmbxLibDoc_SelectedIndexChanged(object sender, EventArgs e) @@ -514,32 +523,40 @@ namespace VEPROMS if (_Initializing) return; // first check if this is a 'new' section - if so, then just return. - if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument == null) return; + if (_SectionConfig.MySection.MyContent.MyEntry == null) return; // see if this was NOT a library document. If it is not a library document, ask the user if // it should be linked, thus losing the original text/data. - if (!(_SectionConfig.MySection.MyContent.MyEntry.MyDocument.LibTitle != "")) + if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument != null && !(_SectionConfig.MySection.MyContent.MyEntry.MyDocument.LibTitle != "")) { _SectionConfig.MySection.MyContent.MyEntry.MyDocument = Document.New(); if (ppCmbxLibDoc.SelectedIndex > -1) { - if (MessageBox.Show("Linking to this library document will cause loss of data. Do you want to continue?", "Link", MessageBoxButtons.YesNo) == DialogResult.Yes) + if (MessageBox.Show("Linking to this library document will cause loss of data to this section. Do you want to continue?", "Link", MessageBoxButtons.YesNo) == DialogResult.Yes) { _DocumentToDelete = _SectionConfig.MySection.MyContent.MyEntry.MyDocument; DocumentInfoList LibDocList = DocumentInfoList.GetLibraries(true); _SectionConfig.MySection.MyContent.MyEntry.MyDocument = Document.Get(LibDocList[ppCmbxLibDoc.SelectedIndex].DocID); + ppBtnCvrtToLibDoc.Enabled = true; } else { ppCmbxLibDoc.SelectedIndex = -1; + ppBtnCvrtToLibDoc.Enabled = false; } } } - else - { + //else if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument == null) + //{ + // // was creating a new document & selected to connect it to a libdoc + // _DocumentToDelete = _SectionConfig.MySection.MyContent.MyEntry.MyDocument; + //} + else + { // it already is a library document, just change usages... DocumentInfoList LibDocList = DocumentInfoList.GetLibraries(true); _SectionConfig.MySection.MyContent.MyEntry.MyDocument = Document.Get(LibDocList[ppCmbxLibDoc.SelectedIndex].DocID); + ppBtnCvrtToLibDoc.Enabled = true; } } #endregion @@ -684,6 +701,7 @@ namespace VEPROMS { SetupPpCmbxSectionType(); ShowAvailableOptionsForSectionType(); + tcpLibDoc.Enabled = !_isStepSection; } }