mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
Fixed bug when shortcut keys doesn't work or worked when it's not necessary.
This commit is contained in:
parent
3f2997afa6
commit
6fdb986ba9
2 changed files with 28 additions and 50 deletions
10
Crypto Notepad/Forms/MainForm.Designer.cs
generated
10
Crypto Notepad/Forms/MainForm.Designer.cs
generated
|
|
@ -191,7 +191,6 @@ public void InitializeComponent()
|
||||||
this.fileMainMenu.Name = "fileMainMenu";
|
this.fileMainMenu.Name = "fileMainMenu";
|
||||||
this.fileMainMenu.Size = new System.Drawing.Size(37, 24);
|
this.fileMainMenu.Size = new System.Drawing.Size(37, 24);
|
||||||
this.fileMainMenu.Text = "File";
|
this.fileMainMenu.Text = "File";
|
||||||
this.fileMainMenu.DropDownOpened += new System.EventHandler(this.FileMainMenu_DropDownOpened);
|
|
||||||
//
|
//
|
||||||
// newMainMenu
|
// newMainMenu
|
||||||
//
|
//
|
||||||
|
|
@ -387,11 +386,9 @@ public void InitializeComponent()
|
||||||
//
|
//
|
||||||
// clearClipboardMainMenu
|
// clearClipboardMainMenu
|
||||||
//
|
//
|
||||||
this.clearClipboardMainMenu.Enabled = false;
|
|
||||||
this.clearClipboardMainMenu.Name = "clearClipboardMainMenu";
|
this.clearClipboardMainMenu.Name = "clearClipboardMainMenu";
|
||||||
this.clearClipboardMainMenu.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
|
this.clearClipboardMainMenu.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D)));
|
||||||
| System.Windows.Forms.Keys.C)));
|
this.clearClipboardMainMenu.Size = new System.Drawing.Size(198, 22);
|
||||||
this.clearClipboardMainMenu.Size = new System.Drawing.Size(230, 22);
|
|
||||||
this.clearClipboardMainMenu.Text = "Clear Clipboard";
|
this.clearClipboardMainMenu.Text = "Clear Clipboard";
|
||||||
this.clearClipboardMainMenu.Click += new System.EventHandler(this.ClearClipboardMainMenu_Click);
|
this.clearClipboardMainMenu.Click += new System.EventHandler(this.ClearClipboardMainMenu_Click);
|
||||||
//
|
//
|
||||||
|
|
@ -440,7 +437,6 @@ public void InitializeComponent()
|
||||||
this.toolsMainMenu.Name = "toolsMainMenu";
|
this.toolsMainMenu.Name = "toolsMainMenu";
|
||||||
this.toolsMainMenu.Size = new System.Drawing.Size(46, 24);
|
this.toolsMainMenu.Size = new System.Drawing.Size(46, 24);
|
||||||
this.toolsMainMenu.Text = "Tools";
|
this.toolsMainMenu.Text = "Tools";
|
||||||
this.toolsMainMenu.DropDownOpened += new System.EventHandler(this.ToolsMainMenu_DropDownOpened);
|
|
||||||
//
|
//
|
||||||
// alwaysOnTopMainMenu
|
// alwaysOnTopMainMenu
|
||||||
//
|
//
|
||||||
|
|
@ -472,7 +468,7 @@ public void InitializeComponent()
|
||||||
//
|
//
|
||||||
this.lockMainMenu.Name = "lockMainMenu";
|
this.lockMainMenu.Name = "lockMainMenu";
|
||||||
this.lockMainMenu.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L)));
|
this.lockMainMenu.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L)));
|
||||||
this.lockMainMenu.Size = new System.Drawing.Size(232, 22);
|
this.lockMainMenu.Size = new System.Drawing.Size(241, 22);
|
||||||
this.lockMainMenu.Text = "Lock";
|
this.lockMainMenu.Text = "Lock";
|
||||||
this.lockMainMenu.Click += new System.EventHandler(this.LockMainMenu_Click);
|
this.lockMainMenu.Click += new System.EventHandler(this.LockMainMenu_Click);
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -660,7 +660,7 @@ protected internal void ShortcutKeys(bool shortcutKeys)
|
||||||
deleteMainMenu.ShortcutKeys = Keys.Delete;
|
deleteMainMenu.ShortcutKeys = Keys.Delete;
|
||||||
findMainMenu.ShortcutKeys = Keys.Control | Keys.F;
|
findMainMenu.ShortcutKeys = Keys.Control | Keys.F;
|
||||||
selectAllMainMenu.ShortcutKeys = Keys.Control | Keys.A;
|
selectAllMainMenu.ShortcutKeys = Keys.Control | Keys.A;
|
||||||
clearClipboardMainMenu.ShortcutKeys = Keys.Control | Keys.Shift | Keys.C;
|
clearClipboardMainMenu.ShortcutKeys = Keys.Control | Keys.D;
|
||||||
wordWrapMainMenu.ShortcutKeys = Keys.Control | Keys.W;
|
wordWrapMainMenu.ShortcutKeys = Keys.Control | Keys.W;
|
||||||
readOnlyMainMenu.ShortcutKeys = Keys.Control | Keys.R;
|
readOnlyMainMenu.ShortcutKeys = Keys.Control | Keys.R;
|
||||||
clearMainMenu.ShortcutKeys = Keys.Control | Keys.Delete;
|
clearMainMenu.ShortcutKeys = Keys.Control | Keys.Delete;
|
||||||
|
|
@ -1331,6 +1331,11 @@ private async void SaveAsMainMenu_Click(object sender, EventArgs e)
|
||||||
|
|
||||||
private async void SaveCloseFileMainMenu_Click(object sender, EventArgs e)
|
private async void SaveCloseFileMainMenu_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrEmpty(filePath))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mainMenu.Enabled = false;
|
mainMenu.Enabled = false;
|
||||||
toolbarPanel.Enabled = false;
|
toolbarPanel.Enabled = false;
|
||||||
richTextBox.SuspendDrawing();
|
richTextBox.SuspendDrawing();
|
||||||
|
|
@ -1358,7 +1363,10 @@ private async void SaveCloseFileMainMenu_Click(object sender, EventArgs e)
|
||||||
|
|
||||||
private void OpenFileLocationMainMenu_Click(object sender, EventArgs e)
|
private void OpenFileLocationMainMenu_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Process.Start("explorer.exe", @"/select, " + filePath);
|
if (!string.IsNullOrEmpty(filePath))
|
||||||
|
{
|
||||||
|
Process.Start("explorer.exe", @"/select, " + filePath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DeleteFileToolStripMenuItem_Click(object sender, EventArgs e)
|
private void DeleteFileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
@ -1394,22 +1402,6 @@ private void ExitMainMenu_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Application.Exit();
|
Application.Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FileMainMenu_DropDownOpened(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(filePath))
|
|
||||||
{
|
|
||||||
openFileLocationMainMenu.Enabled = false;
|
|
||||||
deleteFileMainMenu.Enabled = false;
|
|
||||||
saveCloseFileMainMenu.Enabled = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
openFileLocationMainMenu.Enabled = true;
|
|
||||||
deleteFileMainMenu.Enabled = true;
|
|
||||||
saveCloseFileMainMenu.Enabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*File*/
|
/*File*/
|
||||||
|
|
||||||
/*Edit*/
|
/*Edit*/
|
||||||
|
|
@ -1427,15 +1419,6 @@ private void EditMainMenu_DropDownOpened(object sender, EventArgs e)
|
||||||
copyMainMenu.Enabled = false;
|
copyMainMenu.Enabled = false;
|
||||||
deleteMainMenu.Enabled = false;
|
deleteMainMenu.Enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Clipboard.ContainsText())
|
|
||||||
{
|
|
||||||
clearClipboardMainMenu.Enabled = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
clearClipboardMainMenu.Enabled = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UndoMainMenu_Click(object sender, EventArgs e)
|
private void UndoMainMenu_Click(object sender, EventArgs e)
|
||||||
|
|
@ -1510,6 +1493,11 @@ private void SelectAllMainMenu_Click(object sender, EventArgs e)
|
||||||
|
|
||||||
private void ClearClipboardMainMenu_Click(object sender, EventArgs e)
|
private void ClearClipboardMainMenu_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (!Clipboard.ContainsText())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Clipboard.Clear();
|
Clipboard.Clear();
|
||||||
if (statusPanelClipboardProgressBar.Visible)
|
if (statusPanelClipboardProgressBar.Visible)
|
||||||
{
|
{
|
||||||
|
|
@ -1568,28 +1556,22 @@ private void PasswordGeneratorMainMenu_Click(object sender, EventArgs e)
|
||||||
passwordGeneratorFrom.ShowDialog(this);
|
passwordGeneratorFrom.ShowDialog(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ToolsMainMenu_DropDownOpened(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(PublicVar.password.Get()))
|
|
||||||
{
|
|
||||||
changePasswordMainMenu.Enabled = false;
|
|
||||||
lockMainMenu.Enabled = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
changePasswordMainMenu.Enabled = true;
|
|
||||||
lockMainMenu.Enabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ChangePasswordMainMenu_Click(object sender, EventArgs e)
|
private void ChangePasswordMainMenu_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
ChangePasswordForm changePasswordForm = new ChangePasswordForm();
|
if (!string.IsNullOrEmpty(PublicVar.password.Get()))
|
||||||
changePasswordForm.ShowDialog(this);
|
{
|
||||||
|
ChangePasswordForm changePasswordForm = new ChangePasswordForm();
|
||||||
|
changePasswordForm.ShowDialog(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void LockMainMenu_Click(object sender, EventArgs e)
|
private async void LockMainMenu_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrEmpty(PublicVar.password.Get()))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mainMenu.Enabled = false;
|
mainMenu.Enabled = false;
|
||||||
toolbarPanel.Enabled = false;
|
toolbarPanel.Enabled = false;
|
||||||
richTextBox.SuspendDrawing();
|
richTextBox.SuspendDrawing();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue