Changed some names

This commit is contained in:
Alexander 2019-10-13 14:54:45 +03:00
parent f089a07a28
commit 9386f6844a
13 changed files with 1816 additions and 1749 deletions

View file

@ -63,34 +63,34 @@
<setting name="menuIcons" serializeAs="String">
<value>False</value>
</setting>
<setting name="lnVisible" serializeAs="String">
<setting name="lineNumbersVisible" serializeAs="String">
<value>False</value>
</setting>
<setting name="lnBackColor" serializeAs="String">
<setting name="lineNumbersBackColor" serializeAs="String">
<value>240, 240, 240</value>
</setting>
<setting name="lnForeColor" serializeAs="String">
<setting name="lineNumbersForeColor" serializeAs="String">
<value>164, 164, 164</value>
</setting>
<setting name="blShow" serializeAs="String">
<setting name="borderLinesVisible" serializeAs="String">
<value>False</value>
</setting>
<setting name="blColor" serializeAs="String">
<setting name="borderLinesColor" serializeAs="String">
<value>164, 164, 164</value>
</setting>
<setting name="blStyle" serializeAs="String">
<setting name="borderLinesStyle" serializeAs="String">
<value>Solid</value>
</setting>
<setting name="glShow" serializeAs="String">
<setting name="gridLinesVisible" serializeAs="String">
<value>False</value>
</setting>
<setting name="glColor" serializeAs="String">
<setting name="gridLinesColor" serializeAs="String">
<value>164, 164, 164</value>
</setting>
<setting name="glStyle" serializeAs="String">
<setting name="gridLinesStyle" serializeAs="String">
<value>Solid</value>
</setting>
<setting name="insKey" serializeAs="String">
<setting name="insertKey" serializeAs="String">
<value>Enable</value>
</setting>
<setting name="customColor" serializeAs="String">
@ -135,16 +135,16 @@
<setting name="oldToolbarIcons" serializeAs="String">
<value>False</value>
</setting>
<setting name="mlVisible" serializeAs="String">
<setting name="marginLinesVisible" serializeAs="String">
<value>False</value>
</setting>
<setting name="mlColor" serializeAs="String">
<setting name="marginLinesColor" serializeAs="String">
<value>164, 164, 164</value>
</setting>
<setting name="mlSide" serializeAs="String">
<setting name="marginLinesSide" serializeAs="String">
<value>Right</value>
</setting>
<setting name="mlStyle" serializeAs="String">
<setting name="marginLinesStyle" serializeAs="String">
<value>Solid</value>
</setting>
<setting name="minimizeToTray" serializeAs="String">

View file

@ -28,141 +28,152 @@ protected override void Dispose(bool disposing)
/// </summary>
private void InitializeComponent()
{
this.txtOldKey = new System.Windows.Forms.TextBox();
this.txtNewKey = new System.Windows.Forms.TextBox();
this.lblOldKey = new System.Windows.Forms.Label();
this.lblNewKey = new System.Windows.Forms.Label();
this.btnAccept = new System.Windows.Forms.Button();
this.pnlMain = new System.Windows.Forms.Panel();
this.picLock = new System.Windows.Forms.PictureBox();
this.picNewKey = new System.Windows.Forms.PictureBox();
this.picOldKey = new System.Windows.Forms.PictureBox();
this.lblStatus = new System.Windows.Forms.Label();
this.pnlMain.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picLock)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picNewKey)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picOldKey)).BeginInit();
this.oldKeyTextBox = new System.Windows.Forms.TextBox();
this.newKeyTextBox = new System.Windows.Forms.TextBox();
this.acceptButton = new System.Windows.Forms.Button();
this.mainPanel = new System.Windows.Forms.Panel();
this.oldKeyPlaceholder = new System.Windows.Forms.Label();
this.newKeyPlaceholder = new System.Windows.Forms.Label();
this.statusLabel = new System.Windows.Forms.Label();
this.lockPictureBox = new System.Windows.Forms.PictureBox();
this.showNewKeyPictureBox = new System.Windows.Forms.PictureBox();
this.showOldKeyPictureBox = new System.Windows.Forms.PictureBox();
this.mainPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.lockPictureBox)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.showNewKeyPictureBox)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.showOldKeyPictureBox)).BeginInit();
this.SuspendLayout();
//
// txtOldKey
// oldKeyTextBox
//
this.txtOldKey.Location = new System.Drawing.Point(120, 9);
this.txtOldKey.Name = "txtOldKey";
this.txtOldKey.Size = new System.Drawing.Size(121, 20);
this.txtOldKey.TabIndex = 0;
this.txtOldKey.UseSystemPasswordChar = true;
this.txtOldKey.TextChanged += new System.EventHandler(this.TxtOldKey_TextChanged);
this.oldKeyTextBox.Location = new System.Drawing.Point(63, 12);
this.oldKeyTextBox.Name = "oldKeyTextBox";
this.oldKeyTextBox.Size = new System.Drawing.Size(177, 22);
this.oldKeyTextBox.TabIndex = 0;
this.oldKeyTextBox.UseSystemPasswordChar = true;
this.oldKeyTextBox.TextChanged += new System.EventHandler(this.OldKeyTextBox_TextChanged);
this.oldKeyTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OldKeyTextBox_KeyDown);
//
// txtNewKey
// newKeyTextBox
//
this.txtNewKey.Location = new System.Drawing.Point(120, 43);
this.txtNewKey.Name = "txtNewKey";
this.txtNewKey.Size = new System.Drawing.Size(121, 20);
this.txtNewKey.TabIndex = 1;
this.txtNewKey.UseSystemPasswordChar = true;
this.txtNewKey.TextChanged += new System.EventHandler(this.TxtNewKey_TextChanged);
this.newKeyTextBox.Location = new System.Drawing.Point(63, 37);
this.newKeyTextBox.Name = "newKeyTextBox";
this.newKeyTextBox.Size = new System.Drawing.Size(177, 22);
this.newKeyTextBox.TabIndex = 1;
this.newKeyTextBox.UseSystemPasswordChar = true;
this.newKeyTextBox.TextChanged += new System.EventHandler(this.NewKeyTextBox_TextChanged);
this.newKeyTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.NewKeyTextBox_KeyDown);
this.newKeyTextBox.Leave += new System.EventHandler(this.NewKeyTextBox_Leave);
//
// lblOldKey
// acceptButton
//
this.lblOldKey.AutoSize = true;
this.lblOldKey.Location = new System.Drawing.Point(61, 12);
this.lblOldKey.Name = "lblOldKey";
this.lblOldKey.Size = new System.Drawing.Size(47, 13);
this.lblOldKey.TabIndex = 2;
this.lblOldKey.Text = "Old Key:";
this.acceptButton.Enabled = false;
this.acceptButton.Location = new System.Drawing.Point(212, 79);
this.acceptButton.Name = "acceptButton";
this.acceptButton.Size = new System.Drawing.Size(53, 23);
this.acceptButton.TabIndex = 4;
this.acceptButton.Text = "Accept";
this.acceptButton.UseVisualStyleBackColor = true;
this.acceptButton.Click += new System.EventHandler(this.AcceptButton_Click);
//
// lblNewKey
// mainPanel
//
this.lblNewKey.AutoSize = true;
this.lblNewKey.Location = new System.Drawing.Point(61, 46);
this.lblNewKey.Name = "lblNewKey";
this.lblNewKey.Size = new System.Drawing.Size(53, 13);
this.lblNewKey.TabIndex = 3;
this.lblNewKey.Text = "New Key:";
this.mainPanel.BackColor = System.Drawing.Color.White;
this.mainPanel.Controls.Add(this.oldKeyPlaceholder);
this.mainPanel.Controls.Add(this.newKeyPlaceholder);
this.mainPanel.Controls.Add(this.lockPictureBox);
this.mainPanel.Controls.Add(this.showNewKeyPictureBox);
this.mainPanel.Controls.Add(this.showOldKeyPictureBox);
this.mainPanel.Controls.Add(this.oldKeyTextBox);
this.mainPanel.Controls.Add(this.newKeyTextBox);
this.mainPanel.Dock = System.Windows.Forms.DockStyle.Top;
this.mainPanel.Location = new System.Drawing.Point(0, 0);
this.mainPanel.Name = "mainPanel";
this.mainPanel.Size = new System.Drawing.Size(269, 75);
this.mainPanel.TabIndex = 6;
//
// btnAccept
// oldKeyPlaceholder
//
this.btnAccept.Enabled = false;
this.btnAccept.Location = new System.Drawing.Point(212, 81);
this.btnAccept.Name = "btnAccept";
this.btnAccept.Size = new System.Drawing.Size(53, 23);
this.btnAccept.TabIndex = 4;
this.btnAccept.Text = "Accept";
this.btnAccept.UseVisualStyleBackColor = true;
this.btnAccept.Click += new System.EventHandler(this.BtnAccept_Click);
this.oldKeyPlaceholder.AutoSize = true;
this.oldKeyPlaceholder.Cursor = System.Windows.Forms.Cursors.IBeam;
this.oldKeyPlaceholder.ForeColor = System.Drawing.Color.DarkGray;
this.oldKeyPlaceholder.Location = new System.Drawing.Point(67, 16);
this.oldKeyPlaceholder.Name = "oldKeyPlaceholder";
this.oldKeyPlaceholder.Size = new System.Drawing.Size(46, 13);
this.oldKeyPlaceholder.TabIndex = 8;
this.oldKeyPlaceholder.Text = "Old key";
this.oldKeyPlaceholder.Click += new System.EventHandler(this.OldKeyPlaceholder_Click);
//
// pnlMain
// newKeyPlaceholder
//
this.pnlMain.BackColor = System.Drawing.Color.White;
this.pnlMain.Controls.Add(this.picLock);
this.pnlMain.Controls.Add(this.picNewKey);
this.pnlMain.Controls.Add(this.lblOldKey);
this.pnlMain.Controls.Add(this.picOldKey);
this.pnlMain.Controls.Add(this.txtOldKey);
this.pnlMain.Controls.Add(this.txtNewKey);
this.pnlMain.Controls.Add(this.lblNewKey);
this.pnlMain.Location = new System.Drawing.Point(0, 0);
this.pnlMain.Name = "pnlMain";
this.pnlMain.Size = new System.Drawing.Size(268, 75);
this.pnlMain.TabIndex = 6;
this.newKeyPlaceholder.AutoSize = true;
this.newKeyPlaceholder.Cursor = System.Windows.Forms.Cursors.IBeam;
this.newKeyPlaceholder.ForeColor = System.Drawing.Color.DarkGray;
this.newKeyPlaceholder.Location = new System.Drawing.Point(67, 41);
this.newKeyPlaceholder.Name = "newKeyPlaceholder";
this.newKeyPlaceholder.Size = new System.Drawing.Size(50, 13);
this.newKeyPlaceholder.TabIndex = 2;
this.newKeyPlaceholder.Text = "New key";
this.newKeyPlaceholder.Click += new System.EventHandler(this.NewKeyPlaceholder_Click);
//
// picLock
// statusLabel
//
this.picLock.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picLock.Image = global::Crypto_Notepad.Properties.Resources.big_lock;
this.picLock.Location = new System.Drawing.Point(8, 12);
this.picLock.Name = "picLock";
this.picLock.Size = new System.Drawing.Size(47, 47);
this.picLock.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.picLock.TabIndex = 7;
this.picLock.TabStop = false;
this.statusLabel.AutoSize = true;
this.statusLabel.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.statusLabel.ForeColor = System.Drawing.Color.Black;
this.statusLabel.Location = new System.Drawing.Point(5, 81);
this.statusLabel.Name = "statusLabel";
this.statusLabel.Size = new System.Drawing.Size(42, 17);
this.statusLabel.TabIndex = 7;
this.statusLabel.Text = "status";
this.statusLabel.Visible = false;
//
// picNewKey
// lockPictureBox
//
this.picNewKey.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picNewKey.Cursor = System.Windows.Forms.Cursors.Hand;
this.picNewKey.Image = global::Crypto_Notepad.Properties.Resources.eye_half;
this.picNewKey.Location = new System.Drawing.Point(247, 43);
this.picNewKey.Name = "picNewKey";
this.picNewKey.Size = new System.Drawing.Size(18, 20);
this.picNewKey.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.picNewKey.TabIndex = 5;
this.picNewKey.TabStop = false;
this.picNewKey.Click += new System.EventHandler(this.PicNewKeyEyeIcon_Click);
this.lockPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lockPictureBox.Image = global::Crypto_Notepad.Properties.Resources.gnupg_keys;
this.lockPictureBox.Location = new System.Drawing.Point(8, 12);
this.lockPictureBox.Name = "lockPictureBox";
this.lockPictureBox.Size = new System.Drawing.Size(47, 47);
this.lockPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.lockPictureBox.TabIndex = 7;
this.lockPictureBox.TabStop = false;
//
// picOldKey
// showNewKeyPictureBox
//
this.picOldKey.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picOldKey.Cursor = System.Windows.Forms.Cursors.Hand;
this.picOldKey.Image = global::Crypto_Notepad.Properties.Resources.eye_half;
this.picOldKey.Location = new System.Drawing.Point(247, 9);
this.picOldKey.Name = "picOldKey";
this.picOldKey.Size = new System.Drawing.Size(18, 20);
this.picOldKey.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.picOldKey.TabIndex = 5;
this.picOldKey.TabStop = false;
this.picOldKey.Click += new System.EventHandler(this.PicOldKeyEyeIcon_Click);
this.showNewKeyPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.showNewKeyPictureBox.Cursor = System.Windows.Forms.Cursors.Hand;
this.showNewKeyPictureBox.Image = global::Crypto_Notepad.Properties.Resources.eye_half;
this.showNewKeyPictureBox.Location = new System.Drawing.Point(239, 37);
this.showNewKeyPictureBox.Name = "showNewKeyPictureBox";
this.showNewKeyPictureBox.Size = new System.Drawing.Size(18, 22);
this.showNewKeyPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.showNewKeyPictureBox.TabIndex = 5;
this.showNewKeyPictureBox.TabStop = false;
this.showNewKeyPictureBox.Click += new System.EventHandler(this.ShowNewKeyPictureBox_Click);
//
// lblStatus
// showOldKeyPictureBox
//
this.lblStatus.AutoSize = true;
this.lblStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.lblStatus.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.lblStatus.Location = new System.Drawing.Point(5, 87);
this.lblStatus.Name = "lblStatus";
this.lblStatus.Size = new System.Drawing.Size(43, 16);
this.lblStatus.TabIndex = 7;
this.lblStatus.Text = "status";
this.lblStatus.Visible = false;
this.showOldKeyPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.showOldKeyPictureBox.Cursor = System.Windows.Forms.Cursors.Hand;
this.showOldKeyPictureBox.Image = global::Crypto_Notepad.Properties.Resources.eye_half;
this.showOldKeyPictureBox.Location = new System.Drawing.Point(239, 12);
this.showOldKeyPictureBox.Name = "showOldKeyPictureBox";
this.showOldKeyPictureBox.Size = new System.Drawing.Size(18, 22);
this.showOldKeyPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.showOldKeyPictureBox.TabIndex = 5;
this.showOldKeyPictureBox.TabStop = false;
this.showOldKeyPictureBox.Click += new System.EventHandler(this.ShowOldKeyPictureBox_Click);
//
// ChangeKeyForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(269, 111);
this.Controls.Add(this.lblStatus);
this.Controls.Add(this.pnlMain);
this.Controls.Add(this.btnAccept);
this.ClientSize = new System.Drawing.Size(269, 106);
this.Controls.Add(this.statusLabel);
this.Controls.Add(this.mainPanel);
this.Controls.Add(this.acceptButton);
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
@ -170,11 +181,11 @@ private void InitializeComponent()
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Change Key";
this.pnlMain.ResumeLayout(false);
this.pnlMain.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picLock)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picNewKey)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picOldKey)).EndInit();
this.mainPanel.ResumeLayout(false);
this.mainPanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.lockPictureBox)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.showNewKeyPictureBox)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.showOldKeyPictureBox)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -182,15 +193,15 @@ private void InitializeComponent()
#endregion
private System.Windows.Forms.TextBox txtOldKey;
private System.Windows.Forms.TextBox txtNewKey;
private System.Windows.Forms.Label lblOldKey;
private System.Windows.Forms.Label lblNewKey;
private System.Windows.Forms.Button btnAccept;
private System.Windows.Forms.PictureBox picOldKey;
private System.Windows.Forms.PictureBox picNewKey;
private System.Windows.Forms.Panel pnlMain;
private System.Windows.Forms.PictureBox picLock;
private System.Windows.Forms.Label lblStatus;
private System.Windows.Forms.TextBox oldKeyTextBox;
private System.Windows.Forms.TextBox newKeyTextBox;
private System.Windows.Forms.Button acceptButton;
private System.Windows.Forms.PictureBox showOldKeyPictureBox;
private System.Windows.Forms.PictureBox showNewKeyPictureBox;
private System.Windows.Forms.Panel mainPanel;
private System.Windows.Forms.PictureBox lockPictureBox;
private System.Windows.Forms.Label statusLabel;
private System.Windows.Forms.Label newKeyPlaceholder;
private System.Windows.Forms.Label oldKeyPlaceholder;
}
}

View file

@ -1,4 +1,5 @@
using System;
using System;
using System.Drawing;
using System.Media;
using System.Threading.Tasks;
using System.Windows.Forms;
@ -13,77 +14,87 @@ public ChangeKeyForm()
}
/*Buttons*/
private async void BtnAccept_Click(object sender, EventArgs e)
private async void AcceptButton_Click(object sender, EventArgs e)
{
if (txtOldKey.Text == PublicVar.encryptionKey.Get() && txtOldKey.Text != txtNewKey.Text)
oldKeyTextBox.Focus();
if (oldKeyTextBox.Text == PublicVar.encryptionKey.Get() && oldKeyTextBox.Text != newKeyTextBox.Text)
{
PublicVar.encryptionKey.Set(txtNewKey.Text);
PublicVar.encryptionKey.Set(newKeyTextBox.Text);
PublicVar.keyChanged = true;
txtOldKey.Text = "";
txtNewKey.Text = "";
lblStatus.Text = "Key was successfully changed";
lblStatus.Visible = true;
btnAccept.Enabled = false;
oldKeyTextBox.Text = "";
newKeyTextBox.Text = "";
statusLabel.ForeColor = Color.Green;
statusLabel.Text = "Key was successfully changed";
statusLabel.Visible = true;
acceptButton.Enabled = false;
await Task.Delay(2000);
lblStatus.Text = "";
return;
statusLabel.Text = "";
}
if (txtOldKey.Text != PublicVar.encryptionKey.Get())
else if (oldKeyTextBox.Text != PublicVar.encryptionKey.Get())
{
SystemSounds.Beep.Play();
lblStatus.Text = "Invalid old key";
lblStatus.Visible = true;
txtOldKey.Text = "";
txtNewKey.Text = "";
return;
statusLabel.ForeColor = Color.Red;
statusLabel.Text = "Invalid old key";
statusLabel.Visible = true;
oldKeyTextBox.Text = "";
newKeyTextBox.Text = "";
await Task.Delay(2000);
statusLabel.Text = "";
}
if (txtOldKey.Text == txtNewKey.Text)
else if(oldKeyTextBox.Text == newKeyTextBox.Text)
{
SystemSounds.Beep.Play();
lblStatus.Text = "New key is the same as old";
lblStatus.Visible = true;
txtOldKey.Text = "";
txtNewKey.Text = "";
return;
statusLabel.ForeColor = Color.Red;
statusLabel.Text = "New key is the same as old";
statusLabel.Visible = true;
oldKeyTextBox.Text = "";
newKeyTextBox.Text = "";
await Task.Delay(2000);
statusLabel.Text = "";
}
}
/*Buttons*/
/*Enter keys area*/
private void PicOldKeyEyeIcon_Click(object sender, EventArgs e)
private void ShowOldKeyPictureBox_Click(object sender, EventArgs e)
{
if (txtOldKey.UseSystemPasswordChar)
if (oldKeyTextBox.UseSystemPasswordChar)
{
txtOldKey.UseSystemPasswordChar = false;
picOldKey.Image = Properties.Resources.eye;
oldKeyTextBox.UseSystemPasswordChar = false;
showOldKeyPictureBox.Image = Properties.Resources.eye;
}
else
{
txtOldKey.UseSystemPasswordChar = true;
picOldKey.Image = Properties.Resources.eye_half;
oldKeyTextBox.UseSystemPasswordChar = true;
showOldKeyPictureBox.Image = Properties.Resources.eye_half;
}
}
private void PicNewKeyEyeIcon_Click(object sender, EventArgs e)
private void ShowNewKeyPictureBox_Click(object sender, EventArgs e)
{
if (txtNewKey.UseSystemPasswordChar)
if (newKeyTextBox.UseSystemPasswordChar)
{
txtNewKey.UseSystemPasswordChar = false;
picNewKey.Image = Properties.Resources.eye;
newKeyTextBox.UseSystemPasswordChar = false;
showNewKeyPictureBox.Image = Properties.Resources.eye;
}
else
{
txtNewKey.UseSystemPasswordChar = true;
picNewKey.Image = Properties.Resources.eye_half;
newKeyTextBox.UseSystemPasswordChar = true;
showNewKeyPictureBox.Image = Properties.Resources.eye_half;
}
}
private void TxtOldKey_TextChanged(object sender, EventArgs e)
private void OldKeyTextBox_TextChanged(object sender, EventArgs e)
{
if (txtOldKey.Text.Length > 0 && txtNewKey.Text.Length > 0)
if (oldKeyTextBox.Text.Length > 0 & newKeyTextBox.Text.Length > 0)
{
acceptButton.Enabled = true;
}
else
{
acceptButton.Enabled = false;
}
{
btnAccept.Enabled = true;
}
@ -93,17 +104,42 @@ private void TxtOldKey_TextChanged(object sender, EventArgs e)
}
}
private void TxtNewKey_TextChanged(object sender, EventArgs e)
private void NewKeyTextBox_TextChanged(object sender, EventArgs e)
{
if (txtNewKey.Text.Length > 0 && txtOldKey.Text.Length > 0)
if (newKeyTextBox.Text.Length > 0 & oldKeyTextBox.Text.Length > 0)
{
acceptButton.Enabled = true;
}
else
{
acceptButton.Enabled = false;
}
if (newKeyTextBox.Text.Length > 0)
{
btnAccept.Enabled = true;
}
else
{
btnAccept.Enabled = false;
private void NewKeyTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter & acceptButton.Enabled)
{
AcceptButton_Click(sender, e);
}
}
private void OldKeyTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter & acceptButton.Enabled)
{
AcceptButton_Click(sender, e);
}
}
/*Enter keys area*/
}
}

View file

