Added Paste Plain Text and Paste No Returns options to System Options

This commit is contained in:
Rich 2012-12-01 00:23:41 +00:00
parent 1b30632829
commit 3b0062bc7e
6 changed files with 157 additions and 5 deletions

View File

@ -327,5 +327,29 @@ namespace VEPROMS.Properties {
this["UpdateSettings"] = value; 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;
}
}
} }
} }

View File

@ -80,5 +80,11 @@
<Setting Name="UpdateSettings" Type="System.Boolean" Scope="User"> <Setting Name="UpdateSettings" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value> <Value Profile="(Default)">True</Value>
</Setting> </Setting>
<Setting Name="PasteNoReturns" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="PastePlainText" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -46,6 +46,9 @@ namespace VEPROMS
this.cbTVExpand = new DevComponents.DotNetBar.Controls.CheckBoxX(); this.cbTVExpand = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.groupPanel5 = new DevComponents.DotNetBar.Controls.GroupPanel(); this.groupPanel5 = new DevComponents.DotNetBar.Controls.GroupPanel();
this.cbStepTypeToolTip = new DevComponents.DotNetBar.Controls.CheckBoxX(); 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.groupPanel4 = new DevComponents.DotNetBar.Controls.GroupPanel();
this.cbAnnotationPopup = new DevComponents.DotNetBar.Controls.CheckBoxX(); this.cbAnnotationPopup = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.groupPanel3 = new DevComponents.DotNetBar.Controls.GroupPanel(); this.groupPanel3 = new DevComponents.DotNetBar.Controls.GroupPanel();
@ -66,6 +69,7 @@ namespace VEPROMS
((System.ComponentModel.ISupportInitialize)(this.tcSysOpts)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tcSysOpts)).BeginInit();
this.tcSysOpts.SuspendLayout(); this.tcSysOpts.SuspendLayout();
this.tabControlPanel3.SuspendLayout(); this.tabControlPanel3.SuspendLayout();
this.groupPanel7.SuspendLayout();
this.groupPanel6.SuspendLayout(); this.groupPanel6.SuspendLayout();
this.groupPanel5.SuspendLayout(); this.groupPanel5.SuspendLayout();
this.groupPanel4.SuspendLayout(); this.groupPanel4.SuspendLayout();
@ -279,6 +283,7 @@ namespace VEPROMS
// //
// tabControlPanel3 // tabControlPanel3
// //
this.tabControlPanel3.Controls.Add(this.groupPanel7);
this.tabControlPanel3.Controls.Add(this.groupPanel6); this.tabControlPanel3.Controls.Add(this.groupPanel6);
this.tabControlPanel3.Controls.Add(this.groupPanel5); this.tabControlPanel3.Controls.Add(this.groupPanel5);
this.tabControlPanel3.Controls.Add(this.groupPanel4); this.tabControlPanel3.Controls.Add(this.groupPanel4);
@ -467,6 +472,51 @@ namespace VEPROMS
this.groupPanel4.TabIndex = 4; this.groupPanel4.TabIndex = 4;
this.groupPanel4.Text = "Annotation Settings"; 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 // cbAnnotationPopup
// //
// //
@ -486,6 +536,44 @@ namespace VEPROMS
this.cbAnnotationPopup.Text = "Auto Popup"; this.cbAnnotationPopup.Text = "Auto Popup";
this.cbAnnotationPopup.CheckedChanged += new System.EventHandler(this.cbAnnotationPopup_CheckedChanged); 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 // groupPanel3
// //
this.groupPanel3.BackColor = System.Drawing.Color.Transparent; this.groupPanel3.BackColor = System.Drawing.Color.Transparent;
@ -731,6 +819,7 @@ namespace VEPROMS
((System.ComponentModel.ISupportInitialize)(this.tcSysOpts)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tcSysOpts)).EndInit();
this.tcSysOpts.ResumeLayout(false); this.tcSysOpts.ResumeLayout(false);
this.tabControlPanel3.ResumeLayout(false); this.tabControlPanel3.ResumeLayout(false);
this.groupPanel7.ResumeLayout(false);
this.groupPanel6.ResumeLayout(false); this.groupPanel6.ResumeLayout(false);
this.groupPanel5.ResumeLayout(false); this.groupPanel5.ResumeLayout(false);
this.groupPanel4.ResumeLayout(false); this.groupPanel4.ResumeLayout(false);
@ -768,10 +857,13 @@ namespace VEPROMS
private DevComponents.DotNetBar.Controls.GroupPanel groupPanel3; private DevComponents.DotNetBar.Controls.GroupPanel groupPanel3;
private DevComponents.DotNetBar.ColorPickerButton colorPickerButton1; private DevComponents.DotNetBar.ColorPickerButton colorPickerButton1;
private DevComponents.DotNetBar.Controls.GroupPanel groupPanel4; 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.CheckBoxX cbAnnotationPopup;
private DevComponents.DotNetBar.Controls.GroupPanel groupPanel5; private DevComponents.DotNetBar.Controls.GroupPanel groupPanel5;
private DevComponents.DotNetBar.Controls.CheckBoxX cbStepTypeToolTip; private DevComponents.DotNetBar.Controls.CheckBoxX cbStepTypeToolTip;
private DevComponents.DotNetBar.Controls.GroupPanel groupPanel6; private DevComponents.DotNetBar.Controls.GroupPanel groupPanel6;
private DevComponents.DotNetBar.Controls.GroupPanel groupPanel7;
private DevComponents.DotNetBar.Controls.CheckBoxX cbTVExpand; private DevComponents.DotNetBar.Controls.CheckBoxX cbTVExpand;

