diff --git a/Crypto Notepad/Form1.Designer.cs b/Crypto Notepad/Form1.Designer.cs index fb1c839..55cc6ec 100644 --- a/Crypto Notepad/Form1.Designer.cs +++ b/Crypto Notepad/Form1.Designer.cs @@ -84,17 +84,41 @@ public void InitializeComponent() this.lineStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.columnStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.pictureBox12 = new System.Windows.Forms.PictureBox(); + this.pictureBox5 = new System.Windows.Forms.PictureBox(); + this.pictureBox2 = new System.Windows.Forms.PictureBox(); + this.pictureBox11 = new System.Windows.Forms.PictureBox(); + this.pictureBox10 = new System.Windows.Forms.PictureBox(); + this.pictureBox9 = new System.Windows.Forms.PictureBox(); + this.pictureBox8 = new System.Windows.Forms.PictureBox(); + this.pictureBox7 = new System.Windows.Forms.PictureBox(); + this.pictureBox6 = new System.Windows.Forms.PictureBox(); + this.pictureBox4 = new System.Windows.Forms.PictureBox(); + this.pictureBox3 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.searchTextBox = new System.Windows.Forms.TextBox(); this.chkMatchCase = new System.Windows.Forms.CheckBox(); this.chkMatchWholeWord = new System.Windows.Forms.CheckBox(); this.panel1 = new System.Windows.Forms.Panel(); + this.panel2 = new System.Windows.Forms.Panel(); this.customRTB = new Crypto_Notepad.CustomRichTextBox(); this.MainMenu.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox12)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox11)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox10)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); this.SuspendLayout(); // // MainMenu @@ -219,6 +243,7 @@ public void InitializeComponent() this.правкаToolStripMenuItem.Name = "правкаToolStripMenuItem"; this.правкаToolStripMenuItem.Size = new System.Drawing.Size(40, 24); this.правкаToolStripMenuItem.Text = "Edit"; + this.правкаToolStripMenuItem.DropDownOpened += new System.EventHandler(this.правкаToolStripMenuItem_DropDownOpened); this.правкаToolStripMenuItem.MouseDown += new System.Windows.Forms.MouseEventHandler(this.правкаToolStripMenuItem_MouseDown); // // отменаToolStripMenuItem @@ -332,14 +357,14 @@ public void InitializeComponent() // changeKeyToolStripMenuItem // this.changeKeyToolStripMenuItem.Name = "changeKeyToolStripMenuItem"; - this.changeKeyToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.changeKeyToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.changeKeyToolStripMenuItem.Text = "Change Key"; this.changeKeyToolStripMenuItem.Click += new System.EventHandler(this.changeKeyToolStripMenuItem_Click); // // settingsToolStripMenuItem // this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; - this.settingsToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.settingsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.settingsToolStripMenuItem.Text = "Settings"; this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click); // @@ -357,7 +382,7 @@ public void InitializeComponent() // this.documentationToolStripMenuItem.Enabled = false; this.documentationToolStripMenuItem.Name = "documentationToolStripMenuItem"; - this.documentationToolStripMenuItem.Size = new System.Drawing.Size(189, 22); + this.documentationToolStripMenuItem.Size = new System.Drawing.Size(187, 22); this.documentationToolStripMenuItem.Text = "Documentation"; this.documentationToolStripMenuItem.Click += new System.EventHandler(this.documentationToolStripMenuItem_Click); // @@ -365,13 +390,13 @@ public void InitializeComponent() // this.сheckForUpdatesToolStripMenuItem.Enabled = false; this.сheckForUpdatesToolStripMenuItem.Name = "сheckForUpdatesToolStripMenuItem"; - this.сheckForUpdatesToolStripMenuItem.Size = new System.Drawing.Size(189, 22); - this.сheckForUpdatesToolStripMenuItem.Text = "Сheck For Updates..."; + this.сheckForUpdatesToolStripMenuItem.Size = new System.Drawing.Size(187, 22); + this.сheckForUpdatesToolStripMenuItem.Text = "Сheck for Updates..."; // // оПрограммеToolStripMenuItem // this.оПрограммеToolStripMenuItem.Name = "оПрограммеToolStripMenuItem"; - this.оПрограммеToolStripMenuItem.Size = new System.Drawing.Size(189, 22); + this.оПрограммеToolStripMenuItem.Size = new System.Drawing.Size(187, 22); this.оПрограммеToolStripMenuItem.Text = "About"; this.оПрограммеToolStripMenuItem.Click += new System.EventHandler(this.оПрограммеToolStripMenuItem_Click); // @@ -534,27 +559,175 @@ public void InitializeComponent() this.columnStripStatusLabel.Size = new System.Drawing.Size(56, 17); this.columnStripStatusLabel.Text = "Column:"; // + // pictureBox12 + // + this.pictureBox12.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.pictureBox12.Cursor = System.Windows.Forms.Cursors.Hand; + this.pictureBox12.Image = global::Crypto_Notepad.Properties.Resources.close_g; + this.pictureBox12.Location = new System.Drawing.Point(670, 5); + this.pictureBox12.Name = "pictureBox12"; + this.pictureBox12.Size = new System.Drawing.Size(14, 14); + this.pictureBox12.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.pictureBox12.TabIndex = 14; + this.pictureBox12.TabStop = false; + this.toolTip1.SetToolTip(this.pictureBox12, "Hide Toolbar"); + this.pictureBox12.Click += new System.EventHandler(this.pictureBox12_Click); + this.pictureBox12.MouseEnter += new System.EventHandler(this.pictureBox12_MouseEnter); + this.pictureBox12.MouseLeave += new System.EventHandler(this.pictureBox12_MouseLeave); + // + // pictureBox5 + // + this.pictureBox5.Cursor = System.Windows.Forms.Cursors.Hand; + this.pictureBox5.Image = global::Crypto_Notepad.Properties.Resources.setting_tools; + this.pictureBox5.Location = new System.Drawing.Point(235, 3); + this.pictureBox5.Name = "pictureBox5"; + this.pictureBox5.Size = new System.Drawing.Size(16, 16); + this.pictureBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox5.TabIndex = 15; + this.pictureBox5.TabStop = false; + this.toolTip1.SetToolTip(this.pictureBox5, "Settings"); + this.pictureBox5.Click += new System.EventHandler(this.pictureBox5_Click); + // + // pictureBox2 + // + this.pictureBox2.Cursor = System.Windows.Forms.Cursors.Hand; + this.pictureBox2.Image = global::Crypto_Notepad.Properties.Resources.page_white_add; + this.pictureBox2.Location = new System.Drawing.Point(10, 3); + this.pictureBox2.Name = "pictureBox2"; + this.pictureBox2.Size = new System.Drawing.Size(16, 16); + this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox2.TabIndex = 15; + this.pictureBox2.TabStop = false; + this.toolTip1.SetToolTip(this.pictureBox2, "New"); + this.pictureBox2.Click += new System.EventHandler(this.pictureBox2_Click); + // + // pictureBox11 + // + this.pictureBox11.Cursor = System.Windows.Forms.Cursors.Hand; + this.pictureBox11.Image = global::Crypto_Notepad.Properties.Resources.page_white_key; + this.pictureBox11.Location = new System.Drawing.Point(210, 3); + this.pictureBox11.Name = "pictureBox11"; + this.pictureBox11.Size = new System.Drawing.Size(16, 16); + this.pictureBox11.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox11.TabIndex = 15; + this.pictureBox11.TabStop = false; + this.toolTip1.SetToolTip(this.pictureBox11, "Change Key"); + this.pictureBox11.Click += new System.EventHandler(this.pictureBox11_Click); + // + // pictureBox10 + // + this.pictureBox10.Cursor = System.Windows.Forms.Cursors.Hand; + this.pictureBox10.Image = global::Crypto_Notepad.Properties.Resources.paste_plain; + this.pictureBox10.Location = new System.Drawing.Point(185, 3); + this.pictureBox10.Name = "pictureBox10"; + this.pictureBox10.Size = new System.Drawing.Size(16, 16); + this.pictureBox10.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox10.TabIndex = 15; + this.pictureBox10.TabStop = false; + this.toolTip1.SetToolTip(this.pictureBox10, "Paste"); + this.pictureBox10.Click += new System.EventHandler(this.pictureBox10_Click); + // + // pictureBox9 + // + this.pictureBox9.Cursor = System.Windows.Forms.Cursors.Hand; + this.pictureBox9.Image = global::Crypto_Notepad.Properties.Resources.page_white_copy; + this.pictureBox9.Location = new System.Drawing.Point(160, 3); + this.pictureBox9.Name = "pictureBox9"; + this.pictureBox9.Size = new System.Drawing.Size(16, 16); + this.pictureBox9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox9.TabIndex = 15; + this.pictureBox9.TabStop = false; + this.toolTip1.SetToolTip(this.pictureBox9, "Copy"); + this.pictureBox9.Click += new System.EventHandler(this.pictureBox9_Click); + // + // pictureBox8 + // + this.pictureBox8.Cursor = System.Windows.Forms.Cursors.Hand; + this.pictureBox8.Image = global::Crypto_Notepad.Properties.Resources.cut_red; + this.pictureBox8.Location = new System.Drawing.Point(135, 3); + this.pictureBox8.Name = "pictureBox8"; + this.pictureBox8.Size = new System.Drawing.Size(16, 16); + this.pictureBox8.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox8.TabIndex = 15; + this.pictureBox8.TabStop = false; + this.toolTip1.SetToolTip(this.pictureBox8, "Cut"); + this.pictureBox8.Click += new System.EventHandler(this.pictureBox8_Click); + // + // pictureBox7 + // + this.pictureBox7.Cursor = System.Windows.Forms.Cursors.Hand; + this.pictureBox7.Image = global::Crypto_Notepad.Properties.Resources.page_white_delete; + this.pictureBox7.Location = new System.Drawing.Point(110, 3); + this.pictureBox7.Name = "pictureBox7"; + this.pictureBox7.Size = new System.Drawing.Size(16, 16); + this.pictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox7.TabIndex = 15; + this.pictureBox7.TabStop = false; + this.toolTip1.SetToolTip(this.pictureBox7, "Delete File"); + this.pictureBox7.Click += new System.EventHandler(this.pictureBox7_Click); + // + // pictureBox6 + // + this.pictureBox6.Cursor = System.Windows.Forms.Cursors.Hand; + this.pictureBox6.Image = global::Crypto_Notepad.Properties.Resources.folder_stand; + this.pictureBox6.Location = new System.Drawing.Point(85, 3); + this.pictureBox6.Name = "pictureBox6"; + this.pictureBox6.Size = new System.Drawing.Size(16, 16); + this.pictureBox6.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox6.TabIndex = 15; + this.pictureBox6.TabStop = false; + this.toolTip1.SetToolTip(this.pictureBox6, "Open File Location"); + this.pictureBox6.Click += new System.EventHandler(this.pictureBox6_Click); + // + // pictureBox4 + // + this.pictureBox4.Cursor = System.Windows.Forms.Cursors.Hand; + this.pictureBox4.Image = global::Crypto_Notepad.Properties.Resources.diskette; + this.pictureBox4.Location = new System.Drawing.Point(60, 3); + this.pictureBox4.Name = "pictureBox4"; + this.pictureBox4.Size = new System.Drawing.Size(16, 16); + this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox4.TabIndex = 15; + this.pictureBox4.TabStop = false; + this.toolTip1.SetToolTip(this.pictureBox4, "Save"); + this.pictureBox4.Click += new System.EventHandler(this.pictureBox4_Click); + // + // pictureBox3 + // + this.pictureBox3.Cursor = System.Windows.Forms.Cursors.Hand; + this.pictureBox3.Image = global::Crypto_Notepad.Properties.Resources.folder_vertical_document; + this.pictureBox3.Location = new System.Drawing.Point(35, 3); + this.pictureBox3.Name = "pictureBox3"; + this.pictureBox3.Size = new System.Drawing.Size(16, 16); + this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox3.TabIndex = 15; + this.pictureBox3.TabStop = false; + this.toolTip1.SetToolTip(this.pictureBox3, "Open"); + this.pictureBox3.Click += new System.EventHandler(this.pictureBox3_Click); + // // pictureBox1 // this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.pictureBox1.Cursor = System.Windows.Forms.Cursors.Hand; - this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); + this.pictureBox1.Image = global::Crypto_Notepad.Properties.Resources.close_g; this.pictureBox1.Location = new System.Drawing.Point(670, 7); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(14, 14); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.pictureBox1.TabIndex = 14; this.pictureBox1.TabStop = false; - this.toolTip1.SetToolTip(this.pictureBox1, "Close"); + this.toolTip1.SetToolTip(this.pictureBox1, "Close Search"); this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click); + this.pictureBox1.MouseLeave += new System.EventHandler(this.pictureBox1_MouseLeave); + this.pictureBox1.MouseHover += new System.EventHandler(this.pictureBox1_MouseHover); // // searchTextBox // this.searchTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.searchTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.searchTextBox.Location = new System.Drawing.Point(496, 3); + this.searchTextBox.Location = new System.Drawing.Point(490, 3); this.searchTextBox.Name = "searchTextBox"; - this.searchTextBox.Size = new System.Drawing.Size(168, 21); + this.searchTextBox.Size = new System.Drawing.Size(178, 21); this.searchTextBox.TabIndex = 9; this.searchTextBox.TabStop = false; this.searchTextBox.TextChanged += new System.EventHandler(this.textBox1_TextChanged); @@ -599,6 +772,26 @@ public void InitializeComponent() this.panel1.TabIndex = 13; this.panel1.Visible = false; // + // panel2 + // + this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel2.Controls.Add(this.pictureBox12); + this.panel2.Controls.Add(this.pictureBox5); + this.panel2.Controls.Add(this.pictureBox2); + this.panel2.Controls.Add(this.pictureBox11); + this.panel2.Controls.Add(this.pictureBox10); + this.panel2.Controls.Add(this.pictureBox9); + this.panel2.Controls.Add(this.pictureBox8); + this.panel2.Controls.Add(this.pictureBox7); + this.panel2.Controls.Add(this.pictureBox6); + this.panel2.Controls.Add(this.pictureBox4); + this.panel2.Controls.Add(this.pictureBox3); + this.panel2.Location = new System.Drawing.Point(-1, 25); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(691, 23); + this.panel2.TabIndex = 14; + // // customRTB // this.customRTB.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -610,9 +803,9 @@ public void InitializeComponent() this.customRTB.DetectUrls = false; this.customRTB.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.customRTB.ForeColor = System.Drawing.SystemColors.WindowText; - this.customRTB.Location = new System.Drawing.Point(0, 24); + this.customRTB.Location = new System.Drawing.Point(0, 48); this.customRTB.Name = "customRTB"; - this.customRTB.Size = new System.Drawing.Size(689, 416); + this.customRTB.Size = new System.Drawing.Size(689, 392); this.customRTB.TabIndex = 10; this.customRTB.Text = ""; this.customRTB.SelectionChanged += new System.EventHandler(this.customRTB_SelectionChanged_1); @@ -623,6 +816,7 @@ public void InitializeComponent() this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(689, 461); + this.Controls.Add(this.panel2); this.Controls.Add(this.panel1); this.Controls.Add(this.customRTB); this.Controls.Add(this.statusStrip1); @@ -644,9 +838,22 @@ public void InitializeComponent() this.contextMenuStrip1.ResumeLayout(false); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox12)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox11)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox10)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); + this.panel2.ResumeLayout(false); + this.panel2.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -714,6 +921,18 @@ public void InitializeComponent() private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; private System.Windows.Forms.ToolStripMenuItem findToolStripMenuItem2; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.PictureBox pictureBox2; + private System.Windows.Forms.PictureBox pictureBox3; + private System.Windows.Forms.PictureBox pictureBox4; + private System.Windows.Forms.PictureBox pictureBox6; + private System.Windows.Forms.PictureBox pictureBox7; + private System.Windows.Forms.PictureBox pictureBox8; + private System.Windows.Forms.PictureBox pictureBox9; + private System.Windows.Forms.PictureBox pictureBox10; + private System.Windows.Forms.PictureBox pictureBox11; + private System.Windows.Forms.PictureBox pictureBox5; + private System.Windows.Forms.PictureBox pictureBox12; } } diff --git a/Crypto Notepad/Form1.cs b/Crypto Notepad/Form1.cs index 8dfce42..3e0a3fe 100644 --- a/Crypto Notepad/Form1.cs +++ b/Crypto Notepad/Form1.cs @@ -29,6 +29,7 @@ public MainWindow() InitializeComponent(); } + #region SaltMac void SaltMAC() { var networkInterfaces = NetworkInterface.GetAllNetworkInterfaces(); @@ -58,6 +59,7 @@ void SaltMAC() } } } + #endregion private void открытьToolStripMenuItem_Click(object sender, EventArgs e) { @@ -245,9 +247,18 @@ private void openAsotiations() { Form2 Form2 = new Form2(); Form2.ShowDialog(); + if (Form2.OkPressed == false) + { + return; + } + Form2.OkPressed = false; + } + + if (SaveFile.ShowDialog() != DialogResult.OK) + { + return; } - if (SaveFile.ShowDialog() != DialogResult.OK) return; filename = SaveFile.FileName; string noenc = customRTB.Text; @@ -356,12 +367,30 @@ private void MainWindow_Load(object sender, EventArgs e) customRTB.BackColor = ps.RichBackColor; переносПоСловамToolStripMenuItem.Checked = ps.MenuWrap; customRTB.WordWrap = ps.RichWrap; - customRTB.SelectionIndent += 6; customRTB.SelectionRightIndent += 7; + panel2.Visible = ps.ShowToolbar; + + if (ps.ShowToolbar == false) + { + panel2.Visible = false; + int h = customRTB.Height; + h += 23; + customRTB.Height = h; + customRTB.Location = new Point(0, 25); + } + + if (ps.ShowToolbar == true) + { + panel2.Visible = true; + //int h = customRTB.Height; + //h -= 23; + //customRTB.Height = h; + //customRTB.Location = new Point(0, 48); + } LineAndColumn(); - + if (args.Length > 1) { openAsotiations(); @@ -384,6 +413,12 @@ private void MainWindow_Load(object sender, EventArgs e) { SaveFile.FileName = f; сохранитьToolStripMenuItem_Click(this, new EventArgs()); + + if (Form2.OkPressed == false) + { + return; + } + Form2.OkPressed = false; } string noenc = customRTB.Text; @@ -448,18 +483,7 @@ private void MainWindow_Load(object sender, EventArgs e) private void правкаToolStripMenuItem_MouseDown(object sender, MouseEventArgs e) { - if (customRTB.SelectionLength != 0) - { - вырезатьToolStripMenuItem.Enabled = true; - копироватьToolStripMenuItem.Enabled = true; - удалитьToolStripMenuItem.Enabled = true; - } - if (customRTB.SelectionLength == 0) - { - вырезатьToolStripMenuItem.Enabled = false; - копироватьToolStripMenuItem.Enabled = false; - удалитьToolStripMenuItem.Enabled = false; - } + } private void УдалитьФайлToolStripMenuItem_Click_1(object sender, EventArgs e) @@ -480,7 +504,7 @@ private void MainWindow_Load(object sender, EventArgs e) { using (new CenterWinDialog(this)) { - MessageBox.Show("No open files", "", MessageBoxButtons.OK, MessageBoxIcon.Question); + MessageBox.Show("No open files", "", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } @@ -495,7 +519,7 @@ private void MainWindow_Load(object sender, EventArgs e) { using (new CenterWinDialog(this)) { - MessageBox.Show("No open files", "", MessageBoxButtons.OK, MessageBoxIcon.Question); + MessageBox.Show("No open files", "", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } @@ -637,6 +661,16 @@ private void searchTextBox_KeyDown(object sender, KeyEventArgs e) private void customRTB_SelectionChanged_1(object sender, EventArgs e) { LineAndColumn(); + if (customRTB.SelectionLength != 0) + { + pictureBox8.Enabled = true; + pictureBox9.Enabled = true; + } + if (customRTB.SelectionLength == 0) + { + pictureBox8.Enabled = false; + pictureBox9.Enabled = false; + } } private void customRTB_TextChanged(object sender, EventArgs e) @@ -661,6 +695,24 @@ private async void MainWindow_Activated(object sender, EventArgs e) customRTB.Font = new Font(ps.RichTextFont, ps.RichTextSize); customRTB.ForeColor = ps.RichForeColor; customRTB.BackColor = ps.RichBackColor; + + if (ps.ShowToolbar == false) + { + panel2.Visible = false; + int h = customRTB.Height; + h += 23; + customRTB.Height = h; + customRTB.Location = new Point(0, 25); + } + + if (ps.ShowToolbar == true) + { + panel2.Visible = true; + int h = customRTB.Height; + h -= 23; + customRTB.Height = h; + customRTB.Location = new Point(0, 48); + } } if (keyChanged == true) @@ -669,6 +721,17 @@ private async void MainWindow_Activated(object sender, EventArgs e) await Task.Delay(4000); toolStripStatusLabel1.Text = "Ready"; } + + + if (key == "") + { + pictureBox11.Enabled = false; + } + + if (key != "") + { + pictureBox11.Enabled = true; + } } private void chkMatchCase_CheckedChanged(object sender, EventArgs e) @@ -715,20 +778,119 @@ private void findToolStripMenuItem2_Click(object sender, EventArgs e) private void documentationToolStripMenuItem_Click(object sender, EventArgs e) { - + } private void сервисToolStripMenuItem_DropDownOpened(object sender, EventArgs e) { - if(filename == "Unnamed.enp") + if(key == "") { changeKeyToolStripMenuItem.Enabled = false; } - if (filename != "Unnamed.enp") + if (key != "") { changeKeyToolStripMenuItem.Enabled = true; } } + + private void pictureBox2_Click(object sender, EventArgs e) + { + новыйToolStripMenuItem_Click_1(this, new EventArgs()); + } + + private void pictureBox3_Click(object sender, EventArgs e) + { + открытьToolStripMenuItem_Click(this, new EventArgs()); + } + + private void pictureBox4_Click(object sender, EventArgs e) + { + сохранитьToolStripMenuItem1_Click_1(this, new EventArgs()); + } + + private void pictureBox6_Click(object sender, EventArgs e) + { + открытьРасположениеФайлаToolStripMenuItem_Click(this, new EventArgs()); + } + + private void pictureBox7_Click(object sender, EventArgs e) + { + УдалитьФайлToolStripMenuItem_Click_1(this, new EventArgs()); + } + + private void pictureBox8_Click(object sender, EventArgs e) + { + вырезатьToolStripMenuItem_Click(this, new EventArgs()); + } + + private void pictureBox9_Click(object sender, EventArgs e) + { + копироватьToolStripMenuItem_Click(this, new EventArgs()); + } + + private void pictureBox10_Click(object sender, EventArgs e) + { + вставитьToolStripMenuItem_Click(this, new EventArgs()); + } + + private void pictureBox11_Click(object sender, EventArgs e) + { + changeKeyToolStripMenuItem_Click(this, new EventArgs()); + } + + private void pictureBox5_Click(object sender, EventArgs e) + { + settingsToolStripMenuItem_Click(this, new EventArgs()); + } + + private void pictureBox12_Click(object sender, EventArgs e) + { + panel2.Visible = false; + int h = customRTB.Height; + h += 23; + customRTB.Height = h; + customRTB.Location = new Point(0, 25); + ps.ShowToolbar = false; + ps.Save(); + } + + private void pictureBox12_MouseEnter(object sender, EventArgs e) + { + pictureBox12.Image = Properties.Resources.close_b; + } + + private void pictureBox12_MouseLeave(object sender, EventArgs e) + { + pictureBox12.Image = Properties.Resources.close_g; + } + + private void pictureBox1_MouseHover(object sender, EventArgs e) + { + pictureBox1.Image = Properties.Resources.close_b; + } + + private void pictureBox1_MouseLeave(object sender, EventArgs e) + { + pictureBox1.Image = Properties.Resources.close_g; + } + + private void правкаToolStripMenuItem_DropDownOpened(object sender, EventArgs e) + { + if (customRTB.SelectionLength != 0) + { + вырезатьToolStripMenuItem.Enabled = true; + копироватьToolStripMenuItem.Enabled = true; + удалитьToolStripMenuItem.Enabled = true; + } + if (customRTB.SelectionLength == 0) + { + вырезатьToolStripMenuItem.Enabled = false; + копироватьToolStripMenuItem.Enabled = false; + удалитьToolStripMenuItem.Enabled = false; + } + } + + } } \ No newline at end of file