From ca1db5a7a3d55a996735287304350815544a34e0 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 26 Oct 2019 00:23:36 +0300 Subject: [PATCH] Removed line numbers --- Crypto Notepad/Crypto Notepad.csproj | 3 - Crypto Notepad/LineNumbers.cs | 1114 ----------------------- Crypto Notepad/MainForm.Designer.cs | 50 +- Crypto Notepad/MainForm.cs | 34 - Crypto Notepad/SettingsForm.Designer.cs | 674 +++----------- Crypto Notepad/SettingsForm.cs | 248 +---- 6 files changed, 116 insertions(+), 2007 deletions(-) delete mode 100644 Crypto Notepad/LineNumbers.cs diff --git a/Crypto Notepad/Crypto Notepad.csproj b/Crypto Notepad/Crypto Notepad.csproj index 0f222f3..b64d696 100644 --- a/Crypto Notepad/Crypto Notepad.csproj +++ b/Crypto Notepad/Crypto Notepad.csproj @@ -104,9 +104,6 @@ ChangeKeyForm.cs - - Component - Form diff --git a/Crypto Notepad/LineNumbers.cs b/Crypto Notepad/LineNumbers.cs deleted file mode 100644 index 7f779da..0000000 --- a/Crypto Notepad/LineNumbers.cs +++ /dev/null @@ -1,1114 +0,0 @@ -using Microsoft.VisualBasic; -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Windows.Forms; - - -namespace LineNumbers -{ - [System.ComponentModel.DefaultProperty("ParentRichTextBox")] - public class LineNumbers: Control - { - - private class LineNumberItem - { - internal int LineNumber; - internal Rectangle Rectangle; - internal LineNumberItem(int zLineNumber, Rectangle zRectangle) - { - LineNumber = zLineNumber; - Rectangle = zRectangle; - } - } - - public enum LineNumberDockSide : byte - { - None = 0, - Left = 1, - Right = 2, - Height = 4 - } - private RichTextBox withEventsField_zParent = null; - - private RichTextBox zParent { - get { return withEventsField_zParent; } - set { - if (withEventsField_zParent != null) { - withEventsField_zParent.LocationChanged -= zParent_Changed; - withEventsField_zParent.Move -= zParent_Changed; - withEventsField_zParent.Resize -= zParent_Changed; - withEventsField_zParent.DockChanged -= zParent_Changed; - withEventsField_zParent.TextChanged -= zParent_Changed; - withEventsField_zParent.MultilineChanged -= zParent_Changed; - withEventsField_zParent.HScroll -= zParent_Scroll; - withEventsField_zParent.VScroll -= zParent_Scroll; - withEventsField_zParent.ContentsResized -= zParent_ContentsResized; - withEventsField_zParent.Disposed -= zParent_Disposed; - } - withEventsField_zParent = value; - if (withEventsField_zParent != null) { - withEventsField_zParent.LocationChanged += zParent_Changed; - withEventsField_zParent.Move += zParent_Changed; - withEventsField_zParent.Resize += zParent_Changed; - withEventsField_zParent.DockChanged += zParent_Changed; - withEventsField_zParent.TextChanged += zParent_Changed; - withEventsField_zParent.MultilineChanged += zParent_Changed; - withEventsField_zParent.HScroll += zParent_Scroll; - withEventsField_zParent.VScroll += zParent_Scroll; - withEventsField_zParent.ContentsResized += zParent_ContentsResized; - withEventsField_zParent.Disposed += zParent_Disposed; - } - } - } - - //private Windows.Forms.Timer withEventsField_zTimer = new Windows.Forms.Timer(); - //private Windows.Forms.Timer zTimer { - //private Timer withEventsField_zTimer = new Windows.Forms.Timer(); - private Timer withEventsField_zTimer = new Timer(); - private Timer zTimer - { - get { return withEventsField_zTimer; } - set { - if (withEventsField_zTimer != null) { - withEventsField_zTimer.Tick -= zTimer_Tick; - } - withEventsField_zTimer = value; - if (withEventsField_zTimer != null) { - withEventsField_zTimer.Tick += zTimer_Tick; - } - } - - } - private bool zAutoSizing = true; - private Size zAutoSizing_Size = new Size(0, 0); - //private Rectangle zContentRectangle = null; - private Rectangle zContentRectangle; - private LineNumberDockSide zDockSide = LineNumberDockSide.Left; - private bool zParentIsScrolling = false; - - private bool zSeeThroughMode = false; - private bool zGradient_Show = true; - private System.Drawing.Drawing2D.LinearGradientMode zGradient_Direction = System.Drawing.Drawing2D.LinearGradientMode.Horizontal; - private Color zGradient_StartColor = Color.FromArgb(0, 0, 0, 0); - - private Color zGradient_EndColor = Color.Transparent; - private bool zGridLines_Show = true; - private float zGridLines_Thickness = 1; - private System.Drawing.Drawing2D.DashStyle zGridLines_Style = System.Drawing.Drawing2D.DashStyle.Dot; - - private Color zGridLines_Color = Color.SlateGray; - private bool zBorderLines_Show = true; - private float zBorderLines_Thickness = 1; - private System.Drawing.Drawing2D.DashStyle zBorderLines_Style = System.Drawing.Drawing2D.DashStyle.Dot; - - private Color zBorderLines_Color = Color.SlateGray; - private bool zMarginLines_Show = true; - private LineNumberDockSide zMarginLines_Side = LineNumberDockSide.Right; - private float zMarginLines_Thickness = 1; - private System.Drawing.Drawing2D.DashStyle zMarginLines_Style = System.Drawing.Drawing2D.DashStyle.Solid; - - private Color zMarginLines_Color = Color.SlateGray; - private bool zLineNumbers_Show = true; - private bool zLineNumbers_ShowLeadingZeroes = true; - private bool zLineNumbers_ShowAsHexadecimal = false; - private bool zLineNumbers_ClipByItemRectangle = true; - private Size zLineNumbers_Offset = new Size(0, 0); - private string zLineNumbers_Format = "0"; - private System.Drawing.ContentAlignment zLineNumbers_Alignment = ContentAlignment.TopRight; - - private bool zLineNumbers_AntiAlias = true; - - private List zLNIs = new List(); - private Point zPointInParent = new Point(0, 0); - private Point zPointInMe = new Point(0, 0); - private int zParentInMe = 0; - //////////////////////////////////////////////////////////////////////////////////////////////////// - - public LineNumbers() - { - { - this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); - this.SetStyle(ControlStyles.ResizeRedraw, true); - this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); - this.SetStyle(ControlStyles.UserPaint, true); - this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); - this.Margin = new Padding(0); - this.Padding = new Padding(0, 0, 2, 0); - } - { - zTimer.Enabled = true; - zTimer.Interval = 200; - zTimer.Stop(); - } - this.Update_SizeAndPosition(); - this.Invalidate(); - } - - protected override void OnHandleCreated(System.EventArgs e) - { - base.OnHandleCreated(e); - this.AutoSize = false; - } - - - //////////////////////////////////////////////////////////////////////////////////////////////////// - - [System.ComponentModel.Browsable(false)] - public override bool AutoSize { - get { return base.AutoSize; } - set { - base.AutoSize = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Description("Use this property to automatically resize the control (and reposition it if needed).")] - [System.ComponentModel.Category("Additional Behavior")] - public bool AutoSizing { - get { return zAutoSizing; } - set { - zAutoSizing = value; - this.Refresh(); - this.Invalidate(); - } - } - - [System.ComponentModel.Description("Use this property to enable LineNumbers for the chosen RichTextBox.")] - [System.ComponentModel.Category("Add LineNumbers to")] - public RichTextBox ParentRichTextBox { - get { return zParent; } - set { - zParent = value; - if (zParent != null) { - this.Parent = zParent.Parent; - zParent.Refresh(); - } - this.Text = ""; - this.Refresh(); - this.Invalidate(); - } - } - - [System.ComponentModel.Description("Use this property to dock the LineNumbers to a chosen side of the chosen RichTextBox.")] - [System.ComponentModel.Category("Additional Behavior")] - public LineNumberDockSide DockSide { - get { return zDockSide; } - set { - zDockSide = value; - this.Refresh(); - this.Invalidate(); - } - } - - [System.ComponentModel.Description("Use this property to enable the control to act as an overlay ontop of the RichTextBox.")] - [System.ComponentModel.Category("Additional Behavior")] - public bool _SeeThroughMode_ { - get { return zSeeThroughMode; } - set { - zSeeThroughMode = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Description("BorderLines are shown on all sides of the LineNumber control.")] - [System.ComponentModel.Category("Additional Behavior")] - public bool Show_BorderLines { - get { return zBorderLines_Show; } - set { - zBorderLines_Show = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Category("Additional Appearance")] - public Color BorderLines_Color { - get { return zBorderLines_Color; } - set { - zBorderLines_Color = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Category("Additional Appearance")] - public float BorderLines_Thickness { - get { return zBorderLines_Thickness; } - set { - zBorderLines_Thickness = Math.Max(1, Math.Min(255, value)); - this.Invalidate(); - } - } - - [System.ComponentModel.Category("Additional Appearance")] - public System.Drawing.Drawing2D.DashStyle BorderLines_Style - { - get { return zBorderLines_Style; } - set { - if (value == System.Drawing.Drawing2D.DashStyle.Custom) - value = System.Drawing.Drawing2D.DashStyle.Solid; - zBorderLines_Style = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Description("GridLines are the horizontal divider-lines shown above each LineNumber.")] - [System.ComponentModel.Category("Additional Behavior")] - public bool Show_GridLines { - get { return zGridLines_Show; } - set { - zGridLines_Show = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Category("Additional Appearance")] - public Color GridLines_Color { - get { return zGridLines_Color; } - set { - zGridLines_Color = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Category("Additional Appearance")] - public float GridLines_Thickness { - get { return zGridLines_Thickness; } - set { - zGridLines_Thickness = Math.Max(1, Math.Min(255, value)); - this.Invalidate(); - } - } - - [System.ComponentModel.Category("Additional Appearance")] - public System.Drawing.Drawing2D.DashStyle GridLines_Style - { - get { return zGridLines_Style; } - set { - if (value == System.Drawing.Drawing2D.DashStyle.Custom) - value = System.Drawing.Drawing2D.DashStyle.Solid; - zGridLines_Style = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Description("MarginLines are shown on the Left or Right (or both in Height-mode) of the LineNumber control.")] - [System.ComponentModel.Category("Additional Behavior")] - public bool Show_MarginLines { - get { return zMarginLines_Show; } - set { - zMarginLines_Show = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Category("Additional Appearance")] - public LineNumberDockSide MarginLines_Side { - get { return zMarginLines_Side; } - set { - zMarginLines_Side = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Category("Additional Appearance")] - public Color MarginLines_Color { - get { return zMarginLines_Color; } - set { - zMarginLines_Color = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Category("Additional Appearance")] - public float MarginLines_Thickness { - get { return zMarginLines_Thickness; } - set { - zMarginLines_Thickness = Math.Max(1, Math.Min(255, value)); - this.Invalidate(); - } - } - - [System.ComponentModel.Category("Additional Appearance")] - public System.Drawing.Drawing2D.DashStyle MarginLines_Style - { - get { return zMarginLines_Style; } - set { - if (value == System.Drawing.Drawing2D.DashStyle.Custom) - value = System.Drawing.Drawing2D.DashStyle.Solid; - zMarginLines_Style = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Description("The BackgroundGradient is a gradual blend of two colors, shown in the back of each LineNumber's item-area.")] - [System.ComponentModel.Category("Additional Behavior")] - public bool Show_BackgroundGradient { - get { return zGradient_Show; } - set { - zGradient_Show = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Category("Additional Appearance")] - public Color BackgroundGradient_AlphaColor { - get { return zGradient_StartColor; } - set { - zGradient_StartColor = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Category("Additional Appearance")] - public Color BackgroundGradient_BetaColor { - get { return zGradient_EndColor; } - set { - zGradient_EndColor = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Category("Additional Appearance")] - public System.Drawing.Drawing2D.LinearGradientMode BackgroundGradient_Direction - { - get { return zGradient_Direction; } - set { - zGradient_Direction = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Category("Additional Behavior")] - public bool Show_LineNrs { - get { return zLineNumbers_Show; } - set { - zLineNumbers_Show = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Description("Use this to set whether the LineNumbers are allowed to spill out of their item-area, or should be clipped by it.")] - [System.ComponentModel.Category("Additional Behavior")] - public bool LineNrs_ClippedByItemRectangle { - get { return zLineNumbers_ClipByItemRectangle; } - set { - zLineNumbers_ClipByItemRectangle = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Description("Use this to set whether the LineNumbers should have leading zeroes (based on the total amount of textlines).")] - [System.ComponentModel.Category("Additional Behavior")] - public bool LineNrs_LeadingZeroes { - get { return zLineNumbers_ShowLeadingZeroes; } - set { - zLineNumbers_ShowLeadingZeroes = value; - this.Refresh(); - this.Invalidate(); - } - } - - [System.ComponentModel.Description("Use this to set whether the LineNumbers should be shown as hexadecimal values.")] - [System.ComponentModel.Category("Additional Behavior")] - public bool LineNrs_AsHexadecimal { - get { return zLineNumbers_ShowAsHexadecimal; } - set { - zLineNumbers_ShowAsHexadecimal = value; - this.Refresh(); - this.Invalidate(); - } - } - - [System.ComponentModel.Description("Use this property to manually reposition the LineNumbers, relative to their current location.")] - [System.ComponentModel.Category("Additional Behavior")] - public Size LineNrs_Offset { - get { return zLineNumbers_Offset; } - set { - zLineNumbers_Offset = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Description("Use this to align the LineNumbers to a chosen corner (or center) within their item-area.")] - [System.ComponentModel.Category("Additional Behavior")] - public System.Drawing.ContentAlignment LineNrs_Alignment { - get { return zLineNumbers_Alignment; } - set { - zLineNumbers_Alignment = value; - this.Invalidate(); - } - } - - [System.ComponentModel.Description("Use this to apply Anti-Aliasing to the LineNumbers (high quality). Some fonts will look better without it, though.")] - [System.ComponentModel.Category("Additional Behavior")] - public bool LineNrs_AntiAlias { - get { return zLineNumbers_AntiAlias; } - set { - zLineNumbers_AntiAlias = value; - this.Refresh(); - this.Invalidate(); - } - } - - [System.ComponentModel.Browsable(true)] - public override System.Drawing.Font Font { - get { return base.Font; } - set { - base.Font = value; - this.Refresh(); - this.Invalidate(); - } - } - - [System.ComponentModel.DefaultValue("")] - [System.ComponentModel.AmbientValue("")] - [System.ComponentModel.Browsable(false)] - public override string Text { - get { return base.Text; } - set { - base.Text = ""; - this.Invalidate(); - } - } - - - //////////////////////////////////////////////////////////////////////////////////////////////////// - - protected override void OnSizeChanged(System.EventArgs e) - { - if (this.DesignMode == true) - this.Refresh(); - base.OnSizeChanged(e); - this.Invalidate(); - } - - protected override void OnLocationChanged(System.EventArgs e) - { - if (this.DesignMode == true) - this.Refresh(); - base.OnLocationChanged(e); - this.Invalidate(); - } - - public override void Refresh() - { - // Note: don't change the order here, first the Mybase.Refresh, then the Update_SizeAndPosition. - base.Refresh(); - this.Update_SizeAndPosition(); - } - - /// - /// This Sub will run whenever Me.Refresh() is called. It applies the AutoSizing and DockSide settings. - /// - /// - private void Update_SizeAndPosition() - { - if (this.AutoSize == true) - return; - if (this.Dock == DockStyle.Bottom | this.Dock == DockStyle.Fill | this.Dock == DockStyle.Top) - return; - Point zNewLocation = this.Location; - Size zNewSize = this.Size; - - if (zAutoSizing == true) { - //switch (true) { - // case zParent == null: - if (zParent == null ){ - // --- ReminderMessage sizing - if (zAutoSizing_Size.Width > 0) - zNewSize.Width = zAutoSizing_Size.Width; - if (zAutoSizing_Size.Height > 0) - zNewSize.Height = zAutoSizing_Size.Height; - this.Size = zNewSize; - - // break; - }else if (this.Dock == DockStyle.Left | this.Dock == DockStyle.Right){ - //--- zParent isNot Nothing for the following cases - //case this.Dock == DockStyle.Left | this.Dock == DockStyle.Right: - if (zAutoSizing_Size.Width > 0) - zNewSize.Width = zAutoSizing_Size.Width; - this.Width = zNewSize.Width; - - //break; - }else if (zDockSide != LineNumberDockSide.None){ - // --- DockSide is active L/R/H - //case zDockSide != LineNumberDockSide.None: - if (zAutoSizing_Size.Width > 0) - zNewSize.Width = zAutoSizing_Size.Width; - zNewSize.Height = zParent.Height; - if (zDockSide == LineNumberDockSide.Left) - zNewLocation.X = zParent.Left - zNewSize.Width - 1; - if (zDockSide == LineNumberDockSide.Right) - zNewLocation.X = zParent.Right + 1; - zNewLocation.Y = zParent.Top; - this.Location = zNewLocation; - this.Size = zNewSize; - - //break; - } else if (zDockSide == LineNumberDockSide.None) { - // --- DockSide = None, but AutoSizing is still setting the Width - //case zDockSide == LineNumberDockSide.None: - if (zAutoSizing_Size.Width > 0) - zNewSize.Width = zAutoSizing_Size.Width; - this.Size = zNewSize; - - //break; - } - - } else { - // --- No AutoSizing - //switch (true) { - if (zParent == null){ - //case zParent == null: - // --- ReminderMessage sizing - if (zAutoSizing_Size.Width > 0) - zNewSize.Width = zAutoSizing_Size.Width; - if (zAutoSizing_Size.Height > 0) - zNewSize.Height = zAutoSizing_Size.Height; - this.Size = zNewSize; - - //break; - }else if (zDockSide != LineNumberDockSide.None){ - // --- No AutoSizing, but DockSide L/R/H is active so height and position need updates. - //case zDockSide != LineNumberDockSide.None: - zNewSize.Height = zParent.Height; - if (zDockSide == LineNumberDockSide.Left) - zNewLocation.X = zParent.Left - zNewSize.Width - 1; - if (zDockSide == LineNumberDockSide.Right) - zNewLocation.X = zParent.Right + 1; - zNewLocation.Y = zParent.Top; - this.Location = zNewLocation; - this.Size = zNewSize; - - //break; - } - } - - } - - - /// - /// This Sub determines which textlines are visible in the ParentRichTextBox, and makes LineNumberItems (LineNumber + ItemRectangle) - /// for each visible line. They are put into the zLNIs List that will be used by the OnPaint event to draw the LineNumberItems. - /// - /// - private void Update_VisibleLineNumberItems() - { - // ################ - int tmpY; - // ############### - zLNIs.Clear(); - zAutoSizing_Size = new Size(0, 0); - zLineNumbers_Format = "0"; - //initial setting - // To measure the LineNumber's width, its Format 0 is replaced by w as that is likely to be one of the widest characters in non-monospace fonts. - if (zAutoSizing == true) - zAutoSizing_Size = new Size(TextRenderer.MeasureText(zLineNumbers_Format.Replace('0', 'W'), this.Font).Width, 0); - //zAutoSizing_Size = new Size(TextRenderer.MeasureText(zLineNumbers_Format.Replace("0".ToCharArray(), "W".ToCharArray()), this.Font).Width, 0); - - if (zParent == null || string.IsNullOrEmpty(zParent.Text)) - return; - - // --- Make sure the LineNumbers are aligning to the same height as the zParent textlines by converting to screencoordinates - // and using that as an offset that gets added to the points for the LineNumberItems - zPointInParent = zParent.PointToScreen(zParent.ClientRectangle.Location); - zPointInMe = this.PointToScreen(new Point(0, 0)); - // zParentInMe is the vertical offset to make the LineNumberItems line up with the textlines in zParent. - zParentInMe = zPointInParent.Y - zPointInMe.Y + 1; - // The first visible LineNumber may not be the first visible line of text in the RTB if the LineNumbercontrol's .Top is lower on the form than - // the .Top of the parent RichTextBox. Therefor, zPointInParent will now be used to find zPointInMe's equivalent height in zParent, - // which is needed to find the best StartIndex later on. - zPointInParent = zParent.PointToClient(zPointInMe); - - // --- NOTES: - // Additional complication is the fact that when wordwrap is enabled on the RTB, the wordwrapped text spills into the RTB.Lines collection, - // so we need to split the text into lines ourselves, and use the Index of each zSplit-line's first character instead of the RTB's. - string[] zSplit = zParent.Text.Split(Constants.vbCrLf.ToCharArray()); - - if (zSplit.Length < 2) { - // Just one line in the text = one linenumber - // NOTE: zContentRectangle is built by the zParent.ContentsResized event. - Point zPoint = zParent.GetPositionFromCharIndex(0); - zLNIs.Add(new LineNumberItem(1, new Rectangle(new Point(0, zPoint.Y - 1 + zParentInMe), new Size(this.Width, zContentRectangle.Height - zPoint.Y)))); - - - } else { - // Multiple lines, but store only those LineNumberItems for lines that are visible. - TimeSpan zTimeSpan = new TimeSpan(DateAndTime.Now.Ticks); - Point zPoint = new Point(0, 0); - int zStartIndex = 0; - int zSplitStartLine = 0; - int zA = zParent.Text.Length - 1; - // ######################### - - //this.FindStartIndex(ref zStartIndex, ref zA, ref zPointInParent.Y); - tmpY = zPointInParent.Y; - this.FindStartIndex(ref zStartIndex, ref zA, ref tmpY); - zPointInParent.Y = tmpY; - - // ################ - - - // zStartIndex now holds the index of a character in the first visible line from zParent.Text - // Now it will be pointed at the first character of that line (chr(10) = Linefeed part of the vbCrLf constant) - zStartIndex = Math.Max(0, Math.Min(zParent.Text.Length - 1, zParent.Text.Substring(0, zStartIndex).LastIndexOf(Strings.Chr(10)) + 1)); - - // We now need to find out which zSplit-line that character is in, by counting the vbCrlf appearances that come before it. - zSplitStartLine = Math.Max(0, zParent.Text.Substring(0, zStartIndex).Split(Constants.vbCrLf.ToCharArray()).Length - 1); - - // zStartIndex starts off pointing at the first character of the first visible line, and will be then be pointed to - // the index of the first character on the next line. - for (zA = zSplitStartLine; zA <= zSplit.Length - 1; zA++) { - zPoint = zParent.GetPositionFromCharIndex(zStartIndex); - zStartIndex += Math.Max(1, zSplit[zA].Length + 1); - if (zPoint.Y + zParentInMe > this.Height) - break; // TODO: might not be correct. Was : Exit For - // For performance reasons, the list of LineNumberItems (zLNIs) is first built with only the location of its - // itemrectangle being used. The height of those rectangles will be computed afterwards by comparing the items' Y coordinates. - zLNIs.Add(new LineNumberItem(zA + 1, new Rectangle(0, zPoint.Y - 1 + zParentInMe, this.Width, 1))); - if (zParentIsScrolling == true && DateAndTime.Now.Ticks > zTimeSpan.Ticks + 500000) { - // The more lines there are in the RTB, the slower the RTB's .GetPositionFromCharIndex() method becomes - // To avoid those delays from interfering with the scrollingspeed, this speedbased exit for is applied (0.05 sec) - // zLNIs will have at least 1 item, and if that's the only one, then change its location to 0,0 to make it readable - if (zLNIs.Count == 1) - zLNIs[0].Rectangle.Y = 0; - // zLNIs(0).Rectangle.Y = 0; - - zParentIsScrolling = false; - zTimer.Start(); - break; // TODO: might not be correct. Was : Exit For - } - } - - if (zLNIs.Count == 0) - return; - - // Add an extra placeholder item to the end, to make the heightcomputation easier - if (zA < zSplit.Length) { - // getting here means the for/next loop was exited before reaching the last zSplit textline - // zStartIndex will still be pointing to the startcharacter of the next line, so we can use that: - zPoint = zParent.GetPositionFromCharIndex(Math.Min(zStartIndex, zParent.Text.Length - 1)); - zLNIs.Add(new LineNumberItem(-1, new Rectangle(0, zPoint.Y - 1 + zParentInMe, 0, 0))); - } else { - // getting here means the for/next loop ran to the end (zA is now zSplit.Length). - zLNIs.Add(new LineNumberItem(-1, new Rectangle(0, zContentRectangle.Bottom, 0, 0))); - } - - // And now we can easily compute the height of the LineNumberItems by comparing each item's Y coordinate with that of the next line. - // There's at least two items in the list, and the last item is a "nextline-placeholder" that will be removed. - for (zA = 0; zA <= zLNIs.Count - 2; zA++) { - zLNIs[zA].Rectangle.Height = Math.Max(1, zLNIs[zA + 1].Rectangle.Y - zLNIs[zA].Rectangle.Y); - //zLNIs(zA).Rectangle.Height = Math.Max(1, zLNIs(zA + 1).Rectangle.Y - zLNIs(zA).Rectangle.Y); - } - // Removing the placeholder item - zLNIs.RemoveAt(zLNIs.Count - 1); - - // Set the Format to the width of the highest possible number so that LeadingZeroes shows the correct amount of zeroes. - if (zLineNumbers_ShowAsHexadecimal == true) { - //zLineNumbers_Format = "".PadRight(zSplit.Length.ToString("X").Length, "0"); - zLineNumbers_Format = "".PadRight(zSplit.Length.ToString("X").Length, '0'); - } else { - //zLineNumbers_Format = "".PadRight(zSplit.Length.ToString().Length, "0"); - zLineNumbers_Format = "".PadRight(zSplit.Length.ToString().Length, '0'); - } - } - - // To measure the LineNumber's width, its Format 0 is replaced by w as that is likely to be one of the widest characters in non-monospace fonts. - if (zAutoSizing == true) - zAutoSizing_Size = new Size(TextRenderer.MeasureText(zLineNumbers_Format.Replace('0', 'W'), this.Font).Width, 0); - //zAutoSizing_Size = new Size(TextRenderer.MeasureText(zLineNumbers_Format.Replace("0".ToCharArray(), "W".ToCharArray()), this.Font).Width, 0); - } - - /// - /// FindStartIndex is a recursive Sub (one that calls itself) to compute the first visible line that should have a LineNumber. - /// - /// this will hold the eventual BestStartIndex when the Sub has completed its run. - /// - /// - /// - private void FindStartIndex(ref int zMin, ref int zMax, ref int zTarget) - { - // Recursive Sub to compute best starting index - only run when zParent is known to exist - if (zMax == zMin + 1 | zMin == (zMax + zMin) / 2) - return; - - if(zParent.GetPositionFromCharIndex((zMax + zMin) / 2).Y == zTarget){ - //switch (zParent.GetPositionFromCharIndex((zMax + zMin) / 2).Y) { - // case // ERROR: Case labels with binary operators are unsupported : Equality - // BestStartIndex found - zMin = (zMax + zMin) / 2; - //break; - } - else if (zParent.GetPositionFromCharIndex((zMax + zMin) / 2).Y > zTarget) - { - //case // ERROR: Case labels with binary operators are unsupported : GreaterThan - //zTarget: - // Look again, in lower half - zMax = (zMax + zMin) / 2; - FindStartIndex(ref zMin, ref zMax, ref zTarget); - //break; - } - else if (zParent.GetPositionFromCharIndex((zMax + zMin) / 2).Y < 0) - { - // case // ERROR: Case labels with binary operators are unsupported : LessThan - //0: - // Look again, in top half - zMin = (zMax + zMin) / 2; - FindStartIndex(ref zMin, ref zMax, ref zTarget); - //break; - } - - } - - - /// - /// OnPaint will go through the enabled elements (vertical ReminderMessage, GridLines, LineNumbers, BorderLines, MarginLines) and will - /// draw them if enabled. At the same time, it will build GraphicsPaths for each of those elements (that are enabled), which will be used - /// in SeeThroughMode (if it's active): the figures in the GraphicsPaths will form a customized outline for the control by setting them as the - /// Region of the LineNumber control. Note: the vertical ReminderMessages are only drawn during designtime. - /// - /// - /// - protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) - { - // Build the list of visible LineNumberItems (= zLNIs) first. (doesn't take long, so it can stay in OnPaint) - this.Update_VisibleLineNumberItems(); - base.OnPaint(e); - - // --- QualitySettings - if (zLineNumbers_AntiAlias == true) { - e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; - } else { - e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SystemDefault; - } - - // --- Local Declarations - string zTextToShow = ""; - string zReminderToShow = ""; - StringFormat zSF = new StringFormat(); - SizeF zTextSize = default(SizeF); - Pen zPen = new Pen(this.ForeColor); - SolidBrush zBrush = new SolidBrush(this.ForeColor); - Point zPoint = new Point(0, 0); - Rectangle zItemClipRectangle = new Rectangle(0, 0, 0, 0); - - // NOTE: The GraphicsPaths are only used for SeeThroughMode - // FillMode.Winding: combined outline ( Alternate: XOR'ed outline ) - System.Drawing.Drawing2D.GraphicsPath zGP_GridLines = new System.Drawing.Drawing2D.GraphicsPath(System.Drawing.Drawing2D.FillMode.Winding); - System.Drawing.Drawing2D.GraphicsPath zGP_BorderLines = new System.Drawing.Drawing2D.GraphicsPath(System.Drawing.Drawing2D.FillMode.Winding); - System.Drawing.Drawing2D.GraphicsPath zGP_MarginLines = new System.Drawing.Drawing2D.GraphicsPath(System.Drawing.Drawing2D.FillMode.Winding); - System.Drawing.Drawing2D.GraphicsPath zGP_LineNumbers = new System.Drawing.Drawing2D.GraphicsPath(System.Drawing.Drawing2D.FillMode.Winding); - Region zRegion = new Region(base.ClientRectangle); - - - // ---------------------------------------------- - // --- DESIGNTIME / NO VISIBLE ITEMS - if (this.DesignMode == true) { - // Show a vertical reminder message - if (zParent == null) { - zReminderToShow = "-!- Set ParentRichTextBox -!-"; - } else { - if (zLNIs.Count == 0) - zReminderToShow = "LineNrs ( " + zParent.Name + " )"; - } - if (zReminderToShow.Length > 0) { - // --- Centering and Rotation for the reminder message - e.Graphics.TranslateTransform(this.Width / 2, this.Height / 2); - e.Graphics.RotateTransform(-90); - zSF.Alignment = StringAlignment.Center; - zSF.LineAlignment = StringAlignment.Center; - // --- Show the reminder message (with small shadow) - zTextSize = e.Graphics.MeasureString(zReminderToShow, this.Font, zPoint, zSF); - e.Graphics.DrawString(zReminderToShow, this.Font, Brushes.WhiteSmoke, 1, 1, zSF); - e.Graphics.DrawString(zReminderToShow, this.Font, Brushes.Firebrick, 0, 0, zSF); - e.Graphics.ResetTransform(); - - //Rectangle zReminderRectangle = new Rectangle(this.Width / 2 - zTextSize.Height / 2, this.Height / 2 - zTextSize.Width / 2, zTextSize.Height, zTextSize.Width); - Rectangle zReminderRectangle = new Rectangle((int)(this.Width / 2 - zTextSize.Height / 2), (int)(this.Height / 2 - zTextSize.Width / 2), (int)(zTextSize.Height), (int)(zTextSize.Width)); - zGP_LineNumbers.AddRectangle(zReminderRectangle); - zGP_LineNumbers.CloseFigure(); - - if (zAutoSizing == true) { - zReminderRectangle.Inflate((int)(zTextSize.Height * 0.2), (int)(zTextSize.Width * 0.1)); - //zReminderRectangle.Inflate(zTextSize.Height * 0.2, zTextSize.Width * 0.1); - zAutoSizing_Size = new Size(zReminderRectangle.Width, zReminderRectangle.Height); - } - } - } - - - // ---------------------------------------------- - // --- DESIGN OR RUNTIME / WITH VISIBLE ITEMS (which means zParent exists) - if (zLNIs.Count > 0) { - // The visible LineNumberItems with their BackgroundGradient and GridLines - // Loop through every visible LineNumberItem - System.Drawing.Drawing2D.LinearGradientBrush zLGB = null; - zPen = new Pen(zGridLines_Color, zGridLines_Thickness); - zPen.DashStyle = zGridLines_Style; - zSF.Alignment = StringAlignment.Near; - zSF.LineAlignment = StringAlignment.Near; - //zSF.FormatFlags = StringFormatFlags.FitBlackBox + StringFormatFlags.NoClip + StringFormatFlags.NoWrap; - zSF.FormatFlags = StringFormatFlags.FitBlackBox | StringFormatFlags.NoClip | StringFormatFlags.NoWrap; - - - for (int zA = 0; zA <= zLNIs.Count - 1; zA++) { - // --- BackgroundGradient - if (zGradient_Show == true) { - //zLGB = new Drawing2D.LinearGradientBrush(zLNIs(zA).Rectangle, zGradient_StartColor, zGradient_EndColor, zGradient_Direction); - zLGB = new System.Drawing.Drawing2D.LinearGradientBrush(zLNIs[zA].Rectangle, zGradient_StartColor, zGradient_EndColor, zGradient_Direction); - e.Graphics.FillRectangle(zLGB, zLNIs[zA].Rectangle); - //e.Graphics.FillRectangle(zLGB, zLNIs(zA).Rectangle); - } - - // --- GridLines - if (zGridLines_Show == true) { - e.Graphics.DrawLine(zPen, new Point(0, zLNIs[zA].Rectangle.Y), new Point(this.Width, zLNIs[zA].Rectangle.Y)); - //e.Graphics.DrawLine(zPen, new Point(0, zLNIs(zA).Rectangle.Y), new Point(this.Width, zLNIs(zA).Rectangle.Y)); - - // NOTE: Every item in a GraphicsPath is a closed figure, so instead of adding gridlines as lines, we'll add them - // as rectangles that loop out of sight. Their height uses the zContentRectangle which is the maxsize of - // the ParentRichTextBox's contents. - // NOTE: Slight adjustment needed when the first item has a negative Y coordinate. - // This explains the " - zLNIs(0).Rectangle.Y" (which adds the negative size to the height - // to make sure the rectangle's bottompart stays out of sight) - //zGP_GridLines.AddRectangle(new Rectangle(-zGridLines_Thickness, zLNIs(zA).Rectangle.Y, this.Width + zGridLines_Thickness * 2, this.Height - zLNIs(0).Rectangle.Y + zGridLines_Thickness)); - zGP_GridLines.AddRectangle(new Rectangle( (int)(-zGridLines_Thickness), - (int)(zLNIs[zA].Rectangle.Y), - (int)(this.Width + zGridLines_Thickness * 2), - (int)(this.Height - zLNIs[zA].Rectangle.Y + zGridLines_Thickness) - )); - zGP_GridLines.CloseFigure(); - } - - // --- LineNumbers - if (zLineNumbers_Show == true) { - // TextFormatting - if (zLineNumbers_ShowLeadingZeroes == true) { - zTextToShow = (zLineNumbers_ShowAsHexadecimal ? zLNIs[zA].LineNumber.ToString("X") : zLNIs[zA].LineNumber.ToString(zLineNumbers_Format)); - //zTextToShow = (zLineNumbers_ShowAsHexadecimal ? zLNIs(zA).LineNumber.ToString("X") : zLNIs(zA).LineNumber.ToString(zLineNumbers_Format)); - } else { - zTextToShow = (zLineNumbers_ShowAsHexadecimal ? zLNIs[zA].LineNumber.ToString("X") : zLNIs[zA].LineNumber.ToString()); - //zTextToShow = (zLineNumbers_ShowAsHexadecimal ? zLNIs(zA).LineNumber.ToString("X") : zLNIs(zA).LineNumber.ToString); - } - - // TextSizing - zTextSize = e.Graphics.MeasureString(zTextToShow, this.Font, zPoint, zSF); - // TextAlignment and positioning (zPoint = TopLeftCornerPoint of the text) - // TextAlignment, padding, manual offset (via LineNrs_Offset) and zTextSize are all included in the calculation of zPoint. - switch (zLineNumbers_Alignment) { - case ContentAlignment.TopLeft: - zPoint = new Point((int)(zLNIs[zA].Rectangle.Left + this.Padding.Left + zLineNumbers_Offset.Width), (int)(zLNIs[zA].Rectangle.Top + this.Padding.Top + zLineNumbers_Offset.Height)); - break; - case ContentAlignment.MiddleLeft: - zPoint = new Point((int)(zLNIs[zA].Rectangle.Left + this.Padding.Left + zLineNumbers_Offset.Width), (int)(zLNIs[zA].Rectangle.Top + (zLNIs[zA].Rectangle.Height / 2) + zLineNumbers_Offset.Height - zTextSize.Height / 2)); - break; - case ContentAlignment.BottomLeft: - zPoint = new Point((int)(zLNIs[zA].Rectangle.Left + this.Padding.Left + zLineNumbers_Offset.Width), (int)(zLNIs[zA].Rectangle.Bottom - this.Padding.Bottom + 1 + zLineNumbers_Offset.Height - zTextSize.Height)); - break; - case ContentAlignment.TopCenter: - zPoint = new Point((int)(zLNIs[zA].Rectangle.Width / 2 + zLineNumbers_Offset.Width - zTextSize.Width / 2), (int)(zLNIs[zA].Rectangle.Top + this.Padding.Top + zLineNumbers_Offset.Height)); - break; - case ContentAlignment.MiddleCenter: - zPoint = new Point((int)(zLNIs[zA].Rectangle.Width / 2 + zLineNumbers_Offset.Width - zTextSize.Width / 2), (int)(zLNIs[zA].Rectangle.Top + (zLNIs[zA].Rectangle.Height / 2) + zLineNumbers_Offset.Height - zTextSize.Height / 2)); - break; - case ContentAlignment.BottomCenter: - zPoint = new Point((int)(zLNIs[zA].Rectangle.Width / 2 + zLineNumbers_Offset.Width - zTextSize.Width / 2), (int)(zLNIs[zA].Rectangle.Bottom - this.Padding.Bottom + 1 + zLineNumbers_Offset.Height - zTextSize.Height)); - break; - case ContentAlignment.TopRight: - zPoint = new Point((int)(zLNIs[zA].Rectangle.Right - this.Padding.Right + zLineNumbers_Offset.Width - zTextSize.Width), (int)(zLNIs[zA].Rectangle.Top + this.Padding.Top + zLineNumbers_Offset.Height)); - break; - case ContentAlignment.MiddleRight: - zPoint = new Point((int)(zLNIs[zA].Rectangle.Right - this.Padding.Right + zLineNumbers_Offset.Width - zTextSize.Width), (int)(zLNIs[zA].Rectangle.Top + (zLNIs[zA].Rectangle.Height / 2) + zLineNumbers_Offset.Height - zTextSize.Height / 2)); - break; - case ContentAlignment.BottomRight: - zPoint = new Point((int)(zLNIs[zA].Rectangle.Right - this.Padding.Right + zLineNumbers_Offset.Width - zTextSize.Width), (int)(zLNIs[zA].Rectangle.Bottom - this.Padding.Bottom + 1 + zLineNumbers_Offset.Height - zTextSize.Height)); - break; - } - // TextClipping - zItemClipRectangle = new Rectangle(zPoint, zTextSize.ToSize()); - if (zLineNumbers_ClipByItemRectangle == true) { - // If selected, the text will be clipped so that it doesn't spill out of its own LineNumberItem-area. - // Only the part of the text inside the LineNumberItem.Rectangle should be visible, so intersect with the ItemRectangle - // The SetClip method temporary restricts the drawing area of the control for whatever is drawn next. - zItemClipRectangle.Intersect(zLNIs[zA].Rectangle); - e.Graphics.SetClip(zItemClipRectangle); - } - // TextDrawing - e.Graphics.DrawString(zTextToShow, this.Font, zBrush, zPoint, zSF); - e.Graphics.ResetClip(); - // The GraphicsPath for the LineNumber is just a rectangle behind the text, to keep the paintingspeed high and avoid ugly artifacts. - zGP_LineNumbers.AddRectangle(zItemClipRectangle); - zGP_LineNumbers.CloseFigure(); - } - } - - // --- GridLinesThickness and Linestyle in SeeThroughMode. All GraphicsPath lines are drawn as solid to keep the paintingspeed high. - if (zGridLines_Show == true) { - zPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid; - zGP_GridLines.Widen(zPen); - } - - // --- Memory CleanUp - if (zLGB != null) - zLGB.Dispose(); - } - - - // ---------------------------------------------- - // --- DESIGN OR RUNTIME / ALWAYS - //Point zP_Left = new Point(Math.Floor(zBorderLines_Thickness / 2), Math.Floor(zBorderLines_Thickness / 2)); - //Point zP_Right = new Point(this.Width - Math.Ceiling(zBorderLines_Thickness / 2), this.Height - Math.Ceiling(zBorderLines_Thickness / 2)); - - Point zP_Left = new Point( - (int)(Math.Floor(zBorderLines_Thickness / 2)), - (int)(Math.Floor(zBorderLines_Thickness / 2)) - ); - Point zP_Right = new Point( - (int)(this.Width - Math.Ceiling(zBorderLines_Thickness / 2)), - (int)(this.Height - Math.Ceiling(zBorderLines_Thickness / 2)) - ); - - // --- BorderLines - Point[] zBorderLines_Points = { - new Point(zP_Left.X, zP_Left.Y), - new Point(zP_Right.X, zP_Left.Y), - new Point(zP_Right.X, zP_Right.Y), - new Point(zP_Left.X, zP_Right.Y), - new Point(zP_Left.X, zP_Left.Y) - }; - if (zBorderLines_Show == true) { - zPen = new Pen(zBorderLines_Color, zBorderLines_Thickness); - zPen.DashStyle = zBorderLines_Style; - e.Graphics.DrawLines(zPen, zBorderLines_Points); - zGP_BorderLines.AddLines(zBorderLines_Points); - zGP_BorderLines.CloseFigure(); - // BorderThickness and Style for SeeThroughMode - zPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid; - zGP_BorderLines.Widen(zPen); - } - - - // --- MarginLines - if (zMarginLines_Show == true && zMarginLines_Side > LineNumberDockSide.None) { - zP_Left = new Point((int)(-zMarginLines_Thickness), (int)(-zMarginLines_Thickness)); - zP_Right = new Point((int)(this.Width + zMarginLines_Thickness), (int)(this.Height + zMarginLines_Thickness)); - zPen = new Pen(zMarginLines_Color, zMarginLines_Thickness); - zPen.DashStyle = zMarginLines_Style; - if (zMarginLines_Side == LineNumberDockSide.Left | zMarginLines_Side == LineNumberDockSide.Height) { - e.Graphics.DrawLine(zPen, new Point( - (int)(Math.Floor(zMarginLines_Thickness / 2)), 0), - new Point( - (int)(Math.Floor(zMarginLines_Thickness / 2)), - this.Height - 1) - ); - zP_Left = new Point( - (int)(Math.Ceiling(zMarginLines_Thickness / 2)), - (int)(-zMarginLines_Thickness)); - } - if (zMarginLines_Side == LineNumberDockSide.Right | zMarginLines_Side == LineNumberDockSide.Height) { - e.Graphics.DrawLine(zPen, new Point( - (int)(this.Width - Math.Ceiling(zMarginLines_Thickness / 2)), 0), - new Point( - (int)(this.Width - Math.Ceiling(zMarginLines_Thickness / 2)), - (int)(this.Height - 1)) - ); - - zP_Right = new Point( - (int)(this.Width - Math.Ceiling(zMarginLines_Thickness / 2)), - (int)(this.Height + zMarginLines_Thickness) - ); - } - // GraphicsPath for the MarginLines(s): - // MarginLines(s) are drawn as a rectangle connecting the zP_Left and zP_Right points, which are either inside or - // outside of sight, depending on whether the MarginLines at that side is visible. zP_Left: TopLeft and ZP_Right: BottomRight - zGP_MarginLines.AddRectangle(new Rectangle(zP_Left, new Size(zP_Right.X - zP_Left.X, zP_Right.Y - zP_Left.Y))); - zPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid; - zGP_MarginLines.Widen(zPen); - } - - - // ---------------------------------------------- - // --- SeeThroughMode - // combine all the GraphicsPaths (= zGP_... ) and set them as the region for the control. - if (zSeeThroughMode == true) { - zRegion.MakeEmpty(); - zRegion.Union(zGP_BorderLines); - zRegion.Union(zGP_MarginLines); - zRegion.Union(zGP_GridLines); - zRegion.Union(zGP_LineNumbers); - } - - // --- Region - if (zRegion.GetBounds(e.Graphics).IsEmpty == true) { - // Note: If the control is in a condition that would show it as empty, then a border-region is still drawn regardless of it's borders on/off state. - // This is added to make sure that the bounds of the control are never lost (it would remain empty if this was not done). - zGP_BorderLines.AddLines(zBorderLines_Points); - zGP_BorderLines.CloseFigure(); - zPen = new Pen(zBorderLines_Color, 1); - zPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid; - zGP_BorderLines.Widen(zPen); - - zRegion = new Region(zGP_BorderLines); - } - this.Region = zRegion; - - - // ---------------------------------------------- - // --- Memory CleanUp - if (zPen != null) - zPen.Dispose(); - if (zBrush != null) - zPen.Dispose(); - if (zRegion != null) - zRegion.Dispose(); - if (zGP_GridLines != null) - zGP_GridLines.Dispose(); - if (zGP_BorderLines != null) - zGP_BorderLines.Dispose(); - if (zGP_MarginLines != null) - zGP_MarginLines.Dispose(); - if (zGP_LineNumbers != null) - zGP_LineNumbers.Dispose(); - - } - - - //////////////////////////////////////////////////////////////////////////////////////////////////// - - private void zTimer_Tick(object sender, System.EventArgs e) - { - zParentIsScrolling = false; - zTimer.Stop(); - this.Invalidate(); - } - - private void zParent_Changed(object sender, System.EventArgs e) - { - this.Refresh(); - this.Invalidate(); - } - - private void zParent_Scroll(object sender, System.EventArgs e) - { - zParentIsScrolling = true; - this.Invalidate(); - this.Refresh(); - } - - private void zParent_ContentsResized(object sender, System.Windows.Forms.ContentsResizedEventArgs e) - { - zContentRectangle = e.NewRectangle; - this.Refresh(); - this.Invalidate(); - } - - private void zParent_Disposed(object sender, System.EventArgs e) - { - this.ParentRichTextBox = null; - this.Refresh(); - this.Invalidate(); - } - - - } -} diff --git a/Crypto Notepad/MainForm.Designer.cs b/Crypto Notepad/MainForm.Designer.cs index df6ca60..a4c0eea 100644 --- a/Crypto Notepad/MainForm.Designer.cs +++ b/Crypto Notepad/MainForm.Designer.cs @@ -124,7 +124,6 @@ public void InitializeComponent() this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.richTextBoxPanel = new System.Windows.Forms.Panel(); this.richTextBox = new Crypto_Notepad.ExRichTextBox(); - this.lineNumbers = new LineNumbers.LineNumbers(); this.statusPanelTimer = new System.Windows.Forms.Timer(this.components); this.mainMenu.SuspendLayout(); this.contextMenu.SuspendLayout(); @@ -1159,7 +1158,6 @@ public void InitializeComponent() this.richTextBoxPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.richTextBoxPanel.Controls.Add(this.fileLockedPanel); this.richTextBoxPanel.Controls.Add(this.richTextBox); - this.richTextBoxPanel.Controls.Add(this.lineNumbers); this.richTextBoxPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.richTextBoxPanel.Location = new System.Drawing.Point(0, 48); this.richTextBoxPanel.Name = "richTextBoxPanel"; @@ -1175,9 +1173,9 @@ public void InitializeComponent() this.richTextBox.Dock = System.Windows.Forms.DockStyle.Fill; this.richTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.richTextBox.ForeColor = System.Drawing.Color.Black; - this.richTextBox.Location = new System.Drawing.Point(22, 0); + this.richTextBox.Location = new System.Drawing.Point(0, 0); this.richTextBox.Name = "richTextBox"; - this.richTextBox.Size = new System.Drawing.Size(480, 184); + this.richTextBox.Size = new System.Drawing.Size(502, 184); this.richTextBox.TabIndex = 16; this.richTextBox.Text = ""; this.richTextBox.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.RichTextBox_LinkClicked); @@ -1185,49 +1183,6 @@ public void InitializeComponent() this.richTextBox.TextChanged += new System.EventHandler(this.RichTextBox_TextChanged); this.richTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.RichTextBox_KeyDown); // - // lineNumbers - // - this.lineNumbers._SeeThroughMode_ = false; - this.lineNumbers.AutoSizing = true; - this.lineNumbers.BackColor = System.Drawing.SystemColors.Control; - this.lineNumbers.BackgroundGradient_AlphaColor = System.Drawing.Color.Transparent; - this.lineNumbers.BackgroundGradient_BetaColor = System.Drawing.Color.Transparent; - this.lineNumbers.BackgroundGradient_Direction = System.Drawing.Drawing2D.LinearGradientMode.Horizontal; - this.lineNumbers.BorderLines_Color = System.Drawing.Color.Transparent; - this.lineNumbers.BorderLines_Style = System.Drawing.Drawing2D.DashStyle.Solid; - this.lineNumbers.BorderLines_Thickness = 1F; - this.lineNumbers.Dock = System.Windows.Forms.DockStyle.Left; - this.lineNumbers.DockSide = LineNumbers.LineNumbers.LineNumberDockSide.Left; - this.lineNumbers.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); - this.lineNumbers.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(164)))), ((int)(((byte)(164)))), ((int)(((byte)(164))))); - this.lineNumbers.GridLines_Color = System.Drawing.Color.Transparent; - this.lineNumbers.GridLines_Style = System.Drawing.Drawing2D.DashStyle.Solid; - this.lineNumbers.GridLines_Thickness = 1F; - this.lineNumbers.LineNrs_Alignment = System.Drawing.ContentAlignment.TopCenter; - this.lineNumbers.LineNrs_AntiAlias = false; - this.lineNumbers.LineNrs_AsHexadecimal = false; - this.lineNumbers.LineNrs_ClippedByItemRectangle = true; - this.lineNumbers.LineNrs_LeadingZeroes = false; - this.lineNumbers.LineNrs_Offset = new System.Drawing.Size(0, 0); - this.lineNumbers.Location = new System.Drawing.Point(0, 0); - this.lineNumbers.Margin = new System.Windows.Forms.Padding(0); - this.lineNumbers.MarginLines_Color = System.Drawing.Color.DarkGray; - this.lineNumbers.MarginLines_Side = LineNumbers.LineNumbers.LineNumberDockSide.None; - this.lineNumbers.MarginLines_Style = System.Drawing.Drawing2D.DashStyle.Solid; - this.lineNumbers.MarginLines_Thickness = 1F; - this.lineNumbers.Name = "lineNumbers"; - this.lineNumbers.Padding = new System.Windows.Forms.Padding(0, 0, 2, 0); - this.lineNumbers.ParentRichTextBox = this.richTextBox; - this.lineNumbers.Show_BackgroundGradient = false; - this.lineNumbers.Show_BorderLines = false; - this.lineNumbers.Show_GridLines = false; - this.lineNumbers.Show_LineNrs = true; - this.lineNumbers.Show_MarginLines = false; - this.lineNumbers.Size = new System.Drawing.Size(22, 184); - this.lineNumbers.TabIndex = 19; - this.lineNumbers.Visible = false; - this.lineNumbers.VisibleChanged += new System.EventHandler(this.LineNumbers_VisibleChanged); - // // statusPanelTimer // this.statusPanelTimer.Interval = 1; @@ -1356,7 +1311,6 @@ public void InitializeComponent() public System.Windows.Forms.TableLayoutPanel toolbarPanel; public ExRichTextBox richTextBox; public System.Windows.Forms.ToolStripMenuItem insertMainMenu; - public LineNumbers.LineNumbers lineNumbers; protected internal System.Windows.Forms.StatusStrip statusPanel; protected internal System.Windows.Forms.ToolStripStatusLabel statusPanelLabel; protected internal System.Windows.Forms.TextBox searchTextBox; diff --git a/Crypto Notepad/MainForm.cs b/Crypto Notepad/MainForm.cs index cf7480f..cd51621 100644 --- a/Crypto Notepad/MainForm.cs +++ b/Crypto Notepad/MainForm.cs @@ -1,16 +1,13 @@ using Crypto_Notepad.Properties; using System; -using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Drawing; -using System.Drawing.Drawing2D; using System.IO; using System.Linq; using System.Net; using System.Reflection; using System.Security.Cryptography; -using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; @@ -526,13 +523,11 @@ private void LoadSettings() if (settings.editorRightToLeft) { richTextBox.RightToLeft = RightToLeft.Yes; - lineNumbers.Dock = DockStyle.Right; rightToLeftContextMenu.Checked = true; } else { richTextBox.RightToLeft = RightToLeft.No; - lineNumbers.Dock = DockStyle.Left; rightToLeftContextMenu.Checked = false; } if (settings.insertKey == "Disable") @@ -591,20 +586,6 @@ private void LoadSettings() searchFindNextButton.ForeColor = settings.searchPanelForeColor; searchCloseButton.ForeColor = settings.searchPanelForeColor; searchPanel.CellBorderStyle = (TableLayoutPanelCellBorderStyle)Enum.Parse(typeof(TableLayoutPanelCellBorderStyle), settings.searchPanelBorder); - lineNumbers.BackColor = settings.lineNumbersBackColor; - lineNumbers.Font = settings.editorFont; - lineNumbers.ForeColor = settings.lineNumbersForeColor; - 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) @@ -694,17 +675,6 @@ private void StatusPanel_VisibleChanged(object sender, EventArgs e) StatusPanelTextInfo(); } } - private void LineNumbers_VisibleChanged(object sender, EventArgs e) - { - if (lineNumbers.Visible) - { - lineNumbers.ParentRichTextBox = richTextBox; - } - else - { - lineNumbers.ParentRichTextBox = null; - } - } private void MainForm_Resize(object sender, EventArgs e) { @@ -736,7 +706,6 @@ private void MainWindow_Activated(object sender, EventArgs e) { richTextBox.Modified = true; } - lineNumbers.Refresh(); } private void MainWindow_FormClosing(object sender, FormClosingEventArgs e) @@ -804,7 +773,6 @@ private void MainForm_Shown(object sender, EventArgs e) Visible = true; richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0); richTextBox.Modified = false; - lineNumbers.Refresh(); } private void MainWindow_Load(object sender, EventArgs e) @@ -1413,14 +1381,12 @@ private void RightToLeftContextMenu_Click(object sender, EventArgs e) richTextBox.Text = rtbTxt; } settings.editorRightToLeft = true; - lineNumbers.Dock = DockStyle.Right; richTextBox.Modified = false; } else { richTextBox.RightToLeft = RightToLeft.No; settings.editorRightToLeft = false; - lineNumbers.Dock = DockStyle.Left; richTextBox.Modified = false; } settings.Save(); diff --git a/Crypto Notepad/SettingsForm.Designer.cs b/Crypto Notepad/SettingsForm.Designer.cs index b510df6..c63e57f 100644 --- a/Crypto Notepad/SettingsForm.Designer.cs +++ b/Crypto Notepad/SettingsForm.Designer.cs @@ -32,6 +32,14 @@ private void InitializeComponent() this.editorFontColorLabel = new System.Windows.Forms.Label(); this.colorDialog = new System.Windows.Forms.ColorDialog(); this.settingsTabControl = new System.Windows.Forms.TabControl(); + this.applicationTabPage = new System.Windows.Forms.TabPage(); + this.singleInstanceCheckBox = new System.Windows.Forms.CheckBox(); + this.closeToTrayCheckBox = new System.Windows.Forms.CheckBox(); + this.minimizeToTrayCheckBox = new System.Windows.Forms.CheckBox(); + this.mainMenuCheckBox = new System.Windows.Forms.CheckBox(); + this.menuIconsCheckBox = new System.Windows.Forms.CheckBox(); + this.autoCheckUpdatesCheckBox = new System.Windows.Forms.CheckBox(); + this.autoLockOnMinimizeCheckBox = new System.Windows.Forms.CheckBox(); this.editorTabPage = new System.Windows.Forms.TabPage(); this.editorBorderLabel = new System.Windows.Forms.Label(); this.editorBorderComboBox = new System.Windows.Forms.ComboBox(); @@ -45,14 +53,6 @@ private void InitializeComponent() this.editorInsertKeyLabel = new System.Windows.Forms.Label(); this.editorBackColor = new System.Windows.Forms.Panel(); this.editorFontColor = new System.Windows.Forms.Panel(); - this.applicationTabPage = new System.Windows.Forms.TabPage(); - this.singleInstanceCheckBox = new System.Windows.Forms.CheckBox(); - this.closeToTrayCheckBox = new System.Windows.Forms.CheckBox(); - this.minimizeToTrayCheckBox = new System.Windows.Forms.CheckBox(); - this.mainMenuCheckBox = new System.Windows.Forms.CheckBox(); - this.menuIconsCheckBox = new System.Windows.Forms.CheckBox(); - this.autoCheckUpdatesCheckBox = new System.Windows.Forms.CheckBox(); - this.autoLockOnMinimizeCheckBox = new System.Windows.Forms.CheckBox(); this.integrationTabPage = new System.Windows.Forms.TabPage(); this.integrateCheckBox = new System.Windows.Forms.CheckBox(); this.associateCheckBox = new System.Windows.Forms.CheckBox(); @@ -64,37 +64,6 @@ private void InitializeComponent() this.keySizeLabel = new System.Windows.Forms.Label(); this.hashAlgorithmLabel = new System.Windows.Forms.Label(); this.keySizeComboBox = new System.Windows.Forms.ComboBox(); - this.lineNumbersTabPage = new System.Windows.Forms.TabPage(); - this.marginLinesGroupBox = new System.Windows.Forms.GroupBox(); - this.marginLinesStyleComboBox = new System.Windows.Forms.ComboBox(); - this.marginLinesStyleLabel = new System.Windows.Forms.Label(); - this.marginLinesSideComboBox = new System.Windows.Forms.ComboBox(); - this.marginLinesColor = new System.Windows.Forms.Panel(); - this.marginLinesSideLabel = new System.Windows.Forms.Label(); - this.marginLinesColorLabel = new System.Windows.Forms.Label(); - this.marginLinesVisibleComboBox = new System.Windows.Forms.ComboBox(); - this.marginLinesVisibleLabel = new System.Windows.Forms.Label(); - this.gridLinesGroupBox = new System.Windows.Forms.GroupBox(); - this.gridLinesVisibleComboBox = new System.Windows.Forms.ComboBox(); - this.gridLinesStyleComboBox = new System.Windows.Forms.ComboBox(); - this.gridLinesColor = new System.Windows.Forms.Panel(); - this.gridLinesVisibleLabel = new System.Windows.Forms.Label(); - this.gridLinesStyleLabel = new System.Windows.Forms.Label(); - this.gridLinesColorLabel = new System.Windows.Forms.Label(); - this.borderLinesGroupBox = new System.Windows.Forms.GroupBox(); - this.borderLinesVisibleСomboBox = new System.Windows.Forms.ComboBox(); - this.borderLinesStyleComboBox = new System.Windows.Forms.ComboBox(); - this.borderLinesColorLabel = new System.Windows.Forms.Label(); - this.borderLinesStyleLabel = new System.Windows.Forms.Label(); - this.borderLinesVisibleLabel = new System.Windows.Forms.Label(); - this.borderLinesColor = new System.Windows.Forms.Panel(); - this.lineNumbersGroupBox = new System.Windows.Forms.GroupBox(); - this.lineNumbersVisibleComboBox = new System.Windows.Forms.ComboBox(); - this.lineNumbersBackColor = new System.Windows.Forms.Panel(); - this.lineNumbersVisibleLabel = new System.Windows.Forms.Label(); - this.lineNumbersFontColor = new System.Windows.Forms.Panel(); - this.lineNumbersFontColorLabel = new System.Windows.Forms.Label(); - this.lineNumbersBackColorLabel = new System.Windows.Forms.Label(); this.statusPanelTabPage = new System.Windows.Forms.TabPage(); this.statusPanelVisibleCheckBox = new System.Windows.Forms.CheckBox(); this.statusPanelBackColor = new System.Windows.Forms.Panel(); @@ -118,15 +87,10 @@ private void InitializeComponent() this.settingsNavigation = new System.Windows.Forms.ListBox(); this.fontDialog = new System.Windows.Forms.FontDialog(); this.settingsTabControl.SuspendLayout(); - this.editorTabPage.SuspendLayout(); this.applicationTabPage.SuspendLayout(); + this.editorTabPage.SuspendLayout(); this.integrationTabPage.SuspendLayout(); this.encryptionTabPage.SuspendLayout(); - this.lineNumbersTabPage.SuspendLayout(); - this.marginLinesGroupBox.SuspendLayout(); - this.gridLinesGroupBox.SuspendLayout(); - this.borderLinesGroupBox.SuspendLayout(); - this.lineNumbersGroupBox.SuspendLayout(); this.statusPanelTabPage.SuspendLayout(); this.toolbarTabPage.SuspendLayout(); this.searchPanelTabPage.SuspendLayout(); @@ -152,7 +116,6 @@ private void InitializeComponent() this.settingsTabControl.Controls.Add(this.editorTabPage); this.settingsTabControl.Controls.Add(this.integrationTabPage); this.settingsTabControl.Controls.Add(this.encryptionTabPage); - this.settingsTabControl.Controls.Add(this.lineNumbersTabPage); this.settingsTabControl.Controls.Add(this.statusPanelTabPage); this.settingsTabControl.Controls.Add(this.toolbarTabPage); this.settingsTabControl.Controls.Add(this.searchPanelTabPage); @@ -165,6 +128,101 @@ private void InitializeComponent() this.settingsTabControl.TabIndex = 4; this.settingsTabControl.SelectedIndexChanged += new System.EventHandler(this.SettingsTabControl_SelectedIndexChanged); // + // applicationTabPage + // + this.applicationTabPage.BackColor = System.Drawing.SystemColors.Window; + this.applicationTabPage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.applicationTabPage.Controls.Add(this.singleInstanceCheckBox); + this.applicationTabPage.Controls.Add(this.closeToTrayCheckBox); + this.applicationTabPage.Controls.Add(this.minimizeToTrayCheckBox); + this.applicationTabPage.Controls.Add(this.mainMenuCheckBox); + this.applicationTabPage.Controls.Add(this.menuIconsCheckBox); + this.applicationTabPage.Controls.Add(this.autoCheckUpdatesCheckBox); + this.applicationTabPage.Controls.Add(this.autoLockOnMinimizeCheckBox); + this.applicationTabPage.Location = new System.Drawing.Point(4, 44); + this.applicationTabPage.Name = "applicationTabPage"; + this.applicationTabPage.Padding = new System.Windows.Forms.Padding(3); + this.applicationTabPage.Size = new System.Drawing.Size(244, 237); + this.applicationTabPage.TabIndex = 2; + this.applicationTabPage.Text = "app"; + // + // singleInstanceCheckBox + // + this.singleInstanceCheckBox.AutoSize = true; + this.singleInstanceCheckBox.Location = new System.Drawing.Point(7, 155); + this.singleInstanceCheckBox.Name = "singleInstanceCheckBox"; + this.singleInstanceCheckBox.Size = new System.Drawing.Size(105, 19); + this.singleInstanceCheckBox.TabIndex = 6; + this.singleInstanceCheckBox.Text = "Single instance"; + this.singleInstanceCheckBox.UseVisualStyleBackColor = true; + this.singleInstanceCheckBox.Click += new System.EventHandler(this.SingleInstanceCheckBox_Click); + // + // closeToTrayCheckBox + // + this.closeToTrayCheckBox.AutoSize = true; + this.closeToTrayCheckBox.Location = new System.Drawing.Point(7, 130); + this.closeToTrayCheckBox.Name = "closeToTrayCheckBox"; + this.closeToTrayCheckBox.Size = new System.Drawing.Size(92, 19); + this.closeToTrayCheckBox.TabIndex = 5; + this.closeToTrayCheckBox.Text = "Close to tray"; + this.closeToTrayCheckBox.UseVisualStyleBackColor = true; + this.closeToTrayCheckBox.Click += new System.EventHandler(this.CloseToTrayCheckBox_Click); + // + // minimizeToTrayCheckBox + // + this.minimizeToTrayCheckBox.AutoSize = true; + this.minimizeToTrayCheckBox.Location = new System.Drawing.Point(7, 105); + this.minimizeToTrayCheckBox.Name = "minimizeToTrayCheckBox"; + this.minimizeToTrayCheckBox.Size = new System.Drawing.Size(112, 19); + this.minimizeToTrayCheckBox.TabIndex = 4; + this.minimizeToTrayCheckBox.Text = "Minimize to tray"; + this.minimizeToTrayCheckBox.UseVisualStyleBackColor = true; + this.minimizeToTrayCheckBox.Click += new System.EventHandler(this.MinimizeToTrayCheckBox_Click); + // + // mainMenuCheckBox + // + this.mainMenuCheckBox.AutoSize = true; + this.mainMenuCheckBox.Location = new System.Drawing.Point(7, 55); + this.mainMenuCheckBox.Name = "mainMenuCheckBox"; + this.mainMenuCheckBox.Size = new System.Drawing.Size(87, 19); + this.mainMenuCheckBox.TabIndex = 2; + this.mainMenuCheckBox.Text = "Main menu"; + this.mainMenuCheckBox.UseVisualStyleBackColor = true; + this.mainMenuCheckBox.Click += new System.EventHandler(this.MainMenuCheckBox_Click); + // + // menuIconsCheckBox + // + this.menuIconsCheckBox.AutoSize = true; + this.menuIconsCheckBox.Location = new System.Drawing.Point(7, 80); + this.menuIconsCheckBox.Name = "menuIconsCheckBox"; + this.menuIconsCheckBox.Size = new System.Drawing.Size(88, 19); + this.menuIconsCheckBox.TabIndex = 3; + this.menuIconsCheckBox.Text = "Menu icons"; + this.menuIconsCheckBox.UseVisualStyleBackColor = true; + this.menuIconsCheckBox.Click += new System.EventHandler(this.MenuIconsCheckBox_Click); + // + // autoCheckUpdatesCheckBox + // + this.autoCheckUpdatesCheckBox.AutoSize = true; + this.autoCheckUpdatesCheckBox.Location = new System.Drawing.Point(7, 30); + this.autoCheckUpdatesCheckBox.Name = "autoCheckUpdatesCheckBox"; + this.autoCheckUpdatesCheckBox.Size = new System.Drawing.Size(131, 19); + this.autoCheckUpdatesCheckBox.TabIndex = 1; + this.autoCheckUpdatesCheckBox.Text = "Auto check updates"; + this.autoCheckUpdatesCheckBox.UseVisualStyleBackColor = true; + this.autoCheckUpdatesCheckBox.Click += new System.EventHandler(this.AutoCheckUpdatesCheckBox_Click); + // + // autoLockOnMinimizeCheckBox + // + this.autoLockOnMinimizeCheckBox.AutoSize = true; + this.autoLockOnMinimizeCheckBox.Location = new System.Drawing.Point(7, 7); + this.autoLockOnMinimizeCheckBox.Name = "autoLockOnMinimizeCheckBox"; + this.autoLockOnMinimizeCheckBox.Size = new System.Drawing.Size(146, 19); + this.autoLockOnMinimizeCheckBox.TabIndex = 0; + this.autoLockOnMinimizeCheckBox.Text = "Auto lock on minimize"; + this.autoLockOnMinimizeCheckBox.UseVisualStyleBackColor = true; + this.autoLockOnMinimizeCheckBox.Click += new System.EventHandler(this.AutoLockOnMinimizeCheckBox_Click); + // // editorTabPage // this.editorTabPage.AutoScroll = true; @@ -183,10 +241,10 @@ private void InitializeComponent() this.editorTabPage.Controls.Add(this.editorBackColor); this.editorTabPage.Controls.Add(this.editorFontColorLabel); this.editorTabPage.Controls.Add(this.editorFontColor); - this.editorTabPage.Location = new System.Drawing.Point(4, 24); + this.editorTabPage.Location = new System.Drawing.Point(4, 44); this.editorTabPage.Name = "editorTabPage"; this.editorTabPage.Padding = new System.Windows.Forms.Padding(3); - this.editorTabPage.Size = new System.Drawing.Size(244, 257); + this.editorTabPage.Size = new System.Drawing.Size(244, 237); this.editorTabPage.TabIndex = 0; this.editorTabPage.Text = "edt"; // @@ -319,101 +377,6 @@ private void InitializeComponent() this.editorFontColor.TabIndex = 0; this.editorFontColor.Click += new System.EventHandler(this.EditorFontColor_Click); // - // applicationTabPage - // - this.applicationTabPage.BackColor = System.Drawing.SystemColors.Window; - this.applicationTabPage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.applicationTabPage.Controls.Add(this.singleInstanceCheckBox); - this.applicationTabPage.Controls.Add(this.closeToTrayCheckBox); - this.applicationTabPage.Controls.Add(this.minimizeToTrayCheckBox); - this.applicationTabPage.Controls.Add(this.mainMenuCheckBox); - this.applicationTabPage.Controls.Add(this.menuIconsCheckBox); - this.applicationTabPage.Controls.Add(this.autoCheckUpdatesCheckBox); - this.applicationTabPage.Controls.Add(this.autoLockOnMinimizeCheckBox); - this.applicationTabPage.Location = new System.Drawing.Point(4, 44); - this.applicationTabPage.Name = "applicationTabPage"; - this.applicationTabPage.Padding = new System.Windows.Forms.Padding(3); - this.applicationTabPage.Size = new System.Drawing.Size(244, 237); - this.applicationTabPage.TabIndex = 2; - this.applicationTabPage.Text = "app"; - // - // singleInstanceCheckBox - // - this.singleInstanceCheckBox.AutoSize = true; - this.singleInstanceCheckBox.Location = new System.Drawing.Point(7, 155); - this.singleInstanceCheckBox.Name = "singleInstanceCheckBox"; - this.singleInstanceCheckBox.Size = new System.Drawing.Size(105, 19); - this.singleInstanceCheckBox.TabIndex = 6; - this.singleInstanceCheckBox.Text = "Single instance"; - this.singleInstanceCheckBox.UseVisualStyleBackColor = true; - this.singleInstanceCheckBox.Click += new System.EventHandler(this.SingleInstanceCheckBox_Click); - // - // closeToTrayCheckBox - // - this.closeToTrayCheckBox.AutoSize = true; - this.closeToTrayCheckBox.Location = new System.Drawing.Point(7, 130); - this.closeToTrayCheckBox.Name = "closeToTrayCheckBox"; - this.closeToTrayCheckBox.Size = new System.Drawing.Size(92, 19); - this.closeToTrayCheckBox.TabIndex = 5; - this.closeToTrayCheckBox.Text = "Close to tray"; - this.closeToTrayCheckBox.UseVisualStyleBackColor = true; - this.closeToTrayCheckBox.Click += new System.EventHandler(this.CloseToTrayCheckBox_Click); - // - // minimizeToTrayCheckBox - // - this.minimizeToTrayCheckBox.AutoSize = true; - this.minimizeToTrayCheckBox.Location = new System.Drawing.Point(7, 105); - this.minimizeToTrayCheckBox.Name = "minimizeToTrayCheckBox"; - this.minimizeToTrayCheckBox.Size = new System.Drawing.Size(112, 19); - this.minimizeToTrayCheckBox.TabIndex = 4; - this.minimizeToTrayCheckBox.Text = "Minimize to tray"; - this.minimizeToTrayCheckBox.UseVisualStyleBackColor = true; - this.minimizeToTrayCheckBox.Click += new System.EventHandler(this.MinimizeToTrayCheckBox_Click); - // - // mainMenuCheckBox - // - this.mainMenuCheckBox.AutoSize = true; - this.mainMenuCheckBox.Location = new System.Drawing.Point(7, 55); - this.mainMenuCheckBox.Name = "mainMenuCheckBox"; - this.mainMenuCheckBox.Size = new System.Drawing.Size(87, 19); - this.mainMenuCheckBox.TabIndex = 2; - this.mainMenuCheckBox.Text = "Main menu"; - this.mainMenuCheckBox.UseVisualStyleBackColor = true; - this.mainMenuCheckBox.Click += new System.EventHandler(this.MainMenuCheckBox_Click); - // - // menuIconsCheckBox - // - this.menuIconsCheckBox.AutoSize = true; - this.menuIconsCheckBox.Location = new System.Drawing.Point(7, 80); - this.menuIconsCheckBox.Name = "menuIconsCheckBox"; - this.menuIconsCheckBox.Size = new System.Drawing.Size(88, 19); - this.menuIconsCheckBox.TabIndex = 3; - this.menuIconsCheckBox.Text = "Menu icons"; - this.menuIconsCheckBox.UseVisualStyleBackColor = true; - this.menuIconsCheckBox.Click += new System.EventHandler(this.MenuIconsCheckBox_Click); - // - // autoCheckUpdatesCheckBox - // - this.autoCheckUpdatesCheckBox.AutoSize = true; - this.autoCheckUpdatesCheckBox.Location = new System.Drawing.Point(7, 30); - this.autoCheckUpdatesCheckBox.Name = "autoCheckUpdatesCheckBox"; - this.autoCheckUpdatesCheckBox.Size = new System.Drawing.Size(131, 19); - this.autoCheckUpdatesCheckBox.TabIndex = 1; - this.autoCheckUpdatesCheckBox.Text = "Auto check updates"; - this.autoCheckUpdatesCheckBox.UseVisualStyleBackColor = true; - this.autoCheckUpdatesCheckBox.Click += new System.EventHandler(this.AutoCheckUpdatesCheckBox_Click); - // - // autoLockOnMinimizeCheckBox - // - this.autoLockOnMinimizeCheckBox.AutoSize = true; - this.autoLockOnMinimizeCheckBox.Location = new System.Drawing.Point(7, 7); - this.autoLockOnMinimizeCheckBox.Name = "autoLockOnMinimizeCheckBox"; - this.autoLockOnMinimizeCheckBox.Size = new System.Drawing.Size(146, 19); - this.autoLockOnMinimizeCheckBox.TabIndex = 0; - this.autoLockOnMinimizeCheckBox.Text = "Auto lock on minimize"; - this.autoLockOnMinimizeCheckBox.UseVisualStyleBackColor = true; - this.autoLockOnMinimizeCheckBox.Click += new System.EventHandler(this.AutoLockOnMinimizeCheckBox_Click); - // // integrationTabPage // this.integrationTabPage.BackColor = System.Drawing.SystemColors.Window; @@ -421,10 +384,10 @@ private void InitializeComponent() this.integrationTabPage.Controls.Add(this.integrateCheckBox); this.integrationTabPage.Controls.Add(this.associateCheckBox); this.integrationTabPage.Controls.Add(this.sendToCheckBox); - this.integrationTabPage.Location = new System.Drawing.Point(4, 24); + this.integrationTabPage.Location = new System.Drawing.Point(4, 44); this.integrationTabPage.Name = "integrationTabPage"; this.integrationTabPage.Padding = new System.Windows.Forms.Padding(3); - this.integrationTabPage.Size = new System.Drawing.Size(244, 257); + this.integrationTabPage.Size = new System.Drawing.Size(244, 237); this.integrationTabPage.TabIndex = 3; this.integrationTabPage.Text = "intgr"; // @@ -471,10 +434,10 @@ private void InitializeComponent() this.encryptionTabPage.Controls.Add(this.keySizeLabel); this.encryptionTabPage.Controls.Add(this.hashAlgorithmLabel); this.encryptionTabPage.Controls.Add(this.keySizeComboBox); - this.encryptionTabPage.Location = new System.Drawing.Point(4, 24); + this.encryptionTabPage.Location = new System.Drawing.Point(4, 44); this.encryptionTabPage.Name = "encryptionTabPage"; this.encryptionTabPage.Padding = new System.Windows.Forms.Padding(3); - this.encryptionTabPage.Size = new System.Drawing.Size(244, 257); + this.encryptionTabPage.Size = new System.Drawing.Size(244, 237); this.encryptionTabPage.TabIndex = 1; this.encryptionTabPage.Text = "enc"; // @@ -546,378 +509,6 @@ private void InitializeComponent() this.keySizeComboBox.TabIndex = 1; this.keySizeComboBox.DropDownClosed += new System.EventHandler(this.KeySizeComboBox_DropDownClosed); // - // lineNumbersTabPage - // - this.lineNumbersTabPage.AutoScroll = true; - this.lineNumbersTabPage.BackColor = System.Drawing.SystemColors.Window; - this.lineNumbersTabPage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.lineNumbersTabPage.Controls.Add(this.marginLinesGroupBox); - this.lineNumbersTabPage.Controls.Add(this.gridLinesGroupBox); - this.lineNumbersTabPage.Controls.Add(this.borderLinesGroupBox); - this.lineNumbersTabPage.Controls.Add(this.lineNumbersGroupBox); - this.lineNumbersTabPage.Location = new System.Drawing.Point(4, 24); - this.lineNumbersTabPage.Name = "lineNumbersTabPage"; - this.lineNumbersTabPage.Padding = new System.Windows.Forms.Padding(3); - this.lineNumbersTabPage.Size = new System.Drawing.Size(244, 257); - this.lineNumbersTabPage.TabIndex = 4; - this.lineNumbersTabPage.Text = "ln"; - // - // marginLinesGroupBox - // - this.marginLinesGroupBox.BackColor = System.Drawing.Color.Transparent; - this.marginLinesGroupBox.Controls.Add(this.marginLinesStyleComboBox); - this.marginLinesGroupBox.Controls.Add(this.marginLinesStyleLabel); - this.marginLinesGroupBox.Controls.Add(this.marginLinesSideComboBox); - this.marginLinesGroupBox.Controls.Add(this.marginLinesColor); - this.marginLinesGroupBox.Controls.Add(this.marginLinesSideLabel); - this.marginLinesGroupBox.Controls.Add(this.marginLinesColorLabel); - this.marginLinesGroupBox.Controls.Add(this.marginLinesVisibleComboBox); - this.marginLinesGroupBox.Controls.Add(this.marginLinesVisibleLabel); - this.marginLinesGroupBox.Dock = System.Windows.Forms.DockStyle.Top; - this.marginLinesGroupBox.Location = new System.Drawing.Point(3, 333); - this.marginLinesGroupBox.Name = "marginLinesGroupBox"; - this.marginLinesGroupBox.Size = new System.Drawing.Size(219, 143); - this.marginLinesGroupBox.TabIndex = 3; - this.marginLinesGroupBox.TabStop = false; - this.marginLinesGroupBox.Text = "Margin lines"; - // - // marginLinesStyleComboBox - // - this.marginLinesStyleComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.marginLinesStyleComboBox.FormattingEnabled = true; - this.marginLinesStyleComboBox.Items.AddRange(new object[] { - "Solid", - "Dash", - "Dot", - "DashDot", - "DashDotDot"}); - this.marginLinesStyleComboBox.Location = new System.Drawing.Point(106, 81); - this.marginLinesStyleComboBox.Name = "marginLinesStyleComboBox"; - this.marginLinesStyleComboBox.Size = new System.Drawing.Size(100, 23); - this.marginLinesStyleComboBox.TabIndex = 6; - this.marginLinesStyleComboBox.DropDownClosed += new System.EventHandler(this.MarginLinesStyleComboBox_DropDownClosed); - // - // marginLinesStyleLabel - // - this.marginLinesStyleLabel.AutoSize = true; - this.marginLinesStyleLabel.Location = new System.Drawing.Point(10, 84); - this.marginLinesStyleLabel.Name = "marginLinesStyleLabel"; - this.marginLinesStyleLabel.Size = new System.Drawing.Size(32, 15); - this.marginLinesStyleLabel.TabIndex = 34; - this.marginLinesStyleLabel.Text = "Style"; - // - // marginLinesSideComboBox - // - this.marginLinesSideComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.marginLinesSideComboBox.FormattingEnabled = true; - this.marginLinesSideComboBox.Items.AddRange(new object[] { - "None", - "Left", - "Right", - "Height"}); - this.marginLinesSideComboBox.Location = new System.Drawing.Point(106, 110); - this.marginLinesSideComboBox.Name = "marginLinesSideComboBox"; - this.marginLinesSideComboBox.Size = new System.Drawing.Size(100, 23); - this.marginLinesSideComboBox.TabIndex = 7; - this.marginLinesSideComboBox.DropDownClosed += new System.EventHandler(this.MarginLinesSideComboBox_DropDownClosed); - // - // marginLinesColor - // - this.marginLinesColor.BackColor = System.Drawing.SystemColors.Control; - this.marginLinesColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.marginLinesColor.Cursor = System.Windows.Forms.Cursors.Hand; - this.marginLinesColor.Location = new System.Drawing.Point(106, 54); - this.marginLinesColor.Name = "marginLinesColor"; - this.marginLinesColor.Size = new System.Drawing.Size(100, 21); - this.marginLinesColor.TabIndex = 32; - this.marginLinesColor.Click += new System.EventHandler(this.MarginLinesColor_Click); - // - // marginLinesSideLabel - // - this.marginLinesSideLabel.AutoSize = true; - this.marginLinesSideLabel.Location = new System.Drawing.Point(10, 113); - this.marginLinesSideLabel.Name = "marginLinesSideLabel"; - this.marginLinesSideLabel.Size = new System.Drawing.Size(29, 15); - this.marginLinesSideLabel.TabIndex = 31; - this.marginLinesSideLabel.Text = "Side"; - // - // marginLinesColorLabel - // - this.marginLinesColorLabel.Location = new System.Drawing.Point(10, 54); - this.marginLinesColorLabel.Name = "marginLinesColorLabel"; - this.marginLinesColorLabel.Size = new System.Drawing.Size(45, 21); - this.marginLinesColorLabel.TabIndex = 30; - this.marginLinesColorLabel.Text = "Color"; - this.marginLinesColorLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // marginLinesVisibleComboBox - // - this.marginLinesVisibleComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.marginLinesVisibleComboBox.FormattingEnabled = true; - this.marginLinesVisibleComboBox.Items.AddRange(new object[] { - "True", - "False"}); - this.marginLinesVisibleComboBox.Location = new System.Drawing.Point(106, 25); - this.marginLinesVisibleComboBox.Name = "marginLinesVisibleComboBox"; - this.marginLinesVisibleComboBox.Size = new System.Drawing.Size(100, 23); - this.marginLinesVisibleComboBox.TabIndex = 5; - this.marginLinesVisibleComboBox.DropDownClosed += new System.EventHandler(this.MarginLinesVisibleComboBox_DropDownClosed); - // - // marginLinesVisibleLabel - // - this.marginLinesVisibleLabel.AutoSize = true; - this.marginLinesVisibleLabel.Location = new System.Drawing.Point(10, 28); - this.marginLinesVisibleLabel.Name = "marginLinesVisibleLabel"; - this.marginLinesVisibleLabel.Size = new System.Drawing.Size(41, 15); - this.marginLinesVisibleLabel.TabIndex = 28; - this.marginLinesVisibleLabel.Text = "Visible"; - // - // gridLinesGroupBox - // - this.gridLinesGroupBox.Controls.Add(this.gridLinesVisibleComboBox); - this.gridLinesGroupBox.Controls.Add(this.gridLinesStyleComboBox); - this.gridLinesGroupBox.Controls.Add(this.gridLinesColor); - this.gridLinesGroupBox.Controls.Add(this.gridLinesVisibleLabel); - this.gridLinesGroupBox.Controls.Add(this.gridLinesStyleLabel); - this.gridLinesGroupBox.Controls.Add(this.gridLinesColorLabel); - this.gridLinesGroupBox.Dock = System.Windows.Forms.DockStyle.Top; - this.gridLinesGroupBox.Location = new System.Drawing.Point(3, 223); - this.gridLinesGroupBox.Name = "gridLinesGroupBox"; - this.gridLinesGroupBox.Size = new System.Drawing.Size(219, 110); - this.gridLinesGroupBox.TabIndex = 2; - this.gridLinesGroupBox.TabStop = false; - this.gridLinesGroupBox.Text = "Grid lines"; - // - // gridLinesVisibleComboBox - // - this.gridLinesVisibleComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.gridLinesVisibleComboBox.FormattingEnabled = true; - this.gridLinesVisibleComboBox.Items.AddRange(new object[] { - "True", - "False"}); - this.gridLinesVisibleComboBox.Location = new System.Drawing.Point(106, 20); - this.gridLinesVisibleComboBox.Name = "gridLinesVisibleComboBox"; - this.gridLinesVisibleComboBox.Size = new System.Drawing.Size(100, 23); - this.gridLinesVisibleComboBox.TabIndex = 3; - this.gridLinesVisibleComboBox.Tag = "False"; - this.gridLinesVisibleComboBox.DropDownClosed += new System.EventHandler(this.GridLinesVisibleComboBox_DropDownClosed); - // - // gridLinesStyleComboBox - // - this.gridLinesStyleComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.gridLinesStyleComboBox.FormattingEnabled = true; - this.gridLinesStyleComboBox.Items.AddRange(new object[] { - "Solid", - "Dash", - "Dot", - "DashDot", - "DashDotDot"}); - this.gridLinesStyleComboBox.Location = new System.Drawing.Point(106, 76); - this.gridLinesStyleComboBox.Name = "gridLinesStyleComboBox"; - this.gridLinesStyleComboBox.Size = new System.Drawing.Size(100, 23); - this.gridLinesStyleComboBox.TabIndex = 4; - this.gridLinesStyleComboBox.DropDownClosed += new System.EventHandler(this.GridLinesStyleComboBox_DropDownClosed); - // - // gridLinesColor - // - this.gridLinesColor.BackColor = System.Drawing.SystemColors.Control; - this.gridLinesColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.gridLinesColor.Cursor = System.Windows.Forms.Cursors.Hand; - this.gridLinesColor.Location = new System.Drawing.Point(106, 49); - this.gridLinesColor.Name = "gridLinesColor"; - this.gridLinesColor.Size = new System.Drawing.Size(100, 21); - this.gridLinesColor.TabIndex = 24; - this.gridLinesColor.Click += new System.EventHandler(this.GridLinesColor_Click); - // - // gridLinesVisibleLabel - // - this.gridLinesVisibleLabel.AutoSize = true; - this.gridLinesVisibleLabel.Location = new System.Drawing.Point(10, 23); - this.gridLinesVisibleLabel.Name = "gridLinesVisibleLabel"; - this.gridLinesVisibleLabel.Size = new System.Drawing.Size(41, 15); - this.gridLinesVisibleLabel.TabIndex = 21; - this.gridLinesVisibleLabel.Text = "Visible"; - // - // gridLinesStyleLabel - // - this.gridLinesStyleLabel.AutoSize = true; - this.gridLinesStyleLabel.Location = new System.Drawing.Point(10, 79); - this.gridLinesStyleLabel.Name = "gridLinesStyleLabel"; - this.gridLinesStyleLabel.Size = new System.Drawing.Size(32, 15); - this.gridLinesStyleLabel.TabIndex = 25; - this.gridLinesStyleLabel.Text = "Style"; - // - // gridLinesColorLabel - // - this.gridLinesColorLabel.Location = new System.Drawing.Point(10, 49); - this.gridLinesColorLabel.Name = "gridLinesColorLabel"; - this.gridLinesColorLabel.Size = new System.Drawing.Size(61, 21); - this.gridLinesColorLabel.TabIndex = 23; - this.gridLinesColorLabel.Text = "Color"; - this.gridLinesColorLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // borderLinesGroupBox - // - this.borderLinesGroupBox.Controls.Add(this.borderLinesVisibleСomboBox); - this.borderLinesGroupBox.Controls.Add(this.borderLinesStyleComboBox); - this.borderLinesGroupBox.Controls.Add(this.borderLinesColorLabel); - this.borderLinesGroupBox.Controls.Add(this.borderLinesStyleLabel); - this.borderLinesGroupBox.Controls.Add(this.borderLinesVisibleLabel); - this.borderLinesGroupBox.Controls.Add(this.borderLinesColor); - this.borderLinesGroupBox.Dock = System.Windows.Forms.DockStyle.Top; - this.borderLinesGroupBox.Location = new System.Drawing.Point(3, 113); - this.borderLinesGroupBox.Name = "borderLinesGroupBox"; - this.borderLinesGroupBox.Size = new System.Drawing.Size(219, 110); - this.borderLinesGroupBox.TabIndex = 1; - this.borderLinesGroupBox.TabStop = false; - this.borderLinesGroupBox.Text = "Border lines"; - // - // borderLinesVisibleСomboBox - // - this.borderLinesVisibleСomboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.borderLinesVisibleСomboBox.FormattingEnabled = true; - this.borderLinesVisibleСomboBox.Items.AddRange(new object[] { - "True", - "False"}); - this.borderLinesVisibleСomboBox.Location = new System.Drawing.Point(106, 19); - this.borderLinesVisibleСomboBox.Name = "borderLinesVisibleСomboBox"; - this.borderLinesVisibleСomboBox.Size = new System.Drawing.Size(100, 23); - this.borderLinesVisibleСomboBox.TabIndex = 1; - this.borderLinesVisibleСomboBox.DropDownClosed += new System.EventHandler(this.BorderLinesVisibleСomboBox_DropDownClosed); - // - // borderLinesStyleComboBox - // - this.borderLinesStyleComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.borderLinesStyleComboBox.FormattingEnabled = true; - this.borderLinesStyleComboBox.Items.AddRange(new object[] { - "Solid", - "Dash", - "Dot", - "DashDot", - "DashDotDot"}); - this.borderLinesStyleComboBox.Location = new System.Drawing.Point(106, 75); - this.borderLinesStyleComboBox.Name = "borderLinesStyleComboBox"; - this.borderLinesStyleComboBox.Size = new System.Drawing.Size(100, 23); - this.borderLinesStyleComboBox.TabIndex = 2; - this.borderLinesStyleComboBox.DropDownClosed += new System.EventHandler(this.BorderLinesStyleComboBox_DropDownClosed); - // - // borderLinesColorLabel - // - this.borderLinesColorLabel.Location = new System.Drawing.Point(10, 48); - this.borderLinesColorLabel.Name = "borderLinesColorLabel"; - this.borderLinesColorLabel.Size = new System.Drawing.Size(45, 21); - this.borderLinesColorLabel.TabIndex = 17; - this.borderLinesColorLabel.Text = "Color"; - this.borderLinesColorLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // borderLinesStyleLabel - // - this.borderLinesStyleLabel.AutoSize = true; - this.borderLinesStyleLabel.Location = new System.Drawing.Point(10, 78); - this.borderLinesStyleLabel.Name = "borderLinesStyleLabel"; - this.borderLinesStyleLabel.Size = new System.Drawing.Size(32, 15); - this.borderLinesStyleLabel.TabIndex = 19; - this.borderLinesStyleLabel.Text = "Style"; - // - // borderLinesVisibleLabel - // - this.borderLinesVisibleLabel.AutoSize = true; - this.borderLinesVisibleLabel.Location = new System.Drawing.Point(10, 22); - this.borderLinesVisibleLabel.Name = "borderLinesVisibleLabel"; - this.borderLinesVisibleLabel.Size = new System.Drawing.Size(41, 15); - this.borderLinesVisibleLabel.TabIndex = 15; - this.borderLinesVisibleLabel.Text = "Visible"; - // - // borderLinesColor - // - this.borderLinesColor.BackColor = System.Drawing.SystemColors.Control; - this.borderLinesColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.borderLinesColor.Cursor = System.Windows.Forms.Cursors.Hand; - this.borderLinesColor.Location = new System.Drawing.Point(106, 48); - this.borderLinesColor.Name = "borderLinesColor"; - this.borderLinesColor.Size = new System.Drawing.Size(100, 21); - this.borderLinesColor.TabIndex = 18; - this.borderLinesColor.Click += new System.EventHandler(this.BorderLinesColor_Click); - // - // lineNumbersGroupBox - // - this.lineNumbersGroupBox.Controls.Add(this.lineNumbersVisibleComboBox); - this.lineNumbersGroupBox.Controls.Add(this.lineNumbersBackColor); - this.lineNumbersGroupBox.Controls.Add(this.lineNumbersVisibleLabel); - this.lineNumbersGroupBox.Controls.Add(this.lineNumbersFontColor); - this.lineNumbersGroupBox.Controls.Add(this.lineNumbersFontColorLabel); - this.lineNumbersGroupBox.Controls.Add(this.lineNumbersBackColorLabel); - this.lineNumbersGroupBox.Dock = System.Windows.Forms.DockStyle.Top; - this.lineNumbersGroupBox.Location = new System.Drawing.Point(3, 3); - this.lineNumbersGroupBox.Name = "lineNumbersGroupBox"; - this.lineNumbersGroupBox.Size = new System.Drawing.Size(219, 110); - this.lineNumbersGroupBox.TabIndex = 0; - this.lineNumbersGroupBox.TabStop = false; - this.lineNumbersGroupBox.Text = "Line numbers"; - // - // lineNumbersVisibleComboBox - // - this.lineNumbersVisibleComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.lineNumbersVisibleComboBox.FormattingEnabled = true; - this.lineNumbersVisibleComboBox.Items.AddRange(new object[] { - "True", - "False"}); - this.lineNumbersVisibleComboBox.Location = new System.Drawing.Point(106, 19); - this.lineNumbersVisibleComboBox.Name = "lineNumbersVisibleComboBox"; - this.lineNumbersVisibleComboBox.Size = new System.Drawing.Size(100, 23); - this.lineNumbersVisibleComboBox.TabIndex = 0; - this.lineNumbersVisibleComboBox.DropDownClosed += new System.EventHandler(this.LineNumbersVisibleComboBox_DropDownClosed); - // - // lineNumbersBackColor - // - this.lineNumbersBackColor.BackColor = System.Drawing.SystemColors.Control; - this.lineNumbersBackColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.lineNumbersBackColor.Cursor = System.Windows.Forms.Cursors.Hand; - this.lineNumbersBackColor.Location = new System.Drawing.Point(106, 48); - this.lineNumbersBackColor.Name = "lineNumbersBackColor"; - this.lineNumbersBackColor.Size = new System.Drawing.Size(100, 21); - this.lineNumbersBackColor.TabIndex = 1; - this.lineNumbersBackColor.Click += new System.EventHandler(this.LineNumbersBackColor_Click); - // - // lineNumbersVisibleLabel - // - this.lineNumbersVisibleLabel.AutoSize = true; - this.lineNumbersVisibleLabel.Location = new System.Drawing.Point(10, 22); - this.lineNumbersVisibleLabel.Name = "lineNumbersVisibleLabel"; - this.lineNumbersVisibleLabel.Size = new System.Drawing.Size(41, 15); - this.lineNumbersVisibleLabel.TabIndex = 0; - this.lineNumbersVisibleLabel.Text = "Visible"; - // - // lineNumbersFontColor - // - this.lineNumbersFontColor.BackColor = System.Drawing.SystemColors.Control; - this.lineNumbersFontColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.lineNumbersFontColor.Cursor = System.Windows.Forms.Cursors.Hand; - this.lineNumbersFontColor.Location = new System.Drawing.Point(106, 75); - this.lineNumbersFontColor.Name = "lineNumbersFontColor"; - this.lineNumbersFontColor.Size = new System.Drawing.Size(100, 21); - this.lineNumbersFontColor.TabIndex = 2; - this.lineNumbersFontColor.Click += new System.EventHandler(this.LineNumbersFontColor_Click); - // - // lineNumbersFontColorLabel - // - this.lineNumbersFontColorLabel.Location = new System.Drawing.Point(10, 75); - this.lineNumbersFontColorLabel.Name = "lineNumbersFontColorLabel"; - this.lineNumbersFontColorLabel.Size = new System.Drawing.Size(61, 21); - this.lineNumbersFontColorLabel.TabIndex = 2; - this.lineNumbersFontColorLabel.Text = "Font color"; - this.lineNumbersFontColorLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // lineNumbersBackColorLabel - // - this.lineNumbersBackColorLabel.BackColor = System.Drawing.SystemColors.Window; - this.lineNumbersBackColorLabel.Location = new System.Drawing.Point(10, 48); - this.lineNumbersBackColorLabel.Name = "lineNumbersBackColorLabel"; - this.lineNumbersBackColorLabel.Size = new System.Drawing.Size(69, 21); - this.lineNumbersBackColorLabel.TabIndex = 1; - this.lineNumbersBackColorLabel.Text = "Back Color"; - this.lineNumbersBackColorLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // // statusPanelTabPage // this.statusPanelTabPage.BackColor = System.Drawing.SystemColors.Window; @@ -1156,7 +747,6 @@ private void InitializeComponent() "Status Panel", "Search Panel", "Editor", - "Line Numbers", "Encryption", "Integration"}); this.settingsNavigation.Location = new System.Drawing.Point(3, 3); @@ -1198,23 +788,14 @@ private void InitializeComponent() this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.SettingsForm_FormClosed); this.Load += new System.EventHandler(this.SettingsForm_Load); this.settingsTabControl.ResumeLayout(false); - this.editorTabPage.ResumeLayout(false); - this.editorTabPage.PerformLayout(); this.applicationTabPage.ResumeLayout(false); this.applicationTabPage.PerformLayout(); + this.editorTabPage.ResumeLayout(false); + this.editorTabPage.PerformLayout(); this.integrationTabPage.ResumeLayout(false); this.integrationTabPage.PerformLayout(); this.encryptionTabPage.ResumeLayout(false); this.encryptionTabPage.PerformLayout(); - this.lineNumbersTabPage.ResumeLayout(false); - this.marginLinesGroupBox.ResumeLayout(false); - this.marginLinesGroupBox.PerformLayout(); - this.gridLinesGroupBox.ResumeLayout(false); - this.gridLinesGroupBox.PerformLayout(); - this.borderLinesGroupBox.ResumeLayout(false); - this.borderLinesGroupBox.PerformLayout(); - this.lineNumbersGroupBox.ResumeLayout(false); - this.lineNumbersGroupBox.PerformLayout(); this.statusPanelTabPage.ResumeLayout(false); this.statusPanelTabPage.PerformLayout(); this.toolbarTabPage.ResumeLayout(false); @@ -1250,30 +831,11 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox integrateCheckBox; private System.Windows.Forms.CheckBox menuIconsCheckBox; private System.Windows.Forms.TabPage integrationTabPage; - private System.Windows.Forms.Label lineNumbersFontColorLabel; - private System.Windows.Forms.Label lineNumbersBackColorLabel; - private System.Windows.Forms.Label lineNumbersVisibleLabel; - private System.Windows.Forms.ComboBox lineNumbersVisibleComboBox; - private System.Windows.Forms.Panel lineNumbersFontColor; - private System.Windows.Forms.Panel lineNumbersBackColor; - private System.Windows.Forms.ComboBox borderLinesStyleComboBox; - private System.Windows.Forms.Label borderLinesStyleLabel; - private System.Windows.Forms.Panel borderLinesColor; - private System.Windows.Forms.Label borderLinesColorLabel; - private System.Windows.Forms.ComboBox borderLinesVisibleСomboBox; - private System.Windows.Forms.Label borderLinesVisibleLabel; - private System.Windows.Forms.ComboBox gridLinesStyleComboBox; - private System.Windows.Forms.Label gridLinesStyleLabel; - private System.Windows.Forms.Panel gridLinesColor; - private System.Windows.Forms.Label gridLinesColorLabel; - private System.Windows.Forms.ComboBox gridLinesVisibleComboBox; - private System.Windows.Forms.Label gridLinesVisibleLabel; private System.Windows.Forms.ComboBox editorInsertKeyComboBox; private System.Windows.Forms.Label editorInsertKeyLabel; private System.Windows.Forms.TextBox editorPaddingLeftTextBox; private System.Windows.Forms.Label editorPaddingLeftLabel; private System.Windows.Forms.ListBox settingsNavigation; - private System.Windows.Forms.TabPage lineNumbersTabPage; private System.Windows.Forms.Button editorFontButton; private System.Windows.Forms.FontDialog fontDialog; private System.Windows.Forms.TabPage statusPanelTabPage; @@ -1295,18 +857,6 @@ private void InitializeComponent() private System.Windows.Forms.Label editorOpenLinksWithLabel; private System.Windows.Forms.CheckBox mainMenuCheckBox; private System.Windows.Forms.CheckBox toolbarOldIconsCheckBox; - private System.Windows.Forms.Label marginLinesVisibleLabel; - private System.Windows.Forms.GroupBox marginLinesGroupBox; - private System.Windows.Forms.ComboBox marginLinesVisibleComboBox; - private System.Windows.Forms.Label marginLinesColorLabel; - private System.Windows.Forms.ComboBox marginLinesSideComboBox; - private System.Windows.Forms.Panel marginLinesColor; - private System.Windows.Forms.Label marginLinesSideLabel; - private System.Windows.Forms.ComboBox marginLinesStyleComboBox; - private System.Windows.Forms.Label marginLinesStyleLabel; - private System.Windows.Forms.GroupBox lineNumbersGroupBox; - private System.Windows.Forms.GroupBox gridLinesGroupBox; - private System.Windows.Forms.GroupBox borderLinesGroupBox; private System.Windows.Forms.CheckBox closeToTrayCheckBox; private System.Windows.Forms.CheckBox minimizeToTrayCheckBox; private System.Windows.Forms.ComboBox editorBorderComboBox; diff --git a/Crypto Notepad/SettingsForm.cs b/Crypto Notepad/SettingsForm.cs index c691b5b..090719a 100644 --- a/Crypto Notepad/SettingsForm.cs +++ b/Crypto Notepad/SettingsForm.cs @@ -2,7 +2,6 @@ using Microsoft.Win32; using System; using System.Drawing; -using System.Drawing.Drawing2D; using System.IO; using System.Linq; using System.Reflection; @@ -59,21 +58,6 @@ private void LoadSettings() statusPanelBackColor.BackColor = settings.statusPanelBackColor; statusPanelFontColor.BackColor = settings.statusPanelFontColor; statusPanelVisibleCheckBox.Checked = settings.statusPanelVisible; - - 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; - - marginLinesVisibleComboBox.Text = settings.marginLinesVisible; - marginLinesColor.BackColor = settings.marginLinesColor; - marginLinesStyleComboBox.Text = settings.marginLinesStyle; - marginLinesSideComboBox.Text = settings.marginLinesSide; } private static void AssociateExtension(string applicationExecutablePath, string extension) @@ -231,66 +215,6 @@ private void EditorBackColor_Click(object sender, EventArgs e) } } - private void LineNumbersBackColor_Click(object sender, EventArgs e) - { - colorDialog.Color = lineNumbersBackColor.BackColor; - using (new CenterWinDialog(this)) - { - if (colorDialog.ShowDialog() == DialogResult.OK) - { - MainForm main = Owner as MainForm; - main.lineNumbers.BackColor = colorDialog.Color; - lineNumbersBackColor.BackColor = colorDialog.Color; - settings.lineNumbersBackColor = colorDialog.Color; - } - } - } - - private void LineNumbersFontColor_Click(object sender, EventArgs e) - { - colorDialog.Color = lineNumbersFontColor.BackColor; - using (new CenterWinDialog(this)) - { - if (colorDialog.ShowDialog() == DialogResult.OK) - { - MainForm main = Owner as MainForm; - main.lineNumbers.ForeColor = colorDialog.Color; - lineNumbersFontColor.BackColor = colorDialog.Color; - settings.lineNumbersForeColor = colorDialog.Color; - } - } - } - - private void BorderLinesColor_Click(object sender, EventArgs e) - { - colorDialog.Color = borderLinesColor.BackColor; - using (new CenterWinDialog(this)) - { - if (colorDialog.ShowDialog() == DialogResult.OK) - { - MainForm main = Owner as MainForm; - main.lineNumbers.BorderLines_Color = colorDialog.Color; - borderLinesColor.BackColor = colorDialog.Color; - settings.borderLinesColor = colorDialog.Color; - } - } - } - - private void GridLinesColor_Click(object sender, EventArgs e) - { - colorDialog.Color = gridLinesColor.BackColor; - using (new CenterWinDialog(this)) - { - if (colorDialog.ShowDialog() == DialogResult.OK) - { - MainForm main = Owner as MainForm; - main.lineNumbers.GridLines_Color = colorDialog.Color; - gridLinesColor.BackColor = colorDialog.Color; - settings.gridLinesColor = colorDialog.Color; - } - } - } - private void SettingsNavigation_Click(object sender, EventArgs e) { switch (settingsNavigation.SelectedIndex) @@ -311,12 +235,9 @@ private void SettingsNavigation_Click(object sender, EventArgs e) settingsTabControl.SelectedTab = editorTabPage; break; case 5: - settingsTabControl.SelectedTab = lineNumbersTabPage; - break; - case 6: settingsTabControl.SelectedTab = encryptionTabPage; break; - case 7: + case 6: settingsTabControl.SelectedTab = integrationTabPage; break; } @@ -333,7 +254,6 @@ private void ToolbarVisibleCheckBox_Click(object sender, EventArgs e) { MainForm main = Owner as MainForm; main.toolbarPanel.Visible = toolbarVisibleCheckBox.Checked; - main.lineNumbers.Height = 1; main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0); settings.toolbarVisible= toolbarVisibleCheckBox.Checked; } @@ -430,98 +350,11 @@ private void EditorFontButton_Click(object sender, EventArgs e) { MainForm main = Owner as MainForm; main.richTextBox.Font = fontDialog.Font; - main.lineNumbers.Font = fontDialog.Font; main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0); } } } - private void LineNumbersVisibleComboBox_DropDownClosed(object sender, EventArgs e) - { - MainForm main = Owner as MainForm; - if (settings.lineNumbersVisible != lineNumbersVisibleComboBox.Text) - { - settings.lineNumbersVisible = lineNumbersVisibleComboBox.Text; - main.lineNumbers.Visible = bool.Parse(settings.lineNumbersVisible); - main.lineNumbers.Height = 1; - settings.lineNumbersVisible = lineNumbersVisibleComboBox.Text; - } - } - - private void BorderLinesVisibleСomboBox_DropDownClosed(object sender, EventArgs e) - { - MainForm main = Owner as MainForm; - if (settings.borderLinesVisible != borderLinesVisibleСomboBox.Text) - { - settings.borderLinesVisible = borderLinesVisibleСomboBox.Text; - main.lineNumbers.Show_BorderLines = bool.Parse(settings.borderLinesVisible); - } - } - - private void BorderLinesStyleComboBox_DropDownClosed(object sender, EventArgs e) - { - MainForm main = Owner as MainForm; - if (settings.borderLinesStyle != borderLinesStyleComboBox.Text) - { - switch (borderLinesStyleComboBox.Text) - { - case "Solid": - settings.borderLinesStyle = DashStyle.Solid.ToString(); - break; - case "Dash": - settings.borderLinesStyle = DashStyle.Dash.ToString(); - break; - case "Dot": - settings.borderLinesStyle = DashStyle.Dot.ToString(); - break; - case "DashDot": - settings.borderLinesStyle = DashStyle.DashDot.ToString(); - break; - case "DashDotDot": - settings.borderLinesStyle = DashStyle.DashDotDot.ToString(); - break; - } - main.lineNumbers.BorderLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.borderLinesStyle); - } - } - - private void GridLinesVisibleComboBox_DropDownClosed(object sender, EventArgs e) - { - MainForm main = Owner as MainForm; - if (settings.gridLinesVisible != gridLinesVisibleComboBox.Text) - { - settings.gridLinesVisible = gridLinesVisibleComboBox.Text; - main.lineNumbers.Show_GridLines = bool.Parse(settings.gridLinesVisible); - } - } - - private void GridLinesStyleComboBox_DropDownClosed(object sender, EventArgs e) - { - MainForm main = Owner as MainForm; - if (settings.gridLinesStyle.ToString() != gridLinesStyleComboBox.Text) - { - switch (gridLinesStyleComboBox.Text) - { - case "Solid": - settings.gridLinesStyle = DashStyle.Solid.ToString(); ; - break; - case "Dash": - settings.gridLinesStyle = DashStyle.Dash.ToString(); - break; - case "Dot": - settings.gridLinesStyle = DashStyle.Dot.ToString(); - break; - case "DashDot": - settings.gridLinesStyle = DashStyle.DashDot.ToString(); - break; - case "DashDotDot": - settings.gridLinesStyle = DashStyle.DashDotDot.ToString(); - break; - } - main.lineNumbers.GridLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.gridLinesStyle); - } - } - private void KeySizeComboBox_DropDownClosed(object sender, EventArgs e) { if (keySizeComboBox.Text != settings.KeySize) @@ -558,7 +391,6 @@ private void FontDialog_Apply(object sender, EventArgs e) { MainForm main = Owner as MainForm; main.richTextBox.Font = fontDialog.Font; - main.lineNumbers.Font = fontDialog.Font; main.richTextBox.SetInnerMargins(Convert.ToInt32(settings.editorPaddingLeft), 0, 0, 0); settings.editorFont = fontDialog.Font; } @@ -712,83 +544,7 @@ private void PasswordIterationsTextBox_TextChanged(object sender, EventArgs e) { settings.PasswordIterations = passwordIterationsTextBox.Text; } - } - - private void MarginLinesVisibleComboBox_DropDownClosed(object sender, EventArgs e) - { - MainForm main = Owner as MainForm; - if (settings.marginLinesVisible != marginLinesVisibleComboBox.Text) - { - settings.marginLinesVisible = marginLinesVisibleComboBox.Text; - main.lineNumbers.Show_MarginLines = bool.Parse(settings.marginLinesVisible); - } - } - - private void MarginLinesSideComboBox_DropDownClosed(object sender, EventArgs e) - { - MainForm main = Owner as MainForm; - if (settings.marginLinesSide.ToString() != marginLinesSideComboBox.Text) - { - switch (marginLinesSideComboBox.Text) - { - case "None": - settings.marginLinesSide = LineNumbers.LineNumbers.LineNumberDockSide.None.ToString(); - break; - case "Left": - settings.marginLinesSide = LineNumbers.LineNumbers.LineNumberDockSide.Left.ToString(); - break; - case "Right": - settings.marginLinesSide = LineNumbers.LineNumbers.LineNumberDockSide.Right.ToString(); - break; - case "Height": - settings.marginLinesSide = LineNumbers.LineNumbers.LineNumberDockSide.Height.ToString(); - break; - } - main.lineNumbers.MarginLines_Side = (LineNumbers.LineNumbers.LineNumberDockSide)Enum.Parse(typeof(LineNumbers.LineNumbers.LineNumberDockSide), settings.marginLinesSide); - } - } - - private void MarginLinesStyleComboBox_DropDownClosed(object sender, EventArgs e) - { - MainForm main = Owner as MainForm; - if (settings.marginLinesStyle != marginLinesStyleComboBox.Text) - { - switch (marginLinesStyleComboBox.Text) - { - case "Solid": - settings.marginLinesStyle = DashStyle.Solid.ToString(); - break; - case "Dash": - settings.marginLinesStyle = DashStyle.Dash.ToString(); - break; - case "Dot": - settings.marginLinesStyle = DashStyle.Dot.ToString(); - break; - case "DashDot": - settings.marginLinesStyle = DashStyle.DashDot.ToString(); - break; - case "DashDotDot": - settings.marginLinesStyle = DashStyle.DashDotDot.ToString(); - break; - } - main.lineNumbers.MarginLines_Style = (DashStyle)Enum.Parse(typeof(DashStyle), settings.marginLinesStyle); - } - } - - private void MarginLinesColor_Click(object sender, EventArgs e) - { - colorDialog.Color = marginLinesColor.BackColor; - using (new CenterWinDialog(this)) - { - if (colorDialog.ShowDialog() == DialogResult.OK) - { - MainForm main = Owner as MainForm; - main.lineNumbers.MarginLines_Color = colorDialog.Color; - marginLinesColor.BackColor = colorDialog.Color; - settings.marginLinesColor = colorDialog.Color; - } - } - } + } private void MinimizeToTrayCheckBox_Click(object sender, EventArgs e) {