mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
Moved properties from designer
This commit is contained in:
parent
4df471f076
commit
2c629b44a2
2 changed files with 220 additions and 127 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
using Crypto_Notepad.Properties;
|
using Crypto_Notepad.Properties;
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
@ -558,33 +558,121 @@ private void AutoLock(bool minimize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MenuIcons()
|
private void LoadSettings()
|
||||||
{
|
{
|
||||||
if (settings.menuIcons)
|
if (settings.editorRightToLeft)
|
||||||
{
|
{
|
||||||
newMainMenu.Image = Properties.Resources.document_plus;
|
richTextBox.RightToLeft = RightToLeft.Yes;
|
||||||
openMainMenu.Image = Properties.Resources.folder_open_document;
|
RTBLineNumbers.Dock = DockStyle.Right;
|
||||||
saveMainMenu.Image = Properties.Resources.disk_return_black;
|
rightToLeftContextMenu.Checked = true;
|
||||||
saveAsMainMenu.Image = Properties.Resources.disks_black;
|
}
|
||||||
fileLocationMainMenu.Image = Properties.Resources.folder_horizontal;
|
else
|
||||||
deleteFileMainMenu.Image = Properties.Resources.document_minus;
|
{
|
||||||
exitMainMenu.Image = Properties.Resources.cross_button;
|
richTextBox.RightToLeft = RightToLeft.No;
|
||||||
undoMainMenu.Image = Properties.Resources.arrow_left;
|
RTBLineNumbers.Dock = DockStyle.Left;
|
||||||
redoMainMenu.Image = Properties.Resources.arrow_right;
|
rightToLeftContextMenu.Checked = false;
|
||||||
cutMainMenu.Image = Properties.Resources.scissors;
|
}
|
||||||
copyMainMenu.Image = Properties.Resources.document_copy;
|
|
||||||
pasteMainMenu.Image = Properties.Resources.clipboard;
|
if (settings.insKey == "Disable")
|
||||||
deleteMainMenu.Image = Properties.Resources.minus;
|
{
|
||||||
findMainMenu.Image = Properties.Resources.magnifier;
|
insMainMenu.ShortcutKeys = Keys.Insert;
|
||||||
selectAllMainMenu.Image = Properties.Resources.selection_input;
|
}
|
||||||
wordWrapMainMenu.Image = Properties.Resources.wrap_option;
|
else
|
||||||
clearMainMenu.Image = Properties.Resources.document;
|
{
|
||||||
changeKeyMainMenu.Image = Properties.Resources.key;
|
insMainMenu.ShortcutKeys = Keys.None;
|
||||||
lockMainMenu.Image = Properties.Resources.lock_warning;
|
}
|
||||||
settingsMainMenu.Image = Properties.Resources.gear;
|
|
||||||
docsMainMenu.Image = Properties.Resources.document_text;
|
if (settings.autoCheckUpdate)
|
||||||
updatesMainMenu.Image = Properties.Resources.upload_cloud;
|
{
|
||||||
aboutMainMenu.Image = Properties.Resources.information;
|
CheckForUpdates(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settings.windowLocation.ToString() != "{X=0,Y=0}")
|
||||||
|
{
|
||||||
|
Location = settings.windowLocation;
|
||||||
|
}
|
||||||
|
Size = settings.windowSize;
|
||||||
|
WindowState = settings.windowState;
|
||||||
|
|
||||||
|
if (settings.toolbarBorder)
|
||||||
|
{
|
||||||
|
toolbarPanel.BorderStyle = BorderStyle.FixedSingle;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
toolbarPanel.BorderStyle = BorderStyle.None;
|
||||||
|
}
|
||||||
|
|
||||||
|
wordWrapMainMenu.Checked = settings.editorWrap;
|
||||||
|
|
||||||
|
toolbarPanel.BackColor = settings.toolbarBackColor;
|
||||||
|
toolbarPanel.Visible = settings.toolbarVisible;
|
||||||
|
|
||||||
|
mainMenu.Visible = settings.mainMenuVisible;
|
||||||
|
rightToLeftContextMenu.Checked = settings.editorRightToLeft;
|
||||||
|
|
||||||
|
RTBLineNumbers.BackColor = settings.lnBackColor;
|
||||||
|
RTBLineNumbers.Font = settings.editorFont;
|
||||||
|
RTBLineNumbers.ForeColor = settings.lnForeColor;
|
||||||
|
|
||||||
|
statusPanel.ForeColor = settings.statusPanelFontColor;
|
||||||
|
statusPanel.BackColor = settings.statusPanelBackColor;
|
||||||
|
statusPanel.Visible = settings.statusPanelVisible;
|
||||||
|
|
||||||
|
richTextBox.WordWrap = settings.editorWrap;
|
||||||
|
richTextBox.ForeColor = settings.editroForeColor;
|
||||||
|
richTextBox.BackColor = settings.editorBackColor;
|
||||||
|
richTextBox.Font = settings.editorFont;
|
||||||
|
BackColor = settings.editorBackColor;
|
||||||
|
|
||||||
|
searchPanel.BackColor = settings.searchPanelBackColor;
|
||||||
|
searchPanel.ForeColor = settings.searchPanelForeColor;
|
||||||
|
searchTextBox.BackColor = settings.searchPanelBackColor;
|
||||||
|
searchTextBox.ForeColor = settings.searchPanelForeColor;
|
||||||
|
caseSensitiveCheckBox.ForeColor = settings.searchPanelForeColor;
|
||||||
|
wholeWordCheckBox.ForeColor = settings.searchPanelForeColor;
|
||||||
|
findNextButton.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);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void MenuIcons(bool menuIcons)
|
||||||
|
{
|
||||||
|
if (menuIcons)
|
||||||
|
{
|
||||||
|
newMainMenu.Image = Resources.document_plus;
|
||||||
|
openMainMenu.Image = Resources.folder_open_document;
|
||||||
|
saveMainMenu.Image = Resources.disk_return_black;
|
||||||
|
saveAsMainMenu.Image = Resources.disks_black;
|
||||||
|
fileLocationMainMenu.Image = Resources.folder_horizontal;
|
||||||
|
deleteFileMainMenu.Image = Resources.document_minus;
|
||||||
|
exitMainMenu.Image = Resources.cross_button;
|
||||||
|
undoMainMenu.Image = Resources.arrow_left;
|
||||||
|
redoMainMenu.Image = Resources.arrow_right;
|
||||||
|
cutMainMenu.Image = Resources.scissors;
|
||||||
|
copyMainMenu.Image = Resources.document_copy;
|
||||||
|
pasteMainMenu.Image = Resources.clipboard;
|
||||||
|
deleteMainMenu.Image = Resources.minus;
|
||||||
|
findMainMenu.Image = Resources.magnifier;
|
||||||
|
selectAllMainMenu.Image = Resources.selection_input;
|
||||||
|
wordWrapMainMenu.Image = Resources.wrap_option;
|
||||||
|
clearMainMenu.Image = Resources.document;
|
||||||
|
changeKeyMainMenu.Image = Resources.key;
|
||||||
|
lockMainMenu.Image = Resources.lock_warning;
|
||||||
|
settingsMainMenu.Image = Resources.gear;
|
||||||
|
docsMainMenu.Image = Resources.document_text;
|
||||||
|
updatesMainMenu.Image = Resources.upload_cloud;
|
||||||
|
aboutMainMenu.Image = Resources.information;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -694,57 +782,10 @@ private void MainForm_Shown(object sender, EventArgs e)
|
||||||
private void MainWindow_Load(object sender, EventArgs e)
|
private void MainWindow_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Visible = false;
|
Visible = false;
|
||||||
string pos = settings.windowLocation.ToString();
|
|
||||||
wordWrapMainMenu.Checked = settings.editorWrap;
|
|
||||||
richTextBox.WordWrap = settings.editorWrap;
|
|
||||||
RTBLineNumbers.Visible = bool.Parse(settings.lnVisible);
|
|
||||||
RTBLineNumbers.Show_BorderLines = bool.Parse(settings.blShow);
|
|
||||||
RTBLineNumbers.BorderLines_Color = settings.blColor;
|
|
||||||
RTBLineNumbers.BorderLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.blStyle);
|
|
||||||
RTBLineNumbers.Show_GridLines = bool.Parse(settings.glShow);
|
|
||||||
RTBLineNumbers.GridLines_Color = settings.glColor;
|
|
||||||
RTBLineNumbers.GridLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.glStyle);
|
|
||||||
|
|
||||||
if (settings.editorRightToLeft)
|
LoadSettings();
|
||||||
{
|
|
||||||
richTextBox.RightToLeft = RightToLeft.Yes;
|
|
||||||
RTBLineNumbers.Dock = DockStyle.Right;
|
|
||||||
rightToLeftContextMenu.Checked = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
richTextBox.RightToLeft = RightToLeft.No;
|
|
||||||
RTBLineNumbers.Dock = DockStyle.Left;
|
|
||||||
rightToLeftContextMenu.Checked = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings.insKey == "Disable")
|
|
||||||
{
|
|
||||||
insMainMenu.ShortcutKeys = Keys.Insert;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
insMainMenu.ShortcutKeys = Keys.None;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings.toolbarBorder)
|
|
||||||
{
|
|
||||||
toolbarPanel.BorderStyle = BorderStyle.FixedSingle;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
toolbarPanel.BorderStyle = BorderStyle.None;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings.autoCheckUpdate)
|
|
||||||
{
|
|
||||||
//Thread up = new Thread(() => CheckForUpdates(false));
|
|
||||||
//up.Start();
|
|
||||||
CheckForUpdates(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
MenuIcons();
|
|
||||||
DeleteUpdateFiles();
|
DeleteUpdateFiles();
|
||||||
|
MenuIcons(settings.menuIcons);
|
||||||
Toolbaricons(settings.oldToolbarIcons);
|
Toolbaricons(settings.oldToolbarIcons);
|
||||||
|
|
||||||
if (args.Length == 2) /*drag & drop to executable*/
|
if (args.Length == 2) /*drag & drop to executable*/
|
||||||
|
|
@ -776,13 +817,6 @@ private void MainWindow_Load(object sender, EventArgs e)
|
||||||
ContextMenuEncryptReplace();
|
ContextMenuEncryptReplace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pos != "{X=0,Y=0}")
|
|
||||||
{
|
|
||||||
Location = settings.windowLocation;
|
|
||||||
}
|
|
||||||
Size = settings.windowSize;
|
|
||||||
WindowState = settings.windowState;
|
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
debugMainMenu.Visible = true;
|
debugMainMenu.Visible = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,57 @@ public SettingsForm()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*Functions*/
|
/*Methods*/
|
||||||
|
private void LoadSettings()
|
||||||
|
{
|
||||||
|
editorFontColor.BackColor = settings.editroForeColor;
|
||||||
|
editorBGColor.BackColor = settings.editorBackColor;
|
||||||
|
insKeyComboBox.Text = settings.insKey;
|
||||||
|
paddingLeftTextBox.Text = settings.editorPaddingLeft;
|
||||||
|
linksComboBox.Text = settings.openLinks;
|
||||||
|
fontDialog.Font = settings.editorFont;
|
||||||
|
|
||||||
|
autoLockCheckBox.Checked = settings.autoLock;
|
||||||
|
updatesCheckBox.Checked = settings.autoCheckUpdate;
|
||||||
|
mainMenuCheckBox.Checked = settings.mainMenuVisible;
|
||||||
|
menuIconsCheckBox.Checked = settings.menuIcons;
|
||||||
|
|
||||||
|
integrateCheckBox.Checked = settings.explorerIntegrate;
|
||||||
|
associateCheckBox.Checked = settings.explorerAssociate;
|
||||||
|
sendToCheckBox.Checked = settings.explorerSendTo;
|
||||||
|
|
||||||
|
hashComboBox.Text = settings.HashAlgorithm;
|
||||||
|
keySizeComboBox.Text = settings.KeySize;
|
||||||
|
pwdIterationsTextBox.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;
|
||||||
|
|
||||||
|
statusBackColor.BackColor = settings.statusPanelBackColor;
|
||||||
|
statusFontColor.BackColor = settings.statusPanelFontColor;
|
||||||
|
statusPanelVisible.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;
|
||||||
|
|
||||||
|
MLVisibleComboBox.Text = settings.mlVisible;
|
||||||
|
MLColor.BackColor = settings.mlColor;
|
||||||
|
MLStyleComboBox.Text = settings.mlStyle;
|
||||||
|
MLSideComboBox.Text = settings.mlSide;
|
||||||
|
}
|
||||||
|
|
||||||
private static void AssociateExtension(string applicationExecutablePath, string extension)
|
private static void AssociateExtension(string applicationExecutablePath, string extension)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
@ -101,7 +151,7 @@ private void SendToShortcut()
|
||||||
shortcut.Arguments = "/s";
|
shortcut.Arguments = "/s";
|
||||||
shortcut.Save();
|
shortcut.Save();
|
||||||
}
|
}
|
||||||
/*Functions*/
|
/*Methods*/
|
||||||
|
|
||||||
|
|
||||||
/*Form Events*/
|
/*Form Events*/
|
||||||
|
|
@ -115,6 +165,7 @@ private void SettingsForm_Load(object sender, EventArgs e)
|
||||||
settingsTabControl.ItemSize = new Size(0, 1);
|
settingsTabControl.ItemSize = new Size(0, 1);
|
||||||
settingsTabControl.SizeMode = TabSizeMode.Fixed;
|
settingsTabControl.SizeMode = TabSizeMode.Fixed;
|
||||||
settingsNav.SelectedIndex = 0;
|
settingsNav.SelectedIndex = 0;
|
||||||
|
LoadSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PaddingLeftTextBox_Click(object sender, EventArgs e)
|
private void PaddingLeftTextBox_Click(object sender, EventArgs e)
|
||||||
|
|
@ -152,6 +203,8 @@ private void EditorFontColor_Click(object sender, EventArgs e)
|
||||||
MainForm main = Owner as MainForm;
|
MainForm main = Owner as MainForm;
|
||||||
main.richTextBox.ForeColor = colorDialog.Color;
|
main.richTextBox.ForeColor = colorDialog.Color;
|
||||||
main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0);
|
main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0);
|
||||||
|
settings.editroForeColor = colorDialog.Color;
|
||||||
|
editorFontColor.BackColor = colorDialog.Color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -165,6 +218,8 @@ private void EditorBGColor_Click(object sender, EventArgs e)
|
||||||
MainForm main = Owner as MainForm;
|
MainForm main = Owner as MainForm;
|
||||||
main.richTextBox.BackColor = colorDialog.Color;
|
main.richTextBox.BackColor = colorDialog.Color;
|
||||||
main.BackColor = colorDialog.Color;
|
main.BackColor = colorDialog.Color;
|
||||||
|
settings.editorBackColor = colorDialog.Color;
|
||||||
|
editorBGColor.BackColor = colorDialog.Color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -178,9 +233,10 @@ private void LNBackColor_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MainForm main = Owner as MainForm;
|
MainForm main = Owner as MainForm;
|
||||||
main.RTBLineNumbers.BackColor = colorDialog.Color;
|
main.RTBLineNumbers.BackColor = colorDialog.Color;
|
||||||
|
LNBackColor.BackColor = colorDialog.Color;
|
||||||
|
settings.lnBackColor = colorDialog.Color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LNBackColor.BackColor = colorDialog.Color;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LNFontColor_Click(object sender, EventArgs e)
|
private void LNFontColor_Click(object sender, EventArgs e)
|
||||||
|
|
@ -192,9 +248,10 @@ private void LNFontColor_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MainForm main = Owner as MainForm;
|
MainForm main = Owner as MainForm;
|
||||||
main.RTBLineNumbers.ForeColor = colorDialog.Color;
|
main.RTBLineNumbers.ForeColor = colorDialog.Color;
|
||||||
|
LNFontColor.BackColor = colorDialog.Color;
|
||||||
|
settings.lnForeColor = colorDialog.Color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LNFontColor.BackColor = colorDialog.Color;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BLColor_Click(object sender, EventArgs e)
|
private void BLColor_Click(object sender, EventArgs e)
|
||||||
|
|
@ -206,9 +263,10 @@ private void BLColor_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MainForm main = Owner as MainForm;
|
MainForm main = Owner as MainForm;
|
||||||
main.RTBLineNumbers.BorderLines_Color = colorDialog.Color;
|
main.RTBLineNumbers.BorderLines_Color = colorDialog.Color;
|
||||||
|
BLColor.BackColor = colorDialog.Color;
|
||||||
|
settings.blColor = colorDialog.Color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BLColor.BackColor = colorDialog.Color;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GLColor_Click(object sender, EventArgs e)
|
private void GLColor_Click(object sender, EventArgs e)
|
||||||
|
|
@ -220,9 +278,10 @@ private void GLColor_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MainForm main = Owner as MainForm;
|
MainForm main = Owner as MainForm;
|
||||||
main.RTBLineNumbers.GridLines_Color = colorDialog.Color;
|
main.RTBLineNumbers.GridLines_Color = colorDialog.Color;
|
||||||
|
GLColor.BackColor = colorDialog.Color;
|
||||||
|
settings.glColor = colorDialog.Color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GLColor.BackColor = colorDialog.Color;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SettingsNav_Click(object sender, EventArgs e)
|
private void SettingsNav_Click(object sender, EventArgs e)
|
||||||
|
|
@ -264,19 +323,10 @@ private void SettingsTabControl_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
private void ToolbarVisible_Click(object sender, EventArgs e)
|
private void ToolbarVisible_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MainForm main = Owner as MainForm;
|
MainForm main = Owner as MainForm;
|
||||||
if (main != null)
|
main.toolbarPanel.Visible = toolbarVisible.Checked;
|
||||||
{
|
main.RTBLineNumbers.Height = 1;
|
||||||
if (toolbarVisible.Checked)
|
main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0);
|
||||||
{
|
settings.toolbarVisible= toolbarVisible.Checked;
|
||||||
main.toolbarPanel.Visible = true;
|
|
||||||
main.RTBLineNumbers.Height = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
main.toolbarPanel.Visible = false;
|
|
||||||
}
|
|
||||||
main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AssociateCheckBox_Click(object sender, EventArgs e)
|
private void AssociateCheckBox_Click(object sender, EventArgs e)
|
||||||
|
|
@ -289,6 +339,8 @@ private void AssociateCheckBox_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
DissociateExtension(Assembly.GetEntryAssembly().Location, "cnp");
|
DissociateExtension(Assembly.GetEntryAssembly().Location, "cnp");
|
||||||
}
|
}
|
||||||
|
settings.explorerAssociate = associateCheckBox.Checked;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void IntegrateCheckBox_Click(object sender, EventArgs e)
|
private void IntegrateCheckBox_Click(object sender, EventArgs e)
|
||||||
|
|
@ -301,6 +353,7 @@ private void IntegrateCheckBox_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MenuIntegrate("disable");
|
MenuIntegrate("disable");
|
||||||
}
|
}
|
||||||
|
settings.explorerIntegrate = integrateCheckBox.Checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PaddingLeftTextBox_TextChanged(object sender, EventArgs e)
|
private void PaddingLeftTextBox_TextChanged(object sender, EventArgs e)
|
||||||
|
|
@ -312,6 +365,7 @@ private void PaddingLeftTextBox_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
main.richTextBox.SetInnerMargins(Convert.ToInt32(paddingLeftTextBox.Text), 0, 0, 0);
|
main.richTextBox.SetInnerMargins(Convert.ToInt32(paddingLeftTextBox.Text), 0, 0, 0);
|
||||||
main.richTextBox.Refresh();
|
main.richTextBox.Refresh();
|
||||||
|
settings.editorPaddingLeft = paddingLeftTextBox.Text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -330,25 +384,32 @@ private void SendToCheckBox_Click(object sender, EventArgs e)
|
||||||
System.IO.File.Delete(shortcutPath);
|
System.IO.File.Delete(shortcutPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
settings.explorerSendTo = sendToCheckBox.Checked;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InsKeyComboBox_DropDownClosed(object sender, EventArgs e)
|
private void InsKeyComboBox_DropDownClosed(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MainForm main = Owner as MainForm;
|
MainForm main = Owner as MainForm;
|
||||||
if (insKeyComboBox.Text == "Disable")
|
if (settings.insKey != insKeyComboBox.Text)
|
||||||
{
|
{
|
||||||
main.insMainMenu.ShortcutKeys = Keys.Insert;
|
if (insKeyComboBox.Text == "Disable")
|
||||||
}
|
{
|
||||||
else
|
main.insMainMenu.ShortcutKeys = Keys.Insert;
|
||||||
{
|
}
|
||||||
main.insMainMenu.ShortcutKeys = Keys.None;
|
else
|
||||||
|
{
|
||||||
|
main.insMainMenu.ShortcutKeys = Keys.None;
|
||||||
|
}
|
||||||
|
settings.insKey = insKeyComboBox.Text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MenuIconsCheckBox_Click(object sender, EventArgs e)
|
private void MenuIconsCheckBox_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MainForm main = Owner as MainForm;
|
MainForm main = Owner as MainForm;
|
||||||
main.MenuIcons();
|
settings.menuIcons = menuIconsCheckBox.Checked;
|
||||||
|
main.MenuIcons(settings.menuIcons);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FontButton_Click(object sender, EventArgs e)
|
private void FontButton_Click(object sender, EventArgs e)
|
||||||
|
|
@ -373,6 +434,7 @@ private void LNVisibleComboBox_DropDownClosed(object sender, EventArgs e)
|
||||||
settings.lnVisible = LNVisibleComboBox.Text;
|
settings.lnVisible = LNVisibleComboBox.Text;
|
||||||
main.RTBLineNumbers.Visible = bool.Parse(settings.lnVisible);
|
main.RTBLineNumbers.Visible = bool.Parse(settings.lnVisible);
|
||||||
main.RTBLineNumbers.Height = 1;
|
main.RTBLineNumbers.Height = 1;
|
||||||
|
settings.lnVisible = LNVisibleComboBox.Text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -450,17 +512,9 @@ private void GLStyleComboBox_DropDownClosed(object sender, EventArgs e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PwdIterationsTextBox_Leave(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (pwdIterationsTextBox.Text != settings.PasswordIterations.ToString())
|
|
||||||
{
|
|
||||||
settings.PasswordIterations = pwdIterationsTextBox.Text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void KeySizeComboBox_DropDownClosed(object sender, EventArgs e)
|
private void KeySizeComboBox_DropDownClosed(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (keySizeComboBox.Text != settings.KeySize.ToString())
|
if (keySizeComboBox.Text != settings.KeySize)
|
||||||
{
|
{
|
||||||
settings.KeySize = keySizeComboBox.Text;
|
settings.KeySize = keySizeComboBox.Text;
|
||||||
}
|
}
|
||||||
|
|
@ -496,20 +550,15 @@ private void FontDialog_Apply(object sender, EventArgs e)
|
||||||
main.richTextBox.Font = fontDialog.Font;
|
main.richTextBox.Font = fontDialog.Font;
|
||||||
main.RTBLineNumbers.Font = fontDialog.Font;
|
main.RTBLineNumbers.Font = fontDialog.Font;
|
||||||
main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0);
|
main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0);
|
||||||
|
settings.editorFont = fontDialog.Font;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StatusPanelVisible_Click(object sender, EventArgs e)
|
private void StatusPanelVisible_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MainForm main = Owner as MainForm;
|
MainForm main = Owner as MainForm;
|
||||||
if (statusPanelVisible.Checked)
|
main.statusPanel.Visible = statusPanelVisible.Checked;
|
||||||
{
|
|
||||||
main.statusPanel.Visible = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
main.statusPanel.Visible = false;
|
|
||||||
}
|
|
||||||
main.richTextBox.SetInnerMargins(Convert.ToInt32(paddingLeftTextBox.Text), 0, 0, 0);
|
main.richTextBox.SetInnerMargins(Convert.ToInt32(paddingLeftTextBox.Text), 0, 0, 0);
|
||||||
|
settings.statusPanelVisible = statusPanelVisible.Checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StatusBackColor_Click(object sender, EventArgs e)
|
private void StatusBackColor_Click(object sender, EventArgs e)
|
||||||
|
|
@ -521,6 +570,8 @@ private void StatusBackColor_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MainForm main = Owner as MainForm;
|
MainForm main = Owner as MainForm;
|
||||||
main.statusPanel.BackColor = colorDialog.Color;
|
main.statusPanel.BackColor = colorDialog.Color;
|
||||||
|
statusBackColor.BackColor = colorDialog.Color;
|
||||||
|
settings.statusPanelBackColor = colorDialog.Color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -535,6 +586,8 @@ private void StatusFontColor_Click(object sender, EventArgs e)
|
||||||
MainForm main = Owner as MainForm;
|
MainForm main = Owner as MainForm;
|
||||||
main.statusPanel.ForeColor = colorDialog.Color;
|
main.statusPanel.ForeColor = colorDialog.Color;
|
||||||
main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0);
|
main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0);
|
||||||
|
statusFontColor.BackColor = colorDialog.Color;
|
||||||
|
settings.statusPanelFontColor = colorDialog.Color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -548,6 +601,8 @@ private void ToolbarBackColor_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MainForm main = Owner as MainForm;
|
MainForm main = Owner as MainForm;
|
||||||
main.toolbarPanel.BackColor = colorDialog.Color;
|
main.toolbarPanel.BackColor = colorDialog.Color;
|
||||||
|
settings.toolbarBackColor = colorDialog.Color;
|
||||||
|
toolbarBackColor.BackColor = colorDialog.Color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -558,13 +613,12 @@ private void ToolbarBorder_Click(object sender, EventArgs e)
|
||||||
if (toolbarBorder.Checked)
|
if (toolbarBorder.Checked)
|
||||||
{
|
{
|
||||||
main.toolbarPanel.BorderStyle = BorderStyle.FixedSingle;
|
main.toolbarPanel.BorderStyle = BorderStyle.FixedSingle;
|
||||||
settings.toolbarBorder = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
main.toolbarPanel.BorderStyle = BorderStyle.None;
|
main.toolbarPanel.BorderStyle = BorderStyle.None;
|
||||||
settings.toolbarBorder = false;
|
|
||||||
}
|
}
|
||||||
|
settings.toolbarBorder = toolbarBorder.Checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SearchBackColor_Click(object sender, EventArgs e)
|
private void SearchBackColor_Click(object sender, EventArgs e)
|
||||||
|
|
@ -577,6 +631,8 @@ private void SearchBackColor_Click(object sender, EventArgs e)
|
||||||
MainForm main = Owner as MainForm;
|
MainForm main = Owner as MainForm;
|
||||||
main.searchPanel.BackColor = colorDialog.Color;
|
main.searchPanel.BackColor = colorDialog.Color;
|
||||||
main.searchTextBox.BackColor = colorDialog.Color;
|
main.searchTextBox.BackColor = colorDialog.Color;
|
||||||
|
settings.searchPanelBackColor = colorDialog.Color;
|
||||||
|
searchBackColor.BackColor = colorDialog.Color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -593,6 +649,8 @@ private void SearchFontColor_Click(object sender, EventArgs e)
|
||||||
main.caseSensitiveCheckBox.ForeColor = colorDialog.Color;
|
main.caseSensitiveCheckBox.ForeColor = colorDialog.Color;
|
||||||
main.wholeWordCheckBox.ForeColor = colorDialog.Color;
|
main.wholeWordCheckBox.ForeColor = colorDialog.Color;
|
||||||
main.findNextButton.ForeColor = colorDialog.Color;
|
main.findNextButton.ForeColor = colorDialog.Color;
|
||||||
|
settings.searchPanelForeColor = colorDialog.Color;
|
||||||
|
searchFontColor.BackColor = colorDialog.Color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -608,6 +666,7 @@ private void MainMenuCheckBox_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
main.mainMenu.Visible = false;
|
main.mainMenu.Visible = false;
|
||||||
}
|
}
|
||||||
|
settings.mainMenuVisible = mainMenuCheckBox.Checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ToolbarOldIcons_Click(object sender, EventArgs e)
|
private void ToolbarOldIcons_Click(object sender, EventArgs e)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue