Disabled ability to copy text when double clicking on some labels

This commit is contained in:
Alexander 2019-10-18 17:30:36 +03:00
parent 7d724959af
commit d3429e6843
4 changed files with 44 additions and 25 deletions

View file

@ -34,10 +34,10 @@ private void InitializeComponent()
this.mainPanel = new System.Windows.Forms.Panel(); this.mainPanel = new System.Windows.Forms.Panel();
this.oldKeyPlaceholder = new System.Windows.Forms.Label(); this.oldKeyPlaceholder = new System.Windows.Forms.Label();
this.newKeyPlaceholder = 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.lockPictureBox = new System.Windows.Forms.PictureBox();
this.showNewKeyPictureBox = new System.Windows.Forms.PictureBox(); this.showNewKeyPictureBox = new System.Windows.Forms.PictureBox();
this.showOldKeyPictureBox = new System.Windows.Forms.PictureBox(); this.showOldKeyPictureBox = new System.Windows.Forms.PictureBox();
this.statusLabel = new System.Windows.Forms.Label();
this.mainPanel.SuspendLayout(); this.mainPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.lockPictureBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.lockPictureBox)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.showNewKeyPictureBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.showNewKeyPictureBox)).BeginInit();
@ -96,6 +96,7 @@ private void InitializeComponent()
// //
this.oldKeyPlaceholder.AutoSize = true; this.oldKeyPlaceholder.AutoSize = true;
this.oldKeyPlaceholder.Cursor = System.Windows.Forms.Cursors.IBeam; this.oldKeyPlaceholder.Cursor = System.Windows.Forms.Cursors.IBeam;
this.oldKeyPlaceholder.Enabled = false;
this.oldKeyPlaceholder.ForeColor = System.Drawing.Color.DarkGray; this.oldKeyPlaceholder.ForeColor = System.Drawing.Color.DarkGray;
this.oldKeyPlaceholder.Location = new System.Drawing.Point(67, 16); this.oldKeyPlaceholder.Location = new System.Drawing.Point(67, 16);
this.oldKeyPlaceholder.Name = "oldKeyPlaceholder"; this.oldKeyPlaceholder.Name = "oldKeyPlaceholder";
@ -108,6 +109,7 @@ private void InitializeComponent()
// //
this.newKeyPlaceholder.AutoSize = true; this.newKeyPlaceholder.AutoSize = true;
this.newKeyPlaceholder.Cursor = System.Windows.Forms.Cursors.IBeam; this.newKeyPlaceholder.Cursor = System.Windows.Forms.Cursors.IBeam;
this.newKeyPlaceholder.Enabled = false;
this.newKeyPlaceholder.ForeColor = System.Drawing.Color.DarkGray; this.newKeyPlaceholder.ForeColor = System.Drawing.Color.DarkGray;
this.newKeyPlaceholder.Location = new System.Drawing.Point(67, 41); this.newKeyPlaceholder.Location = new System.Drawing.Point(67, 41);
this.newKeyPlaceholder.Name = "newKeyPlaceholder"; this.newKeyPlaceholder.Name = "newKeyPlaceholder";
@ -116,17 +118,6 @@ private void InitializeComponent()
this.newKeyPlaceholder.Text = "New key"; this.newKeyPlaceholder.Text = "New key";
this.newKeyPlaceholder.Click += new System.EventHandler(this.NewKeyPlaceholder_Click); this.newKeyPlaceholder.Click += new System.EventHandler(this.NewKeyPlaceholder_Click);
// //
// statusLabel
//
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";
//
// lockPictureBox // lockPictureBox
// //
this.lockPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.lockPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
@ -164,6 +155,17 @@ private void InitializeComponent()
this.showOldKeyPictureBox.TabStop = false; this.showOldKeyPictureBox.TabStop = false;
this.showOldKeyPictureBox.Click += new System.EventHandler(this.ShowOldKeyPictureBox_Click); this.showOldKeyPictureBox.Click += new System.EventHandler(this.ShowOldKeyPictureBox_Click);
// //
// statusLabel
//
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";
//
// ChangeKeyForm // ChangeKeyForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View file

@ -32,9 +32,9 @@ private void InitializeComponent()
this.keyTextBox = new System.Windows.Forms.TextBox(); this.keyTextBox = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button(); this.okButton = new System.Windows.Forms.Button();
this.mainPanel = new System.Windows.Forms.Panel(); this.mainPanel = new System.Windows.Forms.Panel();
this.fileNameLabel = new System.Windows.Forms.Label();
this.encryptionKeyPlaceholder = new System.Windows.Forms.Label(); this.encryptionKeyPlaceholder = new System.Windows.Forms.Label();
this.lockPictureBox = new System.Windows.Forms.PictureBox(); this.lockPictureBox = new System.Windows.Forms.PictureBox();
this.fileNameLabel = new System.Windows.Forms.Label();
this.showKeyPictureBox = new System.Windows.Forms.PictureBox(); this.showKeyPictureBox = new System.Windows.Forms.PictureBox();
this.mainPanel.SuspendLayout(); this.mainPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.lockPictureBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.lockPictureBox)).BeginInit();
@ -76,20 +76,11 @@ private void InitializeComponent()
this.mainPanel.Size = new System.Drawing.Size(269, 75); this.mainPanel.Size = new System.Drawing.Size(269, 75);
this.mainPanel.TabIndex = 5; this.mainPanel.TabIndex = 5;
// //
// fileNameLabel
//
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;
//
// encryptionKeyPlaceholder // encryptionKeyPlaceholder
// //
this.encryptionKeyPlaceholder.AutoSize = true; this.encryptionKeyPlaceholder.AutoSize = true;
this.encryptionKeyPlaceholder.Cursor = System.Windows.Forms.Cursors.IBeam; this.encryptionKeyPlaceholder.Cursor = System.Windows.Forms.Cursors.IBeam;
this.encryptionKeyPlaceholder.Enabled = false;
this.encryptionKeyPlaceholder.ForeColor = System.Drawing.Color.DarkGray; this.encryptionKeyPlaceholder.ForeColor = System.Drawing.Color.DarkGray;
this.encryptionKeyPlaceholder.Location = new System.Drawing.Point(68, 40); this.encryptionKeyPlaceholder.Location = new System.Drawing.Point(68, 40);
this.encryptionKeyPlaceholder.Name = "encryptionKeyPlaceholder"; this.encryptionKeyPlaceholder.Name = "encryptionKeyPlaceholder";
@ -108,6 +99,16 @@ private void InitializeComponent()
this.lockPictureBox.TabIndex = 6; this.lockPictureBox.TabIndex = 6;
this.lockPictureBox.TabStop = false; this.lockPictureBox.TabStop = false;
// //
// fileNameLabel
//
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;
//
// showKeyPictureBox // showKeyPictureBox
// //
this.showKeyPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.showKeyPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;

