From 3b0062bc7e82c447403d9d37be6dfcb12c6df45d Mon Sep 17 00:00:00 2001 From: Rich Date: Sat, 1 Dec 2012 00:23:41 +0000 Subject: [PATCH] Added Paste Plain Text and Paste No Returns options to System Options --- .../Properties/Settings.Designer.cs | 24 +++++ .../Properties/Settings.settings | 6 ++ .../frmSysOptions.Designer.cs | 92 +++++++++++++++++++ PROMS/VEPROMS User Interface/frmSysOptions.cs | 18 +++- PROMS/VEPROMS User Interface/frmVEPROMS.cs | 5 +- .../Volian.Controls.Library/StepTabRibbon.cs | 17 +++- 6 files changed, 157 insertions(+), 5 deletions(-) diff --git a/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs b/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs index 88d8abca..33cf36c0 100644 --- a/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs +++ b/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs @@ -327,5 +327,29 @@ namespace VEPROMS.Properties { this["UpdateSettings"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool PasteNoReturns { + get { + return ((bool)(this["PasteNoReturns"])); + } + set { + this["PasteNoReturns"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool PastePlainText { + get { + return ((bool)(this["PastePlainText"])); + } + set { + this["PastePlainText"] = value; + } + } } } diff --git a/PROMS/VEPROMS User Interface/Properties/Settings.settings b/PROMS/VEPROMS User Interface/Properties/Settings.settings index 25ef57ed..80900b2d 100644 --- a/PROMS/VEPROMS User Interface/Properties/Settings.settings +++ b/PROMS/VEPROMS User Interface/Properties/Settings.settings @@ -80,5 +80,11 @@ True + + False + + + False + \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/frmSysOptions.Designer.cs b/PROMS/VEPROMS User Interface/frmSysOptions.Designer.cs index ce5a3c4e..89b88feb 100644 --- a/PROMS/VEPROMS User Interface/frmSysOptions.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmSysOptions.Designer.cs @@ -46,6 +46,9 @@ namespace VEPROMS this.cbTVExpand = new DevComponents.DotNetBar.Controls.CheckBoxX(); this.groupPanel5 = new DevComponents.DotNetBar.Controls.GroupPanel(); this.cbStepTypeToolTip = new DevComponents.DotNetBar.Controls.CheckBoxX(); + this.groupPanel7 = new DevComponents.DotNetBar.Controls.GroupPanel(); + this.cbPastePlainText = new DevComponents.DotNetBar.Controls.CheckBoxX(); + this.cbPasteNoReturns = new DevComponents.DotNetBar.Controls.CheckBoxX(); this.groupPanel4 = new DevComponents.DotNetBar.Controls.GroupPanel(); this.cbAnnotationPopup = new DevComponents.DotNetBar.Controls.CheckBoxX(); this.groupPanel3 = new DevComponents.DotNetBar.Controls.GroupPanel(); @@ -66,6 +69,7 @@ namespace VEPROMS ((System.ComponentModel.ISupportInitialize)(this.tcSysOpts)).BeginInit(); this.tcSysOpts.SuspendLayout(); this.tabControlPanel3.SuspendLayout(); + this.groupPanel7.SuspendLayout(); this.groupPanel6.SuspendLayout(); this.groupPanel5.SuspendLayout(); this.groupPanel4.SuspendLayout(); @@ -279,6 +283,7 @@ namespace VEPROMS // // tabControlPanel3 // + this.tabControlPanel3.Controls.Add(this.groupPanel7); this.tabControlPanel3.Controls.Add(this.groupPanel6); this.tabControlPanel3.Controls.Add(this.groupPanel5); this.tabControlPanel3.Controls.Add(this.groupPanel4); @@ -467,6 +472,51 @@ namespace VEPROMS this.groupPanel4.TabIndex = 4; this.groupPanel4.Text = "Annotation Settings"; // + // groupPanel7 + // + this.groupPanel7.BackColor = System.Drawing.Color.Transparent; + this.groupPanel7.CanvasColor = System.Drawing.SystemColors.Control; + this.groupPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; + this.groupPanel7.Controls.Add(this.cbPastePlainText); + this.groupPanel7.Controls.Add(this.cbPasteNoReturns); + this.groupPanel7.Location = new System.Drawing.Point(33, 300); + this.groupPanel7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.groupPanel7.Name = "groupPanel4"; + this.groupPanel7.Size = new System.Drawing.Size(159, 100); + // + // + // + this.groupPanel7.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + this.groupPanel7.Style.BackColorGradientAngle = 90; + this.groupPanel7.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + this.groupPanel7.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.groupPanel7.Style.BorderBottomWidth = 1; + this.groupPanel7.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.groupPanel7.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.groupPanel7.Style.BorderLeftWidth = 1; + this.groupPanel7.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.groupPanel7.Style.BorderRightWidth = 1; + this.groupPanel7.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.groupPanel7.Style.BorderTopWidth = 1; + this.groupPanel7.Style.Class = ""; + this.groupPanel7.Style.CornerDiameter = 4; + this.groupPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.groupPanel7.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; + this.groupPanel7.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; + this.groupPanel7.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; + // + // + // + this.groupPanel7.StyleMouseDown.Class = ""; + this.groupPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.groupPanel7.StyleMouseOver.Class = ""; + this.groupPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.groupPanel7.TabIndex = 8; + this.groupPanel7.Text = "Paste Settings"; + // // cbAnnotationPopup // // @@ -486,6 +536,44 @@ namespace VEPROMS this.cbAnnotationPopup.Text = "Auto Popup"; this.cbAnnotationPopup.CheckedChanged += new System.EventHandler(this.cbAnnotationPopup_CheckedChanged); // + // cbPastePlainText + // + // + // + // + this.cbPastePlainText.BackgroundStyle.Class = ""; + this.cbPastePlainText.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.cbPastePlainText.Checked = true; + this.cbPastePlainText.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbPastePlainText.CheckValue = "Y"; + this.cbPastePlainText.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbPastePlainText.Location = new System.Drawing.Point(10, 10); + this.cbPastePlainText.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.cbPastePlainText.Name = "cbPastePlainText"; + this.cbPastePlainText.Size = new System.Drawing.Size(123, 23); + this.cbPastePlainText.TabIndex = 9; + this.cbPastePlainText.Text = "Plain Text"; + this.cbPastePlainText.CheckedChanged += new System.EventHandler(this.cbPastePlainText_CheckedChanged); + // + // cbPasteNoReturns + // + // + // + // + this.cbPasteNoReturns.BackgroundStyle.Class = ""; + this.cbPasteNoReturns.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.cbPasteNoReturns.Checked = true; + this.cbPasteNoReturns.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbPasteNoReturns.CheckValue = "Y"; + this.cbPasteNoReturns.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbPasteNoReturns.Location = new System.Drawing.Point(10, 34); + this.cbPasteNoReturns.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.cbPasteNoReturns.Name = "cbPasteNoReturns"; + this.cbPasteNoReturns.Size = new System.Drawing.Size(123, 23); + this.cbPasteNoReturns.TabIndex = 10; + this.cbPasteNoReturns.Text = "No Returns"; + this.cbPasteNoReturns.CheckedChanged += new System.EventHandler(this.cbPasteNoReturns_CheckedChanged); + // // groupPanel3 // this.groupPanel3.BackColor = System.Drawing.Color.Transparent; @@ -731,6 +819,7 @@ namespace VEPROMS ((System.ComponentModel.ISupportInitialize)(this.tcSysOpts)).EndInit(); this.tcSysOpts.ResumeLayout(false); this.tabControlPanel3.ResumeLayout(false); + this.groupPanel7.ResumeLayout(false); this.groupPanel6.ResumeLayout(false); this.groupPanel5.ResumeLayout(false); this.groupPanel4.ResumeLayout(false); @@ -768,10 +857,13 @@ namespace VEPROMS private DevComponents.DotNetBar.Controls.GroupPanel groupPanel3; private DevComponents.DotNetBar.ColorPickerButton colorPickerButton1; private DevComponents.DotNetBar.Controls.GroupPanel groupPanel4; + private DevComponents.DotNetBar.Controls.CheckBoxX cbPastePlainText; + private DevComponents.DotNetBar.Controls.CheckBoxX cbPasteNoReturns; private DevComponents.DotNetBar.Controls.CheckBoxX cbAnnotationPopup; private DevComponents.DotNetBar.Controls.GroupPanel groupPanel5; private DevComponents.DotNetBar.Controls.CheckBoxX cbStepTypeToolTip; private DevComponents.DotNetBar.Controls.GroupPanel groupPanel6; + private DevComponents.DotNetBar.Controls.GroupPanel groupPanel7; private DevComponents.DotNetBar.Controls.CheckBoxX cbTVExpand; diff --git a/PROMS/VEPROMS User Interface/frmSysOptions.cs b/PROMS/VEPROMS User Interface/frmSysOptions.cs index 0d4ccbfc..3f84bc19 100644 --- a/PROMS/VEPROMS User Interface/frmSysOptions.cs +++ b/PROMS/VEPROMS User Interface/frmSysOptions.cs @@ -57,9 +57,23 @@ namespace VEPROMS cbAnnotationPopup.Checked = Settings.Default.AutoPopUpAnnotations; cbStepTypeToolTip.Checked = Settings.Default.StepTypeToolTip; cbTVExpand.Checked = Settings.Default.SaveTreeviewExpanded; + cbPasteNoReturns.Checked = Settings.Default.PasteNoReturns; + cbPastePlainText.Checked = Settings.Default.PastePlainText; + } + private void cbPastePlainText_CheckedChanged(object sender, EventArgs e) + { + if (!_initializing) + { + Settings.Default.PastePlainText = cbPastePlainText.Checked; + } + } + private void cbPasteNoReturns_CheckedChanged(object sender, EventArgs e) + { + if (!_initializing) + { + Settings.Default.PasteNoReturns = cbPasteNoReturns.Checked; + } } - - private void cbRibonBlue_CheckedChanged(object sender, EventArgs e) { if (!_initializing) diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index ea510830..f5545a83 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -545,6 +545,8 @@ namespace VEPROMS // Shutoff UpdateFormats for Production Mode if (Volian.Base.Library.VlnSettings.ProductionMode) btnAdmin.Visible = false; + StepTabRibbon.PasteNoReturnsSetting = Properties.Settings.Default.PasteNoReturns; + StepTabRibbon.PastePlainTextSetting = Properties.Settings.Default.PastePlainText; } void tmrShutDown_Tick(object sender, EventArgs e) { @@ -1202,7 +1204,8 @@ namespace VEPROMS { frmSysOptions VeSysOpts = new frmSysOptions(); VeSysOpts.ShowDialog(); - + StepTabRibbon.PasteNoReturnsSetting = Properties.Settings.Default.PasteNoReturns; + StepTabRibbon.PastePlainTextSetting = Properties.Settings.Default.PastePlainText; } /// /// Exit button on the dialog that appears when the V icon is clicked (top left of application window) diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index c0adbd65..5bc671ea 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -15,6 +15,18 @@ namespace Volian.Controls.Library { public partial class StepTabRibbon : UserControl { + private static bool _PastePlainTextSetting = false; + public static bool PastePlainTextSetting + { + get { return _PastePlainTextSetting; } + set { _PastePlainTextSetting = value; } + } + private static bool _PasteNoReturnsSetting = false; + public static bool PasteNoReturnsSetting + { + get { return _PasteNoReturnsSetting; } + set { _PasteNoReturnsSetting = value; } + } private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #region Properties private VlnFlexGrid MyFlexGrid @@ -1029,8 +1041,7 @@ namespace Volian.Controls.Library return; } } - - if (myDO.GetDataPresent(DataFormats.Rtf) && !_PastePlainText) + if (myDO.GetDataPresent(DataFormats.Rtf) && !_PastePlainText && !PastePlainTextSetting) { string tmpForLink = myDO.GetData(DataFormats.Rtf).ToString(); tmpForLink = Regex.Replace(tmpForLink, @"#Link:ReferencedObject:[0-9]+ ", @"#Link:ReferencedObject: "); @@ -1041,6 +1052,8 @@ namespace Volian.Controls.Library else if (myDO.GetDataPresent(DataFormats.Text)) { string ptext = myDO.GetData(DataFormats.Text).ToString(); + ptext = ptext.TrimEnd("\r\n\t ".ToCharArray()); + if (PasteNoReturnsSetting) ptext = ptext.Replace("\r\n", " "); myRtb.SelectedText = ptext; //myRtb.SelectedText = myDO.GetData(DataFormats.Text).ToString(); }