@ -29,92 +29,107 @@ protected override void Dispose(bool disposing)
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EnterKeyForm));
this.txtKey = new System.Windows.Forms.TextBox();
this.btnOk = new System.Windows.Forms.Button();
this.picShowKey = new System.Windows.Forms.PictureBox();
this.pnlMain = new System.Windows.Forms.Panel();
this.picLock = new System.Windows.Forms.PictureBox();
this.lblFileName = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.picShowKey)).BeginInit();
this.pnlMain.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picLock)).BeginInit();
this.keyTextBox = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.mainPanel = new System.Windows.Forms.Panel();
this.fileNameLabel = new System.Windows.Forms.Label();
this.encryptionKeyPlaceholder = new System.Windows.Forms.Label();
this.lockPictureBox = new System.Windows.Forms.PictureBox();
this.showKeyPictureBox = new System.Windows.Forms.PictureBox();
this.mainPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.lockPictureBox)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.showKeyPictureBox)).BeginInit();
this.SuspendLayout();
//
// txtKey
// keyTextBox
//
this.txtKey.Location = new System.Drawing.Point(64, 39);
this.txtKey.Name = "txtKey";
this.txtKey.Size = new System.Drawing.Size(177, 20);
this.txtKey.TabIndex = 0;
this.txtKey.UseSystemPasswordChar = true;
this.txtKey.TextChanged += new System.EventHandler(this.TxtKey_TextChanged);
this.txtKey.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TxtKey_KeyDown);
this.keyTextBox.Location = new System.Drawing.Point(64, 37);
this.keyTextBox.Name = "keyTextBox";
this.keyTextBox.Size = new System.Drawing.Size(177, 22);
this.keyTextBox.TabIndex = 0;
this.keyTextBox.UseSystemPasswordChar = true;
this.keyTextBox.TextChanged += new System.EventHandler(this.KeyTextBox_TextChanged);
this.keyTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.KeyTextBox_KeyDown);
//
// btnOk
// okButton
//
this.btnOk.Enabled = false;
this.btnOk.Location = new System.Drawing.Point(190, 79);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.TabIndex = 1;
this.btnOk.Text = "OK";
this.btnOk.UseVisualStyleBackColor = true;
this.btnOk.Click += new System.EventHandler(this.BtnOk_Click);
this.okButton.Enabled = false;
this.okButton.Location = new System.Drawing.Point(190, 80);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 23);
this.okButton.TabIndex = 1;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.OkButton_Click);
//
// picShowKey
// mainPanel
//
this.picShowKey.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picShowKey.Cursor = System.Windows.Forms.Cursors.Hand;
this.picShowKey.Image = global::Crypto_Notepad.Properties.Resources.eye_half;
this.picShowKey.InitialImage = global::Crypto_Notepad.Properties.Resources.eye_half;
this.picShowKey.Location = new System.Drawing.Point(247, 39);
this.picShowKey.Name = "picShowKey";
this.picShowKey.Size = new System.Drawing.Size(18, 20);
this.picShowKey.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.picShowKey.TabIndex = 3;
this.picShowKey.TabStop = false;
this.picShowKey.Click += new System.EventHandler(this.KeyEyeIcon_Click);
this.mainPanel.BackColor = System.Drawing.Color.White;
this.mainPanel.Controls.Add(this.encryptionKeyPlaceholder);
this.mainPanel.Controls.Add(this.lockPictureBox);
this.mainPanel.Controls.Add(this.fileNameLabel);
this.mainPanel.Controls.Add(this.keyTextBox);
this.mainPanel.Controls.Add(this.showKeyPictureBox);
this.mainPanel.Dock = System.Windows.Forms.DockStyle.Top;
this.mainPanel.Location = new System.Drawing.Point(0, 0);
this.mainPanel.Name = "mainPanel";
this.mainPanel.Size = new System.Drawing.Size(269, 75);
this.mainPanel.TabIndex = 5;
//
// pnlMain
// fileNameLabel
//
this.pnlMain.BackColor = System.Drawing.Color.White;
this.pnlMain.Controls.Add(this.picLock);
this.pnlMain.Controls.Add(this.lblFileName);
this.pnlMain.Controls.Add(this.txtKey);
this.pnlMain.Controls.Add(this.picShowKey);
this.pnlMain.Location = new System.Drawing.Point(0, 0);
this.pnlMain.Name = "pnlMain";
this.pnlMain.Size = new System.Drawing.Size(269, 73);
this.pnlMain.TabIndex = 5;
this.fileNameLabel.AutoEllipsis = true;
this.fileNameLabel.Location = new System.Drawing.Point(61, 12);
this.fileNameLabel.Name = "fileNameLabel";
this.fileNameLabel.Size = new System.Drawing.Size(196, 13);
this.fileNameLabel.TabIndex = 6;
this.fileNameLabel.Text = "File name";
this.fileNameLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// picLock
// encryptionKeyPlaceholder
//
this.picLock.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picLock.Image = global::Crypto_Notepad.Properties.Resources.big_lock;
this.picLock.Location = new System.Drawing.Point(8, 12);
this.picLock.Name = "picLock";
this.picLock.Size = new System.Drawing.Size(47, 47);
this.picLock.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.picLock.TabIndex = 6;
this.picLock.TabStop = false;
this.encryptionKeyPlaceholder.AutoSize = true;
this.encryptionKeyPlaceholder.Cursor = System.Windows.Forms.Cursors.IBeam;
this.encryptionKeyPlaceholder.ForeColor = System.Drawing.Color.DarkGray;
this.encryptionKeyPlaceholder.Location = new System.Drawing.Point(68, 40);
this.encryptionKeyPlaceholder.Name = "encryptionKeyPlaceholder";
this.encryptionKeyPlaceholder.Size = new System.Drawing.Size(82, 13);
this.encryptionKeyPlaceholder.TabIndex = 9;
this.encryptionKeyPlaceholder.Text = "Encryption key";
//
// lblFileName
// lockPictureBox
//
this.lblFileName.AutoEllipsis = true;
this.lblFileName.Location = new System.Drawing.Point(61, 12);
this.lblFileName.Name = "lblFileName";
this.lblFileName.Size = new System.Drawing.Size(196, 13);
this.lblFileName.TabIndex = 6;
this.lblFileName.Text = "Enter the encryption key:";
this.lblFileName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lockPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lockPictureBox.Image = global::Crypto_Notepad.Properties.Resources.key_solid;
this.lockPictureBox.Location = new System.Drawing.Point(8, 12);
this.lockPictureBox.Name = "lockPictureBox";
this.lockPictureBox.Size = new System.Drawing.Size(47, 47);
this.lockPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.lockPictureBox.TabIndex = 6;
this.lockPictureBox.TabStop = false;
//
// showKeyPictureBox
//
this.showKeyPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.showKeyPictureBox.Cursor = System.Windows.Forms.Cursors.Hand;
this.showKeyPictureBox.Image = global::Crypto_Notepad.Properties.Resources.eye_half;
this.showKeyPictureBox.InitialImage = global::Crypto_Notepad.Properties.Resources.eye_half;
this.showKeyPictureBox.Location = new System.Drawing.Point(240, 37);
this.showKeyPictureBox.Name = "showKeyPictureBox";
this.showKeyPictureBox.Size = new System.Drawing.Size(18, 22);
this.showKeyPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.showKeyPictureBox.TabIndex = 3;
this.showKeyPictureBox.TabStop = false;
this.showKeyPictureBox.Click += new System.EventHandler(this.ShowKeyPictureBox_Click);
//
// EnterKeyForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(269, 107);
this.Controls.Add(this.pnlMain);
this.Controls.Add(this.btnOk);
this.ClientSize = new System.Drawing.Size(269, 106);
this.Controls.Add(this.mainPanel);
this.Controls.Add(this.okButton);
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
@ -125,20 +140,21 @@ private void InitializeComponent()
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.EnterKeyForm_FormClosed);
this.Load += new System.EventHandler(this.EnterKeyForm_Load);
this.Shown += new System.EventHandler(this.EnterKeyForm_Shown);
((System.ComponentModel.ISupportInitialize)(this.picShowKey)).EndInit();
this.pnlMain.ResumeLayout(false);
this.pnlMain.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picLock)).EndInit();
this.mainPanel.ResumeLayout(false);
this.mainPanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.lockPictureBox)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.showKeyPictureBox)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnOk;
private System.Windows.Forms.PictureBox picShowKey;
private System.Windows.Forms.Panel pnlMain;
private System.Windows.Forms.Label lblFileName;
private System.Windows.Forms.PictureBox picLock;
public System.Windows.Forms.TextBox txtKey;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.PictureBox showKeyPictureBox;
private System.Windows.Forms.Panel mainPanel;
private System.Windows.Forms.Label fileNameLabel;
private System.Windows.Forms.PictureBox lockPictureBox;
public System.Windows.Forms.TextBox keyTextBox;
private System.Windows.Forms.Label encryptionKeyPlaceholder;
}
}

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Windows.Forms;
namespace Crypto_Notepad
@ -17,27 +17,28 @@ private void EnterKeyForm_FormClosed(object sender, FormClosedEventArgs e)
MainForm main = Owner as MainForm;
if (main.Visible == false)
{
main.trayIcon.Visible = false;
Environment.Exit(0);
}
txtKey.Focus();
keyTextBox.Focus();
}
private void EnterKeyForm_Load(object sender, EventArgs e)
{
lblFileName.Text = PublicVar.openFileName;
fileNameLabel.Text = PublicVar.openFileName;
Properties.Settings settings = Properties.Settings.Default;
TopMost = settings.alwaysOnTop;
}
private void EnterKeyForm_Shown(object sender, EventArgs e)
{
lblFileName.Text = PublicVar.openFileName;
fileNameLabel.Text = PublicVar.openFileName;
}
/*Form Events*/
/*Enter key area*/
private void TxtKey_TextChanged(object sender, EventArgs e)
private void KeyTextBox_TextChanged(object sender, EventArgs e)
{
if (txtKey.Text.Length > 0)
btnOk.Enabled = true;
@ -45,37 +46,38 @@ private void TxtKey_TextChanged(object sender, EventArgs e)
btnOk.Enabled = false;
}
private void TxtKey_KeyDown(object sender, KeyEventArgs e)
private void KeyTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter && btnOk.Enabled)
if (e.KeyCode == Keys.Enter && okButton.Enabled)
{
BtnOk_Click(sender, e);
OkButton_Click(sender, e);
}
}
private void KeyEyeIcon_Click(object sender, EventArgs e)
private void ShowKeyPictureBox_Click(object sender, EventArgs e)
{
if (txtKey.UseSystemPasswordChar)
if (keyTextBox.UseSystemPasswordChar)
{
txtKey.UseSystemPasswordChar = false;
picShowKey.Image = Properties.Resources.eye;
keyTextBox.UseSystemPasswordChar = false;
showKeyPictureBox.Image = Properties.Resources.eye;
}
else
{
txtKey.UseSystemPasswordChar = true;
picShowKey.Image = Properties.Resources.eye_half;
keyTextBox.UseSystemPasswordChar = true;
showKeyPictureBox.Image = Properties.Resources.eye_half;
}
}
/*Enter key area*/
/*Buttons*/
private void BtnOk_Click(object sender, EventArgs e)
private void OkButton_Click(object sender, EventArgs e)
{
TypedPassword.Value = txtKey.Text;
txtKey.Focus();
TypedPassword.Value = keyTextBox.Text;
keyTextBox.Focus();
PublicVar.okPressed = true;
Hide();
}
/*Buttons*/

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
using Crypto_Notepad.Properties;
using Crypto_Notepad.Properties;
using System;
using System.ComponentModel;
using System.Diagnostics;
@ -422,40 +422,40 @@ private async void StatusPanelMessage(string type)
switch (type)
{
case "save":
if (statusLabel.Text != "File Saved")
if (statusPanelLabel.Text != "File Saved")
{
statusLabel.Text = "File Saved";
statusPanelLabel.Text = "File Saved";
await Task.Delay(3000);
statusLabel.Text = ready;
statusPanelLabel.Text = ready;
}
break;
case "update-missing":
statusLabel.Text = "Crypto Notepad is up to date";
statusPanelLabel.Text = "Crypto Notepad is up to date";
await Task.Delay(3000);
statusLabel.Text = ready;
statusPanelLabel.Text = ready;
break;
case "update-failed":
statusLabel.Text = "Checking for updates failed";
statusPanelLabel.Text = "Checking for updates failed";
await Task.Delay(3000);
statusLabel.Text = ready;
statusPanelLabel.Text = ready;
break;
case "update-needed":
statusLabel.Text = "New version is available";
statusPanelLabel.Text = "New version is available";
break;
case "always-top-on":
if (statusLabel.Text != "Always on top ON")
if (statusPanelLabel.Text != "Always on top ON")
{
statusLabel.Text = "Always on top ON";
statusPanelLabel.Text = "Always on top ON";
await Task.Delay(3000);
statusLabel.Text = ready;
statusPanelLabel.Text = ready;
}
break;
case "always-top-off":
if (statusLabel.Text != "Always on top OFF")
if (statusPanelLabel.Text != "Always on top OFF")
{
statusLabel.Text = "Always on top OFF";
statusPanelLabel.Text = "Always on top OFF";
await Task.Delay(3000);
statusLabel.Text = ready;
statusPanelLabel.Text = ready;
}
break;
}
@ -475,10 +475,10 @@ private void StatusPanelTextInfo()
linesCount = 1;
}
lengthStatusLabel.Text = "Length: " + richTextBox.TextLength;
linesStatusLabel.Text = "Lines: " + linesCount;
lnStatusLabel.Text = "Ln: " + currentLine;
colStatusLabel.Text = "Col: " + currentColumn;
statusPanelLengthLabel.Text = "Length: " + richTextBox.TextLength;
statusPaneLinesLabel.Text = "Lines: " + linesCount;
statusPaneLnLabel.Text = "Ln: " + currentLine;
statusPaneColLabel.Text = "Col: " + currentColumn;
}
private void LockFile()
@ -505,12 +505,12 @@ private void LockFile()
DialogResult dialogResult = MessageBox.Show("Invalid key!", PublicVar.appName, MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
if (dialogResult == DialogResult.Retry)
{
txtKey.Text = "";
txtKey.Focus();
fileLockedKeyTextBox.Text = "";
fileLockedKeyTextBox.Focus();
}
if (dialogResult == DialogResult.Cancel)
{
pnlEnterKey.Visible = false;
fileLockedPanel.Visible = false;
Text = PublicVar.appName;
filePath = "";
PublicVar.openFileName = null;
@ -531,17 +531,17 @@ private void LoadSettings()
else
{
richTextBox.RightToLeft = RightToLeft.No;
RTBLineNumbers.Dock = DockStyle.Left;
lineNumbers.Dock = DockStyle.Left;
rightToLeftContextMenu.Checked = false;
}
if (settings.insKey == "Disable")
if (settings.insertKey == "Disable")
{
insMainMenu.ShortcutKeys = Keys.Insert;
insertMainMenu.ShortcutKeys = Keys.Insert;
}
else
{
insMainMenu.ShortcutKeys = Keys.None;
insertMainMenu.ShortcutKeys = Keys.None;
}
if (settings.autoCheckUpdate)
@ -581,9 +581,9 @@ private void LoadSettings()
mainMenu.Visible = settings.mainMenuVisible;
rightToLeftContextMenu.Checked = settings.editorRightToLeft;
RTBLineNumbers.BackColor = settings.lnBackColor;
RTBLineNumbers.Font = settings.editorFont;
RTBLineNumbers.ForeColor = settings.lnForeColor;
lineNumbers.BackColor = settings.lineNumbersBackColor;
lineNumbers.Font = settings.editorFont;
lineNumbers.ForeColor = settings.lineNumbersForeColor;
statusPanel.ForeColor = settings.statusPanelFontColor;
statusPanel.BackColor = settings.statusPanelBackColor;
@ -599,21 +599,21 @@ private void LoadSettings()
searchPanel.ForeColor = settings.searchPanelForeColor;
searchTextBox.BackColor = settings.searchPanelBackColor;
searchTextBox.ForeColor = settings.searchPanelForeColor;
caseSensitiveCheckBox.ForeColor = settings.searchPanelForeColor;
wholeWordCheckBox.ForeColor = settings.searchPanelForeColor;
findNextButton.ForeColor = settings.searchPanelForeColor;
searchCaseSensitiveCheckBox.ForeColor = settings.searchPanelForeColor;
searchWholeWordCheckBox.ForeColor = settings.searchPanelForeColor;
searchFindNextButton.ForeColor = settings.searchPanelForeColor;
RTBLineNumbers.Visible = bool.Parse(settings.lnVisible);
RTBLineNumbers.Show_BorderLines = bool.Parse(settings.blShow);
RTBLineNumbers.Show_GridLines = bool.Parse(settings.glShow);
RTBLineNumbers.Show_MarginLines = bool.Parse(settings.mlVisible);
RTBLineNumbers.GridLines_Color = settings.glColor;
RTBLineNumbers.MarginLines_Color = settings.mlColor;
RTBLineNumbers.BorderLines_Color = settings.blColor;
RTBLineNumbers.BorderLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.blStyle);
RTBLineNumbers.GridLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.glStyle);
RTBLineNumbers.MarginLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.mlStyle);
RTBLineNumbers.MarginLines_Side = (LineNumbers.LineNumbers.LineNumberDockSide)Enum.Parse(typeof(LineNumbers.LineNumbers.LineNumberDockSide), settings.mlSide);
lineNumbers.Visible = bool.Parse(settings.lineNumbersVisible);
lineNumbers.Show_BorderLines = bool.Parse(settings.borderLinesVisible);
lineNumbers.Show_GridLines = bool.Parse(settings.gridLinesVisible);
lineNumbers.Show_MarginLines = bool.Parse(settings.marginLinesVisible);
lineNumbers.GridLines_Color = settings.gridLinesColor;
lineNumbers.MarginLines_Color = settings.marginLinesColor;
lineNumbers.BorderLines_Color = settings.borderLinesColor;
lineNumbers.BorderLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.borderLinesStyle);
lineNumbers.GridLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.gridLinesStyle);
lineNumbers.MarginLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.marginLinesStyle);
lineNumbers.MarginLines_Side = (LineNumbers.LineNumbers.LineNumberDockSide)Enum.Parse(typeof(LineNumbers.LineNumbers.LineNumberDockSide), settings.marginLinesSide);
}
public void MenuIcons(bool menuIcons)
@ -708,14 +708,14 @@ private void MainForm_Resize(object sender, EventArgs e)
if (WindowState == FormWindowState.Minimized & settings.autoLock & PublicVar.encryptionKey.Get() != null)
{
pnlEnterKey.Visible = true;
fileLockedPanel.Visible = true;
}
if (WindowState == FormWindowState.Normal)
{
if (pnlEnterKey.Visible)
if (fileLockedPanel.Visible)
{
txtKey.Focus();
fileLockedKeyTextBox.Focus();
}
}
}
@ -728,7 +728,7 @@ private void MainWindow_Activated(object sender, EventArgs e)
{
richTextBox.Modified = true;
}
RTBLineNumbers.Refresh();
lineNumbers.Refresh();
}
private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
@ -837,7 +837,7 @@ private void RichTextBox_KeyDown(object sender, KeyEventArgs e)
if (e.KeyCode == Keys.Enter & searchPanel.Visible & searchTextBox.Text != "")
{
FindNextButton_Click(this, new EventArgs());
SearchFindNextButton_Click(this, new EventArgs());
e.Handled = e.SuppressKeyPress = true;
}
}
@ -1283,7 +1283,7 @@ private void ChangeKeyMainMenu_Click(object sender, EventArgs e)
private void LockMainMenu_Click(object sender, EventArgs e)
{
SaveMainMenu_Click(this, new EventArgs());
pnlEnterKey.Visible = true;
fileLockedPanel.Visible = true;
}
private void SettingsMainMenu_Click(object sender, EventArgs e)
@ -1389,14 +1389,14 @@ private void RightToLeftContextMenu_Click(object sender, EventArgs e)
richTextBox.Text = rtbTxt;
}
settings.editorRightToLeft = true;
RTBLineNumbers.Dock = DockStyle.Right;
lineNumbers.Dock = DockStyle.Right;
richTextBox.Modified = false;
}
else
{
richTextBox.RightToLeft = RightToLeft.No;
settings.editorRightToLeft = false;
RTBLineNumbers.Dock = DockStyle.Left;
lineNumbers.Dock = DockStyle.Left;
richTextBox.Modified = false;
}
settings.Save();
@ -1550,33 +1550,33 @@ private void SearchTextBox_KeyDown(object sender, KeyEventArgs e)
if (e.KeyCode == Keys.Enter & searchPanel.Visible & searchTextBox.Text != "")
{
FindNextButton_Click(this, new EventArgs());
SearchFindNextButton_Click(this, new EventArgs());
e.Handled = e.SuppressKeyPress = true;
}
}
private void CloseSearchPanel_Click(object sender, EventArgs e)
private void SearchCloseButton_Click(object sender, EventArgs e)
{
FindMainMenu_Click(this, new EventArgs());
}
private void CloseSearchPanel_MouseHover(object sender, EventArgs e)
private void SearchCloseButton_MouseHover(object sender, EventArgs e)
{
closeSearchPanel.Image = Resources.close_b;
searchCloseButton.Image = Resources.close_b;
}
private void CloseSearchPanel_MouseLeave(object sender, EventArgs e)
private void SearchCloseButton_MouseLeave(object sender, EventArgs e)
{
closeSearchPanel.Image = Resources.close_g;
searchCloseButton.Image = Resources.close_g;
}
private void CaseSensitiveCheckBox_CheckedChanged(object sender, EventArgs e)
private void SearchCaseSensitiveCheckBox_CheckedChanged(object sender, EventArgs e)
{
findPos = 0;
richTextBox.DeselectAll();
}
private void WholeWordCheckBox_CheckedChanged(object sender, EventArgs e)
private void SearchWholeWordCheckBox_CheckedChanged(object sender, EventArgs e)
{
findPos = 0;
richTextBox.DeselectAll();
@ -1606,27 +1606,27 @@ private void FindText(string text, RichTextBoxFinds findOptions)
}
}
private void FindNextButton_Click(object sender, EventArgs e)
private void SearchFindNextButton_Click(object sender, EventArgs e)
{
if ((!wholeWordCheckBox.Checked) & (!caseSensitiveCheckBox.Checked))
if ((!searchWholeWordCheckBox.Checked) & (!searchCaseSensitiveCheckBox.Checked))
{
FindText(searchTextBox.Text, RichTextBoxFinds.None);
return;
}
if (wholeWordCheckBox.Checked & caseSensitiveCheckBox.Checked)
if (searchWholeWordCheckBox.Checked & searchCaseSensitiveCheckBox.Checked)
{
FindText(searchTextBox.Text, RichTextBoxFinds.MatchCase | RichTextBoxFinds.WholeWord);
return;
}
if (caseSensitiveCheckBox.Checked)
if (searchCaseSensitiveCheckBox.Checked)
{
FindText(searchTextBox.Text, RichTextBoxFinds.MatchCase);
return;
}
if (wholeWordCheckBox.Checked)
if (searchWholeWordCheckBox.Checked)
{
FindText(searchTextBox.Text, RichTextBoxFinds.WholeWord);
return;
@ -1636,17 +1636,17 @@ private void FindNextButton_Click(object sender, EventArgs e)
#region AutoLock
private void TxtKey_TextChanged(object sender, EventArgs e)
private void FileLockedKeyTextBox_TextChanged(object sender, EventArgs e)
{
if (txtKey.Text.Length > 0)
btnOk.Enabled = true;
if (fileLockedKeyTextBox.Text.Length > 0)
fileLockedOkButton.Enabled = true;
else
btnOk.Enabled = false;
fileLockedOkButton.Enabled = false;
}
private void PnlEnterKey_VisibleChanged(object sender, EventArgs e)
private void FileLockedPanel_VisibleChanged(object sender, EventArgs e)
{
if (pnlEnterKey.Visible)
if (fileLockedPanel.Visible)
{
PublicVar.encryptionKey.Set(null);
caretPos = richTextBox.SelectionStart;
@ -1654,7 +1654,7 @@ private void PnlEnterKey_VisibleChanged(object sender, EventArgs e)
toolbarPanel.Enabled = false;
mainMenu.Enabled = false;
richTextBox.Clear();
txtKey.Focus();
fileLockedKeyTextBox.Focus();
}
else
{
@ -1667,49 +1667,49 @@ private void PnlEnterKey_VisibleChanged(object sender, EventArgs e)
}
private void BtnOk_Click(object sender, EventArgs e)
private void FileLockedOkButton_Click(object sender, EventArgs e)
{
LockFile();
}
private void BtnCloseEnterKey_MouseClick(object sender, MouseEventArgs e)
private void FileLockedCloseButton_MouseClick(object sender, MouseEventArgs e)
{
pnlEnterKey.Visible = false;
fileLockedPanel.Visible = false;
Text = PublicVar.appName;
filePath = null;
PublicVar.openFileName = null;
PublicVar.openFileName = null;
}
private void PicShowKey_Click(object sender, EventArgs e)
private void FileLockedShowKey_Click(object sender, EventArgs e)
{
if (txtKey.UseSystemPasswordChar)
if (fileLockedKeyTextBox.UseSystemPasswordChar)
{
txtKey.UseSystemPasswordChar = false;
picShowKey.Image = Resources.eye;
fileLockedKeyTextBox.UseSystemPasswordChar = false;
fileLockedShowKey.Image = Resources.eye;
}
else
{
txtKey.UseSystemPasswordChar = true;
picShowKey.Image = Resources.eye_half;
}
fileLockedKeyTextBox.UseSystemPasswordChar = true;
fileLockedShowKey.Image = Resources.eye_half;
}
}
private void TxtKey_KeyDown(object sender, KeyEventArgs e)
private void FileLockedKeyTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter & btnOk.Enabled)
if (e.KeyCode == Keys.Enter & fileLockedOkButton.Enabled)
{
BtnOk_Click(sender, e);
FileLockedOkButton_Click(sender, e);
}
}
private void BtnCloseEnterKey_MouseEnter(object sender, EventArgs e)
private void FileLockedCloseButton_MouseEnter(object sender, EventArgs e)
{
btnCloseEnterKey.ForeColor = Color.Silver;
fileLockedCloseButton.ForeColor = Color.Silver;
}
private void BtnCloseEnterKey_MouseLeave(object sender, EventArgs e)
private void FileLockedCloseButton_MouseLeave(object sender, EventArgs e)
{
btnCloseEnterKey.ForeColor = Color.DimGray;
fileLockedCloseButton.ForeColor = Color.DimGray;
}
#endregion
@ -1717,22 +1717,20 @@ private void BtnCloseEnterKey_MouseLeave(object sender, EventArgs e)
#region Tray
private void TrayIcon_MouseDoubleClick(object sender, MouseEventArgs e)
{
Show();
WindowState = FormWindowState.Normal;
}
private void ShowToolStripMenuItem_Click(object sender, EventArgs e)
{
Show();
WindowState = FormWindowState.Normal;
}
private void ExitToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveConfirm(true);
if (settings.closeToTray)
{
Environment.Exit(0);
if (e.Button == MouseButtons.Left) {
Show();
WindowState = FormWindowState.Normal;
}
}
private void TrayMenuShow_Click(object sender, EventArgs e)
{
Show();
WindowState = FormWindowState.Normal;
}
private void TrayMenuExit_Click(object sender, EventArgs e)
{
Application.Exit();
}
#endregion
@ -1746,13 +1744,16 @@ private void VariablesMainMenu_Click(object sender, EventArgs e)
Debug.WriteLine("filePath: " + filePath);
Debug.WriteLine("encryptionKey: " + PublicVar.encryptionKey.Get());
Debug.WriteLine("TypedPassword: " + TypedPassword.Value);
Debug.WriteLine("preventExit: " + preventExit);
Debug.WriteLine("keyChanged: " + PublicVar.keyChanged);
Debug.WriteLine("okPressed: " + PublicVar.okPressed);
Debug.WriteLine("RichTextBox.Modified: " + richTextBox.Modified);
Debug.WriteLine("EditorMenuStrip: " + contextMenu.Enabled);
#endif
}
#endregion