View file

@ -712,6 +712,8 @@ public void InitializeComponent()
this.searchFindNextButton.TabIndex = 17; this.searchFindNextButton.TabIndex = 17;
this.searchFindNextButton.Text = "Find Next"; this.searchFindNextButton.Text = "Find Next";
this.searchFindNextButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.searchFindNextButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.searchFindNextButton.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.SearchFindNextButton_MouseDoubleClick);
this.searchFindNextButton.MouseEnter += new System.EventHandler(this.SearchFindNextButton_MouseEnter);
this.searchFindNextButton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.SearchFindNextButton_MouseUp); this.searchFindNextButton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.SearchFindNextButton_MouseUp);
// //
// toolbarPanel // toolbarPanel
@ -1062,6 +1064,7 @@ public void InitializeComponent()
this.encryptionKeyPlaceholder.AutoSize = true; this.encryptionKeyPlaceholder.AutoSize = true;
this.encryptionKeyPlaceholder.BackColor = System.Drawing.SystemColors.Window; this.encryptionKeyPlaceholder.BackColor = System.Drawing.SystemColors.Window;
this.encryptionKeyPlaceholder.Cursor = System.Windows.Forms.Cursors.IBeam; this.encryptionKeyPlaceholder.Cursor = System.Windows.Forms.Cursors.IBeam;
this.encryptionKeyPlaceholder.Enabled = false;
this.encryptionKeyPlaceholder.ForeColor = System.Drawing.Color.DarkGray; this.encryptionKeyPlaceholder.ForeColor = System.Drawing.Color.DarkGray;
this.encryptionKeyPlaceholder.Location = new System.Drawing.Point(11, 37); this.encryptionKeyPlaceholder.Location = new System.Drawing.Point(11, 37);
this.encryptionKeyPlaceholder.Name = "encryptionKeyPlaceholder"; this.encryptionKeyPlaceholder.Name = "encryptionKeyPlaceholder";
@ -1076,7 +1079,7 @@ public void InitializeComponent()
this.fileLockedCloseButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(55)))), ((int)(((byte)(55)))), ((int)(((byte)(55))))); this.fileLockedCloseButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(55)))), ((int)(((byte)(55)))), ((int)(((byte)(55)))));
this.fileLockedCloseButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(55)))), ((int)(((byte)(55)))), ((int)(((byte)(55))))); this.fileLockedCloseButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(55)))), ((int)(((byte)(55)))), ((int)(((byte)(55)))));
this.fileLockedCloseButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.fileLockedCloseButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.fileLockedCloseButton.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.fileLockedCloseButton.Font = new System.Drawing.Font("Segoe UI Black", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.fileLockedCloseButton.ForeColor = System.Drawing.Color.DimGray; this.fileLockedCloseButton.ForeColor = System.Drawing.Color.DimGray;
this.fileLockedCloseButton.Location = new System.Drawing.Point(239, -2); this.fileLockedCloseButton.Location = new System.Drawing.Point(239, -2);
this.fileLockedCloseButton.Name = "fileLockedCloseButton"; this.fileLockedCloseButton.Name = "fileLockedCloseButton";

View file

@ -18,9 +18,10 @@ public partial class MainForm : Form
{ {
Settings settings = Settings.Default; Settings settings = Settings.Default;
readonly string[] args = Environment.GetCommandLineArgs(); readonly string[] args = Environment.GetCommandLineArgs();
bool cancelPressed = false; string currentClipboardText;
string filePath = ""; string filePath = "";
string argsPath = ""; string argsPath = "";
bool cancelPressed = false;
int findPos = 0; int findPos = 0;
int caretPos; int caretPos;
@ -1588,6 +1589,16 @@ private void SearchFindNextButton_MouseUp(object sender, MouseEventArgs e)
FindText(searchTextBox.Text, RichTextBoxFinds.WholeWord); FindText(searchTextBox.Text, RichTextBoxFinds.WholeWord);
} }
} }
private void SearchFindNextButton_MouseEnter(object sender, EventArgs e)
{
currentClipboardText = Clipboard.GetText();
}
private void SearchFindNextButton_MouseDoubleClick(object sender, MouseEventArgs e)
{
Clipboard.SetText(currentClipboardText);
}
#endregion #endregion
@ -1738,6 +1749,8 @@ private void VariablesMainMenu_Click(object sender, EventArgs e)
#endif #endif
} }
#endregion #endregion