View File

@ -57,9 +57,23 @@ namespace VEPROMS
cbAnnotationPopup.Checked = Settings.Default.AutoPopUpAnnotations; cbAnnotationPopup.Checked = Settings.Default.AutoPopUpAnnotations;
cbStepTypeToolTip.Checked = Settings.Default.StepTypeToolTip; cbStepTypeToolTip.Checked = Settings.Default.StepTypeToolTip;
cbTVExpand.Checked = Settings.Default.SaveTreeviewExpanded; 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) private void cbRibonBlue_CheckedChanged(object sender, EventArgs e)
{ {
if (!_initializing) if (!_initializing)

View File

@ -545,6 +545,8 @@ namespace VEPROMS
// Shutoff UpdateFormats for Production Mode // Shutoff UpdateFormats for Production Mode
if (Volian.Base.Library.VlnSettings.ProductionMode) if (Volian.Base.Library.VlnSettings.ProductionMode)
btnAdmin.Visible = false; btnAdmin.Visible = false;
StepTabRibbon.PasteNoReturnsSetting = Properties.Settings.Default.PasteNoReturns;
StepTabRibbon.PastePlainTextSetting = Properties.Settings.Default.PastePlainText;
} }
void tmrShutDown_Tick(object sender, EventArgs e) void tmrShutDown_Tick(object sender, EventArgs e)
{ {
@ -1202,7 +1204,8 @@ namespace VEPROMS
{ {
frmSysOptions VeSysOpts = new frmSysOptions(); frmSysOptions VeSysOpts = new frmSysOptions();
VeSysOpts.ShowDialog(); VeSysOpts.ShowDialog();
StepTabRibbon.PasteNoReturnsSetting = Properties.Settings.Default.PasteNoReturns;
StepTabRibbon.PastePlainTextSetting = Properties.Settings.Default.PastePlainText;
} }
/// <summary> /// <summary>
/// Exit button on the dialog that appears when the V icon is clicked (top left of application window) /// Exit button on the dialog that appears when the V icon is clicked (top left of application window)

View File

@ -15,6 +15,18 @@ namespace Volian.Controls.Library
{ {
public partial class StepTabRibbon : UserControl 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); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#region Properties #region Properties
private VlnFlexGrid MyFlexGrid private VlnFlexGrid MyFlexGrid
@ -1029,8 +1041,7 @@ namespace Volian.Controls.Library
return; return;
} }
} }
if (myDO.GetDataPresent(DataFormats.Rtf) && !_PastePlainText && !PastePlainTextSetting)
if (myDO.GetDataPresent(DataFormats.Rtf) && !_PastePlainText)
{ {
string tmpForLink = myDO.GetData(DataFormats.Rtf).ToString(); string tmpForLink = myDO.GetData(DataFormats.Rtf).ToString();
tmpForLink = Regex.Replace(tmpForLink, @"#Link:ReferencedObject:[0-9]+ ", @"#Link:ReferencedObject:<NewID> "); tmpForLink = Regex.Replace(tmpForLink, @"#Link:ReferencedObject:[0-9]+ ", @"#Link:ReferencedObject:<NewID> ");
@ -1041,6 +1052,8 @@ namespace Volian.Controls.Library
else if (myDO.GetDataPresent(DataFormats.Text)) else if (myDO.GetDataPresent(DataFormats.Text))
{ {
string ptext = myDO.GetData(DataFormats.Text).ToString(); 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 = ptext;
//myRtb.SelectedText = myDO.GetData(DataFormats.Text).ToString(); //myRtb.SelectedText = myDO.GetData(DataFormats.Text).ToString();
} }