View file

@ -130,7 +130,7 @@
<value>260, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="closeSearchPanel.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<data name="searchCloseButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAABidJREFUaEPt
mE1oVFcUx6WIiBQJIRQRCaVI6CILKV0UKdJF6EKkC+miiJSCjUKIRUyC4EIwYpoQQ0g0UfNhNIlfWSTi
@ -163,7 +163,7 @@
</value>
</data>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>725, 17</value>
<value>331, 56</value>
</metadata>
<data name="lockToolbarButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
@ -322,13 +322,13 @@
</value>
</data>
<metadata name="statusPanel.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>517, 17</value>
<value>123, 56</value>
</metadata>
<metadata name="trayIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>630, 17</value>
<value>236, 56</value>
</metadata>
<metadata name="mnuTray.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>815, 17</value>
<metadata name="trayMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 56</value>
</metadata>
<data name="trayIcon.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
@ -6503,7 +6503,7 @@
</value>
</data>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>725, 17</value>
<value>331, 56</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>55</value>

View file

@ -248,12 +248,12 @@ public bool menuIcons {
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public string lnVisible {
public string lineNumbersVisible {
get {
return ((string)(this["lnVisible"]));
return ((string)(this["lineNumbersVisible"]));
}
set {
this["lnVisible"] = value;
this["lineNumbersVisible"] = value;
}
}
@ -261,12 +261,12 @@ public string lnVisible {
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("240, 240, 240")]
public global::System.Drawing.Color lnBackColor {
public global::System.Drawing.Color lineNumbersBackColor {
get {
return ((global::System.Drawing.Color)(this["lnBackColor"]));
return ((global::System.Drawing.Color)(this["lineNumbersBackColor"]));
}
set {
this["lnBackColor"] = value;
this["lineNumbersBackColor"] = value;
}
}
@ -274,12 +274,12 @@ public string lnVisible {
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("164, 164, 164")]
public global::System.Drawing.Color lnForeColor {
public global::System.Drawing.Color lineNumbersForeColor {
get {
return ((global::System.Drawing.Color)(this["lnForeColor"]));
return ((global::System.Drawing.Color)(this["lineNumbersForeColor"]));
}
set {
this["lnForeColor"] = value;
this["lineNumbersForeColor"] = value;
}
}
@ -287,12 +287,12 @@ public string lnVisible {
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public string blShow {
public string borderLinesVisible {
get {
return ((string)(this["blShow"]));
return ((string)(this["borderLinesVisible"]));
}
set {
this["blShow"] = value;
this["borderLinesVisible"] = value;
}
}
@ -300,12 +300,12 @@ public string blShow {
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("164, 164, 164")]
public global::System.Drawing.Color blColor {
public global::System.Drawing.Color borderLinesColor {
get {
return ((global::System.Drawing.Color)(this["blColor"]));
return ((global::System.Drawing.Color)(this["borderLinesColor"]));
}
set {
this["blColor"] = value;
this["borderLinesColor"] = value;
}
}
@ -313,12 +313,12 @@ public string blShow {
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Solid")]
public string blStyle {
public string borderLinesStyle {
get {
return ((string)(this["blStyle"]));
return ((string)(this["borderLinesStyle"]));
}
set {
this["blStyle"] = value;
this["borderLinesStyle"] = value;
}
}
@ -326,12 +326,12 @@ public string blStyle {
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public string glShow {
public string gridLinesVisible {
get {
return ((string)(this["glShow"]));
return ((string)(this["gridLinesVisible"]));
}
set {
this["glShow"] = value;
this["gridLinesVisible"] = value;
}
}
@ -339,12 +339,12 @@ public string glShow {
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("164, 164, 164")]
public global::System.Drawing.Color glColor {
public global::System.Drawing.Color gridLinesColor {
get {
return ((global::System.Drawing.Color)(this["glColor"]));
return ((global::System.Drawing.Color)(this["gridLinesColor"]));
}
set {
this["glColor"] = value;
this["gridLinesColor"] = value;
}
}
@ -352,12 +352,12 @@ public string glShow {
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Solid")]
public string glStyle {
public string gridLinesStyle {
get {
return ((string)(this["glStyle"]));
return ((string)(this["gridLinesStyle"]));
}
set {
this["glStyle"] = value;
this["gridLinesStyle"] = value;
}
}
@ -365,12 +365,12 @@ public string glStyle {
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Enable")]
public string insKey {
public string insertKey {
get {
return ((string)(this["insKey"]));
return ((string)(this["insertKey"]));
}
set {
this["insKey"] = value;
this["insertKey"] = value;
}
}
@ -561,12 +561,12 @@ public bool oldToolbarIcons {
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public string mlVisible {
public string marginLinesVisible {
get {
return ((string)(this["mlVisible"]));
return ((string)(this["marginLinesVisible"]));
}
set {
this["mlVisible"] = value;
this["marginLinesVisible"] = value;
}
}
@ -574,12 +574,12 @@ public string mlVisible {
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("164, 164, 164")]
public global::System.Drawing.Color mlColor {
public global::System.Drawing.Color marginLinesColor {
get {
return ((global::System.Drawing.Color)(this["mlColor"]));
return ((global::System.Drawing.Color)(this["marginLinesColor"]));
}
set {
this["mlColor"] = value;
this["marginLinesColor"] = value;
}
}
@ -587,12 +587,12 @@ public string mlVisible {
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Right")]
public string mlSide {
public string marginLinesSide {
get {
return ((string)(this["mlSide"]));
return ((string)(this["marginLinesSide"]));
}
set {
this["mlSide"] = value;
this["marginLinesSide"] = value;
}
}
@ -600,12 +600,12 @@ public string mlSide {
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Solid")]
public string mlStyle {
public string marginLinesStyle {
get {
return ((string)(this["mlStyle"]));
return ((string)(this["marginLinesStyle"]));
}
set {
this["mlStyle"] = value;
this["marginLinesStyle"] = value;
}
}

View file

@ -53,34 +53,34 @@
<Setting Name="menuIcons" Provider="PortableSettingsProvider" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="lnVisible" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Setting Name="lineNumbersVisible" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="lnBackColor" Provider="PortableSettingsProvider" Type="System.Drawing.Color" Scope="User">
<Setting Name="lineNumbersBackColor" Provider="PortableSettingsProvider" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)">240, 240, 240</Value>
</Setting>
<Setting Name="lnForeColor" Provider="PortableSettingsProvider" Type="System.Drawing.Color" Scope="User">
<Setting Name="lineNumbersForeColor" Provider="PortableSettingsProvider" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)">164, 164, 164</Value>
</Setting>
<Setting Name="blShow" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Setting Name="borderLinesVisible" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="blColor" Provider="PortableSettingsProvider" Type="System.Drawing.Color" Scope="User">
<Setting Name="borderLinesColor" Provider="PortableSettingsProvider" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)">164, 164, 164</Value>
</Setting>
<Setting Name="blStyle" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Setting Name="borderLinesStyle" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">Solid</Value>
</Setting>
<Setting Name="glShow" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Setting Name="gridLinesVisible" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="glColor" Provider="PortableSettingsProvider" Type="System.Drawing.Color" Scope="User">
<Setting Name="gridLinesColor" Provider="PortableSettingsProvider" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)">164, 164, 164</Value>
</Setting>
<Setting Name="glStyle" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Setting Name="gridLinesStyle" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">Solid</Value>
</Setting>
<Setting Name="insKey" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Setting Name="insertKey" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">Enable</Value>
</Setting>
<Setting Name="customColor" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
@ -125,16 +125,16 @@
<Setting Name="oldToolbarIcons" Provider="PortableSettingsProvider" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="mlVisible" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Setting Name="marginLinesVisible" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="mlColor" Provider="PortableSettingsProvider" Type="System.Drawing.Color" Scope="User">
<Setting Name="marginLinesColor" Provider="PortableSettingsProvider" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)">164, 164, 164</Value>
</Setting>
<Setting Name="mlSide" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Setting Name="marginLinesSide" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">Right</Value>
</Setting>
<Setting Name="mlStyle" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Setting Name="marginLinesStyle" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">Solid</Value>
</Setting>
<Setting Name="minimizeToTray" Provider="PortableSettingsProvider" Type="System.Boolean" Scope="User">

File diff suppressed because it is too large Load diff

View file

@ -22,54 +22,54 @@ public SettingsForm()
/*Methods*/
private void LoadSettings()
{
pnlEditorFontColor.BackColor = settings.editroForeColor;
pnlEditorBackColor.BackColor = settings.editorBackColor;
cbxInsKey.Text = settings.insKey;
txtPaddingLeft.Text = settings.editorPaddingLeft;
cbxOpenLinks.Text = settings.openLinks;
editorFontColor.BackColor = settings.editroForeColor;
editorBackColor.BackColor = settings.editorBackColor;
editorInsertKeyComboBox.Text = settings.insertKey;
editorPaddingLeftTextBox.Text = settings.editorPaddingLeft;
editorOpenLinksWithComboBox.Text = settings.openLinks;
fontDialog.Font = settings.editorFont;
chkAutoLock.Checked = settings.autoLock;
chkUpdates.Checked = settings.autoCheckUpdate;
chkMainMenu.Checked = settings.mainMenuVisible;
chkMenuIcons.Checked = settings.menuIcons;
chkMinimizeToTray.Checked = settings.minimizeToTray;
chkCloseToTray.Checked = settings.closeToTray;
autoLockOnMinimizeCheckBox.Checked = settings.autoLock;
autoCheckUpdatesCheckBox.Checked = settings.autoCheckUpdate;
mainMenuCheckBox.Checked = settings.mainMenuVisible;
menuIconsCheckBox.Checked = settings.menuIcons;
minimizeToTrayCheckBox.Checked = settings.minimizeToTray;
closeToTrayCheckBox.Checked = settings.closeToTray;
chkIntegrate.Checked = settings.explorerIntegrate;
chkAssociate.Checked = settings.explorerAssociate;
chkSendTo.Checked = settings.explorerSendTo;
integrateCheckBox.Checked = settings.explorerIntegrate;
associateCheckBox.Checked = settings.explorerAssociate;
sendToCheckBox.Checked = settings.explorerSendTo;
cboHash.Text = settings.HashAlgorithm;
cboKeySize.Text = settings.KeySize;
txtPwdIterations.Text = settings.PasswordIterations;
hashAlgorithmComboBox.Text = settings.HashAlgorithm;
keySizeComboBox.Text = settings.KeySize;
passwordIterationsTextBox.Text = settings.PasswordIterations;
searchBackColor.BackColor = settings.searchPanelBackColor;
searchFontColor.BackColor = settings.searchPanelForeColor;
toolbarBackColor.BackColor = settings.toolbarBackColor;
toolbarBorder.Checked = settings.toolbarBorder;
toolbarVisible.Checked = settings.toolbarVisible;
toolbarOldIcons.Checked = settings.oldToolbarIcons;
toolbarBorderCheckBox.Checked = settings.toolbarBorder;
toolbarVisibleCheckBox.Checked = settings.toolbarVisible;
toolbarOldIconsCheckBox.Checked = settings.oldToolbarIcons;
statusBackColor.BackColor = settings.statusPanelBackColor;
statusFontColor.BackColor = settings.statusPanelFontColor;
statusPanelVisible.Checked = settings.statusPanelVisible;
statusPanelBackColor.BackColor = settings.statusPanelBackColor;
statusPanelFontColor.BackColor = settings.statusPanelFontColor;
statusPanelVisibleCheckBox.Checked = settings.statusPanelVisible;
LNVisibleComboBox.Text = settings.lnVisible;
LNBackColor.BackColor = settings.lnBackColor;
LNFontColor.BackColor = settings.lnForeColor;
BLShowСomboBox.Text = settings.blShow;
BLColor.BackColor = settings.blColor;
BLStyleComboBox.Text = settings.blStyle;
GLShowComboBox.Text = settings.glShow;
GLColor.BackColor = settings.glColor;
GLStyleComboBox.Text = settings.glStyle;
lineNumbersVisibleComboBox.Text = settings.lineNumbersVisible;
lineNumbersBackColor.BackColor = settings.lineNumbersBackColor;
lineNumbersFontColor.BackColor = settings.lineNumbersForeColor;
borderLinesVisibleСomboBox.Text = settings.borderLinesVisible;
borderLinesColor.BackColor = settings.borderLinesColor;
borderLinesStyleComboBox.Text = settings.borderLinesStyle;
gridLinesVisibleComboBox.Text = settings.gridLinesVisible;
gridLinesColor.BackColor = settings.gridLinesColor;
gridLinesStyleComboBox.Text = settings.gridLinesStyle;
MLVisibleComboBox.Text = settings.mlVisible;
MLColor.BackColor = settings.mlColor;
MLStyleComboBox.Text = settings.mlStyle;
MLSideComboBox.Text = settings.mlSide;
marginLinesVisibleComboBox.Text = settings.marginLinesVisible;
marginLinesColor.BackColor = settings.marginLinesColor;
marginLinesStyleComboBox.Text = settings.marginLinesStyle;
marginLinesSideComboBox.Text = settings.marginLinesSide;
}
private static void AssociateExtension(string applicationExecutablePath, string extension)
@ -166,14 +166,14 @@ private void SettingsForm_Load(object sender, EventArgs e)
settingsTabControl.Appearance = TabAppearance.FlatButtons;
settingsTabControl.ItemSize = new Size(0, 1);
settingsTabControl.SizeMode = TabSizeMode.Fixed;
lstSettingsNav.SelectedIndex = 0;
settingsNavigation.SelectedIndex = 0;
TopMost = settings.alwaysOnTop;
LoadSettings();
}
private void TxtPaddingLeft_Click(object sender, EventArgs e)
private void EditorPaddingLeftTextBox_Click(object sender, EventArgs e)
{
txtPaddingLeft.SelectAll();
editorPaddingLeftTextBox.SelectAll();
}
private void SettingsForm_FormClosed(object sender, FormClosedEventArgs e)
@ -185,7 +185,7 @@ private void SettingsForm_FormClosed(object sender, FormClosedEventArgs e)
{
settings.PasswordIterations = "1";
}
if (string.IsNullOrWhiteSpace(txtPaddingLeft.Text))
if (string.IsNullOrWhiteSpace(editorPaddingLeftTextBox.Text))
{
settings.editorPaddingLeft = "0";
main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0);
@ -198,7 +198,7 @@ private void SettingsForm_FormClosed(object sender, FormClosedEventArgs e)
/*Settings Section*/
private void EditorFontColor_Click(object sender, EventArgs e)
{
colorDialog.Color = pnlEditorFontColor.BackColor;
colorDialog.Color = editorFontColor.BackColor;
using (new CenterWinDialog(this))
{
if (colorDialog.ShowDialog() == DialogResult.OK)
@ -207,13 +207,13 @@ private void EditorFontColor_Click(object sender, EventArgs e)
main.richTextBox.ForeColor = colorDialog.Color;
main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0);
settings.editroForeColor = colorDialog.Color;
pnlEditorFontColor.BackColor = colorDialog.Color;
editorFontColor.BackColor = colorDialog.Color;
}
}
}
private void EditorBGColor_Click(object sender, EventArgs e)
private void EditorBackColor_Click(object sender, EventArgs e)
{
colorDialog.Color = pnlEditorBackColor.BackColor;
colorDialog.Color = editorBackColor.BackColor;
using (new CenterWinDialog(this))
{
if (colorDialog.ShowDialog() == DialogResult.OK)
@ -222,74 +222,74 @@ private void EditorBGColor_Click(object sender, EventArgs e)
main.richTextBox.BackColor = colorDialog.Color;
main.BackColor = colorDialog.Color;
settings.editorBackColor = colorDialog.Color;
pnlEditorBackColor.BackColor = colorDialog.Color;
editorBackColor.BackColor = colorDialog.Color;
}
}
}
private void LNBackColor_Click(object sender, EventArgs e)
private void LineNumbersBackColor_Click(object sender, EventArgs e)
{
colorDialog.Color = LNBackColor.BackColor;
colorDialog.Color = lineNumbersBackColor.BackColor;
using (new CenterWinDialog(this))
{
if (colorDialog.ShowDialog() == DialogResult.OK)
{
MainForm main = Owner as MainForm;
main.RTBLineNumbers.BackColor = colorDialog.Color;
LNBackColor.BackColor = colorDialog.Color;
settings.lnBackColor = colorDialog.Color;
main.lineNumbers.BackColor = colorDialog.Color;
lineNumbersBackColor.BackColor = colorDialog.Color;
settings.lineNumbersBackColor = colorDialog.Color;
}
}
}
private void LNFontColor_Click(object sender, EventArgs e)
private void LineNumbersFontColor_Click(object sender, EventArgs e)
{
colorDialog.Color = LNFontColor.BackColor;
colorDialog.Color = lineNumbersFontColor.BackColor;
using (new CenterWinDialog(this))
{
if (colorDialog.ShowDialog() == DialogResult.OK)
{
MainForm main = Owner as MainForm;
main.RTBLineNumbers.ForeColor = colorDialog.Color;
LNFontColor.BackColor = colorDialog.Color;
settings.lnForeColor = colorDialog.Color;
main.lineNumbers.ForeColor = colorDialog.Color;
lineNumbersFontColor.BackColor = colorDialog.Color;
settings.lineNumbersForeColor = colorDialog.Color;
}
}
}
private void BLColor_Click(object sender, EventArgs e)
private void BorderLinesColor_Click(object sender, EventArgs e)
{
colorDialog.Color = BLColor.BackColor;
colorDialog.Color = borderLinesColor.BackColor;
using (new CenterWinDialog(this))
{
if (colorDialog.ShowDialog() == DialogResult.OK)
{
MainForm main = Owner as MainForm;
main.RTBLineNumbers.BorderLines_Color = colorDialog.Color;
BLColor.BackColor = colorDialog.Color;
settings.blColor = colorDialog.Color;
main.lineNumbers.BorderLines_Color = colorDialog.Color;
borderLinesColor.BackColor = colorDialog.Color;
settings.borderLinesColor = colorDialog.Color;
}
}
}
private void GLColor_Click(object sender, EventArgs e)
private void GridLinesColor_Click(object sender, EventArgs e)
{
colorDialog.Color = GLColor.BackColor;
colorDialog.Color = gridLinesColor.BackColor;
using (new CenterWinDialog(this))
{
if (colorDialog.ShowDialog() == DialogResult.OK)
{
MainForm main = Owner as MainForm;
main.RTBLineNumbers.GridLines_Color = colorDialog.Color;
GLColor.BackColor = colorDialog.Color;
settings.glColor = colorDialog.Color;
main.lineNumbers.GridLines_Color = colorDialog.Color;
gridLinesColor.BackColor = colorDialog.Color;
settings.gridLinesColor = colorDialog.Color;
}
}
}
private void LstSettingsNav_Click(object sender, EventArgs e)
private void SettingsNavigation_Click(object sender, EventArgs e)
{
switch (lstSettingsNav.SelectedIndex)
switch (settingsNavigation.SelectedIndex)
{
case 0:
settingsTabControl.SelectedTab = editorTabPage;
@ -325,18 +325,18 @@ private void SettingsTabControl_SelectedIndexChanged(object sender, EventArgs e)
settingsTabControl.Focus();
}
private void ToolbarVisible_Click(object sender, EventArgs e)
private void ToolbarVisibleCheckBox_Click(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
main.toolbarPanel.Visible = toolbarVisible.Checked;
main.RTBLineNumbers.Height = 1;
main.toolbarPanel.Visible = toolbarVisibleCheckBox.Checked;
main.lineNumbers.Height = 1;
main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0);
settings.toolbarVisible= toolbarVisible.Checked;
settings.toolbarVisible= toolbarVisibleCheckBox.Checked;
}
private void AssociateCheckBox_Click(object sender, EventArgs e)
{
if (chkAssociate.Checked)
if (associateCheckBox.Checked)
{
AssociateExtension(Assembly.GetEntryAssembly().Location, "cnp");
}
@ -344,13 +344,13 @@ private void AssociateCheckBox_Click(object sender, EventArgs e)
{
DissociateExtension(Assembly.GetEntryAssembly().Location, "cnp");
}
settings.explorerAssociate = chkAssociate.Checked;
settings.explorerAssociate = associateCheckBox.Checked;
}
private void IntegrateCheckBox_Click(object sender, EventArgs e)
{
if (chkIntegrate.Checked)
if (integrateCheckBox.Checked)
{
MenuIntegrate("enable");
}
@ -358,26 +358,27 @@ private void IntegrateCheckBox_Click(object sender, EventArgs e)
{
MenuIntegrate("disable");
}
settings.explorerIntegrate = chkIntegrate.Checked;
settings.explorerIntegrate = integrateCheckBox.Checked;
}
private void TxtPaddingLeft_TextChanged(object sender, EventArgs e)
private void EditorPaddingLeftTextBox_TextChanged(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
if (txtPaddingLeft.Text.Length >= 1)
if (editorPaddingLeftTextBox.Text.Length >= 1)
{
if (settings.editorPaddingLeft != txtPaddingLeft.Text)
if (settings.editorPaddingLeft != editorPaddingLeftTextBox.Text)
{
main.richTextBox.SetInnerMargins(Convert.ToInt32(txtPaddingLeft.Text), 0, 0, 0);
main.richTextBox.SetInnerMargins(Convert.ToInt32(editorPaddingLeftTextBox.Text), 0, 0, 0);
main.richTextBox.Refresh();
settings.editorPaddingLeft = txtPaddingLeft.Text;
settings.editorPaddingLeft = editorPaddingLeftTextBox.Text;
}
}
}
}
private void SendToCheckBox_Click(object sender, EventArgs e)
{
if (chkSendTo.Checked)
if (sendToCheckBox.Checked)
{
SendToShortcut();
}
@ -389,35 +390,35 @@ private void SendToCheckBox_Click(object sender, EventArgs e)
System.IO.File.Delete(shortcutPath);
}
}
settings.explorerSendTo = chkSendTo.Checked;
settings.explorerSendTo = sendToCheckBox.Checked;
}
private void InsKeyComboBox_DropDownClosed(object sender, EventArgs e)
private void EditorInsertKeyComboBox_DropDownClosed(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
if (settings.insKey != cbxInsKey.Text)
if (settings.insertKey != editorInsertKeyComboBox.Text)
{
if (cbxInsKey.Text == "Disable")
if (editorInsertKeyComboBox.Text == "Disable")
{
main.insMainMenu.ShortcutKeys = Keys.Insert;
main.insertMainMenu.ShortcutKeys = Keys.Insert;
}
else
{
main.insMainMenu.ShortcutKeys = Keys.None;
main.insertMainMenu.ShortcutKeys = Keys.None;
}
settings.insKey = cbxInsKey.Text;
settings.insertKey = editorInsertKeyComboBox.Text;
}
}
private void MenuIconsCheckBox_Click(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
settings.menuIcons = chkMenuIcons.Checked;
main.MenuIcons(settings.menuIcons);
settings.menuIcons = menuIconsCheckBox.Checked;
main.MenuIcons(settings.menuIcons);
}
private void BtnFont_Click(object sender, EventArgs e)
private void EditorFontButton_Click(object sender, EventArgs e)
{
using (new CenterWinDialog(this))
{
@ -425,115 +426,115 @@ private void BtnFont_Click(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
main.richTextBox.Font = fontDialog.Font;
main.RTBLineNumbers.Font = fontDialog.Font;
main.lineNumbers.Font = fontDialog.Font;
main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0);
}
}
}
private void LNVisibleComboBox_DropDownClosed(object sender, EventArgs e)
private void LineNumbersVisibleComboBox_DropDownClosed(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
if (settings.lnVisible != LNVisibleComboBox.Text)
if (settings.lineNumbersVisible != lineNumbersVisibleComboBox.Text)
{
settings.lnVisible = LNVisibleComboBox.Text;
main.RTBLineNumbers.Visible = bool.Parse(settings.lnVisible);
main.RTBLineNumbers.Height = 1;
settings.lnVisible = LNVisibleComboBox.Text;
settings.lineNumbersVisible = lineNumbersVisibleComboBox.Text;
main.lineNumbers.Visible = bool.Parse(settings.lineNumbersVisible);
main.lineNumbers.Height = 1;
settings.lineNumbersVisible = lineNumbersVisibleComboBox.Text;
}
}
private void BLShowСomboBox_DropDownClosed(object sender, EventArgs e)
private void BorderLinesVisibleСomboBox_DropDownClosed(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
if (settings.blShow != BLShowСomboBox.Text)
if (settings.borderLinesVisible != borderLinesVisibleСomboBox.Text)
{
settings.blShow = BLShowСomboBox.Text;
main.RTBLineNumbers.Show_BorderLines = bool.Parse(settings.blShow);
settings.borderLinesVisible = borderLinesVisibleСomboBox.Text;
main.lineNumbers.Show_BorderLines = bool.Parse(settings.borderLinesVisible);
}
}
private void BLStyleComboBox_DropDownClosed(object sender, EventArgs e)
private void BorderLinesStyleComboBox_DropDownClosed(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
if (settings.blStyle != BLStyleComboBox.Text)
if (settings.borderLinesStyle != borderLinesStyleComboBox.Text)
{
switch (BLStyleComboBox.Text)
switch (borderLinesStyleComboBox.Text)
{
case "Solid":
settings.blStyle = DashStyle.Solid.ToString();
settings.borderLinesStyle = DashStyle.Solid.ToString();
break;
case "Dash":
settings.blStyle = DashStyle.Dash.ToString();
settings.borderLinesStyle = DashStyle.Dash.ToString();
break;
case "Dot":
settings.blStyle = DashStyle.Dot.ToString();
settings.borderLinesStyle = DashStyle.Dot.ToString();
break;
case "DashDot":
settings.blStyle = DashStyle.DashDot.ToString();
settings.borderLinesStyle = DashStyle.DashDot.ToString();
break;
case "DashDotDot":
settings.blStyle = DashStyle.DashDotDot.ToString();
settings.borderLinesStyle = DashStyle.DashDotDot.ToString();
break;
}
main.RTBLineNumbers.BorderLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.blStyle);
main.lineNumbers.BorderLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.borderLinesStyle);
}
}
private void GLShowComboBox_DropDownClosed(object sender, EventArgs e)
private void GridLinesVisibleComboBox_DropDownClosed(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
if (settings.glShow != GLShowComboBox.Text)
if (settings.gridLinesVisible != gridLinesVisibleComboBox.Text)
{
settings.glShow = GLShowComboBox.Text;
main.RTBLineNumbers.Show_GridLines = bool.Parse(settings.glShow);
settings.gridLinesVisible = gridLinesVisibleComboBox.Text;
main.lineNumbers.Show_GridLines = bool.Parse(settings.gridLinesVisible);
}
}
private void GLStyleComboBox_DropDownClosed(object sender, EventArgs e)
private void GridLinesStyleComboBox_DropDownClosed(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
if (settings.glStyle.ToString() != GLStyleComboBox.Text)
if (settings.gridLinesStyle.ToString() != gridLinesStyleComboBox.Text)
{
switch (GLStyleComboBox.Text)
switch (gridLinesStyleComboBox.Text)
{
case "Solid":
settings.glStyle = DashStyle.Solid.ToString(); ;
settings.gridLinesStyle = DashStyle.Solid.ToString(); ;
break;
case "Dash":
settings.glStyle = DashStyle.Dash.ToString();
settings.gridLinesStyle = DashStyle.Dash.ToString();
break;
case "Dot":
settings.glStyle = DashStyle.Dot.ToString();
settings.gridLinesStyle = DashStyle.Dot.ToString();
break;
case "DashDot":
settings.glStyle = DashStyle.DashDot.ToString();
settings.gridLinesStyle = DashStyle.DashDot.ToString();
break;
case "DashDotDot":
settings.glStyle = DashStyle.DashDotDot.ToString();
settings.gridLinesStyle = DashStyle.DashDotDot.ToString();
break;
}
main.RTBLineNumbers.GridLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.glStyle);
main.lineNumbers.GridLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.gridLinesStyle);
}
}
private void KeySizeComboBox_DropDownClosed(object sender, EventArgs e)
{
if (cboKeySize.Text != settings.KeySize)
if (keySizeComboBox.Text != settings.KeySize)
{
settings.KeySize = cboKeySize.Text;
settings.KeySize = keySizeComboBox.Text;
}
}
private void HashComboBox_DropDownClosed(object sender, EventArgs e)
private void HashAlgorithmComboBox_DropDownClosed(object sender, EventArgs e)
{
if (cboHash.Text != settings.HashAlgorithm)
if (hashAlgorithmComboBox.Text != settings.HashAlgorithm)
{
settings.HashAlgorithm = cboHash.Text;
settings.HashAlgorithm = hashAlgorithmComboBox.Text;
}
}
private void TxtPaddingLeft_KeyPress(object sender, KeyPressEventArgs e)
private void EditorPaddingLeftTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar))
{
@ -541,7 +542,7 @@ private void TxtPaddingLeft_KeyPress(object sender, KeyPressEventArgs e)
}
}
private void PwdIterationsTextBox_KeyPress(object sender, KeyPressEventArgs e)
private void PasswordIterationsTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar))
{
@ -553,37 +554,37 @@ private void FontDialog_Apply(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
main.richTextBox.Font = fontDialog.Font;
main.RTBLineNumbers.Font = fontDialog.Font;
main.lineNumbers.Font = fontDialog.Font;
main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0);
settings.editorFont = fontDialog.Font;
}
private void StatusPanelVisible_Click(object sender, EventArgs e)
private void StatusPanelVisibleCheckBox_Click(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
main.statusPanel.Visible = statusPanelVisible.Checked;
main.richTextBox.SetInnerMargins(Convert.ToInt32(txtPaddingLeft.Text), 0, 0, 0);
settings.statusPanelVisible = statusPanelVisible.Checked;
main.statusPanel.Visible = statusPanelVisibleCheckBox.Checked;
main.richTextBox.SetInnerMargins(Convert.ToInt32(editorPaddingLeftTextBox.Text), 0, 0, 0);
settings.statusPanelVisible = statusPanelVisibleCheckBox.Checked;
}
private void StatusBackColor_Click(object sender, EventArgs e)
private void StatusPanelBackColor_Click(object sender, EventArgs e)
{
colorDialog.Color = statusBackColor.BackColor;
colorDialog.Color = statusPanelBackColor.BackColor;
using (new CenterWinDialog(this))
{
if (colorDialog.ShowDialog() == DialogResult.OK)
{
MainForm main = Owner as MainForm;
main.statusPanel.BackColor = colorDialog.Color;
statusBackColor.BackColor = colorDialog.Color;
statusPanelBackColor.BackColor = colorDialog.Color;
settings.statusPanelBackColor = colorDialog.Color;
}
}
}
private void StatusFontColor_Click(object sender, EventArgs e)
private void StatusPanelFontColor_Click(object sender, EventArgs e)
{
colorDialog.Color = statusFontColor.BackColor;
colorDialog.Color = statusPanelFontColor.BackColor;
using (new CenterWinDialog(this))
{
if (colorDialog.ShowDialog() == DialogResult.OK)
@ -591,7 +592,7 @@ private void StatusFontColor_Click(object sender, EventArgs e)
MainForm main = Owner as MainForm;
main.statusPanel.ForeColor = colorDialog.Color;
main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0);
statusFontColor.BackColor = colorDialog.Color;
statusPanelFontColor.BackColor = colorDialog.Color;
settings.statusPanelFontColor = colorDialog.Color;
}
}
@ -612,10 +613,10 @@ private void ToolbarBackColor_Click(object sender, EventArgs e)
}
}
private void ToolbarBorder_Click(object sender, EventArgs e)
private void ToolbarBorderCheckBox_Click(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
if (toolbarBorder.Checked)
if (toolbarBorderCheckBox.Checked)
{
main.toolbarPanel.BorderStyle = BorderStyle.FixedSingle;
}
@ -623,7 +624,7 @@ private void ToolbarBorder_Click(object sender, EventArgs e)
{
main.toolbarPanel.BorderStyle = BorderStyle.None;
}
settings.toolbarBorder = toolbarBorder.Checked;
settings.toolbarBorder = toolbarBorderCheckBox.Checked;
}
private void SearchBackColor_Click(object sender, EventArgs e)
@ -651,9 +652,9 @@ private void SearchFontColor_Click(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
main.searchTextBox.ForeColor = colorDialog.Color;
main.caseSensitiveCheckBox.ForeColor = colorDialog.Color;
main.wholeWordCheckBox.ForeColor = colorDialog.Color;
main.findNextButton.ForeColor = colorDialog.Color;
main.searchCaseSensitiveCheckBox.ForeColor = colorDialog.Color;
main.searchWholeWordCheckBox.ForeColor = colorDialog.Color;
main.searchFindNextButton.ForeColor = colorDialog.Color;
settings.searchPanelForeColor = colorDialog.Color;
searchFontColor.BackColor = colorDialog.Color;
}
@ -663,7 +664,7 @@ private void SearchFontColor_Click(object sender, EventArgs e)
private void MainMenuCheckBox_Click(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
if (chkMainMenu.Checked)
if (mainMenuCheckBox.Checked)
{
main.mainMenu.Visible = true;
}
@ -671,147 +672,147 @@ private void MainMenuCheckBox_Click(object sender, EventArgs e)
{
main.mainMenu.Visible = false;
}
settings.mainMenuVisible = chkMainMenu.Checked;
settings.mainMenuVisible = mainMenuCheckBox.Checked;
}
private void ToolbarOldIcons_Click(object sender, EventArgs e)
private void ToolbarOldIconsCheckBox_Click(object sender, EventArgs e)
{
settings.oldToolbarIcons = toolbarOldIcons.Checked;
settings.oldToolbarIcons = toolbarOldIconsCheckBox.Checked;
MainForm main = Owner as MainForm;
main.Toolbaricons(settings.oldToolbarIcons);
}
private void CbxOpenLinks_DropDownClosed(object sender, EventArgs e)
private void EditorOpenLinksWithComboBox_DropDownClosed(object sender, EventArgs e)
{
if (settings.openLinks != cbxOpenLinks.Text)
if (settings.openLinks != editorOpenLinksWithComboBox.Text)
{
settings.openLinks = cbxOpenLinks.Text;
}
}
private void AutoLockCheckBox_Click(object sender, EventArgs e)
{
settings.autoLock = chkAutoLock.Checked;
}
private void UpdatesCheckBox_Click(object sender, EventArgs e)
{
settings.autoCheckUpdate = chkUpdates.Checked;
}
private void PwdIterationsTextBox_TextChanged(object sender, EventArgs e)
{
if (txtPwdIterations.Text != settings.PasswordIterations)
{
settings.PasswordIterations = txtPwdIterations.Text;
settings.openLinks = editorOpenLinksWithComboBox.Text;
}
}
private void MLVisibleComboBox_DropDownClosed(object sender, EventArgs e)
private void AutoLockOnMinimizeCheckBox_Click(object sender, EventArgs e)
{
settings.autoLock = autoLockOnMinimizeCheckBox.Checked;
}
private void AutoCheckUpdatesCheckBox_Click(object sender, EventArgs e)
{
settings.autoCheckUpdate = autoCheckUpdatesCheckBox.Checked;
}
private void PasswordIterationsTextBox_TextChanged(object sender, EventArgs e)
{
if (passwordIterationsTextBox.Text != settings.PasswordIterations)
{
settings.PasswordIterations = passwordIterationsTextBox.Text;
}
}
private void MarginLinesVisibleComboBox_DropDownClosed(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
if (settings.mlVisible != MLVisibleComboBox.Text)
if (settings.marginLinesVisible != marginLinesVisibleComboBox.Text)
{
settings.mlVisible = MLVisibleComboBox.Text;
main.RTBLineNumbers.Show_MarginLines = bool.Parse(settings.mlVisible);
settings.marginLinesVisible = marginLinesVisibleComboBox.Text;
main.lineNumbers.Show_MarginLines = bool.Parse(settings.marginLinesVisible);
}
}
private void MLSideComboBox_DropDownClosed(object sender, EventArgs e)
private void MarginLinesSideComboBox_DropDownClosed(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
if (settings.mlSide.ToString() != MLSideComboBox.Text)
if (settings.marginLinesSide.ToString() != marginLinesSideComboBox.Text)
{
switch (MLSideComboBox.Text)
switch (marginLinesSideComboBox.Text)
{
case "None":
settings.mlSide = LineNumbers.LineNumbers.LineNumberDockSide.None.ToString();
settings.marginLinesSide = LineNumbers.LineNumbers.LineNumberDockSide.None.ToString();
break;
case "Left":
settings.mlSide = LineNumbers.LineNumbers.LineNumberDockSide.Left.ToString();
settings.marginLinesSide = LineNumbers.LineNumbers.LineNumberDockSide.Left.ToString();
break;
case "Right":
settings.mlSide = LineNumbers.LineNumbers.LineNumberDockSide.Right.ToString();
settings.marginLinesSide = LineNumbers.LineNumbers.LineNumberDockSide.Right.ToString();
break;
case "Height":
settings.mlSide = LineNumbers.LineNumbers.LineNumberDockSide.Height.ToString();
settings.marginLinesSide = LineNumbers.LineNumbers.LineNumberDockSide.Height.ToString();
break;
}
main.RTBLineNumbers.MarginLines_Side = (LineNumbers.LineNumbers.LineNumberDockSide)Enum.Parse(typeof(LineNumbers.LineNumbers.LineNumberDockSide), settings.mlSide);
main.lineNumbers.MarginLines_Side = (LineNumbers.LineNumbers.LineNumberDockSide)Enum.Parse(typeof(LineNumbers.LineNumbers.LineNumberDockSide), settings.marginLinesSide);
}
}
private void MLStyleComboBox_DropDownClosed(object sender, EventArgs e)
private void MarginLinesStyleComboBox_DropDownClosed(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
if (settings.mlStyle != MLStyleComboBox.Text)
if (settings.marginLinesStyle != marginLinesStyleComboBox.Text)
{
switch (MLStyleComboBox.Text)
switch (marginLinesStyleComboBox.Text)
{
case "Solid":
settings.mlStyle = DashStyle.Solid.ToString();
settings.marginLinesStyle = DashStyle.Solid.ToString();
break;
case "Dash":
settings.mlStyle = DashStyle.Dash.ToString();
settings.marginLinesStyle = DashStyle.Dash.ToString();
break;
case "Dot":
settings.mlStyle = DashStyle.Dot.ToString();
settings.marginLinesStyle = DashStyle.Dot.ToString();
break;
case "DashDot":
settings.mlStyle = DashStyle.DashDot.ToString();
settings.marginLinesStyle = DashStyle.DashDot.ToString();
break;
case "DashDotDot":
settings.mlStyle = DashStyle.DashDotDot.ToString();
settings.marginLinesStyle = DashStyle.DashDotDot.ToString();
break;
}
main.RTBLineNumbers.MarginLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.mlStyle);
main.lineNumbers.MarginLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.marginLinesStyle);
}
}
private void MLColor_Click(object sender, EventArgs e)
private void MarginLinesColor_Click(object sender, EventArgs e)
{
colorDialog.Color = MLColor.BackColor;
colorDialog.Color = marginLinesColor.BackColor;
using (new CenterWinDialog(this))
{
if (colorDialog.ShowDialog() == DialogResult.OK)
{
MainForm main = Owner as MainForm;
main.RTBLineNumbers.MarginLines_Color = colorDialog.Color;
MLColor.BackColor = colorDialog.Color;
settings.mlColor = colorDialog.Color;
main.lineNumbers.MarginLines_Color = colorDialog.Color;
marginLinesColor.BackColor = colorDialog.Color;
settings.marginLinesColor = colorDialog.Color;
}
}
}
private void ChkMinimizeToTray_Click(object sender, EventArgs e)
private void MinimizeToTrayCheckBox_Click(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
if (chkCloseToTray.Checked == false & chkMinimizeToTray.Checked == false)
if (closeToTrayCheckBox.Checked == false & minimizeToTrayCheckBox.Checked == false)
{
main.trayIcon.Visible = false;
}
if (chkMinimizeToTray.Checked == true)
if (minimizeToTrayCheckBox.Checked == true)
{
main.trayIcon.Visible = true;
}
settings.minimizeToTray = chkMinimizeToTray.Checked;
settings.minimizeToTray = minimizeToTrayCheckBox.Checked;
}
private void ChkCloseToTray_Click(object sender, EventArgs e)
private void CloseToTrayCheckBox_Click(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
if (chkCloseToTray.Checked == false & chkMinimizeToTray.Checked ==false )
if (closeToTrayCheckBox.Checked == false & minimizeToTrayCheckBox.Checked ==false )
{
main.trayIcon.Visible = false;
}
if (chkCloseToTray.Checked == true)
if (closeToTrayCheckBox.Checked == true)
{
main.trayIcon.Visible = true;
}
settings.closeToTray = chkCloseToTray.Checked;
settings.closeToTray = closeToTrayCheckBox.Checked;
}
/*Settings Section*/

View file

@ -121,7 +121,7 @@
<value>17, 17</value>
</metadata>
<metadata name="fontDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>115, 17</value>
<value>131, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>76</value>