From 62c6fce171386f0c587a2b884b97f14d57ed9cb2 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 09:28:59 +0100 Subject: [PATCH 01/97] Created project --- DarkUI.sln | 28 ++ DarkUI/Config/Colors.cs | 107 ++++++ DarkUI/Config/Consts.cs | 7 + DarkUI/Config/Enums.cs | 22 ++ DarkUI/Controls/DarkButton.cs | 423 +++++++++++++++++++++++ DarkUI/DarkUI.csproj | 56 +++ DarkUI/Properties/AssemblyInfo.cs | 36 ++ Example/Example.csproj | 87 +++++ Example/Forms/MainForm.Designer.cs | 91 +++++ Example/Forms/MainForm.cs | 12 + Example/Forms/MainForm.resx | 120 +++++++ Example/Program.cs | 19 + Example/Properties/AssemblyInfo.cs | 36 ++ Example/Properties/Resources.Designer.cs | 63 ++++ Example/Properties/Resources.resx | 117 +++++++ Example/Properties/Settings.Designer.cs | 26 ++ Example/Properties/Settings.settings | 7 + 17 files changed, 1257 insertions(+) create mode 100644 DarkUI.sln create mode 100644 DarkUI/Config/Colors.cs create mode 100644 DarkUI/Config/Consts.cs create mode 100644 DarkUI/Config/Enums.cs create mode 100644 DarkUI/Controls/DarkButton.cs create mode 100644 DarkUI/DarkUI.csproj create mode 100644 DarkUI/Properties/AssemblyInfo.cs create mode 100644 Example/Example.csproj create mode 100644 Example/Forms/MainForm.Designer.cs create mode 100644 Example/Forms/MainForm.cs create mode 100644 Example/Forms/MainForm.resx create mode 100644 Example/Program.cs create mode 100644 Example/Properties/AssemblyInfo.cs create mode 100644 Example/Properties/Resources.Designer.cs create mode 100644 Example/Properties/Resources.resx create mode 100644 Example/Properties/Settings.Designer.cs create mode 100644 Example/Properties/Settings.settings diff --git a/DarkUI.sln b/DarkUI.sln new file mode 100644 index 0000000..b03eda9 --- /dev/null +++ b/DarkUI.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DarkUI", "DarkUI\DarkUI.csproj", "{F19472F5-8C44-4C51-A8A0-B9DE5F555255}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example", "Example\Example.csproj", "{FA334815-6D78-4E9A-9F4D-6C8A58222A57}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F19472F5-8C44-4C51-A8A0-B9DE5F555255}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F19472F5-8C44-4C51-A8A0-B9DE5F555255}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F19472F5-8C44-4C51-A8A0-B9DE5F555255}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F19472F5-8C44-4C51-A8A0-B9DE5F555255}.Release|Any CPU.Build.0 = Release|Any CPU + {FA334815-6D78-4E9A-9F4D-6C8A58222A57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA334815-6D78-4E9A-9F4D-6C8A58222A57}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA334815-6D78-4E9A-9F4D-6C8A58222A57}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA334815-6D78-4E9A-9F4D-6C8A58222A57}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/DarkUI/Config/Colors.cs b/DarkUI/Config/Colors.cs new file mode 100644 index 0000000..8731415 --- /dev/null +++ b/DarkUI/Config/Colors.cs @@ -0,0 +1,107 @@ +using System.Drawing; + +namespace DarkUI +{ + public sealed class Colors + { + public static Color GreyBackground + { + get { return Color.FromArgb(60, 63, 65); } + } + + public static Color HeaderBackground + { + get { return Color.FromArgb(57, 60, 62); } + } + + public static Color BlueBackground + { + get { return Color.FromArgb(66, 77, 95); } + } + + public static Color DarkBlueBackground + { + get { return Color.FromArgb(52, 57, 66); } + } + + public static Color DarkBackground + { + get { return Color.FromArgb(43, 43, 43); } + } + + public static Color MediumBackground + { + get { return Color.FromArgb(49, 51, 53); } + } + + public static Color LightBackground + { + get { return Color.FromArgb(69, 73, 74); } + } + + public static Color LighterBackground + { + get { return Color.FromArgb(95, 101, 102); } + } + + public static Color LightBorder + { + get { return Color.FromArgb(81, 81, 81); } + } + + public static Color DarkBorder + { + get { return Color.FromArgb(51, 51, 51); } + } + + public static Color LightText + { + get { return Color.FromArgb(220, 220, 220); } + } + + public static Color DisabledText + { + get { return Color.FromArgb(153, 153, 153); } + } + + public static Color BlueHighlight + { + get { return Color.FromArgb(104, 151, 187); } + } + + public static Color BlueSelection + { + get { return Color.FromArgb(75, 110, 175); } + } + + public static Color GreyHighlight + { + get { return Color.FromArgb(122, 128, 132); } + } + + public static Color GreySelection + { + get { return Color.FromArgb(92, 92, 92); } + } + + public static Color DarkGreySelection + { + get { return Color.FromArgb(82, 82, 82); } + } + + public static Color DarkBlueBorder + { + get { return Color.FromArgb(51, 61, 78); } + } + + public static Color LightBlueBorder + { + get { return Color.FromArgb(86, 97, 114); } + } + + public static Color ActiveControl + { + get { return Color.FromArgb(159, 178, 196); } + } + } +} diff --git a/DarkUI/Config/Consts.cs b/DarkUI/Config/Consts.cs new file mode 100644 index 0000000..3586b06 --- /dev/null +++ b/DarkUI/Config/Consts.cs @@ -0,0 +1,7 @@ +namespace DarkUI +{ + public sealed class Consts + { + public static int Padding = 10; + } +} diff --git a/DarkUI/Config/Enums.cs b/DarkUI/Config/Enums.cs new file mode 100644 index 0000000..c497934 --- /dev/null +++ b/DarkUI/Config/Enums.cs @@ -0,0 +1,22 @@ +namespace DarkUI +{ + public enum DarkButtonStyle + { + Normal, + Flat + } + + public enum DarkControlState + { + Normal, + Hover, + Pressed + } + + public enum DarkContentAlignment + { + Center, + Left, + Right + } +} diff --git a/DarkUI/Controls/DarkButton.cs b/DarkUI/Controls/DarkButton.cs new file mode 100644 index 0000000..4e94a5b --- /dev/null +++ b/DarkUI/Controls/DarkButton.cs @@ -0,0 +1,423 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace DarkUI +{ + [ToolboxBitmap(typeof(Button))] + [DefaultEvent("Click")] + public class DarkButton : Button + { + #region Field Region + + private DarkButtonStyle _style = DarkButtonStyle.Normal; + private DarkControlState _buttonState = DarkControlState.Normal; + + private bool _isDefault; + private bool _spacePressed; + + private int _padding = Consts.Padding / 2; + private int _imagePadding = 5; // Consts.Padding / 2 + + #endregion + + #region Designer Property Region + + [Category("Appearance")] + [Description("The text associated with this control.")] + public new string Text + { + get { return base.Text; } + set + { + base.Text = value; + Invalidate(); + } + } + + [Category("Behavior")] + [Description("Indicates whether the control is enabled.")] + public new bool Enabled + { + get { return base.Enabled; } + set + { + base.Enabled = value; + Invalidate(); + } + } + + [Category("Appearance")] + [Description("Determines the style of the button.")] + [DefaultValue(DarkButtonStyle.Normal)] + public DarkButtonStyle ButtonStyle + { + get { return _style; } + set + { + _style = value; + Invalidate(); + } + } + + [Category("Appearance")] + [Description("Determines the amount of padding between the image and text.")] + [DefaultValue(5)] + public int ImagePadding + { + get { return _imagePadding; } + set + { + _imagePadding = value; + Invalidate(); + } + } + + #endregion + + #region Code Property Region + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public DarkControlState ButtonState + { + get { return _buttonState; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new ContentAlignment TextAlign + { + get { return base.TextAlign; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new ContentAlignment ImageAlign + { + get { return base.ImageAlign; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoEllipsis + { + get { return false; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool FlatAppearance + { + get { return false; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new FlatStyle FlatStyle + { + get { return base.FlatStyle; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool UseCompatibleTextRendering + { + get { return false; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool UseVisualStyleBackColor + { + get { return false; } + } + + #endregion + + #region Constructor Region + + public DarkButton() + { + SetStyle(ControlStyles.OptimizedDoubleBuffer | + ControlStyles.ResizeRedraw | + ControlStyles.UserPaint, true); + + base.UseVisualStyleBackColor = false; + base.UseCompatibleTextRendering = false; + + SetButtonState(DarkControlState.Normal); + Padding = new Padding(_padding); + } + + #endregion + + #region Method Region + + private void SetButtonState(DarkControlState buttonState) + { + if (_buttonState != buttonState) + { + _buttonState = buttonState; + Invalidate(); + } + } + + #endregion + + #region Event Handler Region + + protected override void OnCreateControl() + { + base.OnCreateControl(); + + var form = FindForm(); + if (form != null) + { + if (form.AcceptButton == this) + _isDefault = true; + } + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + + if (_spacePressed) + return; + + if (e.Button == MouseButtons.Left) + { + if (ClientRectangle.Contains(e.Location)) + SetButtonState(DarkControlState.Pressed); + else + SetButtonState(DarkControlState.Hover); + } + else + { + SetButtonState(DarkControlState.Hover); + } + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + if (!ClientRectangle.Contains(e.Location)) + return; + + SetButtonState(DarkControlState.Pressed); + } + + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseUp(e); + + if (_spacePressed) + return; + + SetButtonState(DarkControlState.Normal); + } + + protected override void OnMouseLeave(EventArgs e) + { + base.OnMouseLeave(e); + + if (_spacePressed) + return; + + SetButtonState(DarkControlState.Normal); + } + + protected override void OnMouseCaptureChanged(EventArgs e) + { + base.OnMouseCaptureChanged(e); + + if (_spacePressed) + return; + + var location = Cursor.Position; + + if (!ClientRectangle.Contains(location)) + SetButtonState(DarkControlState.Normal); + } + + protected override void OnGotFocus(EventArgs e) + { + base.OnGotFocus(e); + + Invalidate(); + } + + protected override void OnLostFocus(EventArgs e) + { + base.OnLostFocus(e); + + _spacePressed = false; + + var location = Cursor.Position; + + if (!ClientRectangle.Contains(location)) + SetButtonState(DarkControlState.Normal); + else + SetButtonState(DarkControlState.Hover); + } + + protected override void OnKeyDown(KeyEventArgs e) + { + base.OnKeyDown(e); + + if (e.KeyCode == Keys.Space) + { + _spacePressed = true; + SetButtonState(DarkControlState.Pressed); + } + } + + protected override void OnKeyUp(KeyEventArgs e) + { + base.OnKeyUp(e); + + if (e.KeyCode == Keys.Space) + { + _spacePressed = false; + + var location = Cursor.Position; + + if (!ClientRectangle.Contains(location)) + SetButtonState(DarkControlState.Normal); + else + SetButtonState(DarkControlState.Hover); + } + } + + public override void NotifyDefault(bool value) + { + base.NotifyDefault(value); + + if (!DesignMode) + return; + + _isDefault = value; + Invalidate(); + } + + #endregion + + #region Paint Region + + protected override void OnPaint(PaintEventArgs e) + { + var g = e.Graphics; + var rect = new Rectangle(0, 0, ClientSize.Width, ClientSize.Height); + + var textColor = Colors.LightText; + var borderColor = Colors.GreySelection; + var fillColor = _isDefault ? Colors.DarkBlueBackground : Colors.LightBackground; + + if (Enabled) + { + if (ButtonStyle == DarkButtonStyle.Normal) + { + if (Focused && TabStop) + borderColor = Colors.BlueHighlight; + + switch (ButtonState) + { + case DarkControlState.Hover: + fillColor = _isDefault ? Colors.BlueBackground : Colors.LighterBackground; + break; + case DarkControlState.Pressed: + fillColor = _isDefault ? Colors.DarkBackground : Colors.DarkBackground; + break; + } + } + else if (ButtonStyle == DarkButtonStyle.Flat) + { + switch (ButtonState) + { + case DarkControlState.Normal: + fillColor = Colors.GreyBackground; + break; + case DarkControlState.Hover: + fillColor = Colors.MediumBackground; + break; + case DarkControlState.Pressed: + fillColor = Colors.DarkBackground; + break; + } + } + } + else + { + textColor = Colors.DisabledText; + fillColor = Colors.DarkGreySelection; + } + + using (var b = new SolidBrush(fillColor)) + { + g.FillRectangle(b, rect); + } + + if (ButtonStyle == DarkButtonStyle.Normal) + { + using (var p = new Pen(borderColor, 1)) + { + var modRect = new Rectangle(rect.Left, rect.Top, rect.Width - 1, rect.Height - 1); + + g.DrawRectangle(p, modRect); + } + } + + var textOffsetX = 0; + var textOffsetY = 0; + + if (Image != null) + { + var stringSize = g.MeasureString(Text, Font, rect.Size); + + var x = 0; + var y = (ClientSize.Height / 2) - (Image.Size.Height / 2); + + switch (TextImageRelation) + { + case TextImageRelation.ImageAboveText: + textOffsetY = (Image.Size.Height / 2) + (ImagePadding / 2); + y = y - ((int)(stringSize.Height / 2) + (ImagePadding / 2)); + break; + case TextImageRelation.TextAboveImage: + textOffsetY = ((Image.Size.Height / 2) + (ImagePadding / 2)) * -1; + y = y + ((int)(stringSize.Height / 2) + (ImagePadding / 2)); + break; + case TextImageRelation.ImageBeforeText: + textOffsetX = Image.Size.Width + ImagePadding; + break; + case TextImageRelation.TextBeforeImage: + x = x + (int)stringSize.Width; + break; + } + + g.DrawImageUnscaled(Image, x, y); + } + + using (var b = new SolidBrush(textColor)) + { + var modRect = new Rectangle(rect.Left + textOffsetX + Padding.Left, + rect.Top + textOffsetY + Padding.Top, rect.Width - Padding.Horizontal, + rect.Height - Padding.Vertical); + + var stringFormat = new StringFormat + { + LineAlignment = StringAlignment.Center, + Alignment = StringAlignment.Center, + Trimming = StringTrimming.EllipsisCharacter + }; + + g.DrawString(Text, Font, b, modRect, stringFormat); + } + } + + #endregion + } +} diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj new file mode 100644 index 0000000..cc560d8 --- /dev/null +++ b/DarkUI/DarkUI.csproj @@ -0,0 +1,56 @@ + + + + + Debug + AnyCPU + {F19472F5-8C44-4C51-A8A0-B9DE5F555255} + Library + Properties + DarkUI + DarkUI + v2.0 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + Component + + + + + + \ No newline at end of file diff --git a/DarkUI/Properties/AssemblyInfo.cs b/DarkUI/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f648242 --- /dev/null +++ b/DarkUI/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Dark UI")] +[assembly: AssemblyDescription("Dark themed control and docking library for .NET WinForms.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Robin Perris")] +[assembly: AssemblyProduct("Dark UI")] +[assembly: AssemblyCopyright("Copyright © Robin Perris")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f19472f5-8c44-4c51-a8a0-b9de5f555255")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Example/Example.csproj b/Example/Example.csproj new file mode 100644 index 0000000..917cb16 --- /dev/null +++ b/Example/Example.csproj @@ -0,0 +1,87 @@ + + + + + Debug + AnyCPU + {FA334815-6D78-4E9A-9F4D-6C8A58222A57} + WinExe + Properties + Example + Example + v2.0 + 512 + true + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + Form + + + MainForm.cs + + + + + MainForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {f19472f5-8c44-4c51-a8a0-b9de5f555255} + DarkUI + + + + + \ No newline at end of file diff --git a/Example/Forms/MainForm.Designer.cs b/Example/Forms/MainForm.Designer.cs new file mode 100644 index 0000000..b17ebd3 --- /dev/null +++ b/Example/Forms/MainForm.Designer.cs @@ -0,0 +1,91 @@ +namespace Example +{ + partial class MainForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.btnConfirm = new DarkUI.DarkButton(); + this.btnCancel = new DarkUI.DarkButton(); + this.btnDisabled = new DarkUI.DarkButton(); + this.SuspendLayout(); + // + // btnConfirm + // + this.btnConfirm.Location = new System.Drawing.Point(12, 12); + this.btnConfirm.Name = "btnConfirm"; + this.btnConfirm.Padding = new System.Windows.Forms.Padding(5); + this.btnConfirm.Size = new System.Drawing.Size(95, 27); + this.btnConfirm.TabIndex = 0; + this.btnConfirm.Text = "Confirm"; + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(113, 12); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Padding = new System.Windows.Forms.Padding(5); + this.btnCancel.Size = new System.Drawing.Size(95, 27); + this.btnCancel.TabIndex = 1; + this.btnCancel.Text = "Cancel"; + // + // btnDisabled + // + this.btnDisabled.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnDisabled.Enabled = false; + this.btnDisabled.Location = new System.Drawing.Point(214, 12); + this.btnDisabled.Name = "btnDisabled"; + this.btnDisabled.Padding = new System.Windows.Forms.Padding(5); + this.btnDisabled.Size = new System.Drawing.Size(95, 27); + this.btnDisabled.TabIndex = 2; + this.btnDisabled.Text = "Disabled"; + // + // MainForm + // + this.AcceptButton = this.btnConfirm; + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(331, 302); + this.Controls.Add(this.btnDisabled); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnConfirm); + this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Name = "MainForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Dark UI - Example"; + this.ResumeLayout(false); + + } + + #endregion + + private DarkUI.DarkButton btnConfirm; + private DarkUI.DarkButton btnCancel; + private DarkUI.DarkButton btnDisabled; + } +} + diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs new file mode 100644 index 0000000..d2c94b0 --- /dev/null +++ b/Example/Forms/MainForm.cs @@ -0,0 +1,12 @@ +using System.Windows.Forms; + +namespace Example +{ + public partial class MainForm : Form + { + public MainForm() + { + InitializeComponent(); + } + } +} diff --git a/Example/Forms/MainForm.resx b/Example/Forms/MainForm.resx new file mode 100644 index 0000000..7080a7d --- /dev/null +++ b/Example/Forms/MainForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Example/Program.cs b/Example/Program.cs new file mode 100644 index 0000000..683da87 --- /dev/null +++ b/Example/Program.cs @@ -0,0 +1,19 @@ +using System; +using System.Windows.Forms; + +namespace Example +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} diff --git a/Example/Properties/AssemblyInfo.cs b/Example/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..71dd721 --- /dev/null +++ b/Example/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Dark UI Example")] +[assembly: AssemblyDescription("Examlpe application for Dark UI")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Robin Perris")] +[assembly: AssemblyProduct("Dark UI")] +[assembly: AssemblyCopyright("Copyright © Robin Perris")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("fa334815-6d78-4e9a-9f4d-6c8a58222a57")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Example/Properties/Resources.Designer.cs b/Example/Properties/Resources.Designer.cs new file mode 100644 index 0000000..c6fca64 --- /dev/null +++ b/Example/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Example.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Example.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Example/Properties/Resources.resx b/Example/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Example/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Example/Properties/Settings.Designer.cs b/Example/Properties/Settings.Designer.cs new file mode 100644 index 0000000..b86894c --- /dev/null +++ b/Example/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Example.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Example/Properties/Settings.settings b/Example/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Example/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + From b45f0d1d822e211408b8f54ae1bc3c6b7d0e4570 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 09:34:02 +0100 Subject: [PATCH 02/97] Added DarkForm --- DarkUI/DarkUI.csproj | 3 +++ DarkUI/Forms/DarkForm.cs | 16 ++++++++++++++++ Example/Forms/MainForm.cs | 5 +++-- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 DarkUI/Forms/DarkForm.cs diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index cc560d8..3183636 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -43,6 +43,9 @@ Component + + Form + diff --git a/DarkUI/Forms/DarkForm.cs b/DarkUI/Forms/DarkForm.cs new file mode 100644 index 0000000..2e5532d --- /dev/null +++ b/DarkUI/Forms/DarkForm.cs @@ -0,0 +1,16 @@ +using System.Windows.Forms; + +namespace DarkUI +{ + public class DarkForm : Form + { + #region Constructor Region + + public DarkForm() + { + BackColor = Colors.GreyBackground; + } + + #endregion + } +} diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index d2c94b0..0ced87d 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -1,8 +1,9 @@ -using System.Windows.Forms; +using DarkUI; +using System.Windows.Forms; namespace Example { - public partial class MainForm : Form + public partial class MainForm : DarkForm { public MainForm() { From a0112f3e9909e589a8d33f8cb0258244bb8d44f6 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 09:46:11 +0100 Subject: [PATCH 03/97] Menu icons --- DarkUI/Icons/MenuIcons.Designer.cs | 83 +++++++++++++++++++ DarkUI/Icons/MenuIcons.resx | 127 +++++++++++++++++++++++++++++ DarkUI/Resources/grip.png | Bin 0 -> 2830 bytes DarkUI/Resources/tick.png | Bin 0 -> 2939 bytes 4 files changed, 210 insertions(+) create mode 100644 DarkUI/Icons/MenuIcons.Designer.cs create mode 100644 DarkUI/Icons/MenuIcons.resx create mode 100644 DarkUI/Resources/grip.png create mode 100644 DarkUI/Resources/tick.png diff --git a/DarkUI/Icons/MenuIcons.Designer.cs b/DarkUI/Icons/MenuIcons.Designer.cs new file mode 100644 index 0000000..0ffedc4 --- /dev/null +++ b/DarkUI/Icons/MenuIcons.Designer.cs @@ -0,0 +1,83 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DarkUI { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class MenuIcons { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal MenuIcons() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DarkUI.Icons.MenuIcons", typeof(MenuIcons).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap grip { + get { + object obj = ResourceManager.GetObject("grip", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap tick { + get { + object obj = ResourceManager.GetObject("tick", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/DarkUI/Icons/MenuIcons.resx b/DarkUI/Icons/MenuIcons.resx new file mode 100644 index 0000000..3c66e3c --- /dev/null +++ b/DarkUI/Icons/MenuIcons.resx @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\grip.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\tick.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/DarkUI/Resources/grip.png b/DarkUI/Resources/grip.png new file mode 100644 index 0000000000000000000000000000000000000000..8ce65f6cb99ed6391a7ec313369b4d076a410998 GIT binary patch literal 2830 zcmV+p3-R=cP)X1^@s6`FrFA00009a7bBm000XU z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjO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>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0000vNklR-CYybcN07*qoM6N<$f~8+Wm;e9( literal 0 HcmV?d00001 diff --git a/DarkUI/Resources/tick.png b/DarkUI/Resources/tick.png new file mode 100644 index 0000000000000000000000000000000000000000..de9a6f85f29fc486d22d6afeb066b54d23a6ccc7 GIT binary patch literal 2939 zcmV->3xxEEP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+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Date: Fri, 18 Sep 2015 09:46:52 +0100 Subject: [PATCH 04/97] ToolStrip & Menu renderers Added toolstrip & menu renderers. Added extension methods for changing bitmap colours and upgraded to .NET 4.0 for easier implementation of these methods. --- DarkUI/DarkUI.csproj | 25 ++- DarkUI/Extensions/BitmapExtensions.cs | 37 ++++ DarkUI/Renderers/DarkMenuRenderer.cs | 137 +++++++++++++++ DarkUI/Renderers/DarkToolStripRenderer.cs | 195 ++++++++++++++++++++++ Example/Example.csproj | 4 +- 5 files changed, 394 insertions(+), 4 deletions(-) create mode 100644 DarkUI/Extensions/BitmapExtensions.cs create mode 100644 DarkUI/Renderers/DarkMenuRenderer.cs create mode 100644 DarkUI/Renderers/DarkToolStripRenderer.cs diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index 3183636..3e5b97b 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -9,9 +9,9 @@ Properties DarkUI DarkUI - v2.0 + v4.0 512 - + Client true @@ -43,10 +43,31 @@ Component + Form + + True + True + MenuIcons.resx + + + + + + + PublicResXFileCodeGenerator + MenuIcons.Designer.cs + DarkUI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\scrollbar_arrow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\scrollbar_arrow_clicked.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\scrollbar_arrow_hot.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\scrollbar_arrow_standard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/DarkUI/Resources/scrollbar_arrow.png b/DarkUI/Resources/scrollbar_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..738e01bd53c24f6dc9250a77401fdb7e63e10f8a GIT binary patch literal 15222 zcmeI3F^uCx6hMtmAXw>6K!XGnRt_Z4;n?=E3G(~N(T}IG!rwayIqur`@%OR&H?Fo z`#3soy`fv)ponbG#KrNzC!;ye*c$uDI>ixh;;!S?3V(h5O@VjpTH%h`l3IQP_nf_p z03Ti4YFihlmSz{W>Kn#bCjkaHLi~8pcSC(#Dk|ao)t}41z;wPU%eS=&Xf!)y$n>Q!vh*T@| zqR7`paWongM@rEPx}vOUnkbdTQb`~qgz(&r&{%N8>uHc_oF)#f!0{u;bNM(fGQD9` zD-_~Hv(IE*1Amst4JYgfMRAOLQ7%g23a3_!?lu@K^$erkGcuFO%9bV!+vh$O4{_)X z0}Jn-VK=(IY!ZIYi@dPst(gDJymA$`HJgY(4EhOR+Y)gf4@l0C_{mGx5ILP}bLN&1 zTUMsSV`qh1Y)RdcQb>2mAoZs=0*oRrXnS72o>tkxbk%&LkyI7`${okGy;1n8AwrjI zzq4q#i6UGl^{5I`MJScpC0SRhx}x5YWL=VSLDG>RMvK(GjUu#8l)14mj%Pca^R=R6 zBj;nZTKc{lM##1BezQ*2UUVE=m#~7WRm~PuRFwr}ZdL_NF*Ttg+hqmY)@Io(C5xPQ zUkKgwtYKUSBy@W4ZOVA<#GPrPT(E^i zZw3zOOQ@e46R*W4$uwI*$gEU_4(^l%&E8anYFUv5ts<+EB$*hSsttaqyZ7u%3kvDHIv7u$7lTEJ7qdOMfy=lscaXk?vb+6lHvXNwPP zIA0OTf!#sfd2KxHN&PJES5l>FE0QLWepTtL>{rW5FkQ%eMnhb0zP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dA{d5QC%5j1L~Yt{9s@teD=sQEUs5Ht*n_MR6~y)XMnp0 z4Tt=Fg>f6!M=nr5*Y7a%8>dSAa{7^9S{Auy&7>exEqRh957FY}DSD<>C$0Z!-ee1U zno&V4mIMHyiwqZ?53n*^00>=VxafRU}d-f5W2{4 z(fI%?!v%oQMTU#c2Ur;{0E8|wTy#Fb%5VW7bdlkr^8r?d3jm>u3>Tdburgc#2wh~j z=zM^c;Q~PDBEv=J1FQ@e074fTE;=7zWw-zky2xR5A0ak_!0HKQv7o88VGF$)%U1YfEe1MhV0zl{@!$s!w8)U4u-B{Zn{Mx#>|M=%S>lcrP!{Lj6tvneHzq$Kpc;~kQ3jEFA3tv2Zcjdv# hx1U`i9>d`?+`YS>e1G`M4=Y6Ewl{A!zFWWj(La@LdR_nk literal 0 HcmV?d00001 diff --git a/DarkUI/Resources/scrollbar_arrow_hot.png b/DarkUI/Resources/scrollbar_arrow_hot.png new file mode 100644 index 0000000000000000000000000000000000000000..85c99ac8b5fe68ebc94f509ec79b96d9d32b4874 GIT binary patch literal 15228 zcmeI3PmkL~6u?~}(6Ul{MS_d#f&?m#|0GV2e3%6XaD*W}sj{@&HRpFl2kQ>1^Zo9h| zAwIg;KejJUZQT)W)z-~{K>~DfjQByf<3+}xDx`4@a-XOrflr6Tr&VDyNywix4)|?9 z#JpB0i?*zk_=;Xov~oqSyv?gbmgEgdl|@-Mw4x!a{OA&D>*UT1ou+YEzdcGvq^i)4 z&$CKB|*P72tuCEUSXk~1QH%EC3oZZqGUnI$Ba zrRng%UE-ElGPkr8vK=x>{TbUKMzJ3r`+ldERoTIK)%^B$T2=g;_gv5M`_Wsb1YPp| z&ZFTvigAt9qbAA~QB{vs#VG2AtlX3pLzbt4WFtY02C01q#b}i%Gh<;K-*KDgD@Dmi z&cqexS z&Znx3)LPnkj_^mb+OeVIrX3_eVT6-|Srx`7bJB7q9VPKe54eHsr1#Y9q)Xqt0BnZPq{D8(QjjqR{mM2bky=7k>8B_D8!pBQX#9H%q;4x8w_tsNw4m> z|G`E?=9@s6^n$;%L9@Wp{euW(e6*X)n{YqZiuNIYHwvgG3rnK68rjvbF8Lg8%;m#qPXUEQ433f*D|GCIW;o*&oxN%BL@+sO-C`MIUO8-k~FbSFCDL! zWpYVM@;!2$Hbd9@bk}J!bj>~A_1w6oj=VxafRU}d-f5W2{4(fI%?!v%oQ zMTU#c2Ur;{0E8|wTy#Fb%5VW7bdlkr^8r?d3jm>u3>Tdburgc#2wh~j=zM^c;Q~PD zBEv=J1FQ@e074fTE;=7zWw-zky2xR5A0ak_!0HKQv7o88VGF$)%U1YfEe1MhV0zl{@!$s!Iv-$VxBw8k zNX50Dzn6+V@-k|lymi|9{xW&>mA7{f8yt7>2FHE;3CCRy$?qQ=*ONK!&xhn?*T)?9 zivPt2zuYEcwY~c0@!&V>n-ANUch`!~hQlXUo;(^3hei3>@bmYs-?{d5?fvWDZG0v? h-ij6Czzv5laNquZ{`c$c2VW=h-p+pg>DI$X{{SOfcoF~r literal 0 HcmV?d00001 diff --git a/DarkUI/Resources/scrollbar_arrow_standard.png b/DarkUI/Resources/scrollbar_arrow_standard.png new file mode 100644 index 0000000000000000000000000000000000000000..6211702b8f562a1cda9f25c715a26435e4eb2519 GIT binary patch literal 15228 zcmeI3L2u(k6o9>2fl8(A2?+@D32 zHfc|2xlk@hNQk{H{DD1iLmUtiaO4N@58whES6V5I?Id^m+xu@>-}c==pdw!|1mMzG0rCh;5;^uA<=1#+lUjg$IX3q z%L@=I7ZlzUr7~Ml3zDo<)XF<-5zB&D6^bG+s+wHV#3DPoxcVx-(*w)a4jOkx>9ADe zI#J|ng3#~x3;j~T3)+IDs;VFsg<_G%Blz&bjf?^BhBwn7<2Vfznt|g-j_0y*T%+Zk zMKz9#6HTtsx_bU3ksFTKVT!`Q@CB(L3JaW?O|o0BH`gk0c@E9>Y^Ub8Dc+a?iwP;&NgRi z39)5iIy7(=xW$&#Eh&X`hjd(j+E##!$P11Skjs!89xb`h0GM0%lH5SJ4EXTfB zDoQqTI!3dp?Yd!PxF*_d)bZL2j$>(+l2xtBsKr;yip`61xyV;lwZfOHs;JmSNik6? zS>&|)Oz4JZp2c;5L#GGd@=P3lQdU|^DVuUxLVQVVNxUQ>nK#N+g>R`<*-}a+)I#<+ zQ7+g_qI-dZ`;yVkjfvM{;bgXAAzM~tzA9BkUN*}3PF5A(mh7seigpF3AE%fTW+v5+ z6XI&R$W^{L@g$sKr4-&yM;=fHvB=LY6t1Y1C;q7+x3R zUfp&6gN+D{^MAJu%blwK#WrMBY<3K{jjXybF5t0Zxt&Y*bNXbBPwVVS)U(bq?gSgS zv&9ECoUVxEz-}7tX>C01QT@#CSC*yNmQ}LjekCsKSMy3RUC4AsU080uxn*s6T`y>Q z7OI!>-kCbXs#~UJdqK~L>Q2vSBf)pux{xVzBjf*E4L3i05RIhiNV+higX53mCe}Sm z#;b~mFF}gGN3MA@bUh)v=FQMG^L*cRqIz+Z4XATo@q>Yu@HxcKu&A!ca!J+&sD>W< z&H#0f8xH>a3gb4cj$ELAuHQ-KH%^uK<@6)Jv@CMZnn^*XTKpu7AEJfHQ}j%&PFnwq zyvY{yBBO#>GzkDg7AY<=A7G`p01&cBagq4|E5!wXkVT4%%m-L0E&zlqQe0#{z)Eoe zAY_r^BJ%-OiVFZCixd}`53o{P00>#6xX65fmEr<^!x07XU&QDK0V}V5PVK z5VA;dk@)~C#RY(nMT(2e2UsaC0E8@3Tx34LN^t=oWRc<`^8r?h3jiUD6c?Efuu@zA z2w9}K$b5j6;sQX(BE?1K1FRGm074ciE;1irrMLhPvPf}}`2Z`$1%Qx6ii^w#SSc<5 zge($qt!D3~A{W1m+Q)C5{`KD9-{3b^S##&0$uO61GR()HFwCDAS Date: Fri, 18 Sep 2015 10:28:56 +0100 Subject: [PATCH 09/97] Removed unnecessary property attributes Apparently using 'new' to override a superclass property doesn't require you to duplicate designer attributes. Huh. --- DarkUI/Controls/DarkButton.cs | 5 ---- Example/Forms/MainForm.Designer.cs | 46 ------------------------------ 2 files changed, 51 deletions(-) diff --git a/DarkUI/Controls/DarkButton.cs b/DarkUI/Controls/DarkButton.cs index 4e94a5b..a5acb9e 100644 --- a/DarkUI/Controls/DarkButton.cs +++ b/DarkUI/Controls/DarkButton.cs @@ -24,8 +24,6 @@ namespace DarkUI #region Designer Property Region - [Category("Appearance")] - [Description("The text associated with this control.")] public new string Text { get { return base.Text; } @@ -35,9 +33,6 @@ namespace DarkUI Invalidate(); } } - - [Category("Behavior")] - [Description("Indicates whether the control is enabled.")] public new bool Enabled { get { return base.Enabled; } diff --git a/Example/Forms/MainForm.Designer.cs b/Example/Forms/MainForm.Designer.cs index 09d04eb..d166c3c 100644 --- a/Example/Forms/MainForm.Designer.cs +++ b/Example/Forms/MainForm.Designer.cs @@ -77,9 +77,6 @@ this.toolStripStatusLabel4 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel6 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel5 = new System.Windows.Forms.ToolStripStatusLabel(); - this.darkLabel1 = new DarkUI.DarkLabel(); - this.darkScrollBar1 = new DarkUI.DarkScrollBar(); - this.darkScrollBar2 = new DarkUI.DarkScrollBar(); this.mnuMain.SuspendLayout(); this.toolMain.SuspendLayout(); this.darkStatusStrip1.SuspendLayout(); @@ -541,51 +538,11 @@ this.toolStripStatusLabel5.Text = "120 MB"; this.toolStripStatusLabel5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // darkLabel1 - // - this.darkLabel1.AutoSize = false; - this.darkLabel1.AutoUpdateHeight = true; - this.darkLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.darkLabel1.Location = new System.Drawing.Point(281, 143); - this.darkLabel1.Name = "darkLabel1"; - this.darkLabel1.Size = new System.Drawing.Size(149, 15); - this.darkLabel1.TabIndex = 3; - this.darkLabel1.Text = "dfsafsa"; - // - // darkScrollBar1 - // - this.darkScrollBar1.Location = new System.Drawing.Point(545, 93); - this.darkScrollBar1.Maximum = 100; - this.darkScrollBar1.Minimum = 0; - this.darkScrollBar1.Name = "darkScrollBar1"; - this.darkScrollBar1.ScrollOrientation = DarkUI.DarkOrientation.Vertical; - this.darkScrollBar1.Size = new System.Drawing.Size(15, 251); - this.darkScrollBar1.TabIndex = 4; - this.darkScrollBar1.Text = "darkScrollBar1"; - this.darkScrollBar1.Value = 0; - this.darkScrollBar1.ViewSize = 0; - // - // darkScrollBar2 - // - this.darkScrollBar2.Location = new System.Drawing.Point(249, 329); - this.darkScrollBar2.Maximum = 100; - this.darkScrollBar2.Minimum = 0; - this.darkScrollBar2.Name = "darkScrollBar2"; - this.darkScrollBar2.ScrollOrientation = DarkUI.DarkOrientation.Horizontal; - this.darkScrollBar2.Size = new System.Drawing.Size(290, 15); - this.darkScrollBar2.TabIndex = 5; - this.darkScrollBar2.Text = "darkScrollBar2"; - this.darkScrollBar2.Value = 0; - this.darkScrollBar2.ViewSize = 0; - // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(784, 562); - this.Controls.Add(this.darkScrollBar2); - this.Controls.Add(this.darkScrollBar1); - this.Controls.Add(this.darkLabel1); this.Controls.Add(this.darkStatusStrip1); this.Controls.Add(this.toolMain); this.Controls.Add(this.mnuMain); @@ -656,9 +613,6 @@ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel4; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel6; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel5; - private DarkUI.DarkLabel darkLabel1; - private DarkUI.DarkScrollBar darkScrollBar1; - private DarkUI.DarkScrollBar darkScrollBar2; } } From 784e3b69b750b9d1520847e1c3c0c5125d92f664 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 10:33:51 +0100 Subject: [PATCH 10/97] DarkSeparator control --- DarkUI/Controls/DarkSeparator.cs | 44 ++++++++++++++++++++++++++++++ DarkUI/DarkUI.csproj | 3 ++ Example/Forms/MainForm.Designer.cs | 2 +- 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 DarkUI/Controls/DarkSeparator.cs diff --git a/DarkUI/Controls/DarkSeparator.cs b/DarkUI/Controls/DarkSeparator.cs new file mode 100644 index 0000000..6ac4398 --- /dev/null +++ b/DarkUI/Controls/DarkSeparator.cs @@ -0,0 +1,44 @@ +using System.Drawing; +using System.Windows.Forms; + +namespace DarkUI +{ + public class DarkSeparator : Control + { + #region Constructor Region + + public DarkSeparator() + { + SetStyle(ControlStyles.Selectable, false); + + Dock = DockStyle.Top; + Size = new Size(1, 2); + } + + #endregion + + #region Paint Region + + protected override void OnPaint(PaintEventArgs e) + { + var g = e.Graphics; + + using (var p = new Pen(Colors.DarkBorder)) + { + g.DrawLine(p, ClientRectangle.Left, 0, ClientRectangle.Right, 0); + } + + using (var p = new Pen(Colors.LightBorder)) + { + g.DrawLine(p, ClientRectangle.Left, 1, ClientRectangle.Right, 1); + } + } + + protected override void OnPaintBackground(PaintEventArgs e) + { + // Absorb event + } + + #endregion + } +} diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index 38da2a9..3abc634 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -52,6 +52,9 @@ Component + + Component + Component diff --git a/Example/Forms/MainForm.Designer.cs b/Example/Forms/MainForm.Designer.cs index d166c3c..7abf00e 100644 --- a/Example/Forms/MainForm.Designer.cs +++ b/Example/Forms/MainForm.Designer.cs @@ -526,7 +526,7 @@ // this.toolStripStatusLabel6.Margin = new System.Windows.Forms.Padding(0, 0, 50, 2); this.toolStripStatusLabel6.Name = "toolStripStatusLabel6"; - this.toolStripStatusLabel6.Size = new System.Drawing.Size(261, 14); + this.toolStripStatusLabel6.Size = new System.Drawing.Size(230, 14); this.toolStripStatusLabel6.Spring = true; this.toolStripStatusLabel6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // From 0d46ab27902c4bc738965f20ba00b963b1d54fee Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 10:36:50 +0100 Subject: [PATCH 11/97] DarkTextBox control --- DarkUI/Controls/DarkTextBox.cs | 19 +++++++++++++++++++ DarkUI/DarkUI.csproj | 3 +++ Example/Forms/MainForm.Designer.cs | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 DarkUI/Controls/DarkTextBox.cs diff --git a/DarkUI/Controls/DarkTextBox.cs b/DarkUI/Controls/DarkTextBox.cs new file mode 100644 index 0000000..e27220f --- /dev/null +++ b/DarkUI/Controls/DarkTextBox.cs @@ -0,0 +1,19 @@ +using System.Windows.Forms; + +namespace DarkUI +{ + public class DarkTextBox : TextBox + { + #region Constructor Region + + public DarkTextBox() + { + BackColor = Colors.LightBackground; + ForeColor = Colors.LightText; + Padding = new Padding(2, 2, 2, 2); + BorderStyle = BorderStyle.FixedSingle; + } + + #endregion + } +} diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index 3abc634..4ba540f 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -58,6 +58,9 @@ Component + + Component + Component diff --git a/Example/Forms/MainForm.Designer.cs b/Example/Forms/MainForm.Designer.cs index 7abf00e..d166c3c 100644 --- a/Example/Forms/MainForm.Designer.cs +++ b/Example/Forms/MainForm.Designer.cs @@ -526,7 +526,7 @@ // this.toolStripStatusLabel6.Margin = new System.Windows.Forms.Padding(0, 0, 50, 2); this.toolStripStatusLabel6.Name = "toolStripStatusLabel6"; - this.toolStripStatusLabel6.Size = new System.Drawing.Size(230, 14); + this.toolStripStatusLabel6.Size = new System.Drawing.Size(261, 14); this.toolStripStatusLabel6.Spring = true; this.toolStripStatusLabel6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // From e0be7e0d0aa7db82112dc70d30f12bd2aad22774 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 10:41:33 +0100 Subject: [PATCH 12/97] Added 'FlatBorder' property to DarkForm FlatBorder can be used to set whether a single pixel border is rendered around the form or not. --- DarkUI/Forms/DarkForm.cs | 47 +++++++++++++++++++++++++++++- Example/Forms/MainForm.Designer.cs | 1 + 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/DarkUI/Forms/DarkForm.cs b/DarkUI/Forms/DarkForm.cs index 2e5532d..0d14107 100644 --- a/DarkUI/Forms/DarkForm.cs +++ b/DarkUI/Forms/DarkForm.cs @@ -1,9 +1,34 @@ -using System.Windows.Forms; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; namespace DarkUI { public class DarkForm : Form { + #region Field Region + + private bool _flatBorder; + + #endregion + + #region Property Region + + [Category("Appearance")] + [Description("Determines whether a single pixel border should be rendered around the form.")] + [DefaultValue(false)] + public bool FlatBorder + { + get { return _flatBorder; } + set + { + _flatBorder = value; + Invalidate(); + } + } + + #endregion + #region Constructor Region public DarkForm() @@ -12,5 +37,25 @@ namespace DarkUI } #endregion + + #region Paint Region + + protected override void OnPaintBackground(PaintEventArgs e) + { + base.OnPaintBackground(e); + + if (!_flatBorder) + return; + + var g = e.Graphics; + + using (var p = new Pen(Colors.DarkBorder)) + { + var modRect = new Rectangle(ClientRectangle.Location, new Size(ClientRectangle.Width - 1, ClientRectangle.Height - 1)); + g.DrawRectangle(p, modRect); + } + } + + #endregion } } diff --git a/Example/Forms/MainForm.Designer.cs b/Example/Forms/MainForm.Designer.cs index d166c3c..bcdb59a 100644 --- a/Example/Forms/MainForm.Designer.cs +++ b/Example/Forms/MainForm.Designer.cs @@ -547,6 +547,7 @@ this.Controls.Add(this.toolMain); this.Controls.Add(this.mnuMain); this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MainMenuStrip = this.mnuMain; this.MinimumSize = new System.Drawing.Size(640, 480); this.Name = "MainForm"; From 27a5ad0c6e88393aa21e73e714d6c04ca5c84d3e Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 11:40:14 +0100 Subject: [PATCH 13/97] DarkDialog & DarkMessageBox Added a dynamic dialog window and message box. --- DarkUI/Config/Enums.cs | 19 +++ DarkUI/Controls/DarkLabel.cs | 3 - DarkUI/DarkUI.csproj | 38 +++++ DarkUI/Forms/DarkDialog.Designer.cs | 186 +++++++++++++++++++++++ DarkUI/Forms/DarkDialog.cs | 162 ++++++++++++++++++++ DarkUI/Forms/DarkDialog.resx | 120 +++++++++++++++ DarkUI/Forms/DarkMessageBox.Designer.cs | 81 ++++++++++ DarkUI/Forms/DarkMessageBox.cs | 149 ++++++++++++++++++ DarkUI/Forms/DarkMessageBox.resx | 120 +++++++++++++++ DarkUI/Icons/MessageBoxIcons.Designer.cs | 93 ++++++++++++ DarkUI/Icons/MessageBoxIcons.resx | 130 ++++++++++++++++ DarkUI/Resources/error.png | Bin 0 -> 745 bytes DarkUI/Resources/info.png | Bin 0 -> 629 bytes DarkUI/Resources/warning.png | Bin 0 -> 431 bytes Example/Forms/MainForm.Designer.cs | 25 ++- Example/Forms/MainForm.cs | 14 +- 16 files changed, 1135 insertions(+), 5 deletions(-) create mode 100644 DarkUI/Forms/DarkDialog.Designer.cs create mode 100644 DarkUI/Forms/DarkDialog.cs create mode 100644 DarkUI/Forms/DarkDialog.resx create mode 100644 DarkUI/Forms/DarkMessageBox.Designer.cs create mode 100644 DarkUI/Forms/DarkMessageBox.cs create mode 100644 DarkUI/Forms/DarkMessageBox.resx create mode 100644 DarkUI/Icons/MessageBoxIcons.Designer.cs create mode 100644 DarkUI/Icons/MessageBoxIcons.resx create mode 100644 DarkUI/Resources/error.png create mode 100644 DarkUI/Resources/info.png create mode 100644 DarkUI/Resources/warning.png diff --git a/DarkUI/Config/Enums.cs b/DarkUI/Config/Enums.cs index 4e1029f..a09c523 100644 --- a/DarkUI/Config/Enums.cs +++ b/DarkUI/Config/Enums.cs @@ -25,4 +25,23 @@ Vertical, Horizontal } + + public enum DarkDialogButton + { + Ok, + Close, + OkCancel, + YesNo, + YesNoCancel, + AbortRetryIgnore, + RetryCancel + } + + public enum DarkMessageBoxIcon + { + None, + Information, + Warning, + Error + } } diff --git a/DarkUI/Controls/DarkLabel.cs b/DarkUI/Controls/DarkLabel.cs index 64ed4d7..6b88d4d 100644 --- a/DarkUI/Controls/DarkLabel.cs +++ b/DarkUI/Controls/DarkLabel.cs @@ -34,9 +34,6 @@ namespace DarkUI } } - [Category("Layout")] - [Description("Enables automatic resizing based on font size. Note that this is only valid for label controls that do not wrap text.")] - [DefaultValue(true)] public new bool AutoSize { get { return base.AutoSize; } diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index 4ba540f..a2ee4ec 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -35,6 +35,7 @@ + @@ -66,14 +67,31 @@ + + Form + + + DarkDialog.cs + Form + + Form + + + DarkMessageBox.cs + True True MenuIcons.resx + + True + True + MessageBoxIcons.resx + True True @@ -84,11 +102,22 @@ + + DarkDialog.cs + + + DarkMessageBox.cs + PublicResXFileCodeGenerator MenuIcons.Designer.cs DarkUI + + ResXFileCodeGenerator + MessageBoxIcons.Designer.cs + DarkUI + ResXFileCodeGenerator ScrollIcons.Designer.cs @@ -113,6 +142,15 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DarkUI/Forms/DarkMessageBox.Designer.cs b/DarkUI/Forms/DarkMessageBox.Designer.cs new file mode 100644 index 0000000..a285fd1 --- /dev/null +++ b/DarkUI/Forms/DarkMessageBox.Designer.cs @@ -0,0 +1,81 @@ +namespace DarkUI +{ + partial class DarkMessageBox + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.picIcon = new System.Windows.Forms.PictureBox(); + this.lblText = new DarkUI.DarkLabel(); + ((System.ComponentModel.ISupportInitialize)(this.picIcon)).BeginInit(); + this.SuspendLayout(); + // + // picIcon + // + this.picIcon.Location = new System.Drawing.Point(10, 10); + this.picIcon.Name = "picIcon"; + this.picIcon.Size = new System.Drawing.Size(32, 32); + this.picIcon.TabIndex = 3; + this.picIcon.TabStop = false; + // + // lblText + // + this.lblText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.lblText.Location = new System.Drawing.Point(50, 9); + this.lblText.Name = "lblText"; + this.lblText.Size = new System.Drawing.Size(185, 15); + this.lblText.TabIndex = 4; + this.lblText.Text = "Something something something"; + // + // DarkMessageBox + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(244, 86); + this.Controls.Add(this.lblText); + this.Controls.Add(this.picIcon); + this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "DarkMessageBox"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Message box"; + this.Controls.SetChildIndex(this.picIcon, 0); + this.Controls.SetChildIndex(this.lblText, 0); + ((System.ComponentModel.ISupportInitialize)(this.picIcon)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.PictureBox picIcon; + private DarkLabel lblText; + } +} \ No newline at end of file diff --git a/DarkUI/Forms/DarkMessageBox.cs b/DarkUI/Forms/DarkMessageBox.cs new file mode 100644 index 0000000..6cf7d57 --- /dev/null +++ b/DarkUI/Forms/DarkMessageBox.cs @@ -0,0 +1,149 @@ +using System; +using System.ComponentModel; +using System.Drawing; + +namespace DarkUI +{ + public partial class DarkMessageBox : DarkDialog + { + #region Field Region + + private string _message; + private int _maximumWidth = 350; + + #endregion + + #region Property Region + + [Description("Determines the maximum width of the message box when it autosizes around the displayed message.")] + [DefaultValue(350)] + public int MaximumWidth + { + get { return _maximumWidth; } + set + { + _maximumWidth = value; + CalculateSize(); + } + } + + #endregion + + #region Constructor Region + + public DarkMessageBox() + { + InitializeComponent(); + } + + public DarkMessageBox(string message, string title, DarkMessageBoxIcon icon, DarkDialogButton buttons) + : this() + { + var offsetHeight = Height - picIcon.Height; + + Text = title; + _message = message; + + DialogButtons = buttons; + SetIcon(icon); + } + + public DarkMessageBox(string message) + : this(message, null, DarkMessageBoxIcon.None, DarkDialogButton.Ok) + { } + + public DarkMessageBox(string message, string title) + : this(message, title, DarkMessageBoxIcon.None, DarkDialogButton.Ok) + { } + + public DarkMessageBox(string message, string title, DarkDialogButton buttons) + : this(message, title, DarkMessageBoxIcon.None, buttons) + { } + + public DarkMessageBox(string message, string title, DarkMessageBoxIcon icon) + : this(message, title, icon, DarkDialogButton.Ok) + { } + + #endregion + + #region Method Region + + private void SetIcon(DarkMessageBoxIcon icon) + { + switch (icon) + { + case DarkMessageBoxIcon.None: + picIcon.Visible = false; + lblText.Left = 10; + break; + case DarkMessageBoxIcon.Information: + picIcon.Image = MessageBoxIcons.info; + break; + case DarkMessageBoxIcon.Warning: + picIcon.Image = MessageBoxIcons.warning; + break; + case DarkMessageBoxIcon.Error: + picIcon.Image = MessageBoxIcons.error; + break; + } + } + + private void CalculateSize() + { + var width = 260; var height = 124; + + // Reset form back to original size + Size = new Size(width, height); + + lblText.Text = string.Empty; + lblText.AutoSize = true; + lblText.Text = _message; + + // Set the minimum dialog size to whichever is bigger - the original size or the buttons. + var minWidth = Math.Max(width, TotalButtonSize + 15); + + // Calculate the total size of the message + var totalWidth = lblText.Right + 25; + + // Make sure we're not making the dialog bigger than the maximum size + if (totalWidth < _maximumWidth) + { + // Width is smaller than the maximum width. + // This means we can have a single-line message box. + // Move the label to accomodate this. + width = totalWidth; + lblText.Top = picIcon.Top + (picIcon.Height / 2) - (lblText.Height / 2); + } + else + { + // Width is larger than the maximum width. + // Change the label size and wrap it. + width = _maximumWidth; + var offsetHeight = Height - picIcon.Height; + lblText.AutoUpdateHeight = true; + lblText.Width = width - lblText.Left - 25; + height = offsetHeight + lblText.Height; + } + + // Force the width to the minimum width + if (width < minWidth) + width = minWidth; + + // Set the new size of the dialog + Size = new Size(width, height); + } + + #endregion + + #region Event Handler Region + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + CalculateSize(); + } + + #endregion + } +} diff --git a/DarkUI/Forms/DarkMessageBox.resx b/DarkUI/Forms/DarkMessageBox.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DarkUI/Forms/DarkMessageBox.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DarkUI/Icons/MessageBoxIcons.Designer.cs b/DarkUI/Icons/MessageBoxIcons.Designer.cs new file mode 100644 index 0000000..7c94bba --- /dev/null +++ b/DarkUI/Icons/MessageBoxIcons.Designer.cs @@ -0,0 +1,93 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DarkUI { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class MessageBoxIcons { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal MessageBoxIcons() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DarkUI.Icons.MessageBoxIcons", typeof(MessageBoxIcons).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap error { + get { + object obj = ResourceManager.GetObject("error", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap info { + get { + object obj = ResourceManager.GetObject("info", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap warning { + get { + object obj = ResourceManager.GetObject("warning", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/DarkUI/Icons/MessageBoxIcons.resx b/DarkUI/Icons/MessageBoxIcons.resx new file mode 100644 index 0000000..3303bd4 --- /dev/null +++ b/DarkUI/Icons/MessageBoxIcons.resx @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\error.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\info.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\warning.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/DarkUI/Resources/error.png b/DarkUI/Resources/error.png new file mode 100644 index 0000000000000000000000000000000000000000..7d96891fa27bbd217eaaf4f688590a97911e0e27 GIT binary patch literal 745 zcmVM@}J%mp{SM^6XSlV`U{Ig=nF0L9|jV zL|aL#SR7g@k^?Oi3m;fn`A$JCuduMRv(1SH^aR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wVbN_N$lqHw+{Pp}9Df|xz16L~| P00000NkvXXu0mjfEmIIw literal 0 HcmV?d00001 diff --git a/DarkUI/Resources/warning.png b/DarkUI/Resources/warning.png new file mode 100644 index 0000000000000000000000000000000000000000..6fbf0effcb85f267a68ac7179e4c7570c1a60ef5 GIT binary patch literal 431 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv(mfq^m6 z)5S5QB5v>0{a(g_0!PowT|dO_v|-D|_6=Wsbtb7zeLo@M2Zvearq=v~WXUaCH*VZ6 zrXmpY=YQ>)NsYdnPtR?(EJ)l@VEp^{-J8CR4zG5}G0jLeUOXkJ^^CwqAFFSh4k`To zcXtv4PD`^|zwi z9eU%oJG_1OHFAO5`sf7xzps}0&QCpf?ptJneC^Mw)`T}X>siY#Zr;a!|D8bZ+^zRt zY=Wx>=>TDk#b5r*ebTLwxm(qL>if!zuf-(x{_dXnUocX3KC9b{>Dmded=pFWFl{|~ z{XU1=ySfehKF2>)$ZiU-vb`@qaq`I>kqaZ%-!Hipq0rD8dY}FI56L+X*C*Sqxo*Y1 zY>L~zxH`FWRdP=GdA8S9t|`Cxi|-60&&Jk@&%N&(X5UCFK3zYvRIo3CxpFEn1{geD L{an^LB{Ts5S`*2@ literal 0 HcmV?d00001 diff --git a/Example/Forms/MainForm.Designer.cs b/Example/Forms/MainForm.Designer.cs index bcdb59a..fcd6887 100644 --- a/Example/Forms/MainForm.Designer.cs +++ b/Example/Forms/MainForm.Designer.cs @@ -77,6 +77,8 @@ this.toolStripStatusLabel4 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel6 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel5 = new System.Windows.Forms.ToolStripStatusLabel(); + this.btnDialog = new DarkUI.DarkButton(); + this.btnMessageBox = new DarkUI.DarkButton(); this.mnuMain.SuspendLayout(); this.toolMain.SuspendLayout(); this.darkStatusStrip1.SuspendLayout(); @@ -538,16 +540,35 @@ this.toolStripStatusLabel5.Text = "120 MB"; this.toolStripStatusLabel5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // + // btnDialog + // + this.btnDialog.Location = new System.Drawing.Point(25, 73); + this.btnDialog.Name = "btnDialog"; + this.btnDialog.Padding = new System.Windows.Forms.Padding(5); + this.btnDialog.Size = new System.Drawing.Size(97, 30); + this.btnDialog.TabIndex = 3; + this.btnDialog.Text = "Dialog"; + // + // btnMessageBox + // + this.btnMessageBox.Location = new System.Drawing.Point(128, 73); + this.btnMessageBox.Name = "btnMessageBox"; + this.btnMessageBox.Padding = new System.Windows.Forms.Padding(5); + this.btnMessageBox.Size = new System.Drawing.Size(97, 30); + this.btnMessageBox.TabIndex = 4; + this.btnMessageBox.Text = "Message Box"; + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(784, 562); + this.Controls.Add(this.btnMessageBox); + this.Controls.Add(this.btnDialog); this.Controls.Add(this.darkStatusStrip1); this.Controls.Add(this.toolMain); this.Controls.Add(this.mnuMain); this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MainMenuStrip = this.mnuMain; this.MinimumSize = new System.Drawing.Size(640, 480); this.Name = "MainForm"; @@ -614,6 +635,8 @@ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel4; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel6; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel5; + private DarkUI.DarkButton btnDialog; + private DarkUI.DarkButton btnMessageBox; } } diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index 0ced87d..8f9f014 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -1,5 +1,4 @@ using DarkUI; -using System.Windows.Forms; namespace Example { @@ -8,6 +7,19 @@ namespace Example public MainForm() { InitializeComponent(); + + btnDialog.Click += delegate { + var msgBox = new DarkMessageBox("This is small", + "Dark UI Example", DarkMessageBoxIcon.Information, DarkDialogButton.AbortRetryIgnore); + msgBox.ShowDialog(); + }; + + btnMessageBox.Click += delegate { + var msgBox = new DarkMessageBox("This is a test of the dark message box. It's cool, isn't it? You can have really quite a lot of text in here and the message box will size itself appropriately. I dislike how the default .NET message box handled this, so hopefully this will be a better option for you. :)", + "Dark UI Example", DarkMessageBoxIcon.Information, DarkDialogButton.AbortRetryIgnore); + msgBox.MaximumWidth = 350; + msgBox.ShowDialog(); + }; } } } From a0d9e343e93171e20800a568d25d9783370ad71e Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 11:45:59 +0100 Subject: [PATCH 14/97] Static message box methods Added static methods for showing specific types of message boxes more easily. --- DarkUI/Forms/DarkMessageBox.cs | 29 +++++++++++++++++++++++++++++ Example/Forms/MainForm.cs | 19 ++++++++----------- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/DarkUI/Forms/DarkMessageBox.cs b/DarkUI/Forms/DarkMessageBox.cs index 6cf7d57..30384f6 100644 --- a/DarkUI/Forms/DarkMessageBox.cs +++ b/DarkUI/Forms/DarkMessageBox.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel; using System.Drawing; +using System.Windows.Forms; namespace DarkUI { @@ -66,6 +67,34 @@ namespace DarkUI #endregion + #region Static Method Region + + public static DialogResult ShowInformation(string message, string caption, DarkDialogButton buttons = DarkDialogButton.Ok) + { + return ShowDialog(message, caption, DarkMessageBoxIcon.Information, buttons); + } + + public static DialogResult ShowWarning(string message, string caption, DarkDialogButton buttons = DarkDialogButton.Ok) + { + return ShowDialog(message, caption, DarkMessageBoxIcon.Warning, buttons); + } + + public static DialogResult ShowError(string message, string caption, DarkDialogButton buttons = DarkDialogButton.Ok) + { + return ShowDialog(message, caption, DarkMessageBoxIcon.Error, buttons); + } + + private static DialogResult ShowDialog(string message, string caption, DarkMessageBoxIcon icon, DarkDialogButton buttons) + { + using (var dlg = new DarkMessageBox(message, caption, icon, buttons)) + { + var result = dlg.ShowDialog(); + return result; + } + } + + #endregion + #region Method Region private void SetIcon(DarkMessageBoxIcon icon) diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index 8f9f014..99360f1 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -8,18 +8,15 @@ namespace Example { InitializeComponent(); - btnDialog.Click += delegate { - var msgBox = new DarkMessageBox("This is small", - "Dark UI Example", DarkMessageBoxIcon.Information, DarkDialogButton.AbortRetryIgnore); - msgBox.ShowDialog(); - }; + btnDialog.Click += delegate + { + DarkMessageBox.ShowError("This is an error", "Dark UI - Example"); + }; - btnMessageBox.Click += delegate { - var msgBox = new DarkMessageBox("This is a test of the dark message box. It's cool, isn't it? You can have really quite a lot of text in here and the message box will size itself appropriately. I dislike how the default .NET message box handled this, so hopefully this will be a better option for you. :)", - "Dark UI Example", DarkMessageBoxIcon.Information, DarkDialogButton.AbortRetryIgnore); - msgBox.MaximumWidth = 350; - msgBox.ShowDialog(); - }; + btnMessageBox.Click += delegate + { + DarkMessageBox.ShowInformation("This is some information, except it is much bigger, so there we go. I wonder how this is going to go. I hope it resizes properly. It probably will.", "Dark UI - Example"); + }; } } } From 13c57d8162710c40147f19785475c0fb99bba23e Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 12:08:22 +0100 Subject: [PATCH 15/97] DarkContextMenu & DarkSectionPanel --- DarkUI/Controls/DarkContextMenu.cs | 16 +++ DarkUI/Controls/DarkSectionPanel.cs | 145 ++++++++++++++++++++++++++++ DarkUI/DarkUI.csproj | 6 ++ Example/Forms/MainForm.Designer.cs | 62 +++++++++++- Example/Forms/MainForm.resx | 3 + 5 files changed, 229 insertions(+), 3 deletions(-) create mode 100644 DarkUI/Controls/DarkContextMenu.cs create mode 100644 DarkUI/Controls/DarkSectionPanel.cs diff --git a/DarkUI/Controls/DarkContextMenu.cs b/DarkUI/Controls/DarkContextMenu.cs new file mode 100644 index 0000000..7e66090 --- /dev/null +++ b/DarkUI/Controls/DarkContextMenu.cs @@ -0,0 +1,16 @@ +using System.Windows.Forms; + +namespace DarkUI +{ + public class DarkContextMenu : ContextMenuStrip + { + #region Constructor Region + + public DarkContextMenu() + { + Renderer = new DarkMenuRenderer(); + } + + #endregion + } +} diff --git a/DarkUI/Controls/DarkSectionPanel.cs b/DarkUI/Controls/DarkSectionPanel.cs new file mode 100644 index 0000000..769a27c --- /dev/null +++ b/DarkUI/Controls/DarkSectionPanel.cs @@ -0,0 +1,145 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace DarkUI +{ + public class DarkSectionPanel : Panel + { + #region Field Region + + private string _sectionHeader; + + #endregion + + #region Property Region + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Padding Padding + { + get { return base.Padding; } + } + + [Category("Appearance")] + [Description("The section header text associated with this control.")] + public string SectionHeader + { + get { return _sectionHeader; } + set + { + _sectionHeader = value; + Invalidate(); + } + } + + #endregion + + #region Constructor Region + + public DarkSectionPanel() + { + SetStyle(ControlStyles.OptimizedDoubleBuffer | + ControlStyles.ResizeRedraw | + ControlStyles.UserPaint, true); + + base.Padding = new Padding(1, 25, 1, 1); + } + + #endregion + + #region Event Handler Region + + protected override void OnEnter(System.EventArgs e) + { + base.OnEnter(e); + + Invalidate(); + } + + protected override void OnLeave(System.EventArgs e) + { + base.OnLeave(e); + + Invalidate(); + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + if (Controls.Count > 0) + Controls[0].Focus(); + } + + #endregion + + #region Paint Region + + protected override void OnPaint(PaintEventArgs e) + { + var g = e.Graphics; + var rect = ClientRectangle; + + // Fill body + using (var b = new SolidBrush(Colors.GreyBackground)) + { + g.FillRectangle(b, rect); + } + + // Draw header + var bgColor = ContainsFocus ? Colors.BlueBackground : Colors.HeaderBackground; + var darkColor = ContainsFocus ? Colors.DarkBlueBorder : Colors.DarkBorder; + var lightColor = ContainsFocus ? Colors.LightBlueBorder : Colors.LightBorder; + + using (var b = new SolidBrush(bgColor)) + { + var bgRect = new Rectangle(0, 0, rect.Width, 25); + g.FillRectangle(b, bgRect); + } + + using (var p = new Pen(darkColor)) + { + g.DrawLine(p, rect.Left, 0, rect.Right, 0); + g.DrawLine(p, rect.Left, 25 - 1, rect.Right, 25 - 1); + } + + using (var p = new Pen(lightColor)) + { + g.DrawLine(p, rect.Left, 1, rect.Right, 1); + } + + var xOffset = 3; + + using (var b = new SolidBrush(Colors.LightText)) + { + var textRect = new Rectangle(xOffset, 0, rect.Width - 4 - xOffset, 25); + + var format = new StringFormat + { + Alignment = StringAlignment.Near, + LineAlignment = StringAlignment.Center, + FormatFlags = StringFormatFlags.NoWrap, + Trimming = StringTrimming.EllipsisCharacter + }; + + g.DrawString(SectionHeader, Font, b, textRect, format); + } + + // Draw border + using (var p = new Pen(Colors.DarkBorder, 1)) + { + var modRect = new Rectangle(rect.Left, rect.Top, rect.Width - 1, rect.Height - 1); + + g.DrawRectangle(p, modRect); + } + } + + protected override void OnPaintBackground(PaintEventArgs e) + { + // Absorb event + } + + #endregion + } +} diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index a2ee4ec..2516111 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -44,6 +44,9 @@ Component + + Component + Component @@ -53,6 +56,9 @@ Component + + Component + Component diff --git a/Example/Forms/MainForm.Designer.cs b/Example/Forms/MainForm.Designer.cs index fcd6887..f19fd8c 100644 --- a/Example/Forms/MainForm.Designer.cs +++ b/Example/Forms/MainForm.Designer.cs @@ -78,10 +78,17 @@ this.toolStripStatusLabel6 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel5 = new System.Windows.Forms.ToolStripStatusLabel(); this.btnDialog = new DarkUI.DarkButton(); + this.darkSectionPanel1 = new DarkUI.DarkSectionPanel(); this.btnMessageBox = new DarkUI.DarkButton(); + this.darkContextMenu1 = new DarkUI.DarkContextMenu(); + this.testToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.moreTestToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.test3ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mnuMain.SuspendLayout(); this.toolMain.SuspendLayout(); this.darkStatusStrip1.SuspendLayout(); + this.darkSectionPanel1.SuspendLayout(); + this.darkContextMenu1.SuspendLayout(); this.SuspendLayout(); // // mnuMain @@ -549,21 +556,63 @@ this.btnDialog.TabIndex = 3; this.btnDialog.Text = "Dialog"; // + // darkSectionPanel1 + // + this.darkSectionPanel1.Controls.Add(this.btnMessageBox); + this.darkSectionPanel1.Location = new System.Drawing.Point(431, 157); + this.darkSectionPanel1.Name = "darkSectionPanel1"; + this.darkSectionPanel1.SectionHeader = "Section test"; + this.darkSectionPanel1.Size = new System.Drawing.Size(221, 224); + this.darkSectionPanel1.TabIndex = 5; + // // btnMessageBox // - this.btnMessageBox.Location = new System.Drawing.Point(128, 73); + this.btnMessageBox.ContextMenuStrip = this.darkContextMenu1; + this.btnMessageBox.Location = new System.Drawing.Point(10, 35); this.btnMessageBox.Name = "btnMessageBox"; this.btnMessageBox.Padding = new System.Windows.Forms.Padding(5); this.btnMessageBox.Size = new System.Drawing.Size(97, 30); - this.btnMessageBox.TabIndex = 4; + this.btnMessageBox.TabIndex = 5; this.btnMessageBox.Text = "Message Box"; // + // darkContextMenu1 + // + this.darkContextMenu1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); + this.darkContextMenu1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.darkContextMenu1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.testToolStripMenuItem, + this.moreTestToolStripMenuItem, + this.test3ToolStripMenuItem}); + this.darkContextMenu1.Name = "darkContextMenu1"; + this.darkContextMenu1.Size = new System.Drawing.Size(125, 70); + // + // testToolStripMenuItem + // + this.testToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.testToolStripMenuItem.Name = "testToolStripMenuItem"; + this.testToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.testToolStripMenuItem.Text = "Test"; + // + // moreTestToolStripMenuItem + // + this.moreTestToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.moreTestToolStripMenuItem.Name = "moreTestToolStripMenuItem"; + this.moreTestToolStripMenuItem.Size = new System.Drawing.Size(124, 22); + this.moreTestToolStripMenuItem.Text = "More test"; + // + // test3ToolStripMenuItem + // + this.test3ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.test3ToolStripMenuItem.Name = "test3ToolStripMenuItem"; + this.test3ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); + this.test3ToolStripMenuItem.Text = "Test 3"; + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(784, 562); - this.Controls.Add(this.btnMessageBox); + this.Controls.Add(this.darkSectionPanel1); this.Controls.Add(this.btnDialog); this.Controls.Add(this.darkStatusStrip1); this.Controls.Add(this.toolMain); @@ -580,6 +629,8 @@ this.toolMain.PerformLayout(); this.darkStatusStrip1.ResumeLayout(false); this.darkStatusStrip1.PerformLayout(); + this.darkSectionPanel1.ResumeLayout(false); + this.darkContextMenu1.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -636,7 +687,12 @@ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel6; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel5; private DarkUI.DarkButton btnDialog; + private DarkUI.DarkSectionPanel darkSectionPanel1; private DarkUI.DarkButton btnMessageBox; + private DarkUI.DarkContextMenu darkContextMenu1; + private System.Windows.Forms.ToolStripMenuItem testToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem moreTestToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem test3ToolStripMenuItem; } } diff --git a/Example/Forms/MainForm.resx b/Example/Forms/MainForm.resx index 29eac64..9271f3a 100644 --- a/Example/Forms/MainForm.resx +++ b/Example/Forms/MainForm.resx @@ -357,4 +357,7 @@ 257, 17 + + 398, 17 + \ No newline at end of file From 431cea92c8b1fdb0460b9e895937983bb95c8ee3 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 12:14:47 +0100 Subject: [PATCH 16/97] Added DarkScrollBase and DarkScrollView Abstract classes that can be built on top of for scrollable controls. Use DarkScrollBase for non-GDI rendering and DarkScrollView for GDI rendering. --- DarkUI/Controls/DarkScrollBase.cs | 294 ++++++++++++++++++++++++++++++ DarkUI/Controls/DarkScrollView.cs | 60 ++++++ DarkUI/DarkUI.csproj | 3 + 3 files changed, 357 insertions(+) create mode 100644 DarkUI/Controls/DarkScrollBase.cs create mode 100644 DarkUI/Controls/DarkScrollView.cs diff --git a/DarkUI/Controls/DarkScrollBase.cs b/DarkUI/Controls/DarkScrollBase.cs new file mode 100644 index 0000000..9456b20 --- /dev/null +++ b/DarkUI/Controls/DarkScrollBase.cs @@ -0,0 +1,294 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace DarkUI +{ + public abstract class DarkScrollBase : Control + { + #region Event Region + + public event EventHandler ViewportChanged; + public event EventHandler ContentSizeChanged; + + #endregion + + #region Field Region + + protected readonly DarkScrollBar _vScrollBar; + protected readonly DarkScrollBar _hScrollBar; + + private Size _visibleSize; + private Size _contentSize; + + private Rectangle _viewport; + + private Point _offsetMousePosition; + + #endregion + + #region Property Region + + public Rectangle Viewport + { + get { return _viewport; } + private set + { + _viewport = value; + + if (ViewportChanged != null) + ViewportChanged(this, null); + } + } + + public Size ContentSize + { + get { return _contentSize; } + set + { + _contentSize = value; + UpdateScrollBars(); + + if (ContentSizeChanged != null) + ContentSizeChanged(this, null); + } + } + + public Point OffsetMousePosition + { + get { return _offsetMousePosition; } + } + + #endregion + + #region Constructor Region + + protected DarkScrollBase() + { + SetStyle(ControlStyles.Selectable | + ControlStyles.UserMouse, true); + + _vScrollBar = new DarkScrollBar { ScrollOrientation = DarkOrientation.Vertical }; + _hScrollBar = new DarkScrollBar { ScrollOrientation = DarkOrientation.Horizontal }; + + Controls.Add(_vScrollBar); + Controls.Add(_hScrollBar); + + _vScrollBar.ValueChanged += delegate { UpdateViewport(); }; + _hScrollBar.ValueChanged += delegate { UpdateViewport(); }; + + _vScrollBar.MouseDown += delegate { Select(); }; + _hScrollBar.MouseDown += delegate { Select(); }; + } + + #endregion + + #region Event Handler Region + + protected override void OnCreateControl() + { + base.OnCreateControl(); + + UpdateScrollBars(); + } + + protected override void OnGotFocus(EventArgs e) + { + base.OnGotFocus(e); + + Invalidate(); + } + + protected override void OnLostFocus(EventArgs e) + { + base.OnLostFocus(e); + + Invalidate(); + } + + protected override void OnResize(EventArgs e) + { + base.OnResize(e); + + UpdateScrollBars(); + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + + _offsetMousePosition = new Point(e.X + Viewport.Left, e.Y + Viewport.Top); + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + if (e.Button == MouseButtons.Right) + Select(); + } + + protected override void OnMouseWheel(MouseEventArgs e) + { + base.OnMouseWheel(e); + + var horizontal = false; + + if (_hScrollBar.Visible && ModifierKeys == Keys.Control) + horizontal = true; + + if (_hScrollBar.Visible && !_vScrollBar.Visible) + horizontal = true; + + if (!horizontal) + { + if (e.Delta > 0) + _vScrollBar.ScrollByPhysical(3); + else if (e.Delta < 0) + _vScrollBar.ScrollByPhysical(-3); + } + else + { + if (e.Delta > 0) + _hScrollBar.ScrollByPhysical(3); + else if (e.Delta < 0) + _hScrollBar.ScrollByPhysical(-3); + } + } + + protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs e) + { + base.OnPreviewKeyDown(e); + + // Allows arrow keys to trigger OnKeyPress + switch (e.KeyCode) + { + case Keys.Up: + case Keys.Down: + case Keys.Left: + case Keys.Right: + e.IsInputKey = true; + break; + } + } + + #endregion + + #region Method Region + + private void UpdateScrollBars() + { + if (_vScrollBar.Maximum != ContentSize.Height) + _vScrollBar.Maximum = ContentSize.Height; + + if (_hScrollBar.Maximum != ContentSize.Width) + _hScrollBar.Maximum = ContentSize.Width; + + var scrollSize = Consts.ScrollBarSize; + + _vScrollBar.Location = new Point(ClientSize.Width - scrollSize, 0); + _vScrollBar.Size = new Size(scrollSize, ClientSize.Height); + + _hScrollBar.Location = new Point(0, ClientSize.Height - scrollSize); + _hScrollBar.Size = new Size(ClientSize.Width, scrollSize); + + if (DesignMode) + return; + + // Do this twice in case changing the visibility of the scrollbars + // causes the VisibleSize to change in such a way as to require a second scrollbar. + // Probably a better way to detect that scenario... + SetVisibleSize(); + SetScrollBarVisibility(); + SetVisibleSize(); + SetScrollBarVisibility(); + + if (_vScrollBar.Visible) + _hScrollBar.Width -= scrollSize; + + if (_hScrollBar.Visible) + _vScrollBar.Height -= scrollSize; + + _vScrollBar.ViewSize = _visibleSize.Height; + _hScrollBar.ViewSize = _visibleSize.Width; + + UpdateViewport(); + } + + private void SetScrollBarVisibility() + { + _vScrollBar.Visible = _visibleSize.Height < ContentSize.Height; + _hScrollBar.Visible = _visibleSize.Width < ContentSize.Width; + } + + private void SetVisibleSize() + { + var scrollSize = Consts.ScrollBarSize; + + _visibleSize = new Size(ClientSize.Width, ClientSize.Height); + + if (_vScrollBar.Visible) + _visibleSize.Width -= scrollSize; + + if (_hScrollBar.Visible) + _visibleSize.Height -= scrollSize; + } + + private void UpdateViewport() + { + var left = 0; + var top = 0; + var width = ClientSize.Width; + var height = ClientSize.Height; + + if (_hScrollBar.Visible) + { + left = _hScrollBar.Value; + height -= _hScrollBar.Height; + } + + if (_vScrollBar.Visible) + { + top = _vScrollBar.Value; + width -= _vScrollBar.Width; + } + + Viewport = new Rectangle(left, top, width, height); + + var pos = PointToClient(MousePosition); + _offsetMousePosition = new Point(pos.X + Viewport.Left, pos.Y + Viewport.Top); + + Invalidate(); + } + + public void ScrollTo(Point point) + { + HScrollTo(point.X); + VScrollTo(point.Y); + } + + public void VScrollTo(int value) + { + if (_vScrollBar.Visible) + _vScrollBar.Value = value; + } + + public void HScrollTo(int value) + { + if (_hScrollBar.Visible) + _hScrollBar.Value = value; + } + + public Point PointToView(Point point) + { + return new Point(point.X - Viewport.Left, point.Y - Viewport.Top); + } + + public Rectangle RectangleToView(Rectangle rect) + { + return new Rectangle(new Point(rect.Left - Viewport.Left, rect.Top - Viewport.Top), rect.Size); + } + + #endregion + } +} diff --git a/DarkUI/Controls/DarkScrollView.cs b/DarkUI/Controls/DarkScrollView.cs new file mode 100644 index 0000000..c6f9270 --- /dev/null +++ b/DarkUI/Controls/DarkScrollView.cs @@ -0,0 +1,60 @@ +using System.Drawing; +using System.Windows.Forms; + +namespace DarkUI +{ + public abstract class DarkScrollView : DarkScrollBase + { + #region Constructor Region + + protected DarkScrollView() + { + SetStyle(ControlStyles.OptimizedDoubleBuffer | + ControlStyles.ResizeRedraw | + ControlStyles.UserPaint, true); + } + + #endregion + + #region Paint Region + + protected abstract void PaintContent(Graphics g); + + protected override void OnPaint(PaintEventArgs e) + { + var g = e.Graphics; + + // Draw background + using (var b = new SolidBrush(BackColor)) + { + g.FillRectangle(b, ClientRectangle); + } + + // Offset the graphics based on the viewport, render the control contents, then reset it. + g.TranslateTransform(Viewport.Left * -1, Viewport.Top * -1); + + PaintContent(g); + + g.TranslateTransform(Viewport.Left, Viewport.Top); + + // Draw the bit where the scrollbars meet + if (_vScrollBar.Visible && _hScrollBar.Visible) + { + using (var b = new SolidBrush(BackColor)) + { + var rect = new Rectangle(_hScrollBar.Right, _vScrollBar.Bottom, _vScrollBar.Width, + _hScrollBar.Height); + + g.FillRectangle(b, rect); + } + } + } + + protected override void OnPaintBackground(PaintEventArgs e) + { + // Absorb event + } + + #endregion + } +} diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index 2516111..4b113af 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -41,6 +41,9 @@ + + Component + Component From 8408c47a3f742175c3a631df6fd67868dae01839 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 12:32:23 +0100 Subject: [PATCH 17/97] DarkListView --- DarkUI/Controls/Classes/DarkListItem.cs | 32 ++ DarkUI/Controls/DarkListView.cs | 474 ++++++++++++++++++++++++ DarkUI/Controls/DarkScrollBase.cs | 7 + DarkUI/DarkUI.csproj | 7 + Example/Forms/MainForm.Designer.cs | 28 +- Example/Forms/MainForm.cs | 6 + 6 files changed, 553 insertions(+), 1 deletion(-) create mode 100644 DarkUI/Controls/Classes/DarkListItem.cs create mode 100644 DarkUI/Controls/DarkListView.cs diff --git a/DarkUI/Controls/Classes/DarkListItem.cs b/DarkUI/Controls/Classes/DarkListItem.cs new file mode 100644 index 0000000..6b320c6 --- /dev/null +++ b/DarkUI/Controls/Classes/DarkListItem.cs @@ -0,0 +1,32 @@ +using System.Drawing; + +namespace DarkUI +{ + public class DarkListItem + { + #region Property Region + + public string Text { get; set; } + public Rectangle Area { get; set; } + public Color TextColor { get; set; } + public FontStyle FontStyle { get; set; } + + #endregion + + #region Constructor Region + + public DarkListItem() + { + TextColor = Colors.LightText; + FontStyle = FontStyle.Regular; + } + + public DarkListItem(string text) + : this() + { + Text = text; + } + + #endregion + } +} diff --git a/DarkUI/Controls/DarkListView.cs b/DarkUI/Controls/DarkListView.cs new file mode 100644 index 0000000..326149f --- /dev/null +++ b/DarkUI/Controls/DarkListView.cs @@ -0,0 +1,474 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Drawing; +using System.Linq; +using System.Windows.Forms; + +namespace DarkUI +{ + public class DarkListView : DarkScrollView + { + #region Field Region + + private int _itemHeight = 20; + private bool _multiSelect; + + private ObservableCollection _items; + private List _selectedIndices; + private int _anchoredItemStart = -1; + private int _anchoredItemEnd = -1; + + #endregion + + #region Property Region + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public ObservableCollection Items + { + get { return _items; } + set + { + if (_items != null) + _items.CollectionChanged -= Items_CollectionChanged; + + _items = value; + + _items.CollectionChanged += Items_CollectionChanged; + + UpdateListBox(); + } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public List SelectedIndices + { + get { return _selectedIndices; } + } + + [Category("Appearance")] + [Description("Determines the height of the individual list view items.")] + [DefaultValue(20)] + public int ItemHeight + { + get { return _itemHeight; } + set + { + _itemHeight = value; + UpdateListBox(); + } + } + + [Category("Behaviour")] + [Description("Determines whether multiple list view items can be selected at once.")] + [DefaultValue(false)] + public bool MultiSelect + { + get { return _multiSelect; } + set { _multiSelect = value; } + } + + #endregion + + #region Constructor Region + + public DarkListView() + { + Items = new ObservableCollection(); + _selectedIndices = new List(); + } + + #endregion + + #region Event Handler Region + + private void Items_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + { + if (e.NewItems != null) + { + using (var g = CreateGraphics()) + { + // Set the area size of all new items + foreach (DarkListItem item in e.NewItems) + UpdateItemSize(item, g); + } + + // Find the starting index of the new item list and update anything past that + if (e.NewStartingIndex < (Items.Count - 1)) + { + for (var i = e.NewStartingIndex; i <= Items.Count - 1; i++) + { + UpdateItemPosition(Items[i], i); + } + } + } + + if (e.OldItems != null) + { + // Find the starting index of the old item list and update anything past that + if (e.OldStartingIndex < (Items.Count - 1)) + { + for (var i = e.NewStartingIndex; i <= Items.Count - 1; i++) + { + UpdateItemPosition(Items[i], i); + } + } + } + + UpdateContentSize(); + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + if (Items.Count == 0) + return; + + if (e.Button != MouseButtons.Left && e.Button != MouseButtons.Right) + return; + + var pos = OffsetMousePosition; + + var range = ItemIndexesInView().ToList(); + + var top = range.Min(); + var bottom = range.Max(); + var width = Math.Max(ContentSize.Width, Viewport.Width); + + for (var i = top; i <= bottom; i++) + { + var rect = new Rectangle(0, i * ItemHeight, width, ItemHeight); + + if (rect.Contains(pos)) + { + if (MultiSelect && ModifierKeys == Keys.Shift) + SelectAnchoredRange(i); + else if (MultiSelect && ModifierKeys == Keys.Control) + ToggleItem(i); + else + SelectItem(i); + } + } + } + + protected override void OnKeyDown(KeyEventArgs e) + { + base.OnKeyDown(e); + + if (Items.Count == 0) + return; + + if (e.KeyCode != Keys.Down && e.KeyCode != Keys.Up) + return; + + if (MultiSelect && ModifierKeys == Keys.Shift) + { + if (e.KeyCode == Keys.Up) + { + if (_anchoredItemEnd - 1 >= 0) + { + SelectAnchoredRange(_anchoredItemEnd - 1); + EnsureVisible(); + } + } + else if (e.KeyCode == Keys.Down) + { + if (_anchoredItemEnd + 1 <= Items.Count - 1) + { + SelectAnchoredRange(_anchoredItemEnd + 1); + } + } + } + else + { + if (e.KeyCode == Keys.Up) + { + if (_anchoredItemEnd - 1 >= 0) + SelectItem(_anchoredItemEnd - 1); + } + else if (e.KeyCode == Keys.Down) + { + if (_anchoredItemEnd + 1 <= Items.Count - 1) + SelectItem(_anchoredItemEnd + 1); + } + } + + EnsureVisible(); + } + + #endregion + + #region Method Region + + public void SelectItem(int index) + { + if (index < 0 || index > Items.Count - 1) + throw new IndexOutOfRangeException(string.Format("Value '{0}' is outside of valid range.", index)); + + _selectedIndices.Clear(); + _selectedIndices.Add(index); + + _anchoredItemStart = index; + _anchoredItemEnd = index; + + Invalidate(); + } + + public void SelectItems(IEnumerable indexes) + { + _selectedIndices.Clear(); + + var list = indexes.ToList(); + + foreach (var index in list) + { + if (index < 0 || index > Items.Count - 1) + throw new IndexOutOfRangeException(string.Format("Value '{0}' is outside of valid range.", index)); + + _selectedIndices.Add(index); + } + + _anchoredItemStart = list[list.Count - 1]; + _anchoredItemEnd = list[list.Count - 1]; + + Invalidate(); + } + + public void ToggleItem(int index) + { + if (_selectedIndices.Contains(index)) + { + _selectedIndices.Remove(index); + + // If we just removed both the anchor start AND end then reset them + if (_anchoredItemStart == index && _anchoredItemEnd == index) + { + if (_selectedIndices.Count > 0) + { + _anchoredItemStart = _selectedIndices[0]; + _anchoredItemEnd = _selectedIndices[0]; + } + else + { + _anchoredItemStart = -1; + _anchoredItemEnd = -1; + } + } + + // If we just removed the anchor start then update it accordingly + if (_anchoredItemStart == index) + { + if (_anchoredItemEnd < index) + _anchoredItemStart = index - 1; + else if (_anchoredItemEnd > index) + _anchoredItemStart = index + 1; + else + _anchoredItemStart = _anchoredItemEnd; + } + + // If we just removed the anchor end then update it accordingly + if (_anchoredItemEnd == index) + { + if (_anchoredItemStart < index) + _anchoredItemEnd = index - 1; + else if (_anchoredItemStart > index) + _anchoredItemEnd = index + 1; + else + _anchoredItemEnd = _anchoredItemStart; + } + } + else + { + _selectedIndices.Add(index); + _anchoredItemStart = index; + _anchoredItemEnd = index; + } + + Invalidate(); + } + + public void SelectItems(int startRange, int endRange) + { + _selectedIndices.Clear(); + + if (startRange == endRange) + _selectedIndices.Add(startRange); + + if (startRange < endRange) + { + for (var i = startRange; i <= endRange; i++) + _selectedIndices.Add(i); + } + else if (startRange > endRange) + { + for (var i = startRange; i >= endRange; i--) + _selectedIndices.Add(i); + } + + Invalidate(); + } + + private void SelectAnchoredRange(int index) + { + _anchoredItemEnd = index; + SelectItems(_anchoredItemStart, index); + } + + private void UpdateListBox() + { + using (var g = CreateGraphics()) + { + for (var i = 0; i <= Items.Count - 1; i++) + { + var item = Items[i]; + UpdateItemSize(item, g); + UpdateItemPosition(item, i); + } + } + + UpdateContentSize(); + } + + private void UpdateItemSize(DarkListItem item) + { + using (var g = CreateGraphics()) + { + UpdateItemSize(item, g); + } + } + + private void UpdateItemSize(DarkListItem item, Graphics g) + { + var size = g.MeasureString(item.Text, Font); + size.Width++; + + item.Area = new Rectangle(item.Area.Left, item.Area.Top, (int)size.Width, item.Area.Height); + } + + private void UpdateItemPosition(DarkListItem item, int index) + { + item.Area = new Rectangle(2, (index * ItemHeight), item.Area.Width, ItemHeight); + } + + private void UpdateContentSize() + { + var highestWidth = 0; + + foreach (var item in Items) + { + if (item.Area.Right + 1 > highestWidth) + highestWidth = item.Area.Right + 1; + } + + ContentSize = new Size(highestWidth, Items.Count * ItemHeight); + + Invalidate(); + } + + public void EnsureVisible() + { + if (SelectedIndices.Count == 0) + return; + + var itemTop = -1; + + if (!MultiSelect) + itemTop = SelectedIndices[0] * ItemHeight; + else + itemTop = _anchoredItemEnd * ItemHeight; + + var itemBottom = itemTop + ItemHeight; + + if (itemTop < Viewport.Top) + VScrollTo(itemTop); + + if (itemBottom > Viewport.Bottom) + VScrollTo((itemBottom - Viewport.Height)); + } + + private IEnumerable ItemIndexesInView() + { + var top = (Viewport.Top / ItemHeight) - 1; + + if (top < 0) + top = 0; + + var bottom = ((Viewport.Top + Viewport.Height) / ItemHeight) + 1; + + if (bottom > Items.Count) + bottom = Items.Count; + + var result = Enumerable.Range(top, bottom - top); + return result; + } + + private IEnumerable ItemsInView() + { + var indexes = ItemIndexesInView(); + var result = indexes.Select(index => Items[index]).ToList(); + return result; + } + + #endregion + + #region Paint Region + + protected override void PaintContent(Graphics g) + { + var range = ItemIndexesInView().ToList(); + + if (range.Count == 0) + return; + + var top = range.Min(); + var bottom = range.Max(); + + // Draw items + for (var i = top; i <= bottom; i++) + { + var width = Math.Max(ContentSize.Width, Viewport.Width); + var rect = new Rectangle(0, i * ItemHeight, width, ItemHeight); + + // Background + var odd = i % 2 != 0; + var bgColor = !odd ? Colors.HeaderBackground : Colors.GreyBackground; + + if (SelectedIndices.Count > 0 && SelectedIndices.Contains(i)) + bgColor = Focused ? Colors.BlueSelection : Colors.GreySelection; + + using (var b = new SolidBrush(bgColor)) + { + g.FillRectangle(b, rect); + } + + // Border + /*using (var p = new Pen(Colors.DarkBorder)) + { + g.DrawLine(p, new Point(rect.Left, rect.Bottom - 1), new Point(rect.Right, rect.Bottom - 1)); + }*/ + + // Text + using (var b = new SolidBrush(Items[i].TextColor)) + { + var stringFormat = new StringFormat + { + Alignment = StringAlignment.Near, + LineAlignment = StringAlignment.Center + }; + + var modFont = new Font(Font, Items[i].FontStyle); + + var modRect = new Rectangle(rect.Left + 2, rect.Top, rect.Width, rect.Height); + g.DrawString(Items[i].Text, modFont, b, modRect, stringFormat); + } + } + } + + #endregion + } +} diff --git a/DarkUI/Controls/DarkScrollBase.cs b/DarkUI/Controls/DarkScrollBase.cs index 9456b20..df0d409 100644 --- a/DarkUI/Controls/DarkScrollBase.cs +++ b/DarkUI/Controls/DarkScrollBase.cs @@ -1,4 +1,5 @@ using System; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; @@ -29,6 +30,8 @@ namespace DarkUI #region Property Region + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Rectangle Viewport { get { return _viewport; } @@ -41,6 +44,8 @@ namespace DarkUI } } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Size ContentSize { get { return _contentSize; } @@ -54,6 +59,8 @@ namespace DarkUI } } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Point OffsetMousePosition { get { return _offsetMousePosition; } diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index 4b113af..246636e 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -41,6 +41,10 @@ + + + Component + Component @@ -59,6 +63,9 @@ Component + + Component + Component diff --git a/Example/Forms/MainForm.Designer.cs b/Example/Forms/MainForm.Designer.cs index f19fd8c..91bddd9 100644 --- a/Example/Forms/MainForm.Designer.cs +++ b/Example/Forms/MainForm.Designer.cs @@ -84,11 +84,14 @@ this.testToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.moreTestToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.test3ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.darkSectionPanel2 = new DarkUI.DarkSectionPanel(); + this.darkListView1 = new DarkUI.DarkListView(); this.mnuMain.SuspendLayout(); this.toolMain.SuspendLayout(); this.darkStatusStrip1.SuspendLayout(); this.darkSectionPanel1.SuspendLayout(); this.darkContextMenu1.SuspendLayout(); + this.darkSectionPanel2.SuspendLayout(); this.SuspendLayout(); // // mnuMain @@ -590,7 +593,7 @@ // this.testToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); this.testToolStripMenuItem.Name = "testToolStripMenuItem"; - this.testToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.testToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.testToolStripMenuItem.Text = "Test"; // // moreTestToolStripMenuItem @@ -607,11 +610,31 @@ this.test3ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.test3ToolStripMenuItem.Text = "Test 3"; // + // darkSectionPanel2 + // + this.darkSectionPanel2.Controls.Add(this.darkListView1); + this.darkSectionPanel2.Location = new System.Drawing.Point(204, 157); + this.darkSectionPanel2.Name = "darkSectionPanel2"; + this.darkSectionPanel2.SectionHeader = "List view test"; + this.darkSectionPanel2.Size = new System.Drawing.Size(221, 224); + this.darkSectionPanel2.TabIndex = 7; + // + // darkListView1 + // + this.darkListView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.darkListView1.Location = new System.Drawing.Point(1, 25); + this.darkListView1.MultiSelect = true; + this.darkListView1.Name = "darkListView1"; + this.darkListView1.Size = new System.Drawing.Size(219, 198); + this.darkListView1.TabIndex = 7; + this.darkListView1.Text = "darkListView1"; + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(784, 562); + this.Controls.Add(this.darkSectionPanel2); this.Controls.Add(this.darkSectionPanel1); this.Controls.Add(this.btnDialog); this.Controls.Add(this.darkStatusStrip1); @@ -631,6 +654,7 @@ this.darkStatusStrip1.PerformLayout(); this.darkSectionPanel1.ResumeLayout(false); this.darkContextMenu1.ResumeLayout(false); + this.darkSectionPanel2.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -693,6 +717,8 @@ private System.Windows.Forms.ToolStripMenuItem testToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem moreTestToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem test3ToolStripMenuItem; + private DarkUI.DarkSectionPanel darkSectionPanel2; + private DarkUI.DarkListView darkListView1; } } diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index 99360f1..9cb6a70 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -8,6 +8,12 @@ namespace Example { InitializeComponent(); + for (var i = 0; i < 100; i++) + { + var item = new DarkListItem(string.Format("List item {0}", i)); + darkListView1.Items.Add(item); + } + btnDialog.Click += delegate { DarkMessageBox.ShowError("This is an error", "Dark UI - Example"); From 217058af7246783283faf692836e8e7cbad92432 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 12:38:18 +0100 Subject: [PATCH 18/97] Created ObservableList Class used for notifying when an item is added/removed from a list without raising events for things like index changes. --- DarkUI/Collections/ObservableList.cs | 93 +++++++++++++++++++ DarkUI/Collections/ObservableListModified.cs | 15 +++ .../{Classes => Items}/DarkListItem.cs | 0 DarkUI/DarkUI.csproj | 2 + 4 files changed, 110 insertions(+) create mode 100644 DarkUI/Collections/ObservableList.cs create mode 100644 DarkUI/Collections/ObservableListModified.cs rename DarkUI/Controls/{Classes => Items}/DarkListItem.cs (100%) diff --git a/DarkUI/Collections/ObservableList.cs b/DarkUI/Collections/ObservableList.cs new file mode 100644 index 0000000..6d6f307 --- /dev/null +++ b/DarkUI/Collections/ObservableList.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace DarkUI +{ + public class ObservableList : List, IDisposable + { + #region Field Region + + private bool _disposed; + + #endregion + + #region Event Region + + public event EventHandler> ItemsAdded; + public event EventHandler> ItemsRemoved; + + #endregion + + #region Destructor Region + + ~ObservableList() + { + Dispose(false); + } + + #endregion + + #region Dispose Region + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // Release managed resources + } + + // Release unmanaged resources. + // Set large fields to null. + if (ItemsAdded != null) + ItemsAdded = null; + + if (ItemsRemoved != null) + ItemsRemoved = null; + + // Set disposed flag + _disposed = true; + } + } + + #endregion + + #region Method Region + + public new void Add(T item) + { + base.Add(item); + + if (ItemsAdded != null) + ItemsAdded(this, new ObservableListModified(new List { item })); + } + + public new void AddRange(IEnumerable collection) + { + var list = collection.ToList(); + + base.AddRange(list); + + if (ItemsAdded != null) + ItemsAdded(this, new ObservableListModified(list)); + } + + public new void Remove(T item) + { + base.Remove(item); + + if (ItemsRemoved != null) + ItemsRemoved(this, new ObservableListModified(new List { item })); + } + + #endregion + } +} diff --git a/DarkUI/Collections/ObservableListModified.cs b/DarkUI/Collections/ObservableListModified.cs new file mode 100644 index 0000000..f5d4d70 --- /dev/null +++ b/DarkUI/Collections/ObservableListModified.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +namespace DarkUI +{ + public class ObservableListModified : EventArgs + { + public IEnumerable Items { get; private set; } + + public ObservableListModified(IEnumerable items) + { + Items = items; + } + } +} diff --git a/DarkUI/Controls/Classes/DarkListItem.cs b/DarkUI/Controls/Items/DarkListItem.cs similarity index 100% rename from DarkUI/Controls/Classes/DarkListItem.cs rename to DarkUI/Controls/Items/DarkListItem.cs diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index 246636e..f4bee5f 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -38,6 +38,8 @@ + + From bd776d50131e76e97f15c1058ce736c38d23b009 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 13:01:09 +0100 Subject: [PATCH 19/97] Created DarkTreeView --- DarkUI/Controls/DarkTreeView.cs | 1274 +++++++++++++++++++++ DarkUI/Controls/Items/DarkTreeNode.cs | 254 ++++ DarkUI/DarkUI.csproj | 28 +- DarkUI/Icons/TreeViewIcons.Designer.cs | 103 ++ DarkUI/Icons/TreeViewIcons.resx | 133 +++ DarkUI/Resources/node_closed_empty.png | Bin 0 -> 2849 bytes DarkUI/Resources/node_closed_full.png | Bin 0 -> 2847 bytes DarkUI/Resources/node_open.png | Bin 0 -> 2836 bytes DarkUI/Resources/node_open_empty.png | Bin 0 -> 17741 bytes Example/Example.csproj | 18 + Example/Forms/MainForm.Designer.cs | 55 +- Example/Forms/MainForm.cs | 23 +- Example/Icons.Designer.cs | 93 ++ Example/Icons.resx | 130 +++ Example/Resources/Files_7954.png | Bin 0 -> 195 bytes Example/Resources/folder_16x.png | Bin 0 -> 286 bytes Example/Resources/folder_Closed_16xLG.png | Bin 0 -> 196 bytes 17 files changed, 2095 insertions(+), 16 deletions(-) create mode 100644 DarkUI/Controls/DarkTreeView.cs create mode 100644 DarkUI/Controls/Items/DarkTreeNode.cs create mode 100644 DarkUI/Icons/TreeViewIcons.Designer.cs create mode 100644 DarkUI/Icons/TreeViewIcons.resx create mode 100644 DarkUI/Resources/node_closed_empty.png create mode 100644 DarkUI/Resources/node_closed_full.png create mode 100644 DarkUI/Resources/node_open.png create mode 100644 DarkUI/Resources/node_open_empty.png create mode 100644 Example/Icons.Designer.cs create mode 100644 Example/Icons.resx create mode 100644 Example/Resources/Files_7954.png create mode 100644 Example/Resources/folder_16x.png create mode 100644 Example/Resources/folder_Closed_16xLG.png diff --git a/DarkUI/Controls/DarkTreeView.cs b/DarkUI/Controls/DarkTreeView.cs new file mode 100644 index 0000000..3c8aef5 --- /dev/null +++ b/DarkUI/Controls/DarkTreeView.cs @@ -0,0 +1,1274 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Drawing; +using System.Linq; +using System.Windows.Forms; + +namespace DarkUI +{ + public class DarkTreeView : DarkScrollView + { + #region Event Region + + public event EventHandler SelectedNodesChanged; + public event EventHandler AfterNodeExpand; + public event EventHandler AfterNodeCollapse; + + #endregion + + #region Field Region + + private bool _disposed; + + private readonly int _expandAreaSize = 16; + private readonly int _iconSize = 16; + + private int _itemHeight = 20; + private int _indent = 20; + + private ObservableList _nodes; + private ObservableCollection _selectedNodes; + + private DarkTreeNode _anchoredNodeStart; + private DarkTreeNode _anchoredNodeEnd; + + private Bitmap _nodeClosed; + private Bitmap _nodeClosedHover; + private Bitmap _nodeClosedHoverSelected; + private Bitmap _nodeOpen; + private Bitmap _nodeOpenHover; + private Bitmap _nodeOpenHoverSelected; + + private bool _isDragging; + private DarkTreeNode _provisionalNode; + private DarkTreeNode _dropNode; + private bool _provisionalDragging; + private List _dragNodes; + private Timer _dragTimer; + private Point _dragPos; + + #endregion + + #region Property Region + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public ObservableList Nodes + { + get { return _nodes; } + set + { + if (_nodes != null) + { + _nodes.ItemsAdded -= Nodes_ItemsAdded; + _nodes.ItemsRemoved -= Nodes_ItemsRemoved; + + foreach (var node in _nodes) + UnhookNodeEvents(node); + } + + _nodes = value; + + _nodes.ItemsAdded += Nodes_ItemsAdded; + _nodes.ItemsRemoved += Nodes_ItemsRemoved; + + foreach (var node in _nodes) + HookNodeEvents(node); + + UpdateNodes(); + } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public ObservableCollection SelectedNodes + { + get { return _selectedNodes; } + } + + [Category("Appearance")] + [Description("Determines the height of tree nodes.")] + [DefaultValue(20)] + public int ItemHeight + { + get { return _itemHeight; } + set + { + _itemHeight = value; + UpdateNodes(); + } + } + + [Category("Appearance")] + [Description("Determines the amount of horizontal space given by parent node.")] + [DefaultValue(20)] + public int Indent + { + get { return _indent; } + set + { + _indent = value; + UpdateNodes(); + } + } + + [Category("Behavior")] + [Description("Determines whether multiple tree nodes can be selected at once.")] + [DefaultValue(false)] + public bool MultiSelect { get; set; } + + [Category("Behavior")] + [Description("Determines whether nodes can be moved within this tree view.")] + [DefaultValue(false)] + public bool AllowMoveNodes { get; set; } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public int VisibleNodeCount { get; private set; } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public IComparer TreeViewNodeSorter { get; set; } + + #endregion + + #region Constructor Region + + public DarkTreeView() + { + Nodes = new ObservableList(); + _selectedNodes = new ObservableCollection(); + _selectedNodes.CollectionChanged += SelectedNodes_CollectionChanged; + + _dragTimer = new Timer(); + _dragTimer.Interval = 1; + _dragTimer.Tick += DragTimer_Tick; + + LoadIcons(); + } + + #endregion + + #region Dispose Region + + protected override void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // Release managed resources + } + + // Release unmanaged resources. + // Set large fields to null. + DisposeIcons(); + + if (SelectedNodesChanged != null) + SelectedNodesChanged = null; + + if (AfterNodeExpand != null) + AfterNodeExpand = null; + + if (AfterNodeCollapse != null) + AfterNodeExpand = null; + + if (_nodes != null) + _nodes.Dispose(); + + if (_selectedNodes != null) + _selectedNodes.CollectionChanged -= SelectedNodes_CollectionChanged; + + // Set disposed flag + _disposed = true; + } + + // Call Dispose on your base class. + base.Dispose(disposing); + } + + #endregion + + #region Event Handler Region + + private void Nodes_ItemsAdded(object sender, ObservableListModified e) + { + foreach (var node in e.Items) + { + node.ParentTree = this; + node.IsRoot = true; + + HookNodeEvents(node); + } + + if (TreeViewNodeSorter != null) + Nodes.Sort(TreeViewNodeSorter); + + UpdateNodes(); + } + + private void Nodes_ItemsRemoved(object sender, ObservableListModified e) + { + foreach (var node in e.Items) + { + node.ParentTree = this; + node.IsRoot = true; + + HookNodeEvents(node); + } + + UpdateNodes(); + } + + private void ChildNodes_ItemsAdded(object sender, ObservableListModified e) + { + foreach (var node in e.Items) + HookNodeEvents(node); + + UpdateNodes(); + } + + private void ChildNodes_ItemsRemoved(object sender, ObservableListModified e) + { + foreach (var node in e.Items) + { + if (SelectedNodes.Contains(node)) + SelectedNodes.Remove(node); + + UnhookNodeEvents(node); + } + + UpdateNodes(); + } + + private void SelectedNodes_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + { + if (SelectedNodesChanged != null) + SelectedNodesChanged(this, null); + } + + private void Nodes_TextChanged(object sender, EventArgs e) + { + UpdateNodes(); + } + + private void Nodes_NodeExpanded(object sender, EventArgs e) + { + UpdateNodes(); + + if (AfterNodeExpand != null) + AfterNodeExpand(this, null); + } + + private void Nodes_NodeCollapsed(object sender, EventArgs e) + { + UpdateNodes(); + + if (AfterNodeCollapse != null) + AfterNodeCollapse(this, null); + } + + protected override void OnMouseMove(MouseEventArgs e) + { + if (_provisionalDragging) + { + if (OffsetMousePosition != _dragPos) + { + StartDrag(); + HandleDrag(); + return; + } + } + + if (_isDragging) + { + if (_dropNode != null) + { + var rect = GetNodeFullRowArea(_dropNode); + if (!rect.Contains(OffsetMousePosition)) + { + _dropNode = null; + Invalidate(); + } + } + } + + CheckHover(); + + if (_isDragging) + { + HandleDrag(); + } + + base.OnMouseMove(e); + } + + protected override void OnMouseWheel(MouseEventArgs e) + { + CheckHover(); + + base.OnMouseWheel(e); + } + + protected override void OnMouseDown(MouseEventArgs e) + { + if (e.Button == MouseButtons.Left || e.Button == MouseButtons.Right) + { + foreach (var node in Nodes) + CheckNodeClick(node, OffsetMousePosition, e.Button); + } + + base.OnMouseDown(e); + } + + protected override void OnMouseUp(MouseEventArgs e) + { + if (_isDragging) + { + HandleDrop(); + } + + if (_provisionalDragging) + { + + if (_provisionalNode != null) + { + var pos = _dragPos; + if (OffsetMousePosition == pos) + SelectNode(_provisionalNode); + } + + _provisionalDragging = false; + } + + base.OnMouseUp(e); + } + + protected override void OnMouseDoubleClick(MouseEventArgs e) + { + if (ModifierKeys == Keys.Control) + return; + + if (e.Button == MouseButtons.Left) + { + foreach (var node in Nodes) + CheckNodeDoubleClick(node, OffsetMousePosition); + } + + base.OnMouseDoubleClick(e); + } + + protected override void OnMouseLeave(EventArgs e) + { + base.OnMouseLeave(e); + + foreach (var node in Nodes) + NodeMouseLeave(node); + } + + protected override void OnKeyDown(KeyEventArgs e) + { + base.OnKeyDown(e); + + if (_isDragging) + return; + + if (Nodes.Count == 0) + return; + + if (e.KeyCode != Keys.Down && e.KeyCode != Keys.Up && e.KeyCode != Keys.Left && e.KeyCode != Keys.Right) + return; + + if (_anchoredNodeEnd == null) + { + if (Nodes.Count > 0) + SelectNode(Nodes[0]); + return; + } + + if (e.KeyCode == Keys.Down || e.KeyCode == Keys.Up) + { + if (MultiSelect && ModifierKeys == Keys.Shift) + { + if (e.KeyCode == Keys.Up) + { + if (_anchoredNodeEnd.PrevVisibleNode != null) + { + SelectAnchoredRange(_anchoredNodeEnd.PrevVisibleNode); + EnsureVisible(); + } + } + else if (e.KeyCode == Keys.Down) + { + if (_anchoredNodeEnd.NextVisibleNode != null) + { + SelectAnchoredRange(_anchoredNodeEnd.NextVisibleNode); + EnsureVisible(); + } + } + } + else + { + if (e.KeyCode == Keys.Up) + { + if (_anchoredNodeEnd.PrevVisibleNode != null) + { + SelectNode(_anchoredNodeEnd.PrevVisibleNode); + EnsureVisible(); + } + } + else if (e.KeyCode == Keys.Down) + { + if (_anchoredNodeEnd.NextVisibleNode != null) + { + SelectNode(_anchoredNodeEnd.NextVisibleNode); + EnsureVisible(); + } + } + } + } + + if (e.KeyCode == Keys.Left || e.KeyCode == Keys.Right) + { + if (e.KeyCode == Keys.Left) + { + if (_anchoredNodeEnd.Expanded && _anchoredNodeEnd.Nodes.Count > 0) + { + _anchoredNodeEnd.Expanded = false; + } + else + { + if (_anchoredNodeEnd.ParentNode != null) + { + SelectNode(_anchoredNodeEnd.ParentNode); + EnsureVisible(); + } + } + } + else if (e.KeyCode == Keys.Right) + { + if (!_anchoredNodeEnd.Expanded) + { + _anchoredNodeEnd.Expanded = true; + } + else + { + if (_anchoredNodeEnd.Nodes.Count > 0) + { + SelectNode(_anchoredNodeEnd.Nodes[0]); + EnsureVisible(); + } + } + } + } + } + + private void DragTimer_Tick(object sender, EventArgs e) + { + if (!_isDragging) + { + StopDrag(); + return; + } + + if (MouseButtons != MouseButtons.Left) + { + StopDrag(); + return; + } + + var pos = PointToClient(MousePosition); + + if (_vScrollBar.Visible) + { + // Scroll up + if (pos.Y < ClientRectangle.Top) + { + var difference = (pos.Y - ClientRectangle.Top) * -1; + + if (difference > ItemHeight) + difference = ItemHeight; + + _vScrollBar.Value = _vScrollBar.Value - difference; + } + + // Scroll down + if (pos.Y > ClientRectangle.Bottom) + { + var difference = pos.Y - ClientRectangle.Bottom; + + if (difference > ItemHeight) + difference = ItemHeight; + + _vScrollBar.Value = _vScrollBar.Value + difference; + } + } + + if (_hScrollBar.Visible) + { + // Scroll left + if (pos.X < ClientRectangle.Left) + { + var difference = (pos.X - ClientRectangle.Left) * -1; + + if (difference > ItemHeight) + difference = ItemHeight; + + _hScrollBar.Value = _hScrollBar.Value - difference; + } + + // Scroll right + if (pos.X > ClientRectangle.Right) + { + var difference = pos.X - ClientRectangle.Right; + + if (difference > ItemHeight) + difference = ItemHeight; + + _hScrollBar.Value = _hScrollBar.Value + difference; + } + } + } + + #endregion + + #region Method Region + + private void HookNodeEvents(DarkTreeNode node) + { + node.Nodes.ItemsAdded += ChildNodes_ItemsAdded; + node.Nodes.ItemsRemoved += ChildNodes_ItemsRemoved; + + node.TextChanged += Nodes_TextChanged; + node.NodeExpanded += Nodes_NodeExpanded; + node.NodeCollapsed += Nodes_NodeCollapsed; + + foreach (var childNode in node.Nodes) + HookNodeEvents(childNode); + } + + private void UnhookNodeEvents(DarkTreeNode node) + { + node.Nodes.ItemsAdded -= ChildNodes_ItemsAdded; + node.Nodes.ItemsRemoved -= ChildNodes_ItemsRemoved; + + node.TextChanged -= Nodes_TextChanged; + node.NodeExpanded -= Nodes_NodeExpanded; + node.NodeCollapsed -= Nodes_NodeCollapsed; + + foreach (var childNode in node.Nodes) + UnhookNodeEvents(childNode); + } + + private void UpdateNodes() + { + if (_isDragging) + return; + + if (Nodes.Count == 0) + return; + + var yOffset = 0; + var isOdd = false; + var index = 0; + DarkTreeNode prevNode = null; + + ContentSize = new Size(0, 0); + + for (var i = 0; i <= Nodes.Count - 1; i++) + { + var node = Nodes[i]; + UpdateNode(node, ref prevNode, 0, ref yOffset, ref isOdd, ref index); + } + + ContentSize = new Size(ContentSize.Width, yOffset); + + VisibleNodeCount = index; + + Invalidate(); + } + + private void UpdateNode(DarkTreeNode node, ref DarkTreeNode prevNode, int indent, ref int yOffset, + ref bool isOdd, ref int index) + { + UpdateNodeBounds(node, yOffset, indent); + + yOffset += ItemHeight; + + node.Odd = isOdd; + isOdd = !isOdd; + + node.VisibleIndex = index; + index++; + + node.PrevVisibleNode = prevNode; + + if (prevNode != null) + prevNode.NextVisibleNode = node; + + prevNode = node; + + if (node.Expanded) + { + foreach (var childNode in node.Nodes) + UpdateNode(childNode, ref prevNode, indent + Indent, ref yOffset, ref isOdd, ref index); + } + } + + private void UpdateNodeBounds(DarkTreeNode node, int yOffset, int indent) + { + var expandTop = yOffset + (ItemHeight / 2) - (_expandAreaSize / 2); + node.ExpandArea = new Rectangle(indent + 3, expandTop, _expandAreaSize, _expandAreaSize); + + var iconTop = yOffset + (ItemHeight / 2) - (_iconSize / 2); + node.IconArea = new Rectangle(node.ExpandArea.Right + 2, iconTop, _iconSize, _iconSize); + + using (var g = CreateGraphics()) + { + var textSize = (int)(g.MeasureString(node.Text, Font).Width); + node.TextArea = new Rectangle(node.IconArea.Right + 2, yOffset, textSize + 1, ItemHeight); + } + + node.FullArea = new Rectangle(indent, yOffset, (node.TextArea.Right - indent), ItemHeight); + + if (ContentSize.Width < node.TextArea.Right + 2) + ContentSize = new Size(node.TextArea.Right + 2, ContentSize.Height); + } + + private void LoadIcons() + { + DisposeIcons(); + + _nodeClosed = TreeViewIcons.node_closed_empty.SetColor(Colors.LightText); + _nodeClosedHover = TreeViewIcons.node_closed_empty.SetColor(Colors.BlueHighlight); + _nodeClosedHoverSelected = TreeViewIcons.node_closed_full.SetColor(Colors.LightText); + _nodeOpen = TreeViewIcons.node_open.SetColor(Colors.LightText); + _nodeOpenHover = TreeViewIcons.node_open.SetColor(Colors.BlueHighlight); + _nodeOpenHoverSelected = TreeViewIcons.node_open_empty.SetColor(Colors.LightText); + } + + private void DisposeIcons() + { + if (_nodeClosed != null) + _nodeClosed.Dispose(); + + if (_nodeClosedHover != null) + _nodeClosedHover.Dispose(); + + if (_nodeClosedHoverSelected != null) + _nodeClosedHoverSelected.Dispose(); + + if (_nodeOpen != null) + _nodeOpen.Dispose(); + + if (_nodeOpenHover != null) + _nodeOpenHover.Dispose(); + + if (_nodeOpenHoverSelected != null) + _nodeOpenHoverSelected.Dispose(); + } + + private void CheckHover() + { + if (!ClientRectangle.Contains(PointToClient(MousePosition))) + { + if (_isDragging) + { + if (_dropNode != null) + { + _dropNode = null; + Invalidate(); + } + } + + return; + } + + foreach (var node in Nodes) + CheckNodeHover(node, OffsetMousePosition); + } + + private void NodeMouseLeave(DarkTreeNode node) + { + node.ExpandAreaHot = false; + + foreach (var childNode in node.Nodes) + NodeMouseLeave(childNode); + + Invalidate(); + } + + private void CheckNodeHover(DarkTreeNode node, Point location) + { + if (_isDragging) + { + var rect = GetNodeFullRowArea(node); + if (rect.Contains(OffsetMousePosition)) + { + var newDropNode = _dragNodes.Contains(node) ? null : node; + + if (_dropNode != newDropNode) + { + _dropNode = newDropNode; + Invalidate(); + } + } + } + else + { + var hot = node.ExpandArea.Contains(location); + if (node.ExpandAreaHot != hot) + { + node.ExpandAreaHot = hot; + Invalidate(); + } + } + + foreach (var childNode in node.Nodes) + CheckNodeHover(childNode, location); + } + + private void CheckNodeClick(DarkTreeNode node, Point location, MouseButtons button) + { + var rect = GetNodeFullRowArea(node); + if (rect.Contains(location)) + { + if (node.ExpandArea.Contains(location)) + { + if (button == MouseButtons.Left) + node.Expanded = !node.Expanded; + } + else + { + if (button == MouseButtons.Left) + { + if (MultiSelect && ModifierKeys == Keys.Shift) + { + SelectAnchoredRange(node); + } + else if (MultiSelect && ModifierKeys == Keys.Control) + { + ToggleNode(node); + } + else + { + if (!SelectedNodes.Contains(node)) + SelectNode(node); + + _dragPos = OffsetMousePosition; + _provisionalDragging = true; + _provisionalNode = node; + } + + return; + } + else if (button == MouseButtons.Right) + { + if (MultiSelect && ModifierKeys == Keys.Shift) + return; + + if (MultiSelect && ModifierKeys == Keys.Control) + return; + + if (!SelectedNodes.Contains(node)) + SelectNode(node); + + return; + } + } + } + + if (node.Expanded) + { + foreach (var childNode in node.Nodes) + CheckNodeClick(childNode, location, button); + } + } + + private void CheckNodeDoubleClick(DarkTreeNode node, Point location) + { + var rect = GetNodeFullRowArea(node); + if (rect.Contains(location)) + { + if (!node.ExpandArea.Contains(location)) + node.Expanded = !node.Expanded; + + return; + } + + if (node.Expanded) + { + foreach (var childNode in node.Nodes) + CheckNodeDoubleClick(childNode, location); + } + } + + public void SelectNode(DarkTreeNode node) + { + _selectedNodes.Clear(); + _selectedNodes.Add(node); + + _anchoredNodeStart = node; + _anchoredNodeEnd = node; + + Invalidate(); + } + + public void SelectNodes(DarkTreeNode startNode, DarkTreeNode endNode) + { + var nodes = new List(); + + if (startNode == endNode) + nodes.Add(startNode); + + if (startNode.VisibleIndex < endNode.VisibleIndex) + { + var node = startNode; + nodes.Add(node); + while (node != endNode && node != null) + { + node = node.NextVisibleNode; + nodes.Add(node); + } + } + else if (startNode.VisibleIndex > endNode.VisibleIndex) + { + var node = startNode; + nodes.Add(node); + while (node != endNode && node != null) + { + node = node.PrevVisibleNode; + nodes.Add(node); + } + } + + SelectNodes(nodes, false); + } + + public void SelectNodes(List nodes, bool updateAnchors = true) + { + _selectedNodes.Clear(); + + foreach (var node in nodes) + _selectedNodes.Add(node); + + if (updateAnchors && _selectedNodes.Count > 0) + { + _anchoredNodeStart = _selectedNodes[_selectedNodes.Count - 1]; + _anchoredNodeEnd = _selectedNodes[_selectedNodes.Count - 1]; + } + + Invalidate(); + } + + private void SelectAnchoredRange(DarkTreeNode node) + { + _anchoredNodeEnd = node; + SelectNodes(_anchoredNodeStart, _anchoredNodeEnd); + } + + public void ToggleNode(DarkTreeNode node) + { + if (_selectedNodes.Contains(node)) + { + _selectedNodes.Remove(node); + + // If we just removed both the anchor start AND end then reset them + if (_anchoredNodeStart == node && _anchoredNodeEnd == node) + { + if (_selectedNodes.Count > 0) + { + _anchoredNodeStart = _selectedNodes[0]; + _anchoredNodeEnd = _selectedNodes[0]; + } + else + { + _anchoredNodeStart = null; + _anchoredNodeEnd = null; + } + } + + // If we just removed the anchor start then update it accordingly + if (_anchoredNodeStart == node) + { + if (_anchoredNodeEnd.VisibleIndex < node.VisibleIndex) + _anchoredNodeStart = node.PrevVisibleNode; + else if (_anchoredNodeEnd.VisibleIndex > node.VisibleIndex) + _anchoredNodeStart = node.NextVisibleNode; + else + _anchoredNodeStart = _anchoredNodeEnd; + } + + // If we just removed the anchor end then update it accordingly + if (_anchoredNodeEnd == node) + { + if (_anchoredNodeStart.VisibleIndex < node.VisibleIndex) + _anchoredNodeEnd = node.PrevVisibleNode; + else if (_anchoredNodeStart.VisibleIndex > node.VisibleIndex) + _anchoredNodeEnd = node.NextVisibleNode; + else + _anchoredNodeEnd = _anchoredNodeStart; + } + } + else + { + _selectedNodes.Add(node); + + _anchoredNodeStart = node; + _anchoredNodeEnd = node; + } + + Invalidate(); + } + + public Rectangle GetNodeFullRowArea(DarkTreeNode node) + { + if (node.ParentNode != null && !node.ParentNode.Expanded) + return new Rectangle(-1, -1, -1, -1); + + var width = Math.Max(ContentSize.Width, Viewport.Width); + var rect = new Rectangle(0, node.FullArea.Top, width, ItemHeight); + return rect; + } + + public void EnsureVisible() + { + if (SelectedNodes.Count == 0) + return; + + foreach (var node in SelectedNodes) + node.EnsureVisible(); + + var itemTop = -1; + + if (!MultiSelect) + itemTop = SelectedNodes[0].FullArea.Top; + else + itemTop = _anchoredNodeEnd.FullArea.Top; + + var itemBottom = itemTop + ItemHeight; + + if (itemTop < Viewport.Top) + VScrollTo(itemTop); + + if (itemBottom > Viewport.Bottom) + VScrollTo((itemBottom - Viewport.Height)); + } + + public void Sort() + { + if (TreeViewNodeSorter == null) + return; + + Nodes.Sort(TreeViewNodeSorter); + + foreach (var node in Nodes) + SortChildNodes(node); + } + + private void SortChildNodes(DarkTreeNode node) + { + node.Nodes.Sort(TreeViewNodeSorter); + + foreach (var childNode in node.Nodes) + SortChildNodes(childNode); + } + + public DarkTreeNode FindNode(string path) + { + foreach (var node in Nodes) + { + var compNode = FindNode(node, path); + if (compNode != null) + return compNode; + } + + return null; + } + + private DarkTreeNode FindNode(DarkTreeNode parentNode, string path, bool recursive = true) + { + if (parentNode.FullPath == path) + return parentNode; + + foreach (var node in parentNode.Nodes) + { + if (node.FullPath == path) + return node; + + if (recursive) + { + var compNode = FindNode(node, path); + if (compNode != null) + return compNode; + } + } + + return null; + } + + #endregion + + #region Drag & Drop Region + + private void StartDrag() + { + if (!AllowMoveNodes) + { + _provisionalDragging = false; + return; + } + + // Create initial list of nodes to drag + _dragNodes = new List(); + foreach (var node in SelectedNodes) + _dragNodes.Add(node); + + // Clear out any nodes with a parent that is being dragged + foreach (var node in _dragNodes.ToList()) + { + if (node.ParentNode == null) + continue; + + if (_dragNodes.Contains(node.ParentNode)) + _dragNodes.Remove(node); + } + + _provisionalDragging = false; + _isDragging = true; + + _dragTimer.Start(); + + Cursor = Cursors.SizeAll; + } + + private void HandleDrag() + { + if (!AllowMoveNodes) + return; + + var dropNode = _dropNode; + + if (dropNode == null) + { + if (Cursor != Cursors.No) + Cursor = Cursors.No; + + return; + } + + if (ForceDropToParent(dropNode)) + dropNode = dropNode.ParentNode; + + if (!CanMoveNodes(_dragNodes, dropNode)) + { + if (Cursor != Cursors.No) + Cursor = Cursors.No; + + return; + } + + if (Cursor != Cursors.SizeAll) + Cursor = Cursors.SizeAll; + } + + private void HandleDrop() + { + if (!AllowMoveNodes) + return; + + var dropNode = _dropNode; + + if (dropNode == null) + { + StopDrag(); + return; + } + + if (ForceDropToParent(dropNode)) + dropNode = dropNode.ParentNode; + + if (CanMoveNodes(_dragNodes, dropNode, true)) + { + var cachedSelectedNodes = SelectedNodes.ToList(); + + MoveNodes(_dragNodes, dropNode); + + foreach (var node in _dragNodes) + { + if (node.ParentNode == null) + Nodes.Remove(node); + else + node.ParentNode.Nodes.Remove(node); + + dropNode.Nodes.Add(node); + } + + if (TreeViewNodeSorter != null) + dropNode.Nodes.Sort(TreeViewNodeSorter); + + dropNode.Expanded = true; + + NodesMoved(_dragNodes); + + foreach (var node in cachedSelectedNodes) + _selectedNodes.Add(node); + } + + StopDrag(); + UpdateNodes(); + } + + private void StopDrag() + { + _isDragging = false; + _dragNodes = null; + _dropNode = null; + + _dragTimer.Stop(); + + Cursor = Cursors.Default; + + Invalidate(); + } + + protected virtual bool ForceDropToParent(DarkTreeNode node) + { + return false; + } + + protected virtual bool CanMoveNodes(List dragNodes, DarkTreeNode dropNode, bool isMoving = false) + { + if (dropNode == null) + return false; + + foreach (var node in dragNodes) + { + if (node == dropNode) + { + if (isMoving) + DarkMessageBox.ShowError(String.Format(@"Cannot move {0}. The destination folder is the same as the source folder.", node.Text), Application.ProductName); + + return false; + } + + if (node.ParentNode != null && node.ParentNode == dropNode) + { + if (isMoving) + DarkMessageBox.ShowError(String.Format(@"Cannot move {0}. The destination folder is the same as the source folder.", node.Text), Application.ProductName); + + return false; + } + + var parentNode = dropNode.ParentNode; + while (parentNode != null) + { + if (node == parentNode) + { + if (isMoving) + DarkMessageBox.ShowError(String.Format(@"Cannot move {0}. The destination folder is a subfolder of the source folder.", node.Text), Application.ProductName); + + return false; + } + + parentNode = parentNode.ParentNode; + } + } + + return true; + } + + protected virtual void MoveNodes(List dragNodes, DarkTreeNode dropNode) + { } + + protected virtual void NodesMoved(List nodesMoved) + { } + + #endregion + + #region Paint Region + + protected override void PaintContent(Graphics g) + { + foreach (var node in Nodes) + { + DrawNode(node, g); + } + } + + private void DrawNode(DarkTreeNode node, Graphics g) + { + var rect = GetNodeFullRowArea(node); + + // 1. Draw background + var bgColor = node.Odd ? Colors.HeaderBackground : Colors.GreyBackground; + + if (SelectedNodes.Count > 0 && SelectedNodes.Contains(node)) + bgColor = Focused ? Colors.BlueSelection : Colors.GreySelection; + + if (_isDragging && _dropNode == node) + bgColor = Focused ? Colors.BlueSelection : Colors.GreySelection; + + using (var b = new SolidBrush(bgColor)) + { + g.FillRectangle(b, rect); + } + + // 2. Draw plus/minus icon + if (node.Nodes.Count > 0) + { + var pos = new Point(node.ExpandArea.Location.X - 1, node.ExpandArea.Location.Y - 1); + + var icon = _nodeOpen; + + if (node.Expanded && !node.ExpandAreaHot) + icon = _nodeOpen; + else if (node.Expanded && node.ExpandAreaHot && !SelectedNodes.Contains(node)) + icon = _nodeOpenHover; + else if (node.Expanded && node.ExpandAreaHot && SelectedNodes.Contains(node)) + icon = _nodeOpenHoverSelected; + else if (!node.Expanded && !node.ExpandAreaHot) + icon = _nodeClosed; + else if (!node.Expanded && node.ExpandAreaHot && !SelectedNodes.Contains(node)) + icon = _nodeClosedHover; + else if (!node.Expanded && node.ExpandAreaHot && SelectedNodes.Contains(node)) + icon = _nodeClosedHoverSelected; + + g.DrawImageUnscaled(icon, pos); + } + + // 3. Draw icon + if (node.Icon != null) + { + if (node.Expanded && node.ExpandedIcon != null) + g.DrawImageUnscaled(node.ExpandedIcon, node.IconArea.Location); + else + g.DrawImageUnscaled(node.Icon, node.IconArea.Location); + } + + // 4. Draw text + using (var b = new SolidBrush(Colors.LightText)) + { + var stringFormat = new StringFormat + { + Alignment = StringAlignment.Near, + LineAlignment = StringAlignment.Center + }; + + g.DrawString(node.Text, Font, b, node.TextArea, stringFormat); + } + + // 5. Draw child nodes + if (node.Expanded) + { + foreach (var childNode in node.Nodes) + DrawNode(childNode, g); + } + } + + #endregion + } +} diff --git a/DarkUI/Controls/Items/DarkTreeNode.cs b/DarkUI/Controls/Items/DarkTreeNode.cs new file mode 100644 index 0000000..ae1b931 --- /dev/null +++ b/DarkUI/Controls/Items/DarkTreeNode.cs @@ -0,0 +1,254 @@ +using System; +using System.Drawing; + +namespace DarkUI +{ + public class DarkTreeNode + { + #region Event Region + + public event EventHandler> ItemsAdded; + public event EventHandler> ItemsRemoved; + + public event EventHandler TextChanged; + public event EventHandler NodeExpanded; + public event EventHandler NodeCollapsed; + + #endregion + + #region Field Region + + private string _text; + private bool _isRoot; + private DarkTreeView _parentTree; + private DarkTreeNode _parentNode; + + private ObservableList _nodes; + + private bool _expanded; + + #endregion + + #region Property Region + + public string Text + { + get { return _text; } + set + { + if (_text == value) + return; + + _text = value; + + OnTextChanged(); + } + } + + public Rectangle ExpandArea { get; set; } + public Rectangle IconArea { get; set; } + public Rectangle TextArea { get; set; } + public Rectangle FullArea { get; set; } + + public bool ExpandAreaHot { get; set; } + + public Bitmap Icon { get; set; } + public Bitmap ExpandedIcon { get; set; } + + public bool Expanded + { + get { return _expanded; } + set + { + if (_expanded == value) + return; + + if (value == true && Nodes.Count == 0) + return; + + _expanded = value; + + if (_expanded) + { + if (NodeExpanded != null) + NodeExpanded(this, null); + } + else + { + if (NodeCollapsed != null) + NodeCollapsed(this, null); + } + } + } + + public ObservableList Nodes + { + get { return _nodes; } + set + { + if (_nodes != null) + { + _nodes.ItemsAdded -= Nodes_ItemsAdded; + _nodes.ItemsRemoved -= Nodes_ItemsRemoved; + } + + _nodes = value; + + _nodes.ItemsAdded += Nodes_ItemsAdded; + _nodes.ItemsRemoved += Nodes_ItemsRemoved; + } + } + + public bool IsRoot + { + get { return _isRoot; } + set { _isRoot = value; } + } + + public DarkTreeView ParentTree + { + get { return _parentTree; } + set + { + if (_parentTree == value) + return; + + _parentTree = value; + + foreach (var node in Nodes) + node.ParentTree = _parentTree; + } + } + + public DarkTreeNode ParentNode + { + get { return _parentNode; } + set { _parentNode = value; } + } + + public bool Odd { get; set; } + + public object NodeType { get; set; } + + public object Tag { get; set; } + + public string FullPath + { + get + { + var parent = ParentNode; + var path = Text; + + while (parent != null) + { + path = string.Format("{0}{1}{2}", parent.Text, "\\", path); + parent = parent.ParentNode; + } + + return path; + } + } + + public DarkTreeNode PrevVisibleNode { get; set; } + + public DarkTreeNode NextVisibleNode { get; set; } + + public int VisibleIndex { get; set; } + + public bool IsNodeAncestor(DarkTreeNode node) + { + var parent = ParentNode; + while (parent != null) + { + if (parent == node) + return true; + + parent = parent.ParentNode; + } + + return false; + } + + #endregion + + #region Constructor Region + + public DarkTreeNode() + { + Nodes = new ObservableList(); + } + + public DarkTreeNode(string text) + : this() + { + Text = text; + } + + #endregion + + #region Method Region + + public void Remove() + { + if (ParentNode != null) + ParentNode.Nodes.Remove(this); + else + ParentTree.Nodes.Remove(this); + } + + public void EnsureVisible() + { + var parent = ParentNode; + + while (parent != null) + { + parent.Expanded = true; + parent = parent.ParentNode; + } + } + + #endregion + + #region Event Handler Region + + private void OnTextChanged() + { + if (ParentTree != null && ParentTree.TreeViewNodeSorter != null) + { + if (ParentNode != null) + ParentNode.Nodes.Sort(ParentTree.TreeViewNodeSorter); + else + ParentTree.Nodes.Sort(ParentTree.TreeViewNodeSorter); + } + + if (TextChanged != null) + TextChanged(this, null); + } + + private void Nodes_ItemsAdded(object sender, ObservableListModified e) + { + foreach (var node in e.Items) + { + node.ParentNode = this; + node.ParentTree = ParentTree; + } + + if (ParentTree != null && ParentTree.TreeViewNodeSorter != null) + Nodes.Sort(ParentTree.TreeViewNodeSorter); + + if (ItemsAdded != null) + ItemsAdded(this, e); + } + + private void Nodes_ItemsRemoved(object sender, ObservableListModified e) + { + if (Nodes.Count == 0) + Expanded = false; + + if (ItemsRemoved != null) + ItemsRemoved(this, e); + } + + #endregion + } +} diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index f4bee5f..de062b4 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -43,7 +43,10 @@ - + + Component + + Component @@ -84,6 +87,7 @@ Component + Form @@ -115,6 +119,11 @@ True ScrollIcons.resx + + True + True + TreeViewIcons.resx + @@ -141,6 +150,11 @@ ScrollIcons.Designer.cs DarkUI + + ResXFileCodeGenerator + TreeViewIcons.Designer.cs + DarkUI + @@ -169,6 +183,18 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\node_closed_empty.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\node_closed_full.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\node_open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\node_open_empty.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/DarkUI/Resources/node_closed_empty.png b/DarkUI/Resources/node_closed_empty.png new file mode 100644 index 0000000000000000000000000000000000000000..5da81920fdc43957d5037ef26621caa006ee55be GIT binary patch literal 2849 zcmV++3*P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`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0000?Nklq@&|NjF3y|o+~^2yoi00000NkvXXu0mjf1cXcr literal 0 HcmV?d00001 diff --git a/DarkUI/Resources/node_closed_full.png b/DarkUI/Resources/node_closed_full.png new file mode 100644 index 0000000000000000000000000000000000000000..21a7062107244f8b06594252de1a56f14721ce6d GIT binary patch literal 2847 zcmV+)3*hvLP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ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G?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0000=NklR4H_gr xVu9p<#5quuGoUGZz?1=i|3A|O009600|2rA6B_L!Et3EM002ovPDHLkV1kgaMx_7% literal 0 HcmV?d00001 diff --git a/DarkUI/Resources/node_open.png b/DarkUI/Resources/node_open.png new file mode 100644 index 0000000000000000000000000000000000000000..a9addef170c161c2058d06bb56036da1105106cf GIT binary patch literal 2836 zcmV+v3+wcWP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3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$`AYKVB2oUk61ebU|5U&Im1c-Q3f=fIfh*yFO0z|wi!6lv##4EuC z0V3X%;1bUV;+5cn01r2mv}x9uLKtahI_$zNlB zNm*Iv&z)d$7R#7)3NgXYm)r1lEe{D|>7nhhu6WtGj96`sYQ^h& literal 0 HcmV?d00001 diff --git a/Example/Example.csproj b/Example/Example.csproj index 23408d1..e99a27b 100644 --- a/Example/Example.csproj +++ b/Example/Example.csproj @@ -45,11 +45,20 @@ MainForm.cs + + True + True + Icons.resx + MainForm.cs + + ResXFileCodeGenerator + Icons.Designer.cs + ResXFileCodeGenerator Resources.Designer.cs @@ -76,6 +85,15 @@ DarkUI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Resources\Files_7954.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\folder_Closed_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\folder_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/Example/Resources/Files_7954.png b/Example/Resources/Files_7954.png new file mode 100644 index 0000000000000000000000000000000000000000..009dde90556b43b069ad85be333cd64a1b6bc97e GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5he4R}c>anMpkS$| zi(^Pd+|f%1Ia>_`S{_dM(qmeeQPINPXIcA!PC{xWt~$(696x6MOgp< literal 0 HcmV?d00001 diff --git a/Example/Resources/folder_16x.png b/Example/Resources/folder_16x.png new file mode 100644 index 0000000000000000000000000000000000000000..bf1195da992ce4da1382f534cf5a48c3fa0c0e7b GIT binary patch literal 286 zcmV+(0pb3MP)rqj=N&;I8MK|GAui<2djmfEz?q0?>jW32rsA`&bOxc;+=>!8Y1t|g1!Bj~vbykhW)art@T5$x_ex0pwwZ)LEM=8Etk>j{YX zv%c@{;8Qg+5V4yLv0sh(0*a!T!SIW9d16zHzV7})Q#G;>aojFJlOO&Th$wP8Z01ao k|9?zGlm-xiN50Sb42+jWo;z}AG5`Po07*qoM6N<$f>f)2RE6w=KAld Date: Fri, 18 Sep 2015 13:24:05 +0100 Subject: [PATCH 20/97] Added 'ShowIcons' property to DarkTreeView --- DarkUI/Controls/DarkTreeView.cs | 13 +++++++++++-- Example/Forms/MainForm.Designer.cs | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/DarkUI/Controls/DarkTreeView.cs b/DarkUI/Controls/DarkTreeView.cs index 3c8aef5..bcd104e 100644 --- a/DarkUI/Controls/DarkTreeView.cs +++ b/DarkUI/Controls/DarkTreeView.cs @@ -125,6 +125,11 @@ namespace DarkUI [DefaultValue(false)] public bool AllowMoveNodes { get; set; } + [Category("Appearance")] + [Description("Determines whether icons are rendered with the tree nodes.")] + [DefaultValue(false)] + public bool ShowIcons { get; set; } + [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int VisibleNodeCount { get; private set; } @@ -624,7 +629,11 @@ namespace DarkUI node.ExpandArea = new Rectangle(indent + 3, expandTop, _expandAreaSize, _expandAreaSize); var iconTop = yOffset + (ItemHeight / 2) - (_iconSize / 2); - node.IconArea = new Rectangle(node.ExpandArea.Right + 2, iconTop, _iconSize, _iconSize); + + if (ShowIcons) + node.IconArea = new Rectangle(node.ExpandArea.Right + 2, iconTop, _iconSize, _iconSize); + else + node.IconArea = new Rectangle(node.ExpandArea.Right, iconTop, 0, 0); using (var g = CreateGraphics()) { @@ -1241,7 +1250,7 @@ namespace DarkUI } // 3. Draw icon - if (node.Icon != null) + if (ShowIcons && node.Icon != null) { if (node.Expanded && node.ExpandedIcon != null) g.DrawImageUnscaled(node.ExpandedIcon, node.IconArea.Location); diff --git a/Example/Forms/MainForm.Designer.cs b/Example/Forms/MainForm.Designer.cs index ea60870..05b8134 100644 --- a/Example/Forms/MainForm.Designer.cs +++ b/Example/Forms/MainForm.Designer.cs @@ -649,6 +649,7 @@ this.darkTreeView1.Location = new System.Drawing.Point(1, 25); this.darkTreeView1.MultiSelect = true; this.darkTreeView1.Name = "darkTreeView1"; + this.darkTreeView1.ShowIcons = true; this.darkTreeView1.Size = new System.Drawing.Size(219, 198); this.darkTreeView1.TabIndex = 0; this.darkTreeView1.Text = "darkTreeView1"; From 71105b8e77d8e43056af5f5fab5b883f8613a84e Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 13:33:10 +0100 Subject: [PATCH 21/97] Added ControlScrollFilter ControlScrollFilter can be added to the application's message filter list to re-route all mousewheel events to the control the user is current hovering over with their cursor. --- DarkUI/DarkUI.csproj | 3 + DarkUI/Win32/ControlScrollFilter.cs | 27 + DarkUI/Win32/Native.cs | 15 + DarkUI/Win32/WindowsMessages.cs | 1199 +++++++++++++++++++++++++++ Example/Forms/MainForm.cs | 5 + 5 files changed, 1249 insertions(+) create mode 100644 DarkUI/Win32/ControlScrollFilter.cs create mode 100644 DarkUI/Win32/Native.cs create mode 100644 DarkUI/Win32/WindowsMessages.cs diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index de062b4..7f141eb 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -124,9 +124,12 @@ True TreeViewIcons.resx + + + diff --git a/DarkUI/Win32/ControlScrollFilter.cs b/DarkUI/Win32/ControlScrollFilter.cs new file mode 100644 index 0000000..d9c109a --- /dev/null +++ b/DarkUI/Win32/ControlScrollFilter.cs @@ -0,0 +1,27 @@ +using System.Drawing; +using System.Windows.Forms; + +namespace DarkUI +{ + public class ControlScrollFilter : IMessageFilter + { + public bool PreFilterMessage(ref Message m) + { + switch (m.Msg) + { + case (int)WM.MOUSEWHEEL: + case (int)WM.MOUSEHWHEEL: + var hControlUnderMouse = Native.WindowFromPoint(new Point((int)m.LParam)); + + if (hControlUnderMouse == m.HWnd) + return false; // Already headed for the right control. + + // Redirect the message to the control under the mouse. + Native.SendMessage(hControlUnderMouse, (uint)m.Msg, m.WParam, m.LParam); + return true; + } + + return false; + } + } +} diff --git a/DarkUI/Win32/Native.cs b/DarkUI/Win32/Native.cs new file mode 100644 index 0000000..0b4b781 --- /dev/null +++ b/DarkUI/Win32/Native.cs @@ -0,0 +1,15 @@ +using System; +using System.Drawing; +using System.Runtime.InteropServices; + +namespace DarkUI +{ + public sealed class Native + { + [DllImport("user32.dll")] + public static extern IntPtr WindowFromPoint(Point point); + + [DllImport("user32.dll", CharSet = CharSet.Auto)] + public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam); + } +} diff --git a/DarkUI/Win32/WindowsMessages.cs b/DarkUI/Win32/WindowsMessages.cs new file mode 100644 index 0000000..2fc798c --- /dev/null +++ b/DarkUI/Win32/WindowsMessages.cs @@ -0,0 +1,1199 @@ +using System; + +namespace DarkUI +{ + /// + /// Windows Messages + /// Defined in winuser.h from Windows SDK v6.1 + /// Documentation pulled from MSDN. + /// + public enum WM : uint + { + /// + /// The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore. + /// + NULL = 0x0000, + + /// + /// The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible. + /// + CREATE = 0x0001, + + /// + /// The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen. + /// This message is sent first to the window being destroyed and then to the child windows (if any) as they are destroyed. During the processing of the message, it can be assumed that all child windows still exist. + /// /// + DESTROY = 0x0002, + + /// + /// The WM_MOVE message is sent after a window has been moved. + /// + MOVE = 0x0003, + + /// + /// The WM_SIZE message is sent to a window after its size has changed. + /// + SIZE = 0x0005, + + /// + /// The WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately. + /// + ACTIVATE = 0x0006, + + /// + /// The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus. + /// + SETFOCUS = 0x0007, + + /// + /// The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus. + /// + KILLFOCUS = 0x0008, + + /// + /// The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the enabled state (WS_DISABLED style bit) of the window has changed. + /// + ENABLE = 0x000A, + + /// + /// An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn. + /// + SETREDRAW = 0x000B, + + /// + /// An application sends a WM_SETTEXT message to set the text of a window. + /// + SETTEXT = 0x000C, + + /// + /// An application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller. + /// + GETTEXT = 0x000D, + + /// + /// An application sends a WM_GETTEXTLENGTH message to determine the length, in characters, of the text associated with a window. + /// + GETTEXTLENGTH = 0x000E, + + /// + /// The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function. + /// + PAINT = 0x000F, + + /// + /// The WM_CLOSE message is sent as a signal that a window or an application should terminate. + /// + CLOSE = 0x0010, + + /// + /// The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero. + /// After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message. + /// + QUERYENDSESSION = 0x0011, + + /// + /// The WM_QUERYOPEN message is sent to an icon when the user requests that the window be restored to its previous size and position. + /// + QUERYOPEN = 0x0013, + + /// + /// The WM_ENDSESSION message is sent to an application after the system processes the results of the WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending. + /// + ENDSESSION = 0x0016, + + /// + /// The WM_QUIT message indicates a request to terminate an application and is generated when the application calls the PostQuitMessage function. It causes the GetMessage function to return zero. + /// + QUIT = 0x0012, + + /// + /// The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting. + /// + ERASEBKGND = 0x0014, + + /// + /// This message is sent to all top-level windows when a change is made to a system color setting. + /// + SYSCOLORCHANGE = 0x0015, + + /// + /// The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown. + /// + SHOWWINDOW = 0x0018, + + /// + /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI. + /// Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message. + /// + WININICHANGE = 0x001A, + + /// + /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI. + /// Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message. + /// + SETTINGCHANGE = WININICHANGE, + + /// + /// The WM_DEVMODECHANGE message is sent to all top-level windows whenever the user changes device-mode settings. + /// + DEVMODECHANGE = 0x001B, + + /// + /// The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated. + /// + ACTIVATEAPP = 0x001C, + + /// + /// An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources. + /// + FONTCHANGE = 0x001D, + + /// + /// A message that is sent whenever there is a change in the system time. + /// + TIMECHANGE = 0x001E, + + /// + /// The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window. + /// + CANCELMODE = 0x001F, + + /// + /// The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured. + /// + SETCURSOR = 0x0020, + + /// + /// The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function. + /// + MOUSEACTIVATE = 0x0021, + + /// + /// The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the window is activated, moved, or sized. + /// + CHILDACTIVATE = 0x0022, + + /// + /// The WM_QUEUESYNC message is sent by a computer-based training (CBT) application to separate user-input messages from other messages sent through the WH_JOURNALPLAYBACK Hook procedure. + /// + QUEUESYNC = 0x0023, + + /// + /// The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size. + /// + GETMINMAXINFO = 0x0024, + + /// + /// Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted. This message is not sent by newer versions of Microsoft Windows, except in unusual circumstances explained in the Remarks. + /// + PAINTICON = 0x0026, + + /// + /// Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the icon must be filled before painting the icon. A window receives this message only if a class icon is defined for the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows. + /// + ICONERASEBKGND = 0x0027, + + /// + /// The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box. + /// + NEXTDLGCTL = 0x0028, + + /// + /// The WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print Manager queue. + /// + SPOOLERSTATUS = 0x002A, + + /// + /// The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed. + /// + DRAWITEM = 0x002B, + + /// + /// The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created. + /// + MEASUREITEM = 0x002C, + + /// + /// Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or combo box item with nonzero item data. + /// + DELETEITEM = 0x002D, + + /// + /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message. + /// + VKEYTOITEM = 0x002E, + + /// + /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message. + /// + CHARTOITEM = 0x002F, + + /// + /// An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text. + /// + SETFONT = 0x0030, + + /// + /// An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text. + /// + GETFONT = 0x0031, + + /// + /// An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user presses the hot key, the system activates the window. + /// + SETHOTKEY = 0x0032, + + /// + /// An application sends a WM_GETHOTKEY message to determine the hot key associated with a window. + /// + GETHOTKEY = 0x0033, + + /// + /// The WM_QUERYDRAGICON message is sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an icon defined for its class. An application can return a handle to an icon or cursor. The system displays this cursor or icon while the user drags the icon. + /// + QUERYDRAGICON = 0x0037, + + /// + /// The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style. + /// + COMPAREITEM = 0x0039, + + /// + /// Active Accessibility sends the WM_GETOBJECT message to obtain information about an accessible object contained in a server application. + /// Applications never send this message directly. It is sent only by Active Accessibility in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications handle this message. + /// + GETOBJECT = 0x003D, + + /// + /// The WM_COMPACTING message is sent to all top-level windows when the system detects more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low. + /// + COMPACTING = 0x0041, + + /// + /// WM_COMMNOTIFY is Obsolete for Win32-Based Applications + /// + [Obsolete] + COMMNOTIFY = 0x0044, + + /// + /// The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function. + /// + WINDOWPOSCHANGING = 0x0046, + + /// + /// The WM_WINDOWPOSCHANGED message is sent to a window whose size, position, or place in the Z order has changed as a result of a call to the SetWindowPos function or another window-management function. + /// + WINDOWPOSCHANGED = 0x0047, + + /// + /// Notifies applications that the system, typically a battery-powered personal computer, is about to enter a suspended mode. + /// Use: POWERBROADCAST + /// + [Obsolete] + POWER = 0x0048, + + /// + /// An application sends the WM_COPYDATA message to pass data to another application. + /// + COPYDATA = 0x004A, + + /// + /// The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling activities. The message is posted with a NULL window handle. + /// + CANCELJOURNAL = 0x004B, + + /// + /// Sent by a common control to its parent window when an event has occurred or the control requires some information. + /// + NOTIFY = 0x004E, + + /// + /// The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject the change (and prevent it from taking place) by returning immediately. + /// + INPUTLANGCHANGEREQUEST = 0x0050, + + /// + /// The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has been changed. You should make any application-specific settings and pass the message to the DefWindowProc function, which passes the message to all first-level child windows. These child windows can pass the message to DefWindowProc to have it pass the message to their child windows, and so on. + /// + INPUTLANGCHANGE = 0x0051, + + /// + /// Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs the application when the user clicks an authorable button. An application initiates a training card by specifying the HELP_TCARD command in a call to the WinHelp function. + /// + TCARD = 0x0052, + + /// + /// Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no window has the keyboard focus, WM_HELP is sent to the currently active window. + /// + HELP = 0x0053, + + /// + /// The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings. + /// + USERCHANGED = 0x0054, + + /// + /// Determines if a window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. WM_NOTIFYFORMAT messages are sent from a common control to its parent window and from the parent window to the common control. + /// + NOTIFYFORMAT = 0x0055, + + /// + /// The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right-clicked) in the window. + /// + CONTEXTMENU = 0x007B, + + /// + /// The WM_STYLECHANGING message is sent to a window when the SetWindowLong function is about to change one or more of the window's styles. + /// + STYLECHANGING = 0x007C, + + /// + /// The WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the window's styles + /// + STYLECHANGED = 0x007D, + + /// + /// The WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed. + /// + DISPLAYCHANGE = 0x007E, + + /// + /// The WM_GETICON message is sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption. + /// + GETICON = 0x007F, + + /// + /// An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption. + /// + SETICON = 0x0080, + + /// + /// The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created. + /// + NCCREATE = 0x0081, + + /// + /// The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY message. WM_DESTROY is used to free the allocated memory object associated with the window. + /// The WM_NCDESTROY message is sent after the child windows have been destroyed. In contrast, WM_DESTROY is sent before the child windows are destroyed. + /// + NCDESTROY = 0x0082, + + /// + /// The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes. + /// + NCCALCSIZE = 0x0083, + + /// + /// The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse. + /// + NCHITTEST = 0x0084, + + /// + /// The WM_NCPAINT message is sent to a window when its frame must be painted. + /// + NCPAINT = 0x0085, + + /// + /// The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or inactive state. + /// + NCACTIVATE = 0x0086, + + /// + /// The WM_GETDLGCODE message is sent to the window procedure associated with a control. By default, the system handles all keyboard input to the control; the system interprets certain types of keyboard input as dialog box navigation keys. To override this default behavior, the control can respond to the WM_GETDLGCODE message to indicate the types of input it wants to process itself. + /// + GETDLGCODE = 0x0087, + + /// + /// The WM_SYNCPAINT message is used to synchronize painting while avoiding linking independent GUI threads. + /// + SYNCPAINT = 0x0088, + + /// + /// The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. + /// + NCMOUSEMOVE = 0x00A0, + + /// + /// The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. + /// + NCLBUTTONDOWN = 0x00A1, + + /// + /// The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. + /// + NCLBUTTONUP = 0x00A2, + + /// + /// The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. + /// + NCLBUTTONDBLCLK = 0x00A3, + + /// + /// The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. + /// + NCRBUTTONDOWN = 0x00A4, + + /// + /// The WM_NCRBUTTONUP message is posted when the user releases the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. + /// + NCRBUTTONUP = 0x00A5, + + /// + /// The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. + /// + NCRBUTTONDBLCLK = 0x00A6, + + /// + /// The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. + /// + NCMBUTTONDOWN = 0x00A7, + + /// + /// The WM_NCMBUTTONUP message is posted when the user releases the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. + /// + NCMBUTTONUP = 0x00A8, + + /// + /// The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. + /// + NCMBUTTONDBLCLK = 0x00A9, + + /// + /// The WM_NCXBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. + /// + NCXBUTTONDOWN = 0x00AB, + + /// + /// The WM_NCXBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. + /// + NCXBUTTONUP = 0x00AC, + + /// + /// The WM_NCXBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. + /// + NCXBUTTONDBLCLK = 0x00AD, + + /// + /// The WM_INPUT_DEVICE_CHANGE message is sent to the window that registered to receive raw input. A window receives this message through its WindowProc function. + /// + INPUT_DEVICE_CHANGE = 0x00FE, + + /// + /// The WM_INPUT message is sent to the window that is getting raw input. + /// + INPUT = 0x00FF, + + /// + /// This message filters for keyboard messages. + /// + KEYFIRST = 0x0100, + + /// + /// The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed. + /// + KEYDOWN = 0x0100, + + /// + /// The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus. + /// + KEYUP = 0x0101, + + /// + /// The WM_CHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed. + /// + CHAR = 0x0102, + + /// + /// The WM_DEADCHAR message is posted to the window with the keyboard focus when a WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR specifies a character code generated by a dead key. A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with another character to form a composite character. For example, the umlaut-O character (Ö) is generated by typing the dead key for the umlaut character, and then typing the O key. + /// + DEADCHAR = 0x0103, + + /// + /// The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. + /// + SYSKEYDOWN = 0x0104, + + /// + /// The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. + /// + SYSKEYUP = 0x0105, + + /// + /// The WM_SYSCHAR message is posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. It specifies the character code of a system character key — that is, a character key that is pressed while the ALT key is down. + /// + SYSCHAR = 0x0106, + + /// + /// The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. WM_SYSDEADCHAR specifies the character code of a system dead key — that is, a dead key that is pressed while holding down the ALT key. + /// + SYSDEADCHAR = 0x0107, + + /// + /// The WM_UNICHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_UNICHAR message contains the character code of the key that was pressed. + /// The WM_UNICHAR message is equivalent to WM_CHAR, but it uses Unicode Transformation Format (UTF)-32, whereas WM_CHAR uses UTF-16. It is designed to send or post Unicode characters to ANSI windows and it can can handle Unicode Supplementary Plane characters. + /// + UNICHAR = 0x0109, + + /// + /// This message filters for keyboard messages. + /// + KEYLAST = 0x0109, + + /// + /// Sent immediately before the IME generates the composition string as a result of a keystroke. A window receives this message through its WindowProc function. + /// + IME_STARTCOMPOSITION = 0x010D, + + /// + /// Sent to an application when the IME ends composition. A window receives this message through its WindowProc function. + /// + IME_ENDCOMPOSITION = 0x010E, + + /// + /// Sent to an application when the IME changes composition status as a result of a keystroke. A window receives this message through its WindowProc function. + /// + IME_COMPOSITION = 0x010F, + IME_KEYLAST = 0x010F, + + /// + /// The WM_INITDIALOG message is sent to the dialog box procedure immediately before a dialog box is displayed. Dialog box procedures typically use this message to initialize controls and carry out any other initialization tasks that affect the appearance of the dialog box. + /// + INITDIALOG = 0x0110, + + /// + /// The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated. + /// + COMMAND = 0x0111, + + /// + /// A window receives this message when the user chooses a command from the Window menu, clicks the maximize button, minimize button, restore button, close button, or moves the form. You can stop the form from moving by filtering this out. + /// + SYSCOMMAND = 0x0112, + + /// + /// The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted by the GetMessage or PeekMessage function. + /// + TIMER = 0x0113, + + /// + /// The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control. + /// + HSCROLL = 0x0114, + + /// + /// The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control. + /// + VSCROLL = 0x0115, + + /// + /// The WM_INITMENU message is sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or presses a menu key. This allows the application to modify the menu before it is displayed. + /// + INITMENU = 0x0116, + + /// + /// The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an application to modify the menu before it is displayed, without changing the entire menu. + /// + INITMENUPOPUP = 0x0117, + + /// + /// The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item. + /// + MENUSELECT = 0x011F, + + /// + /// The WM_MENUCHAR message is sent when a menu is active and the user presses a key that does not correspond to any mnemonic or accelerator key. This message is sent to the window that owns the menu. + /// + MENUCHAR = 0x0120, + + /// + /// The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state. A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages. + /// + ENTERIDLE = 0x0121, + + /// + /// The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a menu item. + /// + MENURBUTTONUP = 0x0122, + + /// + /// The WM_MENUDRAG message is sent to the owner of a drag-and-drop menu when the user drags a menu item. + /// + MENUDRAG = 0x0123, + + /// + /// The WM_MENUGETOBJECT message is sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves from the center of the item to the top or bottom of the item. + /// + MENUGETOBJECT = 0x0124, + + /// + /// The WM_UNINITMENUPOPUP message is sent when a drop-down menu or submenu has been destroyed. + /// + UNINITMENUPOPUP = 0x0125, + + /// + /// The WM_MENUCOMMAND message is sent when the user makes a selection from a menu. + /// + MENUCOMMAND = 0x0126, + + /// + /// An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed. + /// + CHANGEUISTATE = 0x0127, + + /// + /// An application sends the WM_UPDATEUISTATE message to change the user interface (UI) state for the specified window and all its child windows. + /// + UPDATEUISTATE = 0x0128, + + /// + /// An application sends the WM_QUERYUISTATE message to retrieve the user interface (UI) state for a window. + /// + QUERYUISTATE = 0x0129, + + /// + /// The WM_CTLCOLORMSGBOX message is sent to the owner window of a message box before Windows draws the message box. By responding to this message, the owner window can set the text and background colors of the message box by using the given display device context handle. + /// + CTLCOLORMSGBOX = 0x0132, + + /// + /// An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the edit control. + /// + CTLCOLOREDIT = 0x0133, + + /// + /// Sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle. + /// + CTLCOLORLISTBOX = 0x0134, + + /// + /// The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing this message. + /// + CTLCOLORBTN = 0x0135, + + /// + /// The WM_CTLCOLORDLG message is sent to a dialog box before the system draws the dialog box. By responding to this message, the dialog box can set its text and background colors using the specified display device context handle. + /// + CTLCOLORDLG = 0x0136, + + /// + /// The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control. + /// + CTLCOLORSCROLLBAR = 0x0137, + + /// + /// A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control. + /// + CTLCOLORSTATIC = 0x0138, + + /// + /// Use WM_MOUSEFIRST to specify the first mouse message. Use the PeekMessage() Function. + /// + MOUSEFIRST = 0x0200, + + /// + /// The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse. + /// + MOUSEMOVE = 0x0200, + + /// + /// The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. + /// + LBUTTONDOWN = 0x0201, + + /// + /// The WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. + /// + LBUTTONUP = 0x0202, + + /// + /// The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. + /// + LBUTTONDBLCLK = 0x0203, + + /// + /// The WM_RBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. + /// + RBUTTONDOWN = 0x0204, + + /// + /// The WM_RBUTTONUP message is posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. + /// + RBUTTONUP = 0x0205, + + /// + /// The WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. + /// + RBUTTONDBLCLK = 0x0206, + + /// + /// The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. + /// + MBUTTONDOWN = 0x0207, + + /// + /// The WM_MBUTTONUP message is posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. + /// + MBUTTONUP = 0x0208, + + /// + /// The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. + /// + MBUTTONDBLCLK = 0x0209, + + /// + /// The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it. + /// + MOUSEWHEEL = 0x020A, + + /// + /// The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. + /// + XBUTTONDOWN = 0x020B, + + /// + /// The WM_XBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. + /// + XBUTTONUP = 0x020C, + + /// + /// The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. + /// + XBUTTONDBLCLK = 0x020D, + + /// + /// The WM_MOUSEHWHEEL message is sent to the focus window when the mouse's horizontal scroll wheel is tilted or rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it. + /// + MOUSEHWHEEL = 0x020E, + + /// + /// Use WM_MOUSELAST to specify the last mouse message. Used with PeekMessage() Function. + /// + MOUSELAST = 0x020E, + + /// + /// The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place. + /// + PARENTNOTIFY = 0x0210, + + /// + /// The WM_ENTERMENULOOP message informs an application's main window procedure that a menu modal loop has been entered. + /// + ENTERMENULOOP = 0x0211, + + /// + /// The WM_EXITMENULOOP message informs an application's main window procedure that a menu modal loop has been exited. + /// + EXITMENULOOP = 0x0212, + + /// + /// The WM_NEXTMENU message is sent to an application when the right or left arrow key is used to switch between the menu bar and the system menu. + /// + NEXTMENU = 0x0213, + + /// + /// The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position. + /// + SIZING = 0x0214, + + /// + /// The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture. + /// + CAPTURECHANGED = 0x0215, + + /// + /// The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position. + /// + MOVING = 0x0216, + + /// + /// Notifies applications that a power-management event has occurred. + /// + POWERBROADCAST = 0x0218, + + /// + /// Notifies an application of a change to the hardware configuration of a device or the computer. + /// + DEVICECHANGE = 0x0219, + + /// + /// An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI child window. + /// + MDICREATE = 0x0220, + + /// + /// An application sends the WM_MDIDESTROY message to a multiple-document interface (MDI) client window to close an MDI child window. + /// + MDIDESTROY = 0x0221, + + /// + /// An application sends the WM_MDIACTIVATE message to a multiple-document interface (MDI) client window to instruct the client window to activate a different MDI child window. + /// + MDIACTIVATE = 0x0222, + + /// + /// An application sends the WM_MDIRESTORE message to a multiple-document interface (MDI) client window to restore an MDI child window from maximized or minimized size. + /// + MDIRESTORE = 0x0223, + + /// + /// An application sends the WM_MDINEXT message to a multiple-document interface (MDI) client window to activate the next or previous child window. + /// + MDINEXT = 0x0224, + + /// + /// An application sends the WM_MDIMAXIMIZE message to a multiple-document interface (MDI) client window to maximize an MDI child window. The system resizes the child window to make its client area fill the client window. The system places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the child window's restore icon in the leftmost position. The system also appends the title bar text of the child window to that of the frame window. + /// + MDIMAXIMIZE = 0x0225, + + /// + /// An application sends the WM_MDITILE message to a multiple-document interface (MDI) client window to arrange all of its MDI child windows in a tile format. + /// + MDITILE = 0x0226, + + /// + /// An application sends the WM_MDICASCADE message to a multiple-document interface (MDI) client window to arrange all its child windows in a cascade format. + /// + MDICASCADE = 0x0227, + + /// + /// An application sends the WM_MDIICONARRANGE message to a multiple-document interface (MDI) client window to arrange all minimized MDI child windows. It does not affect child windows that are not minimized. + /// + MDIICONARRANGE = 0x0228, + + /// + /// An application sends the WM_MDIGETACTIVE message to a multiple-document interface (MDI) client window to retrieve the handle to the active MDI child window. + /// + MDIGETACTIVE = 0x0229, + + /// + /// An application sends the WM_MDISETMENU message to a multiple-document interface (MDI) client window to replace the entire menu of an MDI frame window, to replace the window menu of the frame window, or both. + /// + MDISETMENU = 0x0230, + + /// + /// The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. + /// The system sends the WM_ENTERSIZEMOVE message regardless of whether the dragging of full windows is enabled. + /// + ENTERSIZEMOVE = 0x0231, + + /// + /// The WM_EXITSIZEMOVE message is sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. + /// + EXITSIZEMOVE = 0x0232, + + /// + /// Sent when the user drops a file on the window of an application that has registered itself as a recipient of dropped files. + /// + DROPFILES = 0x0233, + + /// + /// An application sends the WM_MDIREFRESHMENU message to a multiple-document interface (MDI) client window to refresh the window menu of the MDI frame window. + /// + MDIREFRESHMENU = 0x0234, + + /// + /// Sent to an application when a window is activated. A window receives this message through its WindowProc function. + /// + IME_SETCONTEXT = 0x0281, + + /// + /// Sent to an application to notify it of changes to the IME window. A window receives this message through its WindowProc function. + /// + IME_NOTIFY = 0x0282, + + /// + /// Sent by an application to direct the IME window to carry out the requested command. The application uses this message to control the IME window that it has created. To send this message, the application calls the SendMessage function with the following parameters. + /// + IME_CONTROL = 0x0283, + + /// + /// Sent to an application when the IME window finds no space to extend the area for the composition window. A window receives this message through its WindowProc function. + /// + IME_COMPOSITIONFULL = 0x0284, + + /// + /// Sent to an application when the operating system is about to change the current IME. A window receives this message through its WindowProc function. + /// + IME_SELECT = 0x0285, + + /// + /// Sent to an application when the IME gets a character of the conversion result. A window receives this message through its WindowProc function. + /// + IME_CHAR = 0x0286, + + /// + /// Sent to an application to provide commands and request information. A window receives this message through its WindowProc function. + /// + IME_REQUEST = 0x0288, + + /// + /// Sent to an application by the IME to notify the application of a key press and to keep message order. A window receives this message through its WindowProc function. + /// + IME_KEYDOWN = 0x0290, + + /// + /// Sent to an application by the IME to notify the application of a key release and to keep message order. A window receives this message through its WindowProc function. + /// + IME_KEYUP = 0x0291, + + /// + /// The WM_MOUSEHOVER message is posted to a window when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent. + /// + MOUSEHOVER = 0x02A1, + + /// + /// The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent. + /// + MOUSELEAVE = 0x02A3, + + /// + /// The WM_NCMOUSEHOVER message is posted to a window when the cursor hovers over the nonclient area of the window for the period of time specified in a prior call to TrackMouseEvent. + /// + NCMOUSEHOVER = 0x02A0, + + /// + /// The WM_NCMOUSELEAVE message is posted to a window when the cursor leaves the nonclient area of the window specified in a prior call to TrackMouseEvent. + /// + NCMOUSELEAVE = 0x02A2, + + /// + /// The WM_WTSSESSION_CHANGE message notifies applications of changes in session state. + /// + WTSSESSION_CHANGE = 0x02B1, + TABLET_FIRST = 0x02c0, + TABLET_LAST = 0x02df, + + /// + /// An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format. + /// + CUT = 0x0300, + + /// + /// An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format. + /// + COPY = 0x0301, + + /// + /// An application sends a WM_PASTE message to an edit control or combo box to copy the current content of the clipboard to the edit control at the current caret position. Data is inserted only if the clipboard contains data in CF_TEXT format. + /// + PASTE = 0x0302, + + /// + /// An application sends a WM_CLEAR message to an edit control or combo box to delete (clear) the current selection, if any, from the edit control. + /// + CLEAR = 0x0303, + + /// + /// An application sends a WM_UNDO message to an edit control to undo the last operation. When this message is sent to an edit control, the previously deleted text is restored or the previously added text is deleted. + /// + UNDO = 0x0304, + + /// + /// The WM_RENDERFORMAT message is sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application has requested data in that format. The clipboard owner must render data in the specified format and place it on the clipboard by calling the SetClipboardData function. + /// + RENDERFORMAT = 0x0305, + + /// + /// The WM_RENDERALLFORMATS message is sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or more clipboard formats. For the content of the clipboard to remain available to other applications, the clipboard owner must render data in all the formats it is capable of generating, and place the data on the clipboard by calling the SetClipboardData function. + /// + RENDERALLFORMATS = 0x0306, + + /// + /// The WM_DESTROYCLIPBOARD message is sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard. + /// + DESTROYCLIPBOARD = 0x0307, + + /// + /// The WM_DRAWCLIPBOARD message is sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard. + /// + DRAWCLIPBOARD = 0x0308, + + /// + /// The WM_PAINTCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting. + /// + PAINTCLIPBOARD = 0x0309, + + /// + /// The WM_VSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. The owner should scroll the clipboard image and update the scroll bar values. + /// + VSCROLLCLIPBOARD = 0x030A, + + /// + /// The WM_SIZECLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size. + /// + SIZECLIPBOARD = 0x030B, + + /// + /// The WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a CF_OWNERDISPLAY clipboard format. + /// + ASKCBFORMATNAME = 0x030C, + + /// + /// The WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being removed from the chain. + /// + CHANGECBCHAIN = 0x030D, + + /// + /// The WM_HSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner should scroll the clipboard image and update the scroll bar values. + /// + HSCROLLCLIPBOARD = 0x030E, + + /// + /// This message informs a window that it is about to receive the keyboard focus, giving the window the opportunity to realize its logical palette when it receives the focus. + /// + QUERYNEWPALETTE = 0x030F, + + /// + /// The WM_PALETTEISCHANGING message informs applications that an application is going to realize its logical palette. + /// + PALETTEISCHANGING = 0x0310, + + /// + /// This message is sent by the OS to all top-level and overlapped windows after the window with the keyboard focus realizes its logical palette. + /// This message enables windows that do not have the keyboard focus to realize their logical palettes and update their client areas. + /// + PALETTECHANGED = 0x0311, + + /// + /// The WM_HOTKEY message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key. + /// + HOTKEY = 0x0312, + + /// + /// The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context. + /// + PRINT = 0x0317, + + /// + /// The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device context, most commonly in a printer device context. + /// + PRINTCLIENT = 0x0318, + + /// + /// The WM_APPCOMMAND message notifies a window that the user generated an application command event, for example, by clicking an application command button using the mouse or typing an application command key on the keyboard. + /// + APPCOMMAND = 0x0319, + + /// + /// The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another. + /// + THEMECHANGED = 0x031A, + + /// + /// Sent when the contents of the clipboard have changed. + /// + CLIPBOARDUPDATE = 0x031D, + + /// + /// The system will send a window the WM_DWMCOMPOSITIONCHANGED message to indicate that the availability of desktop composition has changed. + /// + DWMCOMPOSITIONCHANGED = 0x031E, + + /// + /// WM_DWMNCRENDERINGCHANGED is called when the non-client area rendering status of a window has changed. Only windows that have set the flag DWM_BLURBEHIND.fTransitionOnMaximized to true will get this message. + /// + DWMNCRENDERINGCHANGED = 0x031F, + + /// + /// Sent to all top-level windows when the colorization color has changed. + /// + DWMCOLORIZATIONCOLORCHANGED = 0x0320, + + /// + /// WM_DWMWINDOWMAXIMIZEDCHANGE will let you know when a DWM composed window is maximized. You also have to register for this message as well. You'd have other windowd go opaque when this message is sent. + /// + DWMWINDOWMAXIMIZEDCHANGE = 0x0321, + + /// + /// Sent to request extended title bar information. A window receives this message through its WindowProc function. + /// + GETTITLEBARINFOEX = 0x033F, + HANDHELDFIRST = 0x0358, + HANDHELDLAST = 0x035F, + AFXFIRST = 0x0360, + AFXLAST = 0x037F, + PENWINFIRST = 0x0380, + PENWINLAST = 0x038F, + + /// + /// The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X is an integer value. + /// + APP = 0x8000, + + /// + /// The WM_USER constant is used by applications to help define private messages for use by private window classes, usually of the form WM_USER+X, where X is an integer value. + /// + USER = 0x0400, + + /// + /// An application sends the WM_CPL_LAUNCH message to Windows Control Panel to request that a Control Panel application be started. + /// + CPL_LAUNCH = USER + 0x1000, + + /// + /// The WM_CPL_LAUNCHED message is sent when a Control Panel application, started by the WM_CPL_LAUNCH message, has closed. The WM_CPL_LAUNCHED message is sent to the window identified by the wParam parameter of the WM_CPL_LAUNCH message that started the application. + /// + CPL_LAUNCHED = USER + 0x1001, + + /// + /// WM_SYSTIMER is a well-known yet still undocumented message. Windows uses WM_SYSTIMER for internal actions like scrolling. + /// + SYSTIMER = 0x118, + + /// + /// The accessibility state has changed. + /// + HSHELL_ACCESSIBILITYSTATE = 11, + + /// + /// The shell should activate its main window. + /// + HSHELL_ACTIVATESHELLWINDOW = 3, + + /// + /// The user completed an input event (for example, pressed an application command button on the mouse or an application command key on the keyboard), and the application did not handle the WM_APPCOMMAND message generated by that input. + /// If the Shell procedure handles the WM_COMMAND message, it should not call CallNextHookEx. See the Return Value section for more information. + /// + HSHELL_APPCOMMAND = 12, + + /// + /// A window is being minimized or maximized. The system needs the coordinates of the minimized rectangle for the window. + /// + HSHELL_GETMINRECT = 5, + + /// + /// Keyboard language was changed or a new keyboard layout was loaded. + /// + HSHELL_LANGUAGE = 8, + + /// + /// The title of a window in the task bar has been redrawn. + /// + HSHELL_REDRAW = 6, + + /// + /// The user has selected the task list. A shell application that provides a task list should return TRUE to prevent Windows from starting its task list. + /// + HSHELL_TASKMAN = 7, + + /// + /// A top-level, unowned window has been created. The window exists when the system calls this hook. + /// + HSHELL_WINDOWCREATED = 1, + + /// + /// A top-level, unowned window is about to be destroyed. The window still exists when the system calls this hook. + /// + HSHELL_WINDOWDESTROYED = 2, + + /// + /// The activation has changed to a different top-level, unowned window. + /// + HSHELL_WINDOWACTIVATED = 4, + + /// + /// A top-level window is being replaced. The window exists when the system calls this hook. + /// + HSHELL_WINDOWREPLACED = 13 + } +} diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index 4113610..8711d01 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -1,4 +1,5 @@ using DarkUI; +using System.Windows.Forms; namespace Example { @@ -8,6 +9,10 @@ namespace Example { InitializeComponent(); + // Add the control scroll message filter to re-route all mousewheel events + // to the control the user is currently hovering over with their cursor. + Application.AddMessageFilter(new ControlScrollFilter()); + // Build dummy list data for (var i = 0; i < 100; i++) { From b5a5815b201dafae88c2b2c5aae7123e7b803af6 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 16:55:13 +0100 Subject: [PATCH 22/97] Started DockPanel & fixed up example project --- DarkUI/DarkUI.csproj | 10 +- DarkUI/Docking/DarkDockContent.cs | 36 + DarkUI/Docking/DarkDockPanel.cs | 25 + ...llFilter.cs => DarkControlScrollFilter.cs} | 2 +- DarkUI/Win32/DarkDockResizeFilter.cs | 31 + Example/Example.csproj | 32 + Example/Forms/DialogAbout.Designer.cs | 146 ++++ Example/Forms/DialogAbout.cs | 20 + Example/Forms/DialogAbout.resx | 131 ++++ Example/Forms/DialogTest.Designer.cs | 211 +++++ Example/Forms/DialogTest.cs | 49 ++ Example/Forms/DialogTest.resx | 131 ++++ Example/Forms/MainForm.Designer.cs | 727 +++--------------- Example/Forms/MainForm.cs | 55 +- Example/Forms/MainForm.resx | 248 +----- Example/Icons.Designer.cs | 40 + Example/Icons.resx | 16 +- Example/Resources/Close_16xLG.png | Bin 0 -> 206 bytes Example/Resources/NewFile_6276.png | Bin 0 -> 270 bytes ...tusAnnotations_Information_16xLG_color.png | Bin 0 -> 338 bytes ...tusAnnotations_Information_16xMD_color.png | Bin 0 -> 325 bytes 21 files changed, 1038 insertions(+), 872 deletions(-) create mode 100644 DarkUI/Docking/DarkDockContent.cs create mode 100644 DarkUI/Docking/DarkDockPanel.cs rename DarkUI/Win32/{ControlScrollFilter.cs => DarkControlScrollFilter.cs} (92%) create mode 100644 DarkUI/Win32/DarkDockResizeFilter.cs create mode 100644 Example/Forms/DialogAbout.Designer.cs create mode 100644 Example/Forms/DialogAbout.cs create mode 100644 Example/Forms/DialogAbout.resx create mode 100644 Example/Forms/DialogTest.Designer.cs create mode 100644 Example/Forms/DialogTest.cs create mode 100644 Example/Forms/DialogTest.resx create mode 100644 Example/Resources/Close_16xLG.png create mode 100644 Example/Resources/NewFile_6276.png create mode 100644 Example/Resources/StatusAnnotations_Information_16xLG_color.png create mode 100644 Example/Resources/StatusAnnotations_Information_16xMD_color.png diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index 7f141eb..b964aae 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -88,6 +88,12 @@ + + UserControl + + + UserControl + Form @@ -124,10 +130,11 @@ True TreeViewIcons.resx - + + @@ -198,6 +205,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAECAAAAEAIAAuAQAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAAFz + UkdCAK7OHOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAw0lEQVQ4T92TsQ0C + MQxFswcNm8ECTMA07IF0oqHNDFAhKCKKJGXIOxx08VkgQceXfuP/v+X4fE4j57yOMQ4ppTIlNTSxzVHF + ZTX64XQvq/2lLHbnjtTQ8OCV2BMSDpvDdRbU3B5vNAldE7oiaHODrksTP4Z5F6NpE2ywNDJkHcux3vyJ + ZMgyvmmADZYGyf5Dg3dLbLC01xJ//oygjuKtK2zQ9e6QAGdZC8G6Rk3zlIE0+e5nmoJ3sZxqHLfcSA1N + bALnHokvo216mLOQAAAAAElFTkSuQmCC + + + \ No newline at end of file diff --git a/Example/Forms/DialogTest.Designer.cs b/Example/Forms/DialogTest.Designer.cs new file mode 100644 index 0000000..aceb1b1 --- /dev/null +++ b/Example/Forms/DialogTest.Designer.cs @@ -0,0 +1,211 @@ +namespace Example +{ + partial class DialogTest + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DialogTest)); + this.pnlMain = new System.Windows.Forms.Panel(); + this.tblMain = new System.Windows.Forms.TableLayoutPanel(); + this.pnlTreeView = new DarkUI.DarkSectionPanel(); + this.treeTest = new DarkUI.DarkTreeView(); + this.pnlListView = new DarkUI.DarkSectionPanel(); + this.lstTest = new DarkUI.DarkListView(); + this.pnlMessageBox = new DarkUI.DarkSectionPanel(); + this.panel1 = new System.Windows.Forms.Panel(); + this.btnMessageBox = new DarkUI.DarkButton(); + this.panel2 = new System.Windows.Forms.Panel(); + this.btnDialog = new DarkUI.DarkButton(); + this.pnlMain.SuspendLayout(); + this.tblMain.SuspendLayout(); + this.pnlTreeView.SuspendLayout(); + this.pnlListView.SuspendLayout(); + this.pnlMessageBox.SuspendLayout(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); + this.SuspendLayout(); + // + // pnlMain + // + this.pnlMain.Controls.Add(this.tblMain); + this.pnlMain.Dock = System.Windows.Forms.DockStyle.Fill; + this.pnlMain.Location = new System.Drawing.Point(0, 0); + this.pnlMain.Name = "pnlMain"; + this.pnlMain.Padding = new System.Windows.Forms.Padding(10, 15, 10, 5); + this.pnlMain.Size = new System.Drawing.Size(708, 410); + this.pnlMain.TabIndex = 2; + // + // tblMain + // + this.tblMain.ColumnCount = 3; + this.tblMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.tblMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.tblMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.tblMain.Controls.Add(this.pnlTreeView, 0, 0); + this.tblMain.Controls.Add(this.pnlListView, 0, 0); + this.tblMain.Controls.Add(this.pnlMessageBox, 0, 0); + this.tblMain.Dock = System.Windows.Forms.DockStyle.Fill; + this.tblMain.Location = new System.Drawing.Point(10, 15); + this.tblMain.Name = "tblMain"; + this.tblMain.RowCount = 1; + this.tblMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tblMain.Size = new System.Drawing.Size(688, 390); + this.tblMain.TabIndex = 0; + // + // pnlTreeView + // + this.pnlTreeView.Controls.Add(this.treeTest); + this.pnlTreeView.Dock = System.Windows.Forms.DockStyle.Fill; + this.pnlTreeView.Location = new System.Drawing.Point(463, 0); + this.pnlTreeView.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.pnlTreeView.Name = "pnlTreeView"; + this.pnlTreeView.SectionHeader = "Tree view test"; + this.pnlTreeView.Size = new System.Drawing.Size(220, 390); + this.pnlTreeView.TabIndex = 14; + // + // treeTest + // + this.treeTest.AllowMoveNodes = true; + this.treeTest.Dock = System.Windows.Forms.DockStyle.Fill; + this.treeTest.Location = new System.Drawing.Point(1, 25); + this.treeTest.MultiSelect = true; + this.treeTest.Name = "treeTest"; + this.treeTest.ShowIcons = true; + this.treeTest.Size = new System.Drawing.Size(218, 364); + this.treeTest.TabIndex = 0; + this.treeTest.Text = "darkTreeView1"; + // + // pnlListView + // + this.pnlListView.Controls.Add(this.lstTest); + this.pnlListView.Dock = System.Windows.Forms.DockStyle.Fill; + this.pnlListView.Location = new System.Drawing.Point(234, 0); + this.pnlListView.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.pnlListView.Name = "pnlListView"; + this.pnlListView.SectionHeader = "List view test"; + this.pnlListView.Size = new System.Drawing.Size(219, 390); + this.pnlListView.TabIndex = 13; + // + // lstTest + // + this.lstTest.Dock = System.Windows.Forms.DockStyle.Fill; + this.lstTest.Location = new System.Drawing.Point(1, 25); + this.lstTest.MultiSelect = true; + this.lstTest.Name = "lstTest"; + this.lstTest.Size = new System.Drawing.Size(217, 364); + this.lstTest.TabIndex = 7; + this.lstTest.Text = "darkListView1"; + // + // pnlMessageBox + // + this.pnlMessageBox.Controls.Add(this.panel1); + this.pnlMessageBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.pnlMessageBox.Location = new System.Drawing.Point(5, 0); + this.pnlMessageBox.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.pnlMessageBox.Name = "pnlMessageBox"; + this.pnlMessageBox.SectionHeader = "Section test"; + this.pnlMessageBox.Size = new System.Drawing.Size(219, 390); + this.pnlMessageBox.TabIndex = 12; + // + // panel1 + // + this.panel1.Controls.Add(this.btnMessageBox); + this.panel1.Controls.Add(this.panel2); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(1, 25); + this.panel1.Name = "panel1"; + this.panel1.Padding = new System.Windows.Forms.Padding(10); + this.panel1.Size = new System.Drawing.Size(217, 364); + this.panel1.TabIndex = 0; + // + // btnMessageBox + // + this.btnMessageBox.Dock = System.Windows.Forms.DockStyle.Top; + this.btnMessageBox.Location = new System.Drawing.Point(10, 50); + this.btnMessageBox.Name = "btnMessageBox"; + this.btnMessageBox.Padding = new System.Windows.Forms.Padding(5); + this.btnMessageBox.Size = new System.Drawing.Size(197, 30); + this.btnMessageBox.TabIndex = 6; + this.btnMessageBox.Text = "Message Box"; + // + // panel2 + // + this.panel2.Controls.Add(this.btnDialog); + this.panel2.Dock = System.Windows.Forms.DockStyle.Top; + this.panel2.Location = new System.Drawing.Point(10, 10); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(197, 40); + this.panel2.TabIndex = 5; + // + // btnDialog + // + this.btnDialog.Dock = System.Windows.Forms.DockStyle.Top; + this.btnDialog.Location = new System.Drawing.Point(0, 0); + this.btnDialog.Name = "btnDialog"; + this.btnDialog.Padding = new System.Windows.Forms.Padding(5); + this.btnDialog.Size = new System.Drawing.Size(197, 30); + this.btnDialog.TabIndex = 4; + this.btnDialog.Text = "Dialog"; + // + // DialogTest + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(708, 455); + this.Controls.Add(this.pnlMain); + this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "DialogTest"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Test dialog please ignore"; + this.Controls.SetChildIndex(this.pnlMain, 0); + this.pnlMain.ResumeLayout(false); + this.tblMain.ResumeLayout(false); + this.pnlTreeView.ResumeLayout(false); + this.pnlListView.ResumeLayout(false); + this.pnlMessageBox.ResumeLayout(false); + this.panel1.ResumeLayout(false); + this.panel2.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel pnlMain; + private System.Windows.Forms.TableLayoutPanel tblMain; + private DarkUI.DarkSectionPanel pnlTreeView; + private DarkUI.DarkTreeView treeTest; + private DarkUI.DarkSectionPanel pnlListView; + private DarkUI.DarkListView lstTest; + private DarkUI.DarkSectionPanel pnlMessageBox; + private System.Windows.Forms.Panel panel1; + private DarkUI.DarkButton btnMessageBox; + private System.Windows.Forms.Panel panel2; + private DarkUI.DarkButton btnDialog; + } +} \ No newline at end of file diff --git a/Example/Forms/DialogTest.cs b/Example/Forms/DialogTest.cs new file mode 100644 index 0000000..b0a74d4 --- /dev/null +++ b/Example/Forms/DialogTest.cs @@ -0,0 +1,49 @@ +using DarkUI; + +namespace Example +{ + public partial class DialogTest : DarkDialog + { + public DialogTest() + { + InitializeComponent(); + + // Build dummy list data + for (var i = 0; i < 100; i++) + { + var item = new DarkListItem(string.Format("List item #{0}", i)); + lstTest.Items.Add(item); + } + + // Build dummy nodes + var childCount = 0; + for (var i = 0; i < 20; i++) + { + var node = new DarkTreeNode(string.Format("Root node #{0}", i)); + node.ExpandedIcon = Icons.folder_open; + node.Icon = Icons.folder_closed; + + for (var x = 0; x < 10; x++) + { + var childNode = new DarkTreeNode(string.Format("Child node #{0}", childCount)); + childNode.Icon = Icons.files; + childCount++; + node.Nodes.Add(childNode); + } + + treeTest.Nodes.Add(node); + } + + // Hook dialog button events + btnDialog.Click += delegate + { + DarkMessageBox.ShowError("This is an error", "Dark UI - Example"); + }; + + btnMessageBox.Click += delegate + { + DarkMessageBox.ShowInformation("This is some information, except it is much bigger, so there we go. I wonder how this is going to go. I hope it resizes properly. It probably will.", "Dark UI - Example"); + }; + } + } +} diff --git a/Example/Forms/DialogTest.resx b/Example/Forms/DialogTest.resx new file mode 100644 index 0000000..16202c3 --- /dev/null +++ b/Example/Forms/DialogTest.resx @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAECAAAAEAIAA8AQAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAAFz + UkdCAK7OHOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAA0UlEQVQ4T7WRsQ2D + MBREGSUjZAZ6D0CXUaiYwj1bsAKDUNAYKB0/8j9xsB0pkTjpJPO5O5/t6lIsy9Ku6zoHeuHMbNu2m0jK + COJxGAbfNI2v63qntXYPCQGPryHsglmNsOu6w6xNRJ4CQbzz2axNRJ5imqbs7pA1s7D2Ik9xDtAQNcNi + gHPuzk9jzEdATI5HG7G8IeajZolccHKJJXPchJ0xB90othd405yZ7zCPmX8+hn3f58wzzURWBgG87V9m + oEegBfzJrCCEJpC1jK9GVT0B8ztfSZzDuHAAAAAASUVORK5CYII= + + + \ No newline at end of file diff --git a/Example/Forms/MainForm.Designer.cs b/Example/Forms/MainForm.Designer.cs index 05b8134..312e955 100644 --- a/Example/Forms/MainForm.Designer.cs +++ b/Example/Forms/MainForm.Designer.cs @@ -30,71 +30,26 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.mnuMain = new DarkUI.DarkMenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); - this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); - this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.customizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.contentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.indexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); - this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuFile = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuView = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuDialog = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuTools = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuHelp = new System.Windows.Forms.ToolStripMenuItem(); this.toolMain = new DarkUI.DarkToolStrip(); - this.newToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.openToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.saveToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.printToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); - this.cutToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.copyToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.pasteToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); - this.helpToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.darkStatusStrip1 = new DarkUI.DarkStatusStrip(); + this.stripMain = new DarkUI.DarkStatusStrip(); this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); - this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel(); - this.toolStripStatusLabel3 = new System.Windows.Forms.ToolStripStatusLabel(); - this.toolStripStatusLabel4 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel6 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel5 = new System.Windows.Forms.ToolStripStatusLabel(); - this.darkSectionPanel1 = new DarkUI.DarkSectionPanel(); - this.btnDialog = new DarkUI.DarkButton(); - this.btnMessageBox = new DarkUI.DarkButton(); - this.darkContextMenu1 = new DarkUI.DarkContextMenu(); - this.testToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.moreTestToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.test3ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.darkSectionPanel2 = new DarkUI.DarkSectionPanel(); - this.darkListView1 = new DarkUI.DarkListView(); - this.darkSectionPanel3 = new DarkUI.DarkSectionPanel(); - this.darkTreeView1 = new DarkUI.DarkTreeView(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.DockPanel = new DarkUI.DarkDockPanel(); + this.btnNewFile = new System.Windows.Forms.ToolStripButton(); + this.mnuNewFile = new System.Windows.Forms.ToolStripMenuItem(); + this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuAbout = new System.Windows.Forms.ToolStripMenuItem(); this.mnuMain.SuspendLayout(); this.toolMain.SuspendLayout(); - this.darkStatusStrip1.SuspendLayout(); - this.darkSectionPanel1.SuspendLayout(); - this.darkContextMenu1.SuspendLayout(); - this.darkSectionPanel2.SuspendLayout(); - this.darkSectionPanel3.SuspendLayout(); + this.stripMain.SuspendLayout(); this.SuspendLayout(); // // mnuMain @@ -102,10 +57,11 @@ this.mnuMain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); this.mnuMain.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); this.mnuMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.editToolStripMenuItem, - this.toolsToolStripMenuItem, - this.helpToolStripMenuItem}); + this.mnuFile, + this.mnuView, + this.mnuTools, + this.mnuWindow, + this.mnuHelp}); this.mnuMain.Location = new System.Drawing.Point(0, 0); this.mnuMain.Name = "mnuMain"; this.mnuMain.Padding = new System.Windows.Forms.Padding(3, 2, 0, 2); @@ -113,250 +69,55 @@ this.mnuMain.TabIndex = 0; this.mnuMain.Text = "darkMenuStrip1"; // - // fileToolStripMenuItem + // mnuFile // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newToolStripMenuItem, - this.openToolStripMenuItem, - this.toolStripSeparator, - this.saveToolStripMenuItem, - this.saveAsToolStripMenuItem, + this.mnuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mnuNewFile, this.toolStripSeparator1, - this.printToolStripMenuItem, - this.printPreviewToolStripMenuItem, - this.toolStripSeparator2, - this.exitToolStripMenuItem}); - this.fileToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); - this.fileToolStripMenuItem.Text = "&File"; + this.closeToolStripMenuItem}); + this.mnuFile.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuFile.Name = "mnuFile"; + this.mnuFile.Size = new System.Drawing.Size(37, 20); + this.mnuFile.Text = "&File"; // - // newToolStripMenuItem + // mnuView // - this.newToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.newToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripMenuItem.Image"))); - this.newToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); - this.newToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.newToolStripMenuItem.Text = "&New"; + this.mnuView.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mnuDialog}); + this.mnuView.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuView.Name = "mnuView"; + this.mnuView.Size = new System.Drawing.Size(44, 20); + this.mnuView.Text = "&View"; // - // openToolStripMenuItem + // mnuDialog // - this.openToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image"))); - this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); - this.openToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.openToolStripMenuItem.Text = "&Open"; + this.mnuDialog.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuDialog.Name = "mnuDialog"; + this.mnuDialog.Size = new System.Drawing.Size(152, 22); + this.mnuDialog.Text = "&Dialog test"; // - // toolStripSeparator + // mnuTools // - this.toolStripSeparator.Name = "toolStripSeparator"; - this.toolStripSeparator.Size = new System.Drawing.Size(143, 6); + this.mnuTools.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuTools.Name = "mnuTools"; + this.mnuTools.Size = new System.Drawing.Size(48, 20); + this.mnuTools.Text = "&Tools"; // - // saveToolStripMenuItem + // mnuWindow // - this.saveToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image"))); - this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.saveToolStripMenuItem.Text = "&Save"; + this.mnuWindow.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuWindow.Name = "mnuWindow"; + this.mnuWindow.Size = new System.Drawing.Size(63, 20); + this.mnuWindow.Text = "&Window"; // - // saveAsToolStripMenuItem + // mnuHelp // - this.saveAsToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.saveAsToolStripMenuItem.Text = "Save &As"; - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(143, 6); - // - // printToolStripMenuItem - // - this.printToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.printToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printToolStripMenuItem.Image"))); - this.printToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.printToolStripMenuItem.Name = "printToolStripMenuItem"; - this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); - this.printToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.printToolStripMenuItem.Text = "&Print"; - // - // printPreviewToolStripMenuItem - // - this.printPreviewToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.printPreviewToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printPreviewToolStripMenuItem.Image"))); - this.printPreviewToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem"; - this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.printPreviewToolStripMenuItem.Text = "Print Pre&view"; - // - // toolStripSeparator2 - // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(143, 6); - // - // exitToolStripMenuItem - // - this.exitToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.exitToolStripMenuItem.Text = "E&xit"; - // - // editToolStripMenuItem - // - this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.undoToolStripMenuItem, - this.redoToolStripMenuItem, - this.toolStripSeparator3, - this.cutToolStripMenuItem, - this.copyToolStripMenuItem, - this.pasteToolStripMenuItem, - this.toolStripSeparator4, - this.selectAllToolStripMenuItem}); - this.editToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.editToolStripMenuItem.Name = "editToolStripMenuItem"; - this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); - this.editToolStripMenuItem.Text = "&Edit"; - // - // undoToolStripMenuItem - // - this.undoToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.undoToolStripMenuItem.Name = "undoToolStripMenuItem"; - this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); - this.undoToolStripMenuItem.Size = new System.Drawing.Size(144, 22); - this.undoToolStripMenuItem.Text = "&Undo"; - // - // redoToolStripMenuItem - // - this.redoToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.redoToolStripMenuItem.Name = "redoToolStripMenuItem"; - this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y))); - this.redoToolStripMenuItem.Size = new System.Drawing.Size(144, 22); - this.redoToolStripMenuItem.Text = "&Redo"; - // - // toolStripSeparator3 - // - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(141, 6); - // - // cutToolStripMenuItem - // - this.cutToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.cutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripMenuItem.Image"))); - this.cutToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.cutToolStripMenuItem.Name = "cutToolStripMenuItem"; - this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); - this.cutToolStripMenuItem.Size = new System.Drawing.Size(144, 22); - this.cutToolStripMenuItem.Text = "Cu&t"; - // - // copyToolStripMenuItem - // - this.copyToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.copyToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripMenuItem.Image"))); - this.copyToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; - this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); - this.copyToolStripMenuItem.Size = new System.Drawing.Size(144, 22); - this.copyToolStripMenuItem.Text = "&Copy"; - // - // pasteToolStripMenuItem - // - this.pasteToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.pasteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("pasteToolStripMenuItem.Image"))); - this.pasteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; - this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); - this.pasteToolStripMenuItem.Size = new System.Drawing.Size(144, 22); - this.pasteToolStripMenuItem.Text = "&Paste"; - // - // toolStripSeparator4 - // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(141, 6); - // - // selectAllToolStripMenuItem - // - this.selectAllToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; - this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(144, 22); - this.selectAllToolStripMenuItem.Text = "Select &All"; - // - // toolsToolStripMenuItem - // - this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.customizeToolStripMenuItem, - this.optionsToolStripMenuItem}); - this.toolsToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; - this.toolsToolStripMenuItem.Size = new System.Drawing.Size(48, 20); - this.toolsToolStripMenuItem.Text = "&Tools"; - // - // customizeToolStripMenuItem - // - this.customizeToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.customizeToolStripMenuItem.Name = "customizeToolStripMenuItem"; - this.customizeToolStripMenuItem.Size = new System.Drawing.Size(130, 22); - this.customizeToolStripMenuItem.Text = "&Customize"; - // - // optionsToolStripMenuItem - // - this.optionsToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; - this.optionsToolStripMenuItem.Size = new System.Drawing.Size(130, 22); - this.optionsToolStripMenuItem.Text = "&Options"; - // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.contentsToolStripMenuItem, - this.indexToolStripMenuItem, - this.searchToolStripMenuItem, - this.toolStripSeparator5, - this.aboutToolStripMenuItem}); - this.helpToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); - this.helpToolStripMenuItem.Text = "&Help"; - // - // contentsToolStripMenuItem - // - this.contentsToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.contentsToolStripMenuItem.Name = "contentsToolStripMenuItem"; - this.contentsToolStripMenuItem.Size = new System.Drawing.Size(122, 22); - this.contentsToolStripMenuItem.Text = "&Contents"; - // - // indexToolStripMenuItem - // - this.indexToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.indexToolStripMenuItem.Name = "indexToolStripMenuItem"; - this.indexToolStripMenuItem.Size = new System.Drawing.Size(122, 22); - this.indexToolStripMenuItem.Text = "&Index"; - // - // searchToolStripMenuItem - // - this.searchToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.searchToolStripMenuItem.Name = "searchToolStripMenuItem"; - this.searchToolStripMenuItem.Size = new System.Drawing.Size(122, 22); - this.searchToolStripMenuItem.Text = "&Search"; - // - // toolStripSeparator5 - // - this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(119, 6); - // - // aboutToolStripMenuItem - // - this.aboutToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(122, 22); - this.aboutToolStripMenuItem.Text = "&About..."; + this.mnuHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mnuAbout}); + this.mnuHelp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuHelp.Name = "mnuHelp"; + this.mnuHelp.Size = new System.Drawing.Size(44, 20); + this.mnuHelp.Text = "&Help"; // // toolMain // @@ -365,16 +126,7 @@ this.toolMain.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); this.toolMain.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.toolMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newToolStripButton, - this.openToolStripButton, - this.saveToolStripButton, - this.printToolStripButton, - this.toolStripSeparator6, - this.cutToolStripButton, - this.copyToolStripButton, - this.pasteToolStripButton, - this.toolStripSeparator7, - this.helpToolStripButton}); + this.btnNewFile}); this.toolMain.Location = new System.Drawing.Point(0, 24); this.toolMain.Name = "toolMain"; this.toolMain.Padding = new System.Windows.Forms.Padding(5, 0, 1, 0); @@ -382,127 +134,22 @@ this.toolMain.TabIndex = 1; this.toolMain.Text = "darkToolStrip1"; // - // newToolStripButton + // stripMain // - this.newToolStripButton.AutoSize = false; - this.newToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.newToolStripButton.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.newToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripButton.Image"))); - this.newToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.newToolStripButton.Name = "newToolStripButton"; - this.newToolStripButton.Size = new System.Drawing.Size(24, 24); - this.newToolStripButton.Text = "&New"; - // - // openToolStripButton - // - this.openToolStripButton.AutoSize = false; - this.openToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.openToolStripButton.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.openToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripButton.Image"))); - this.openToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.openToolStripButton.Name = "openToolStripButton"; - this.openToolStripButton.Size = new System.Drawing.Size(24, 24); - this.openToolStripButton.Text = "&Open"; - // - // saveToolStripButton - // - this.saveToolStripButton.AutoSize = false; - this.saveToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.saveToolStripButton.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.saveToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripButton.Image"))); - this.saveToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.saveToolStripButton.Name = "saveToolStripButton"; - this.saveToolStripButton.Size = new System.Drawing.Size(24, 24); - this.saveToolStripButton.Text = "&Save"; - // - // printToolStripButton - // - this.printToolStripButton.AutoSize = false; - this.printToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.printToolStripButton.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.printToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("printToolStripButton.Image"))); - this.printToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.printToolStripButton.Name = "printToolStripButton"; - this.printToolStripButton.Size = new System.Drawing.Size(24, 24); - this.printToolStripButton.Text = "&Print"; - // - // toolStripSeparator6 - // - this.toolStripSeparator6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.toolStripSeparator6.Margin = new System.Windows.Forms.Padding(0, 0, 2, 0); - this.toolStripSeparator6.Name = "toolStripSeparator6"; - this.toolStripSeparator6.Size = new System.Drawing.Size(6, 28); - // - // cutToolStripButton - // - this.cutToolStripButton.AutoSize = false; - this.cutToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.cutToolStripButton.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.cutToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripButton.Image"))); - this.cutToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.cutToolStripButton.Name = "cutToolStripButton"; - this.cutToolStripButton.Size = new System.Drawing.Size(24, 24); - this.cutToolStripButton.Text = "C&ut"; - // - // copyToolStripButton - // - this.copyToolStripButton.AutoSize = false; - this.copyToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.copyToolStripButton.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.copyToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripButton.Image"))); - this.copyToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.copyToolStripButton.Name = "copyToolStripButton"; - this.copyToolStripButton.Size = new System.Drawing.Size(24, 24); - this.copyToolStripButton.Text = "&Copy"; - // - // pasteToolStripButton - // - this.pasteToolStripButton.AutoSize = false; - this.pasteToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.pasteToolStripButton.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.pasteToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("pasteToolStripButton.Image"))); - this.pasteToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.pasteToolStripButton.Name = "pasteToolStripButton"; - this.pasteToolStripButton.Size = new System.Drawing.Size(24, 24); - this.pasteToolStripButton.Text = "&Paste"; - // - // toolStripSeparator7 - // - this.toolStripSeparator7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.toolStripSeparator7.Margin = new System.Windows.Forms.Padding(0, 0, 2, 0); - this.toolStripSeparator7.Name = "toolStripSeparator7"; - this.toolStripSeparator7.Size = new System.Drawing.Size(6, 28); - // - // helpToolStripButton - // - this.helpToolStripButton.AutoSize = false; - this.helpToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.helpToolStripButton.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.helpToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("helpToolStripButton.Image"))); - this.helpToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.helpToolStripButton.Name = "helpToolStripButton"; - this.helpToolStripButton.Size = new System.Drawing.Size(24, 24); - this.helpToolStripButton.Text = "He&lp"; - // - // darkStatusStrip1 - // - this.darkStatusStrip1.AutoSize = false; - this.darkStatusStrip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); - this.darkStatusStrip1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.darkStatusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.stripMain.AutoSize = false; + this.stripMain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); + this.stripMain.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.stripMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripStatusLabel1, - this.toolStripStatusLabel2, - this.toolStripStatusLabel3, - this.toolStripStatusLabel4, this.toolStripStatusLabel6, this.toolStripStatusLabel5}); - this.darkStatusStrip1.Location = new System.Drawing.Point(0, 538); - this.darkStatusStrip1.Name = "darkStatusStrip1"; - this.darkStatusStrip1.Padding = new System.Windows.Forms.Padding(0, 5, 0, 3); - this.darkStatusStrip1.Size = new System.Drawing.Size(784, 24); - this.darkStatusStrip1.SizingGrip = false; - this.darkStatusStrip1.TabIndex = 2; - this.darkStatusStrip1.Text = "darkStatusStrip1"; + this.stripMain.Location = new System.Drawing.Point(0, 538); + this.stripMain.Name = "stripMain"; + this.stripMain.Padding = new System.Windows.Forms.Padding(0, 5, 0, 3); + this.stripMain.Size = new System.Drawing.Size(784, 24); + this.stripMain.SizingGrip = false; + this.stripMain.TabIndex = 2; + this.stripMain.Text = "darkStatusStrip1"; // // toolStripStatusLabel1 // @@ -513,35 +160,11 @@ this.toolStripStatusLabel1.Text = "Ready"; this.toolStripStatusLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // toolStripStatusLabel2 - // - this.toolStripStatusLabel2.Margin = new System.Windows.Forms.Padding(0, 0, 50, 0); - this.toolStripStatusLabel2.Name = "toolStripStatusLabel2"; - this.toolStripStatusLabel2.Size = new System.Drawing.Size(25, 16); - this.toolStripStatusLabel2.Text = "0, 0"; - this.toolStripStatusLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // toolStripStatusLabel3 - // - this.toolStripStatusLabel3.Margin = new System.Windows.Forms.Padding(0, 0, 50, 0); - this.toolStripStatusLabel3.Name = "toolStripStatusLabel3"; - this.toolStripStatusLabel3.Size = new System.Drawing.Size(49, 16); - this.toolStripStatusLabel3.Text = "150, 200"; - this.toolStripStatusLabel3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // toolStripStatusLabel4 - // - this.toolStripStatusLabel4.Margin = new System.Windows.Forms.Padding(0, 0, 50, 0); - this.toolStripStatusLabel4.Name = "toolStripStatusLabel4"; - this.toolStripStatusLabel4.Size = new System.Drawing.Size(112, 16); - this.toolStripStatusLabel4.Text = "Active layer: Default"; - this.toolStripStatusLabel4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // // toolStripStatusLabel6 // this.toolStripStatusLabel6.Margin = new System.Windows.Forms.Padding(0, 0, 50, 2); this.toolStripStatusLabel6.Name = "toolStripStatusLabel6"; - this.toolStripStatusLabel6.Size = new System.Drawing.Size(261, 14); + this.toolStripStatusLabel6.Size = new System.Drawing.Size(597, 14); this.toolStripStatusLabel6.Spring = true; this.toolStripStatusLabel6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // @@ -553,119 +176,68 @@ this.toolStripStatusLabel5.Text = "120 MB"; this.toolStripStatusLabel5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // darkSectionPanel1 + // toolStripSeparator1 // - this.darkSectionPanel1.Controls.Add(this.btnDialog); - this.darkSectionPanel1.Controls.Add(this.btnMessageBox); - this.darkSectionPanel1.Location = new System.Drawing.Point(12, 69); - this.darkSectionPanel1.Name = "darkSectionPanel1"; - this.darkSectionPanel1.SectionHeader = "Section test"; - this.darkSectionPanel1.Size = new System.Drawing.Size(221, 224); - this.darkSectionPanel1.TabIndex = 5; + this.toolStripSeparator1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.toolStripSeparator1.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1); + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6); // - // btnDialog + // DockPanel // - this.btnDialog.Location = new System.Drawing.Point(10, 71); - this.btnDialog.Name = "btnDialog"; - this.btnDialog.Padding = new System.Windows.Forms.Padding(5); - this.btnDialog.Size = new System.Drawing.Size(97, 30); - this.btnDialog.TabIndex = 6; - this.btnDialog.Text = "Dialog"; + this.DockPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); + this.DockPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.DockPanel.Location = new System.Drawing.Point(0, 52); + this.DockPanel.Name = "DockPanel"; + this.DockPanel.Size = new System.Drawing.Size(784, 486); + this.DockPanel.TabIndex = 3; // - // btnMessageBox + // btnNewFile // - this.btnMessageBox.ContextMenuStrip = this.darkContextMenu1; - this.btnMessageBox.Location = new System.Drawing.Point(10, 35); - this.btnMessageBox.Name = "btnMessageBox"; - this.btnMessageBox.Padding = new System.Windows.Forms.Padding(5); - this.btnMessageBox.Size = new System.Drawing.Size(97, 30); - this.btnMessageBox.TabIndex = 5; - this.btnMessageBox.Text = "Message Box"; + this.btnNewFile.AutoSize = false; + this.btnNewFile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.btnNewFile.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.btnNewFile.Image = global::Example.Icons.NewFile_6276; + this.btnNewFile.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnNewFile.Name = "btnNewFile"; + this.btnNewFile.Size = new System.Drawing.Size(24, 24); + this.btnNewFile.Text = "New file"; // - // darkContextMenu1 + // mnuNewFile // - this.darkContextMenu1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); - this.darkContextMenu1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.darkContextMenu1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.testToolStripMenuItem, - this.moreTestToolStripMenuItem, - this.test3ToolStripMenuItem}); - this.darkContextMenu1.Name = "darkContextMenu1"; - this.darkContextMenu1.Size = new System.Drawing.Size(125, 70); + this.mnuNewFile.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuNewFile.Image = global::Example.Icons.NewFile_6276; + this.mnuNewFile.Name = "mnuNewFile"; + this.mnuNewFile.Size = new System.Drawing.Size(152, 22); + this.mnuNewFile.Text = "&New file"; // - // testToolStripMenuItem + // closeToolStripMenuItem // - this.testToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.testToolStripMenuItem.Name = "testToolStripMenuItem"; - this.testToolStripMenuItem.Size = new System.Drawing.Size(124, 22); - this.testToolStripMenuItem.Text = "Test"; + this.closeToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.closeToolStripMenuItem.Image = global::Example.Icons.Close_16xLG; + this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; + this.closeToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.closeToolStripMenuItem.Text = "&Close"; // - // moreTestToolStripMenuItem + // mnuAbout // - this.moreTestToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.moreTestToolStripMenuItem.Name = "moreTestToolStripMenuItem"; - this.moreTestToolStripMenuItem.Size = new System.Drawing.Size(124, 22); - this.moreTestToolStripMenuItem.Text = "More test"; - // - // test3ToolStripMenuItem - // - this.test3ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.test3ToolStripMenuItem.Name = "test3ToolStripMenuItem"; - this.test3ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); - this.test3ToolStripMenuItem.Text = "Test 3"; - // - // darkSectionPanel2 - // - this.darkSectionPanel2.Controls.Add(this.darkListView1); - this.darkSectionPanel2.Location = new System.Drawing.Point(239, 69); - this.darkSectionPanel2.Name = "darkSectionPanel2"; - this.darkSectionPanel2.SectionHeader = "List view test"; - this.darkSectionPanel2.Size = new System.Drawing.Size(221, 224); - this.darkSectionPanel2.TabIndex = 7; - // - // darkListView1 - // - this.darkListView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.darkListView1.Location = new System.Drawing.Point(1, 25); - this.darkListView1.MultiSelect = true; - this.darkListView1.Name = "darkListView1"; - this.darkListView1.Size = new System.Drawing.Size(219, 198); - this.darkListView1.TabIndex = 7; - this.darkListView1.Text = "darkListView1"; - // - // darkSectionPanel3 - // - this.darkSectionPanel3.Controls.Add(this.darkTreeView1); - this.darkSectionPanel3.Location = new System.Drawing.Point(466, 69); - this.darkSectionPanel3.Name = "darkSectionPanel3"; - this.darkSectionPanel3.SectionHeader = "Tree view test"; - this.darkSectionPanel3.Size = new System.Drawing.Size(221, 224); - this.darkSectionPanel3.TabIndex = 8; - // - // darkTreeView1 - // - this.darkTreeView1.AllowMoveNodes = true; - this.darkTreeView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.darkTreeView1.Location = new System.Drawing.Point(1, 25); - this.darkTreeView1.MultiSelect = true; - this.darkTreeView1.Name = "darkTreeView1"; - this.darkTreeView1.ShowIcons = true; - this.darkTreeView1.Size = new System.Drawing.Size(219, 198); - this.darkTreeView1.TabIndex = 0; - this.darkTreeView1.Text = "darkTreeView1"; + this.mnuAbout.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuAbout.Image = global::Example.Icons.StatusAnnotations_Information_16xLG_color; + this.mnuAbout.Name = "mnuAbout"; + this.mnuAbout.Size = new System.Drawing.Size(152, 22); + this.mnuAbout.Text = "&About DarkUI"; // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(784, 562); - this.Controls.Add(this.darkSectionPanel3); - this.Controls.Add(this.darkSectionPanel2); - this.Controls.Add(this.darkSectionPanel1); - this.Controls.Add(this.darkStatusStrip1); + this.Controls.Add(this.DockPanel); + this.Controls.Add(this.stripMain); this.Controls.Add(this.toolMain); this.Controls.Add(this.mnuMain); this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.mnuMain; this.MinimumSize = new System.Drawing.Size(640, 480); this.Name = "MainForm"; @@ -675,12 +247,8 @@ this.mnuMain.PerformLayout(); this.toolMain.ResumeLayout(false); this.toolMain.PerformLayout(); - this.darkStatusStrip1.ResumeLayout(false); - this.darkStatusStrip1.PerformLayout(); - this.darkSectionPanel1.ResumeLayout(false); - this.darkContextMenu1.ResumeLayout(false); - this.darkSectionPanel2.ResumeLayout(false); - this.darkSectionPanel3.ResumeLayout(false); + this.stripMain.ResumeLayout(false); + this.stripMain.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -689,64 +257,23 @@ #endregion private DarkUI.DarkMenuStrip mnuMain; - private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator; - private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripMenuItem printToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem printPreviewToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; - private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; - private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; - private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem customizeToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem contentsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem indexToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; - private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; private DarkUI.DarkToolStrip toolMain; - private System.Windows.Forms.ToolStripButton newToolStripButton; - private System.Windows.Forms.ToolStripButton openToolStripButton; - private System.Windows.Forms.ToolStripButton saveToolStripButton; - private System.Windows.Forms.ToolStripButton printToolStripButton; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; - private System.Windows.Forms.ToolStripButton cutToolStripButton; - private System.Windows.Forms.ToolStripButton copyToolStripButton; - private System.Windows.Forms.ToolStripButton pasteToolStripButton; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; - private System.Windows.Forms.ToolStripButton helpToolStripButton; - private DarkUI.DarkStatusStrip darkStatusStrip1; + private DarkUI.DarkStatusStrip stripMain; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel3; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel4; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel6; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel5; - private DarkUI.DarkSectionPanel darkSectionPanel1; - private DarkUI.DarkButton btnMessageBox; - private DarkUI.DarkContextMenu darkContextMenu1; - private System.Windows.Forms.ToolStripMenuItem testToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem moreTestToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem test3ToolStripMenuItem; - private DarkUI.DarkSectionPanel darkSectionPanel2; - private DarkUI.DarkListView darkListView1; - private DarkUI.DarkButton btnDialog; - private DarkUI.DarkSectionPanel darkSectionPanel3; - private DarkUI.DarkTreeView darkTreeView1; + private System.Windows.Forms.ToolStripMenuItem mnuFile; + private System.Windows.Forms.ToolStripMenuItem mnuView; + private System.Windows.Forms.ToolStripMenuItem mnuDialog; + private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mnuTools; + private System.Windows.Forms.ToolStripMenuItem mnuWindow; + private System.Windows.Forms.ToolStripMenuItem mnuHelp; + private System.Windows.Forms.ToolStripMenuItem mnuAbout; + private System.Windows.Forms.ToolStripButton btnNewFile; + private System.Windows.Forms.ToolStripMenuItem mnuNewFile; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private DarkUI.DarkDockPanel DockPanel; } } diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index 8711d01..8bee97e 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -5,6 +5,8 @@ namespace Example { public partial class MainForm : DarkForm { + #region Constructor Region + public MainForm() { InitializeComponent(); @@ -13,42 +15,33 @@ namespace Example // to the control the user is currently hovering over with their cursor. Application.AddMessageFilter(new ControlScrollFilter()); - // Build dummy list data - for (var i = 0; i < 100; i++) + // Add the dock panel message filter to filter through for dock panel splitter + // input before letting events pass through to the rest of the application. + Application.AddMessageFilter(DockPanel.MessageFilter); + + // Hook in all the UI events manually for clarity. + HookEvents(); + } + + #endregion + + #region Method Region + + private void HookEvents() + { + mnuDialog.Click += delegate { - var item = new DarkListItem(string.Format("List item #{0}", i)); - darkListView1.Items.Add(item); - } - - // Build dummy nodes - var childCount = 0; - for (var i = 0; i < 20; i++) - { - var node = new DarkTreeNode(string.Format("Root node #{0}", i)); - node.ExpandedIcon = Icons.folder_open; - node.Icon = Icons.folder_closed; - - for (var x = 0; x < 10; x++) - { - var childNode = new DarkTreeNode(string.Format("Child node #{0}", childCount)); - childNode.Icon = Icons.files; - childCount++; - node.Nodes.Add(childNode); - } - - darkTreeView1.Nodes.Add(node); - } - - // Hook dialog button events - btnDialog.Click += delegate - { - DarkMessageBox.ShowError("This is an error", "Dark UI - Example"); + var test = new DialogTest(); + test.ShowDialog(); }; - btnMessageBox.Click += delegate + mnuAbout.Click += delegate { - DarkMessageBox.ShowInformation("This is some information, except it is much bigger, so there we go. I wonder how this is going to go. I hope it resizes properly. It probably will.", "Dark UI - Example"); + var about = new DialogAbout(); + about.ShowDialog(); }; } + + #endregion } } diff --git a/Example/Forms/MainForm.resx b/Example/Forms/MainForm.resx index 9271f3a..c15ccc5 100644 --- a/Example/Forms/MainForm.resx +++ b/Example/Forms/MainForm.resx @@ -120,244 +120,18 @@ 17, 17 - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAERSURBVDhPrZDbSgJRGIXnpewd6jXsjSQvIrwoI0RQMChU - 0iiDPCGiE3ZCRkvR8VzTeBhnyR5/ccaZNnPhB4t9sdf6Ln5hb8QeathNJFVFKF5C8DqL4ksDVHWGDf7j - LHyPg6NjviSaFqlu5yQYR+KpupaIkrMknCxT3Y7v/NYYb0ITK1c3BarbWWhLQ7IR0cTKReyZ6lZ0XYei - ztHpK4bAc+h1FgQijzSxMptrGIxVSO0xX3AaStFki7bUMVFmaMm/eJMGfIH/MkGzLep0AXn4h/r3CJV3 - mS9gn2bY4UY/UzQ7E9TqfeTFtnuB+XAfzSHKr11kSl/uBebDiZ89ZCst3OUkdwL28sIVsE83ock+EIQV - 2Mz2wxeg6/UAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJHSURBVDhPxZBdSNNhFMb/F110ZZEVhVBgeeHNICiiuggp - olAUyyxI0oSaH1QYC3N+tKnp5ubm1JUua5uuqdNKMwr7kApFItTUkWZqVhSVYmao5Nevvy7UoYR3HXh4 - 4XCe33nOKyy3lAY7l9RWMo0O/raWXxEyo5spVYTNvOGyfIRPfW+ptOkXqaPl6T83hcRmExSdgzAz3NVm - YWyoYla/B+1M9JtxWLPpaH22J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VksD+7XyPctrJdx4p5s605M5gKz8lJPSDwtGFbKboJ1blAN52vKb - PdXm80/AfDokTVu+8DfPXv9XCcIPTvjvLQ8YoakAAAAASUVORK5CYII= - - - 156, 17 + 121, 17 - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAERSURBVDhPrZDbSgJRGIXnpewd6jXsjSQvIrwoI0RQMChU - 0iiDPCGiE3ZCRkvR8VzTeBhnyR5/ccaZNnPhB4t9sdf6Ln5hb8QeathNJFVFKF5C8DqL4ksDVHWGDf7j - LHyPg6NjviSaFqlu5yQYR+KpupaIkrMknCxT3Y7v/NYYb0ITK1c3BarbWWhLQ7IR0cTKReyZ6lZ0XYei - ztHpK4bAc+h1FgQijzSxMptrGIxVSO0xX3AaStFki7bUMVFmaMm/eJMGfIH/MkGzLep0AXn4h/r3CJV3 - mS9gn2bY4UY/UzQ7E9TqfeTFtnuB+XAfzSHKr11kSl/uBebDiZ89ZCst3OUkdwL28sIVsE83ock+EIQV - 2Mz2wxeg6/UAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJHSURBVDhPxZBdSNNhFMb/F110ZZEVhVBgeeHNICiiuggp - olAUyyxI0oSaH1QYC3N+tKnp5ubm1JUua5uuqdNKMwr7kApFItTUkWZqVhSVYmao5Nevvy7UoYR3HXh4 - 4XCe33nOKyy3lAY7l9RWMo0O/raWXxEyo5spVYTNvOGyfIRPfW+ptOkXqaPl6T83hcRmExSdgzAz3NVm - YWyoYla/B+1M9JtxWLPpaH22JORIjI6gKAMB0jyEimIdo4OlbuaprwVMOOMovammpDADc34qppwUrmnl - 5Kni3aFlFg2j3y1z5mnRTJccnNIltQhwq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OJwfEwmiC - BQ49yaW50J7Fh0xJw3IxbM3hwo2x0ICRHZzFgveTunYERK5lgo5YMxx8WPFw5Li+U8wYm66jNz+Naov+ - Beqiao58N5NrPluoryJO0QeKU7sNGKPPazh9aRzGo/eYmVvEMk270fTlmzl2N3XW9xL/jv7iaxw7+wAH - E9ew//AVxE8OItv/9O/Cf0ck8gud2vKswuxNZgAAAABJRU5ErkJggg== - - - - 257, 17 - - - 398, 17 + + 222, 17 + + + + AAABAAEAECAAAAEAIACcAAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAAFz + UkdCAK7OHOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAMUlEQVQ4T2OgGHz7 + 9u0/JRhsgJOTE1l4kBnw4f1HkvCoAcPTAHIw3ABKMDRPkgsYGAD4YMZfYsb9cAAAAABJRU5ErkJggg== + + \ No newline at end of file diff --git a/Example/Icons.Designer.cs b/Example/Icons.Designer.cs index 40f305b..4838e0b 100644 --- a/Example/Icons.Designer.cs +++ b/Example/Icons.Designer.cs @@ -60,6 +60,16 @@ namespace Example { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Close_16xLG { + get { + object obj = ResourceManager.GetObject("Close_16xLG", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -89,5 +99,35 @@ namespace Example { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap NewFile_6276 { + get { + object obj = ResourceManager.GetObject("NewFile_6276", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap StatusAnnotations_Information_16xLG_color { + get { + object obj = ResourceManager.GetObject("StatusAnnotations_Information_16xLG_color", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap StatusAnnotations_Information_16xMD_color { + get { + object obj = ResourceManager.GetObject("StatusAnnotations_Information_16xMD_color", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/Example/Icons.resx b/Example/Icons.resx index 1487cbd..672a26c 100644 --- a/Example/Icons.resx +++ b/Example/Icons.resx @@ -118,13 +118,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Resources\folder_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\StatusAnnotations_Information_16xMD_color.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\Close_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\Files_7954.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Resources\NewFile_6276.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\folder_Closed_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Resources\folder_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Resources\StatusAnnotations_Information_16xLG_color.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/Example/Resources/Close_16xLG.png b/Example/Resources/Close_16xLG.png new file mode 100644 index 0000000000000000000000000000000000000000..a9ae49f26478fc992a2e745c262779ba995a78a4 GIT binary patch literal 206 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAP_V(% z#WAEJ?r5+hSA&AUl@E_LzuDt|^7;+)Ro%~Prnx6K_XZ?-PGn0dNo^|)nHeNxJHtg? zB&cWOO5U|wL$)w9_$R%u{Vw>5t!!h`eZD7IYtJY&N8der?2N~Go0iGnyqJ%*9ARF+ zaT4>^zwcTsoix=P^A5FjD6i)|*AN%R{qKLT_yGYMcl`%PErD)f@O1TaS?83{1OQ?9 BPBQ=i literal 0 HcmV?d00001 diff --git a/Example/Resources/NewFile_6276.png b/Example/Resources/NewFile_6276.png new file mode 100644 index 0000000000000000000000000000000000000000..12354ce14e9cedf2c377ae0d7b11f6344e05e741 GIT binary patch literal 270 zcmV+p0rCEcP)zr?|{uKfu|b?JB@I6L?O{zL0>YrGUL9J%6&PCf|X z1>VaeL_q*+Eqan=nSulm5e8o9#kc(g#Oy6PgHR}W(!g(-ZVoJ>PMnZRp~xWIHs3x# z@&K)?g}cw4Z{S5#99_(cqUfrss*$4?w{!;b`q$kU`+D0vx$->6vMg!dkO?PRx~@TMt$YH0p6G$ne-Pup42FWsV|{NxSN;SF5#blS09loe UG8Nz?4*&oF07*qoM6N<$f{3ehNB{r; literal 0 HcmV?d00001 diff --git a/Example/Resources/StatusAnnotations_Information_16xLG_color.png b/Example/Resources/StatusAnnotations_Information_16xLG_color.png new file mode 100644 index 0000000000000000000000000000000000000000..fc631e2b8adebc8f1ecb7133059f1074f329fea7 GIT binary patch literal 338 zcmV-Y0j>UtP)S` zFasu%8~!9bEAVdgd9S1}9qxhwD6#Wn>>Md3V8CJmI}84pZc&*gU}0dUA52|A6*Hz3 zCG|fH0)(WfmON>MD;Q#;t07*qoM6N<$g4*zlqyPW_ literal 0 HcmV?d00001 diff --git a/Example/Resources/StatusAnnotations_Information_16xMD_color.png b/Example/Resources/StatusAnnotations_Information_16xMD_color.png new file mode 100644 index 0000000000000000000000000000000000000000..cfb2d3c44da8214882cf2765505a21797044b93a GIT binary patch literal 325 zcmV-L0lNN)P)P7p*>cyMuE$T}!VireA_hGpKHc{7>a$T*ILjXA>7N+ys}zQ8DohIIJk zO0a42z;)d<0y8;Jz{S(>{<|9Qud2N~3*(4^gU|g0bfzSKu)T;~_(-tRsEH$qfrCe0 z-VXfP_f1@Xc(IMe@kIg$kGwnqg-*tJ0=AS_EWqQpXuQAQ0&Vv|BG&If_q?ydf|S>J z0>PwH6}7U=ECvo9d6@!uBwob{HvM|qiEjZhaPY``+rfv(ly;%#-CDs*Wc&A@$zI?I XL*H Date: Fri, 18 Sep 2015 18:33:19 +0100 Subject: [PATCH 23/97] Fixed example project. --- Example/Forms/DialogTest.Designer.cs | 30 ++++++++++++++-------------- Example/Forms/MainForm.cs | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Example/Forms/DialogTest.Designer.cs b/Example/Forms/DialogTest.Designer.cs index aceb1b1..a71be7e 100644 --- a/Example/Forms/DialogTest.Designer.cs +++ b/Example/Forms/DialogTest.Designer.cs @@ -55,7 +55,7 @@ this.pnlMain.Dock = System.Windows.Forms.DockStyle.Fill; this.pnlMain.Location = new System.Drawing.Point(0, 0); this.pnlMain.Name = "pnlMain"; - this.pnlMain.Padding = new System.Windows.Forms.Padding(10, 15, 10, 5); + this.pnlMain.Padding = new System.Windows.Forms.Padding(5, 10, 5, 0); this.pnlMain.Size = new System.Drawing.Size(708, 410); this.pnlMain.TabIndex = 2; // @@ -69,22 +69,22 @@ this.tblMain.Controls.Add(this.pnlListView, 0, 0); this.tblMain.Controls.Add(this.pnlMessageBox, 0, 0); this.tblMain.Dock = System.Windows.Forms.DockStyle.Fill; - this.tblMain.Location = new System.Drawing.Point(10, 15); + this.tblMain.Location = new System.Drawing.Point(5, 10); this.tblMain.Name = "tblMain"; this.tblMain.RowCount = 1; this.tblMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tblMain.Size = new System.Drawing.Size(688, 390); + this.tblMain.Size = new System.Drawing.Size(698, 400); this.tblMain.TabIndex = 0; // // pnlTreeView // this.pnlTreeView.Controls.Add(this.treeTest); this.pnlTreeView.Dock = System.Windows.Forms.DockStyle.Fill; - this.pnlTreeView.Location = new System.Drawing.Point(463, 0); + this.pnlTreeView.Location = new System.Drawing.Point(469, 0); this.pnlTreeView.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.pnlTreeView.Name = "pnlTreeView"; this.pnlTreeView.SectionHeader = "Tree view test"; - this.pnlTreeView.Size = new System.Drawing.Size(220, 390); + this.pnlTreeView.Size = new System.Drawing.Size(224, 400); this.pnlTreeView.TabIndex = 14; // // treeTest @@ -95,7 +95,7 @@ this.treeTest.MultiSelect = true; this.treeTest.Name = "treeTest"; this.treeTest.ShowIcons = true; - this.treeTest.Size = new System.Drawing.Size(218, 364); + this.treeTest.Size = new System.Drawing.Size(222, 374); this.treeTest.TabIndex = 0; this.treeTest.Text = "darkTreeView1"; // @@ -103,11 +103,11 @@ // this.pnlListView.Controls.Add(this.lstTest); this.pnlListView.Dock = System.Windows.Forms.DockStyle.Fill; - this.pnlListView.Location = new System.Drawing.Point(234, 0); + this.pnlListView.Location = new System.Drawing.Point(237, 0); this.pnlListView.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.pnlListView.Name = "pnlListView"; this.pnlListView.SectionHeader = "List view test"; - this.pnlListView.Size = new System.Drawing.Size(219, 390); + this.pnlListView.Size = new System.Drawing.Size(222, 400); this.pnlListView.TabIndex = 13; // // lstTest @@ -116,7 +116,7 @@ this.lstTest.Location = new System.Drawing.Point(1, 25); this.lstTest.MultiSelect = true; this.lstTest.Name = "lstTest"; - this.lstTest.Size = new System.Drawing.Size(217, 364); + this.lstTest.Size = new System.Drawing.Size(220, 374); this.lstTest.TabIndex = 7; this.lstTest.Text = "darkListView1"; // @@ -128,7 +128,7 @@ this.pnlMessageBox.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.pnlMessageBox.Name = "pnlMessageBox"; this.pnlMessageBox.SectionHeader = "Section test"; - this.pnlMessageBox.Size = new System.Drawing.Size(219, 390); + this.pnlMessageBox.Size = new System.Drawing.Size(222, 400); this.pnlMessageBox.TabIndex = 12; // // panel1 @@ -139,7 +139,7 @@ this.panel1.Location = new System.Drawing.Point(1, 25); this.panel1.Name = "panel1"; this.panel1.Padding = new System.Windows.Forms.Padding(10); - this.panel1.Size = new System.Drawing.Size(217, 364); + this.panel1.Size = new System.Drawing.Size(220, 374); this.panel1.TabIndex = 0; // // btnMessageBox @@ -148,7 +148,7 @@ this.btnMessageBox.Location = new System.Drawing.Point(10, 50); this.btnMessageBox.Name = "btnMessageBox"; this.btnMessageBox.Padding = new System.Windows.Forms.Padding(5); - this.btnMessageBox.Size = new System.Drawing.Size(197, 30); + this.btnMessageBox.Size = new System.Drawing.Size(200, 30); this.btnMessageBox.TabIndex = 6; this.btnMessageBox.Text = "Message Box"; // @@ -158,7 +158,7 @@ this.panel2.Dock = System.Windows.Forms.DockStyle.Top; this.panel2.Location = new System.Drawing.Point(10, 10); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(197, 40); + this.panel2.Size = new System.Drawing.Size(200, 40); this.panel2.TabIndex = 5; // // btnDialog @@ -167,7 +167,7 @@ this.btnDialog.Location = new System.Drawing.Point(0, 0); this.btnDialog.Name = "btnDialog"; this.btnDialog.Padding = new System.Windows.Forms.Padding(5); - this.btnDialog.Size = new System.Drawing.Size(197, 30); + this.btnDialog.Size = new System.Drawing.Size(200, 30); this.btnDialog.TabIndex = 4; this.btnDialog.Text = "Dialog"; // @@ -181,7 +181,7 @@ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "DialogTest"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Test dialog please ignore"; + this.Text = "Dialog test"; this.Controls.SetChildIndex(this.pnlMain, 0); this.pnlMain.ResumeLayout(false); this.tblMain.ResumeLayout(false); diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index 8bee97e..00d389b 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -13,7 +13,7 @@ namespace Example // Add the control scroll message filter to re-route all mousewheel events // to the control the user is currently hovering over with their cursor. - Application.AddMessageFilter(new ControlScrollFilter()); + Application.AddMessageFilter(new DarkControlScrollFilter()); // Add the dock panel message filter to filter through for dock panel splitter // input before letting events pass through to the rest of the application. From 9227a0a3671b04ab02e073b2ee11cfd33b0e8fe4 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 18 Sep 2015 18:33:28 +0100 Subject: [PATCH 24/97] Removed unneeded line from DarkMessageBox --- DarkUI/Forms/DarkMessageBox.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/DarkUI/Forms/DarkMessageBox.cs b/DarkUI/Forms/DarkMessageBox.cs index 30384f6..3eedfe4 100644 --- a/DarkUI/Forms/DarkMessageBox.cs +++ b/DarkUI/Forms/DarkMessageBox.cs @@ -40,8 +40,6 @@ namespace DarkUI public DarkMessageBox(string message, string title, DarkMessageBoxIcon icon, DarkDialogButton buttons) : this() { - var offsetHeight = Height - picIcon.Height; - Text = title; _message = message; From 5a57b1011cf343f6e30c21a7f743bfb246f15ef6 Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 19 Sep 2015 11:32:11 +0100 Subject: [PATCH 25/97] Added DockPanel basics & updated example Re-adding content currently broken. Need to add tabs too. --- DarkUI/Config/Consts.cs | 4 + DarkUI/Config/Enums.cs | 9 + DarkUI/DarkUI.csproj | 12 ++ DarkUI/Docking/DarkDockContent.cs | 62 +++++- DarkUI/Docking/DarkDockGroup.cs | 69 +++++++ DarkUI/Docking/DarkDockPanel.cs | 74 ++++++- DarkUI/Docking/DarkDockRegion.cs | 185 ++++++++++++++++++ DarkUI/Docking/DarkDocument.cs | 29 +++ DarkUI/Docking/DarkToolWindow.cs | 100 ++++++++++ Example/Example.csproj | 57 +++++- .../{ => Dialogs}/DialogAbout.Designer.cs | 8 +- Example/Forms/{ => Dialogs}/DialogAbout.cs | 0 Example/Forms/{ => Dialogs}/DialogAbout.resx | 0 .../{ => Dialogs}/DialogTest.Designer.cs | 0 Example/Forms/{ => Dialogs}/DialogTest.cs | 0 Example/Forms/{ => Dialogs}/DialogTest.resx | 0 Example/Forms/Docking/DockConsole.Designer.cs | 49 +++++ Example/Forms/Docking/DockConsole.cs | 16 ++ Example/Forms/Docking/DockConsole.resx | 120 ++++++++++++ .../Forms/Docking/DockDocument.Designer.cs | 64 ++++++ Example/Forms/Docking/DockDocument.cs | 33 ++++ Example/Forms/Docking/DockDocument.resx | 120 ++++++++++++ Example/Forms/Docking/DockProject.Designer.cs | 49 +++++ Example/Forms/Docking/DockProject.cs | 16 ++ Example/Forms/Docking/DockProject.resx | 120 ++++++++++++ .../Forms/Docking/DockProperties.Designer.cs | 49 +++++ Example/Forms/Docking/DockProperties.cs | 16 ++ Example/Forms/Docking/DockProperties.resx | 120 ++++++++++++ Example/Forms/MainForm.Designer.cs | 125 +++++++----- Example/Forms/MainForm.cs | 111 ++++++++++- Example/Icons.Designer.cs | 30 +++ Example/Icons.resx | 13 +- Example/Resources/Console.png | Bin 0 -> 182 bytes Example/Resources/application_16x.png | Bin 0 -> 157 bytes Example/Resources/properties_16xLG.png | Bin 0 -> 357 bytes 35 files changed, 1587 insertions(+), 73 deletions(-) create mode 100644 DarkUI/Docking/DarkDockGroup.cs create mode 100644 DarkUI/Docking/DarkDockRegion.cs create mode 100644 DarkUI/Docking/DarkDocument.cs create mode 100644 DarkUI/Docking/DarkToolWindow.cs rename Example/Forms/{ => Dialogs}/DialogAbout.Designer.cs (98%) rename Example/Forms/{ => Dialogs}/DialogAbout.cs (100%) rename Example/Forms/{ => Dialogs}/DialogAbout.resx (100%) rename Example/Forms/{ => Dialogs}/DialogTest.Designer.cs (100%) rename Example/Forms/{ => Dialogs}/DialogTest.cs (100%) rename Example/Forms/{ => Dialogs}/DialogTest.resx (100%) create mode 100644 Example/Forms/Docking/DockConsole.Designer.cs create mode 100644 Example/Forms/Docking/DockConsole.cs create mode 100644 Example/Forms/Docking/DockConsole.resx create mode 100644 Example/Forms/Docking/DockDocument.Designer.cs create mode 100644 Example/Forms/Docking/DockDocument.cs create mode 100644 Example/Forms/Docking/DockDocument.resx create mode 100644 Example/Forms/Docking/DockProject.Designer.cs create mode 100644 Example/Forms/Docking/DockProject.cs create mode 100644 Example/Forms/Docking/DockProject.resx create mode 100644 Example/Forms/Docking/DockProperties.Designer.cs create mode 100644 Example/Forms/Docking/DockProperties.cs create mode 100644 Example/Forms/Docking/DockProperties.resx create mode 100644 Example/Resources/Console.png create mode 100644 Example/Resources/application_16x.png create mode 100644 Example/Resources/properties_16xLG.png diff --git a/DarkUI/Config/Consts.cs b/DarkUI/Config/Consts.cs index 19e252b..23e63ea 100644 --- a/DarkUI/Config/Consts.cs +++ b/DarkUI/Config/Consts.cs @@ -7,5 +7,9 @@ public static int ScrollBarSize = 15; public static int ArrowButtonSize = 15; public static int MinimumThumbSize = 11; + + public const int ToolWindowHeaderSize = 25; + public const int DocumentTabAreaSize = 24; + public const int ToolWindowTabAreaSize = 21; } } diff --git a/DarkUI/Config/Enums.cs b/DarkUI/Config/Enums.cs index a09c523..2f7b317 100644 --- a/DarkUI/Config/Enums.cs +++ b/DarkUI/Config/Enums.cs @@ -44,4 +44,13 @@ Warning, Error } + + public enum DarkDockArea + { + None, + Document, + Left, + Right, + Bottom + } } diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index b964aae..0280617 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -91,9 +91,21 @@ UserControl + + Component + UserControl + + Component + + + UserControl + + + UserControl + Form diff --git a/DarkUI/Docking/DarkDockContent.cs b/DarkUI/Docking/DarkDockContent.cs index 269b4ec..13a993c 100644 --- a/DarkUI/Docking/DarkDockContent.cs +++ b/DarkUI/Docking/DarkDockContent.cs @@ -1,4 +1,5 @@ using System.ComponentModel; +using System.Drawing; using System.Windows.Forms; namespace DarkUI @@ -6,20 +7,17 @@ namespace DarkUI [ToolboxItem(false)] public class DarkDockContent : UserControl { - #region Event Region - - - - #endregion - #region Field Region private string _dockText; + private Image _icon; #endregion #region Property Region + [Category("Appearance")] + [Description("Determines the text that will appear in the content tabs and headers.")] public string DockText { get { return _dockText; } @@ -27,10 +25,60 @@ namespace DarkUI { _dockText = value; Invalidate(); - // TODO: raise event for parent tabs + // TODO: raise event for re-sizing parent tabs } } + [Category("Appearance")] + [Description("Determines the icon that will appear in the content tabs and headers.")] + public Image Icon + { + get { return _icon; } + set + { + _icon = value; + Invalidate(); + } + } + + [Category("Layout")] + [Description("Determines which area of the dock panel this content will dock to.")] + [DefaultValue(DarkDockArea.None)] + public DarkDockArea DockArea { get; set; } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public DarkDockPanel DockPanel { get; internal set; } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public DarkDockRegion DockRegion { get; internal set; } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public DarkDockGroup DockGroup { get; internal set; } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public bool IsActive { get; internal set; } + + #endregion + + #region Constructor Region + + public DarkDockContent() + { } + + #endregion + + #region Method Region + + public virtual void Close() + { + if (DockPanel != null) + DockPanel.RemoveContent(this); + } + #endregion } } diff --git a/DarkUI/Docking/DarkDockGroup.cs b/DarkUI/Docking/DarkDockGroup.cs new file mode 100644 index 0000000..278b86e --- /dev/null +++ b/DarkUI/Docking/DarkDockGroup.cs @@ -0,0 +1,69 @@ +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace DarkUI +{ + [ToolboxItem(false)] + public class DarkDockGroup : Panel + { + #region Field Region + + private List _contents; + + #endregion + + #region Property Region + + public DarkDockPanel DockPanel { get; private set; } + + public DarkDockRegion DockRegion { get; private set; } + + public DarkDockArea DockArea { get; private set; } + + public int ContentCount + { + get + { + return _contents.Count; + } + } + + #endregion + + #region Constructor Region + + public DarkDockGroup(DarkDockPanel dockPanel, DarkDockRegion dockRegion) + { + _contents = new List(); + + DockPanel = dockPanel; + DockRegion = dockRegion; + DockArea = dockRegion.DockArea; + } + + #endregion + + #region Method Region + + public void AddContent(DarkDockContent dockContent) + { + dockContent.DockGroup = this; + dockContent.Dock = DockStyle.Fill; + + _contents.Add(dockContent); + Controls.Add(dockContent); + } + + public void RemoveContent(DarkDockContent dockContent) + { + dockContent.DockGroup = null; + + _contents.Remove(dockContent); + Controls.Remove(dockContent); + } + + #endregion + } +} diff --git a/DarkUI/Docking/DarkDockPanel.cs b/DarkUI/Docking/DarkDockPanel.cs index f0aa15f..ed8e582 100644 --- a/DarkUI/Docking/DarkDockPanel.cs +++ b/DarkUI/Docking/DarkDockPanel.cs @@ -1,9 +1,17 @@ -using System.Windows.Forms; +using System.Collections.Generic; +using System.Windows.Forms; namespace DarkUI { public class DarkDockPanel : UserControl { + #region Field Region + + private List _contents; + private Dictionary _regions; + + #endregion + #region Property Region public IMessageFilter MessageFilter { get; private set; } @@ -16,7 +24,71 @@ namespace DarkUI { MessageFilter = new DarkDockResizeFilter(this); + _regions = new Dictionary(); + _contents = new List(); + BackColor = Colors.GreyBackground; + + CreateRegions(); + } + + #endregion + + #region Method Region + + public void AddContent(DarkDockContent dockContent) + { + if (_contents.Contains(dockContent)) + return; + + if (dockContent.DockArea == DarkDockArea.None) + return; + + dockContent.DockPanel = this; + _contents.Add(dockContent); + + var region = _regions[dockContent.DockArea]; + region.AddContent(dockContent); + } + + public void RemoveContent(DarkDockContent dockContent) + { + if (!_contents.Contains(dockContent)) + return; + + dockContent.DockPanel = null; + _contents.Remove(dockContent); + + var region = _regions[dockContent.DockArea]; + region.RemoveContent(dockContent); + } + + private void CreateRegions() + { + var documentRegion = new DarkDockRegion(this, DarkDockArea.Document); + _regions.Add(DarkDockArea.Document, documentRegion); + + var leftRegion = new DarkDockRegion(this, DarkDockArea.Left); + _regions.Add(DarkDockArea.Left, leftRegion); + + var rightRegion = new DarkDockRegion(this, DarkDockArea.Right); + _regions.Add(DarkDockArea.Right, rightRegion); + + var bottomRegion = new DarkDockRegion(this, DarkDockArea.Bottom); + _regions.Add(DarkDockArea.Bottom, bottomRegion); + + // Add the regions in this order to force the bottom region to be positioned + // between the left and right regions properly. + Controls.Add(documentRegion); + Controls.Add(bottomRegion); + Controls.Add(leftRegion); + Controls.Add(rightRegion); + + // Create tab index for intuitive tabbing order + documentRegion.TabIndex = 0; + rightRegion.TabIndex = 1; + bottomRegion.TabIndex = 2; + leftRegion.TabIndex = 3; } #endregion diff --git a/DarkUI/Docking/DarkDockRegion.cs b/DarkUI/Docking/DarkDockRegion.cs new file mode 100644 index 0000000..83c8c98 --- /dev/null +++ b/DarkUI/Docking/DarkDockRegion.cs @@ -0,0 +1,185 @@ +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace DarkUI +{ + [ToolboxItem(false)] + public class DarkDockRegion : Panel + { + #region Field Region + + private List _groups; + + #endregion + + #region Property Region + + public DarkDockPanel DockPanel { get; private set; } + + public DarkDockArea DockArea { get; private set; } + + #endregion + + #region Constructor Region + + public DarkDockRegion(DarkDockPanel dockPanel, DarkDockArea dockArea) + { + _groups = new List(); + + DockPanel = dockPanel; + DockArea = dockArea; + + BuildProperties(); + } + + #endregion + + #region Method Region + + public void AddContent(DarkDockContent dockContent) + { + AddContent(dockContent, null); + } + + public void AddContent(DarkDockContent dockContent, DarkDockGroup dockGroup) + { + // If no existing group is specified then create a new one + if (dockGroup == null) + { + // If this is the document region, then default to first group if it exists + if (DockArea == DarkDockArea.Document && _groups.Count > 0) + dockGroup = _groups[0]; + else + dockGroup = CreateGroup(); + } + + dockContent.DockRegion = this; + dockGroup.AddContent(dockContent); + + // Show the region if it was previously hidden + if (!Visible) + Visible = true; + } + + public void RemoveContent(DarkDockContent dockContent) + { + dockContent.DockRegion = null; + + var group = dockContent.DockGroup; + group.RemoveContent(dockContent); + + // If that was the final content in the group then remove the group + if (group.ContentCount == 0) + { + _groups.Remove(group); + PositionGroups(); + } + + // Check if we have any groups left. If not then hide the region + if (_groups.Count == 0) + Visible = false; + } + + private DarkDockGroup CreateGroup() + { + var newGroup = new DarkDockGroup(DockPanel, this); + _groups.Add(newGroup); + Controls.Add(newGroup); + + PositionGroups(); + + return newGroup; + } + + private void PositionGroups() + { + DockStyle dockStyle; + + switch (DockArea) + { + default: + case DarkDockArea.Document: + dockStyle = DockStyle.Fill; + break; + case DarkDockArea.Left: + case DarkDockArea.Right: + dockStyle = DockStyle.Top; + break; + case DarkDockArea.Bottom: + dockStyle = DockStyle.Left; + break; + } + + if (_groups.Count == 1) + _groups[0].Dock = DockStyle.Fill; + else if (_groups.Count > 1) + foreach (var group in _groups) + group.Dock = dockStyle; + } + + private void BuildProperties() + { + switch (DockArea) + { + default: + case DarkDockArea.Document: + Dock = DockStyle.Fill; + Padding = new Padding(0, 1, 0, 0); + break; + case DarkDockArea.Left: + Dock = DockStyle.Left; + Padding = new Padding(0, 0, 1, 0); + Visible = false; + break; + case DarkDockArea.Right: + Dock = DockStyle.Right; + Padding = new Padding(1, 0, 0, 0); + Visible = false; + break; + case DarkDockArea.Bottom: + Dock = DockStyle.Bottom; + Padding = new Padding(0, 0, 0, 0); + Visible = false; + break; + } + } + + #endregion + + #region Paint Region + + protected override void OnPaint(PaintEventArgs e) + { + var g = e.Graphics; + + if (!Visible) + return; + + // Fill body + using (var b = new SolidBrush(Colors.GreyBackground)) + { + g.FillRectangle(b, ClientRectangle); + } + + // Draw border + using (var p = new Pen(Colors.DarkBorder)) + { + // Top border + if (DockArea == DarkDockArea.Document) + g.DrawLine(p, ClientRectangle.Left, 0, ClientRectangle.Right, 0); + + // Left border + if (DockArea == DarkDockArea.Right) + g.DrawLine(p, ClientRectangle.Left, 0, ClientRectangle.Left, Height); + + // Right border + if (DockArea == DarkDockArea.Left) + g.DrawLine(p, ClientRectangle.Right - 1, 0, ClientRectangle.Right - 1, Height); + } + } + + #endregion + } +} diff --git a/DarkUI/Docking/DarkDocument.cs b/DarkUI/Docking/DarkDocument.cs new file mode 100644 index 0000000..60c69c6 --- /dev/null +++ b/DarkUI/Docking/DarkDocument.cs @@ -0,0 +1,29 @@ +using System.ComponentModel; + +namespace DarkUI +{ + [ToolboxItem(false)] + public class DarkDocument : DarkDockContent + { + #region Property Region + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new DarkDockArea DockArea + { + get { return base.DockArea; } + } + + #endregion + + #region Constructor Region + + public DarkDocument() + { + BackColor = Colors.GreyBackground; + base.DockArea = DarkDockArea.Document; + } + + #endregion + } +} diff --git a/DarkUI/Docking/DarkToolWindow.cs b/DarkUI/Docking/DarkToolWindow.cs new file mode 100644 index 0000000..a9d7067 --- /dev/null +++ b/DarkUI/Docking/DarkToolWindow.cs @@ -0,0 +1,100 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace DarkUI +{ + [ToolboxItem(false)] + public class DarkToolWindow : DarkDockContent + { + #region Property Region + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Padding Padding + { + get { return base.Padding; } + } + + #endregion + + #region Constructor Region + + public DarkToolWindow() + { + SetStyle(ControlStyles.OptimizedDoubleBuffer | + ControlStyles.ResizeRedraw | + ControlStyles.UserPaint, true); + + BackColor = Colors.GreyBackground; + base.Padding = new Padding(0, Consts.ToolWindowHeaderSize, 0, 0); + } + + #endregion + + #region Paint Region + + protected override void OnPaint(PaintEventArgs e) + { + var g = e.Graphics; + + // Fill body + using (var b = new SolidBrush(Colors.GreyBackground)) + { + g.FillRectangle(b, ClientRectangle); + } + + // Draw header + var bgColor = IsActive ? Colors.BlueBackground : Colors.HeaderBackground; + var darkColor = IsActive ? Colors.DarkBlueBorder : Colors.DarkBorder; + var lightColor = IsActive ? Colors.LightBlueBorder : Colors.LightBorder; + + using (var b = new SolidBrush(bgColor)) + { + var bgRect = new Rectangle(0, 0, ClientRectangle.Width, Consts.ToolWindowHeaderSize); + g.FillRectangle(b, bgRect); + } + + using (var p = new Pen(darkColor)) + { + g.DrawLine(p, ClientRectangle.Left, 0, ClientRectangle.Right, 0); + g.DrawLine(p, ClientRectangle.Left, Consts.ToolWindowHeaderSize - 1, ClientRectangle.Right, Consts.ToolWindowHeaderSize - 1); + } + + using (var p = new Pen(lightColor)) + { + g.DrawLine(p, ClientRectangle.Left, 1, ClientRectangle.Right, 1); + } + + var xOffset = 2; + + if (Icon != null) + { + g.DrawImageUnscaled(Icon, ClientRectangle.Left + 5, ClientRectangle.Top + (Consts.ToolWindowHeaderSize / 2) - (Icon.Height / 2) + 1); + xOffset = Icon.Width + 8; + } + + using (var b = new SolidBrush(Colors.LightText)) + { + var textRect = new Rectangle(xOffset, 0, ClientRectangle.Width - 4 - xOffset, Consts.ToolWindowHeaderSize); + + var format = new StringFormat + { + Alignment = StringAlignment.Near, + LineAlignment = StringAlignment.Center, + FormatFlags = StringFormatFlags.NoWrap, + Trimming = StringTrimming.EllipsisCharacter + }; + + g.DrawString(DockText, Font, b, textRect, format); + } + } + + protected override void OnPaintBackground(PaintEventArgs e) + { + // Absorb event + } + + #endregion + } +} diff --git a/Example/Example.csproj b/Example/Example.csproj index 79e2554..d41da30 100644 --- a/Example/Example.csproj +++ b/Example/Example.csproj @@ -41,18 +41,42 @@ - + Form - + DialogAbout.cs - + Form - + DialogTest.cs + + UserControl + + + DockDocument.cs + + + UserControl + + + DockConsole.cs + + + UserControl + + + DockProperties.cs + + + UserControl + + + DockProject.cs + Form @@ -66,12 +90,24 @@ - + DialogAbout.cs - + DialogTest.cs + + DockDocument.cs + + + DockConsole.cs + + + DockProperties.cs + + + DockProject.cs + MainForm.cs @@ -126,6 +162,15 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Example/Forms/Docking/DockDocument.Designer.cs b/Example/Forms/Docking/DockDocument.Designer.cs new file mode 100644 index 0000000..8f6a77d --- /dev/null +++ b/Example/Forms/Docking/DockDocument.Designer.cs @@ -0,0 +1,64 @@ +namespace Example +{ + partial class DockDocument + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.txtDocument = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // txtDocument + // + this.txtDocument.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(43)))), ((int)(((byte)(43))))); + this.txtDocument.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.txtDocument.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtDocument.ForeColor = System.Drawing.Color.Gainsboro; + this.txtDocument.Location = new System.Drawing.Point(0, 0); + this.txtDocument.Multiline = true; + this.txtDocument.Name = "txtDocument"; + this.txtDocument.Size = new System.Drawing.Size(175, 173); + this.txtDocument.TabIndex = 1; + this.txtDocument.Text = "This is some example text"; + // + // DockDocument + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.txtDocument); + this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Name = "DockDocument"; + this.Size = new System.Drawing.Size(175, 173); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox txtDocument; + } +} diff --git a/Example/Forms/Docking/DockDocument.cs b/Example/Forms/Docking/DockDocument.cs new file mode 100644 index 0000000..bc478b1 --- /dev/null +++ b/Example/Forms/Docking/DockDocument.cs @@ -0,0 +1,33 @@ +using DarkUI; +using System.Windows.Forms; + +namespace Example +{ + public partial class DockDocument : DarkDocument + { + #region Constructor Region + + public DockDocument() + { + InitializeComponent(); + + // Workaround to stop the textbox from highlight all text. + txtDocument.SelectionStart = txtDocument.Text.Length; + } + + #endregion + + #region Event Handler Region + + public override void Close() + { + var result = DarkMessageBox.ShowWarning(@"You will lose any unsaved changes. Continue?", @"Close document", DarkDialogButton.YesNo); + if (result == DialogResult.No) + return; + + base.Close(); + } + + #endregion + } +} diff --git a/Example/Forms/Docking/DockDocument.resx b/Example/Forms/Docking/DockDocument.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Example/Forms/Docking/DockDocument.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Example/Forms/Docking/DockProject.Designer.cs b/Example/Forms/Docking/DockProject.Designer.cs new file mode 100644 index 0000000..95ac14f --- /dev/null +++ b/Example/Forms/Docking/DockProject.Designer.cs @@ -0,0 +1,49 @@ +namespace Example +{ + partial class DockProject + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // DockProject + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.DockArea = DarkUI.DarkDockArea.Left; + this.DockText = "Project Explorer"; + this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Icon = global::Example.Icons.application_16x; + this.Name = "DockProject"; + this.Size = new System.Drawing.Size(280, 450); + this.ResumeLayout(false); + + } + + #endregion + } +} diff --git a/Example/Forms/Docking/DockProject.cs b/Example/Forms/Docking/DockProject.cs new file mode 100644 index 0000000..af0d9c0 --- /dev/null +++ b/Example/Forms/Docking/DockProject.cs @@ -0,0 +1,16 @@ +using DarkUI; + +namespace Example +{ + public partial class DockProject : DarkToolWindow + { + #region Constructor Region + + public DockProject() + { + InitializeComponent(); + } + + #endregion + } +} diff --git a/Example/Forms/Docking/DockProject.resx b/Example/Forms/Docking/DockProject.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Example/Forms/Docking/DockProject.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Example/Forms/Docking/DockProperties.Designer.cs b/Example/Forms/Docking/DockProperties.Designer.cs new file mode 100644 index 0000000..c47ae7c --- /dev/null +++ b/Example/Forms/Docking/DockProperties.Designer.cs @@ -0,0 +1,49 @@ +namespace Example +{ + partial class DockProperties + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // DockProperties + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.DockArea = DarkUI.DarkDockArea.Right; + this.DockText = "Properties"; + this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Icon = global::Example.Icons.properties_16xLG; + this.Name = "DockProperties"; + this.Size = new System.Drawing.Size(280, 450); + this.ResumeLayout(false); + + } + + #endregion + } +} diff --git a/Example/Forms/Docking/DockProperties.cs b/Example/Forms/Docking/DockProperties.cs new file mode 100644 index 0000000..655df52 --- /dev/null +++ b/Example/Forms/Docking/DockProperties.cs @@ -0,0 +1,16 @@ +using DarkUI; + +namespace Example +{ + public partial class DockProperties : DarkToolWindow + { + #region Constructor Region + + public DockProperties() + { + InitializeComponent(); + } + + #endregion + } +} diff --git a/Example/Forms/Docking/DockProperties.resx b/Example/Forms/Docking/DockProperties.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Example/Forms/Docking/DockProperties.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Example/Forms/MainForm.Designer.cs b/Example/Forms/MainForm.Designer.cs index 312e955..2e09db1 100644 --- a/Example/Forms/MainForm.Designer.cs +++ b/Example/Forms/MainForm.Designer.cs @@ -31,22 +31,25 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.mnuMain = new DarkUI.DarkMenuStrip(); this.mnuFile = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuNewFile = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.mnuClose = new System.Windows.Forms.ToolStripMenuItem(); this.mnuView = new System.Windows.Forms.ToolStripMenuItem(); this.mnuDialog = new System.Windows.Forms.ToolStripMenuItem(); this.mnuTools = new System.Windows.Forms.ToolStripMenuItem(); this.mnuWindow = new System.Windows.Forms.ToolStripMenuItem(); this.mnuHelp = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuAbout = new System.Windows.Forms.ToolStripMenuItem(); this.toolMain = new DarkUI.DarkToolStrip(); + this.btnNewFile = new System.Windows.Forms.ToolStripButton(); this.stripMain = new DarkUI.DarkStatusStrip(); this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel6 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel5 = new System.Windows.Forms.ToolStripStatusLabel(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.DockPanel = new DarkUI.DarkDockPanel(); - this.btnNewFile = new System.Windows.Forms.ToolStripButton(); - this.mnuNewFile = new System.Windows.Forms.ToolStripMenuItem(); - this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.mnuAbout = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuProject = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuProperties = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuConsole = new System.Windows.Forms.ToolStripMenuItem(); this.mnuMain.SuspendLayout(); this.toolMain.SuspendLayout(); this.stripMain.SuspendLayout(); @@ -74,12 +77,37 @@ this.mnuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mnuNewFile, this.toolStripSeparator1, - this.closeToolStripMenuItem}); + this.mnuClose}); this.mnuFile.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); this.mnuFile.Name = "mnuFile"; this.mnuFile.Size = new System.Drawing.Size(37, 20); this.mnuFile.Text = "&File"; // + // mnuNewFile + // + this.mnuNewFile.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuNewFile.Image = global::Example.Icons.NewFile_6276; + this.mnuNewFile.Name = "mnuNewFile"; + this.mnuNewFile.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); + this.mnuNewFile.Size = new System.Drawing.Size(160, 22); + this.mnuNewFile.Text = "&New file"; + // + // toolStripSeparator1 + // + this.toolStripSeparator1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.toolStripSeparator1.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1); + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(157, 6); + // + // mnuClose + // + this.mnuClose.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuClose.Image = global::Example.Icons.Close_16xLG; + this.mnuClose.Name = "mnuClose"; + this.mnuClose.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); + this.mnuClose.Size = new System.Drawing.Size(160, 22); + this.mnuClose.Text = "&Close"; + // // mnuView // this.mnuView.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -92,8 +120,9 @@ // mnuDialog // this.mnuDialog.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuDialog.Image = global::Example.Icons.properties_16xLG; this.mnuDialog.Name = "mnuDialog"; - this.mnuDialog.Size = new System.Drawing.Size(152, 22); + this.mnuDialog.Size = new System.Drawing.Size(130, 22); this.mnuDialog.Text = "&Dialog test"; // // mnuTools @@ -105,6 +134,10 @@ // // mnuWindow // + this.mnuWindow.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mnuProject, + this.mnuProperties, + this.mnuConsole}); this.mnuWindow.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); this.mnuWindow.Name = "mnuWindow"; this.mnuWindow.Size = new System.Drawing.Size(63, 20); @@ -119,6 +152,14 @@ this.mnuHelp.Size = new System.Drawing.Size(44, 20); this.mnuHelp.Text = "&Help"; // + // mnuAbout + // + this.mnuAbout.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuAbout.Image = global::Example.Icons.StatusAnnotations_Information_16xLG_color; + this.mnuAbout.Name = "mnuAbout"; + this.mnuAbout.Size = new System.Drawing.Size(145, 22); + this.mnuAbout.Text = "&About DarkUI"; + // // toolMain // this.toolMain.AutoSize = false; @@ -134,6 +175,17 @@ this.toolMain.TabIndex = 1; this.toolMain.Text = "darkToolStrip1"; // + // btnNewFile + // + this.btnNewFile.AutoSize = false; + this.btnNewFile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.btnNewFile.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.btnNewFile.Image = global::Example.Icons.NewFile_6276; + this.btnNewFile.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnNewFile.Name = "btnNewFile"; + this.btnNewFile.Size = new System.Drawing.Size(24, 24); + this.btnNewFile.Text = "New file"; + // // stripMain // this.stripMain.AutoSize = false; @@ -176,13 +228,6 @@ this.toolStripStatusLabel5.Text = "120 MB"; this.toolStripStatusLabel5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // toolStripSeparator1 - // - this.toolStripSeparator1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.toolStripSeparator1.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1); - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6); - // // DockPanel // this.DockPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); @@ -192,40 +237,29 @@ this.DockPanel.Size = new System.Drawing.Size(784, 486); this.DockPanel.TabIndex = 3; // - // btnNewFile + // mnuProject // - this.btnNewFile.AutoSize = false; - this.btnNewFile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.btnNewFile.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.btnNewFile.Image = global::Example.Icons.NewFile_6276; - this.btnNewFile.ImageTransparentColor = System.Drawing.Color.Magenta; - this.btnNewFile.Name = "btnNewFile"; - this.btnNewFile.Size = new System.Drawing.Size(24, 24); - this.btnNewFile.Text = "New file"; + this.mnuProject.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuProject.Image = global::Example.Icons.application_16x; + this.mnuProject.Name = "mnuProject"; + this.mnuProject.Size = new System.Drawing.Size(156, 22); + this.mnuProject.Text = "&Project Explorer"; // - // mnuNewFile + // mnuProperties // - this.mnuNewFile.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.mnuNewFile.Image = global::Example.Icons.NewFile_6276; - this.mnuNewFile.Name = "mnuNewFile"; - this.mnuNewFile.Size = new System.Drawing.Size(152, 22); - this.mnuNewFile.Text = "&New file"; + this.mnuProperties.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuProperties.Image = global::Example.Icons.properties_16xLG; + this.mnuProperties.Name = "mnuProperties"; + this.mnuProperties.Size = new System.Drawing.Size(156, 22); + this.mnuProperties.Text = "P&roperties"; // - // closeToolStripMenuItem + // mnuConsole // - this.closeToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.closeToolStripMenuItem.Image = global::Example.Icons.Close_16xLG; - this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; - this.closeToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.closeToolStripMenuItem.Text = "&Close"; - // - // mnuAbout - // - this.mnuAbout.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.mnuAbout.Image = global::Example.Icons.StatusAnnotations_Information_16xLG_color; - this.mnuAbout.Name = "mnuAbout"; - this.mnuAbout.Size = new System.Drawing.Size(152, 22); - this.mnuAbout.Text = "&About DarkUI"; + this.mnuConsole.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuConsole.Image = global::Example.Icons.Console; + this.mnuConsole.Name = "mnuConsole"; + this.mnuConsole.Size = new System.Drawing.Size(156, 22); + this.mnuConsole.Text = "&Console"; // // MainForm // @@ -265,7 +299,7 @@ private System.Windows.Forms.ToolStripMenuItem mnuFile; private System.Windows.Forms.ToolStripMenuItem mnuView; private System.Windows.Forms.ToolStripMenuItem mnuDialog; - private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mnuClose; private System.Windows.Forms.ToolStripMenuItem mnuTools; private System.Windows.Forms.ToolStripMenuItem mnuWindow; private System.Windows.Forms.ToolStripMenuItem mnuHelp; @@ -274,6 +308,9 @@ private System.Windows.Forms.ToolStripMenuItem mnuNewFile; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private DarkUI.DarkDockPanel DockPanel; + private System.Windows.Forms.ToolStripMenuItem mnuProject; + private System.Windows.Forms.ToolStripMenuItem mnuProperties; + private System.Windows.Forms.ToolStripMenuItem mnuConsole; } } diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index 00d389b..3a2ce30 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -1,10 +1,19 @@ using DarkUI; +using System; using System.Windows.Forms; namespace Example { public partial class MainForm : DarkForm { + #region Field Region + + private DockProject _dockProject; + private DockProperties _dockProperties; + private DockConsole _dockConsole; + + #endregion + #region Constructor Region public MainForm() @@ -19,6 +28,20 @@ namespace Example // input before letting events pass through to the rest of the application. Application.AddMessageFilter(DockPanel.MessageFilter); + // Build the tool windows and add them to the dock panel + _dockProject = new DockProject(); + _dockProperties = new DockProperties(); + _dockConsole = new DockConsole(); + + DockPanel.AddContent(_dockProject); + DockPanel.AddContent(_dockProperties); + DockPanel.AddContent(_dockConsole); + + // Show the tool windows as visible in the 'Window' menu + mnuProject.Checked = true; + mnuProperties.Checked = true; + mnuConsole.Checked = true; + // Hook in all the UI events manually for clarity. HookEvents(); } @@ -29,17 +52,87 @@ namespace Example private void HookEvents() { - mnuDialog.Click += delegate - { - var test = new DialogTest(); - test.ShowDialog(); - }; + mnuNewFile.Click += NewFile_Click; + mnuClose.Click += Close_Click; - mnuAbout.Click += delegate + btnNewFile.Click += NewFile_Click; + + mnuDialog.Click += Dialog_Click; + + mnuProject.Click += Project_Click; + mnuProperties.Click += Properties_Click; + mnuConsole.Click += Console_Click; + + mnuAbout.Click += About_Click; + } + + #endregion + + #region Event Handler Region + + private void NewFile_Click(object sender, EventArgs e) + { + var newFile = new DockDocument(); + DockPanel.AddContent(newFile); + } + + private void Close_Click(object sender, EventArgs e) + { + Close(); + } + + private void Dialog_Click(object sender, EventArgs e) + { + var test = new DialogTest(); + test.ShowDialog(); + } + + private void Project_Click(object sender, EventArgs e) + { + if (_dockProject.DockPanel == null) { - var about = new DialogAbout(); - about.ShowDialog(); - }; + DockPanel.AddContent(_dockProject); + mnuProject.Checked = true; + } + else + { + DockPanel.RemoveContent(_dockProject); + mnuProject.Checked = false; + } + } + + private void Properties_Click(object sender, EventArgs e) + { + if (_dockProperties.DockPanel == null) + { + DockPanel.AddContent(_dockProperties); + mnuProperties.Checked = true; + } + else + { + DockPanel.RemoveContent(_dockProperties); + mnuProperties.Checked = false; + } + } + + private void Console_Click(object sender, EventArgs e) + { + if (_dockConsole.DockPanel == null) + { + DockPanel.AddContent(_dockConsole); + mnuConsole.Checked = true; + } + else + { + DockPanel.RemoveContent(_dockConsole); + mnuConsole.Checked = false; + } + } + + private void About_Click(object sender, EventArgs e) + { + var about = new DialogAbout(); + about.ShowDialog(); } #endregion diff --git a/Example/Icons.Designer.cs b/Example/Icons.Designer.cs index 4838e0b..27854a3 100644 --- a/Example/Icons.Designer.cs +++ b/Example/Icons.Designer.cs @@ -60,6 +60,16 @@ namespace Example { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap application_16x { + get { + object obj = ResourceManager.GetObject("application_16x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -70,6 +80,16 @@ namespace Example { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Console { + get { + object obj = ResourceManager.GetObject("Console", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -110,6 +130,16 @@ namespace Example { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap properties_16xLG { + get { + object obj = ResourceManager.GetObject("properties_16xLG", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/Example/Icons.resx b/Example/Icons.resx index 672a26c..480b287 100644 --- a/Example/Icons.resx +++ b/Example/Icons.resx @@ -124,6 +124,12 @@ Resources\StatusAnnotations_Information_16xMD_color.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Resources\StatusAnnotations_Information_16xLG_color.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\application_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\Close_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -133,10 +139,13 @@ Resources\NewFile_6276.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Resources\properties_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\folder_Closed_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Resources\StatusAnnotations_Information_16xLG_color.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Resources\Console.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/Example/Resources/Console.png b/Example/Resources/Console.png new file mode 100644 index 0000000000000000000000000000000000000000..406db1122794bc3d79e3ccec21eaa62592b864f8 GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5he4R}c>anMpkRil zi(^Pd+}%lrTnz?1uGQP-C~da&+S@tzt?HYY{6%_^$}BAojs}t<_IsYT*BnwmsH>F3 zFT}tgwoht9{&Cmm%T4aFy;yoqyZGU*E9s20EL>(PFM7$eaO>31Q*>oHE;W9t|H>|R b=(QDNoIYDtkfF2|&`t(VS3j3^P6Kg6;-4dVRB3^k;{d$bBFo$_P$UX*7S3j3^P6iXQ+_P<4^E~eg<`c@G0!r2#gk@Piz)=*< z@SPJm!Y~Y~>pJNu%kx}e00ByfAggH_26#VfC*(g+H4KBCaQgu?O_R!%BP`(`*ko8# z5Cl{T9 Date: Sat, 19 Sep 2015 13:16:44 +0100 Subject: [PATCH 26/97] Fixed docking groups Groups were being kept on scope because they weren't being removed from the region's control array. --- DarkUI/DarkUI.csproj | 1 + DarkUI/Docking/DarkDockRegion.cs | 17 +++++++++++------ DarkUI/Docking/Items/DarkDockSplitter.cs | 6 ++++++ Example/Forms/Docking/DockConsole.Designer.cs | 14 ++++++++++++++ Example/Forms/Docking/DockConsole.cs | 7 +++++++ Example/Forms/Docking/DockProject.Designer.cs | 16 ++++++++++++++++ Example/Forms/Docking/DockProject.cs | 19 +++++++++++++++++++ .../Forms/Docking/DockProperties.Designer.cs | 2 +- 8 files changed, 75 insertions(+), 7 deletions(-) create mode 100644 DarkUI/Docking/Items/DarkDockSplitter.cs diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index 0280617..5cc190d 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -106,6 +106,7 @@ UserControl + Form diff --git a/DarkUI/Docking/DarkDockRegion.cs b/DarkUI/Docking/DarkDockRegion.cs index 83c8c98..ad0ba76 100644 --- a/DarkUI/Docking/DarkDockRegion.cs +++ b/DarkUI/Docking/DarkDockRegion.cs @@ -72,13 +72,10 @@ namespace DarkUI // If that was the final content in the group then remove the group if (group.ContentCount == 0) - { - _groups.Remove(group); - PositionGroups(); - } + RemoveGroup(group); - // Check if we have any groups left. If not then hide the region - if (_groups.Count == 0) + // If we just removed the final group, and this isn't the document region, then hide + if (_groups.Count == 0 && DockArea != DarkDockArea.Document) Visible = false; } @@ -93,6 +90,14 @@ namespace DarkUI return newGroup; } + private void RemoveGroup(DarkDockGroup group) + { + _groups.Remove(group); + Controls.Remove(group); + + PositionGroups(); + } + private void PositionGroups() { DockStyle dockStyle; diff --git a/DarkUI/Docking/Items/DarkDockSplitter.cs b/DarkUI/Docking/Items/DarkDockSplitter.cs new file mode 100644 index 0000000..49a2b6f --- /dev/null +++ b/DarkUI/Docking/Items/DarkDockSplitter.cs @@ -0,0 +1,6 @@ +namespace DarkUI +{ + public class DarkDockSplitter + { + } +} diff --git a/Example/Forms/Docking/DockConsole.Designer.cs b/Example/Forms/Docking/DockConsole.Designer.cs index 68297e1..0ee49df 100644 --- a/Example/Forms/Docking/DockConsole.Designer.cs +++ b/Example/Forms/Docking/DockConsole.Designer.cs @@ -28,12 +28,24 @@ /// private void InitializeComponent() { + this.lstConsole = new DarkUI.DarkListView(); this.SuspendLayout(); // + // lstConsole + // + this.lstConsole.Dock = System.Windows.Forms.DockStyle.Fill; + this.lstConsole.Location = new System.Drawing.Point(0, 25); + this.lstConsole.MultiSelect = true; + this.lstConsole.Name = "lstConsole"; + this.lstConsole.Size = new System.Drawing.Size(500, 175); + this.lstConsole.TabIndex = 0; + this.lstConsole.Text = "darkListView1"; + // // DockConsole // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lstConsole); this.DockArea = DarkUI.DarkDockArea.Bottom; this.DockText = "Console"; this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -45,5 +57,7 @@ } #endregion + + private DarkUI.DarkListView lstConsole; } } diff --git a/Example/Forms/Docking/DockConsole.cs b/Example/Forms/Docking/DockConsole.cs index edb5400..e7da119 100644 --- a/Example/Forms/Docking/DockConsole.cs +++ b/Example/Forms/Docking/DockConsole.cs @@ -9,6 +9,13 @@ namespace Example public DockConsole() { InitializeComponent(); + + // Build dummy list data + for (var i = 0; i < 100; i++) + { + var item = new DarkListItem(string.Format("List item #{0}", i)); + lstConsole.Items.Add(item); + } } #endregion diff --git a/Example/Forms/Docking/DockProject.Designer.cs b/Example/Forms/Docking/DockProject.Designer.cs index 95ac14f..284084d 100644 --- a/Example/Forms/Docking/DockProject.Designer.cs +++ b/Example/Forms/Docking/DockProject.Designer.cs @@ -28,12 +28,26 @@ /// private void InitializeComponent() { + this.treeProject = new DarkUI.DarkTreeView(); this.SuspendLayout(); // + // treeProject + // + this.treeProject.AllowMoveNodes = true; + this.treeProject.Dock = System.Windows.Forms.DockStyle.Fill; + this.treeProject.Location = new System.Drawing.Point(0, 25); + this.treeProject.MultiSelect = true; + this.treeProject.Name = "treeProject"; + this.treeProject.ShowIcons = true; + this.treeProject.Size = new System.Drawing.Size(280, 425); + this.treeProject.TabIndex = 0; + this.treeProject.Text = "darkTreeView1"; + // // DockProject // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.treeProject); this.DockArea = DarkUI.DarkDockArea.Left; this.DockText = "Project Explorer"; this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -45,5 +59,7 @@ } #endregion + + private DarkUI.DarkTreeView treeProject; } } diff --git a/Example/Forms/Docking/DockProject.cs b/Example/Forms/Docking/DockProject.cs index af0d9c0..8b6ca6b 100644 --- a/Example/Forms/Docking/DockProject.cs +++ b/Example/Forms/Docking/DockProject.cs @@ -9,6 +9,25 @@ namespace Example public DockProject() { InitializeComponent(); + + // Build dummy nodes + var childCount = 0; + for (var i = 0; i < 20; i++) + { + var node = new DarkTreeNode(string.Format("Root node #{0}", i)); + node.ExpandedIcon = Icons.folder_open; + node.Icon = Icons.folder_closed; + + for (var x = 0; x < 10; x++) + { + var childNode = new DarkTreeNode(string.Format("Child node #{0}", childCount)); + childNode.Icon = Icons.files; + childCount++; + node.Nodes.Add(childNode); + } + + treeProject.Nodes.Add(node); + } } #endregion diff --git a/Example/Forms/Docking/DockProperties.Designer.cs b/Example/Forms/Docking/DockProperties.Designer.cs index c47ae7c..f3fecaf 100644 --- a/Example/Forms/Docking/DockProperties.Designer.cs +++ b/Example/Forms/Docking/DockProperties.Designer.cs @@ -34,7 +34,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.DockArea = DarkUI.DarkDockArea.Right; + this.DockArea = DarkUI.DarkDockArea.Left; this.DockText = "Properties"; this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = global::Example.Icons.properties_16xLG; From 964bf6708eb28d21c3d161b4a6b4108b4f649e23 Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 19 Sep 2015 13:37:08 +0100 Subject: [PATCH 27/97] Added more panels to example project --- DarkUI/Docking/DarkDockRegion.cs | 1 + Example/Example.csproj | 24 ++ Example/Forms/Docking/DockHistory.Designer.cs | 62 +++++ Example/Forms/Docking/DockHistory.cs | 23 ++ Example/Forms/Docking/DockHistory.resx | 120 ++++++++ Example/Forms/Docking/DockLayers.Designer.cs | 62 +++++ Example/Forms/Docking/DockLayers.cs | 23 ++ Example/Forms/Docking/DockLayers.resx | 120 ++++++++ .../Forms/Docking/DockProperties.Designer.cs | 2 +- Example/Forms/MainForm.Designer.cs | 92 +++++-- Example/Forms/MainForm.cs | 67 +++-- Example/Forms/MainForm.resx | 257 +++++++++++++++++- Example/Icons.Designer.cs | 20 ++ Example/Icons.resx | 12 +- Example/Resources/Collection_16xLG.png | Bin 0 -> 266 bytes Example/Resources/RefactoringLog_12810.png | Bin 0 -> 15089 bytes 16 files changed, 821 insertions(+), 64 deletions(-) create mode 100644 Example/Forms/Docking/DockHistory.Designer.cs create mode 100644 Example/Forms/Docking/DockHistory.cs create mode 100644 Example/Forms/Docking/DockHistory.resx create mode 100644 Example/Forms/Docking/DockLayers.Designer.cs create mode 100644 Example/Forms/Docking/DockLayers.cs create mode 100644 Example/Forms/Docking/DockLayers.resx create mode 100644 Example/Resources/Collection_16xLG.png create mode 100644 Example/Resources/RefactoringLog_12810.png diff --git a/DarkUI/Docking/DarkDockRegion.cs b/DarkUI/Docking/DarkDockRegion.cs index ad0ba76..e1874ea 100644 --- a/DarkUI/Docking/DarkDockRegion.cs +++ b/DarkUI/Docking/DarkDockRegion.cs @@ -84,6 +84,7 @@ namespace DarkUI var newGroup = new DarkDockGroup(DockPanel, this); _groups.Add(newGroup); Controls.Add(newGroup); + newGroup.BringToFront(); PositionGroups(); diff --git a/Example/Example.csproj b/Example/Example.csproj index d41da30..8cf6514 100644 --- a/Example/Example.csproj +++ b/Example/Example.csproj @@ -65,6 +65,18 @@ DockConsole.cs + + UserControl + + + DockHistory.cs + + + UserControl + + + DockLayers.cs + UserControl @@ -102,6 +114,12 @@ DockConsole.cs + + DockHistory.cs + + + DockLayers.cs + DockProperties.cs @@ -171,6 +189,12 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Example/Forms/Docking/DockLayers.Designer.cs b/Example/Forms/Docking/DockLayers.Designer.cs new file mode 100644 index 0000000..955126b --- /dev/null +++ b/Example/Forms/Docking/DockLayers.Designer.cs @@ -0,0 +1,62 @@ +namespace Example +{ + partial class DockLayers + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.lstLayers = new DarkUI.DarkListView(); + this.SuspendLayout(); + // + // lstLayers + // + this.lstLayers.Dock = System.Windows.Forms.DockStyle.Fill; + this.lstLayers.Location = new System.Drawing.Point(0, 25); + this.lstLayers.Name = "lstLayers"; + this.lstLayers.Size = new System.Drawing.Size(280, 425); + this.lstLayers.TabIndex = 0; + this.lstLayers.Text = "darkListView1"; + // + // DockLayers + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lstLayers); + this.DockArea = DarkUI.DarkDockArea.Right; + this.DockText = "Layers"; + this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Icon = global::Example.Icons.Collection_16xLG; + this.Name = "DockLayers"; + this.Size = new System.Drawing.Size(280, 450); + this.ResumeLayout(false); + + } + + #endregion + + private DarkUI.DarkListView lstLayers; + } +} diff --git a/Example/Forms/Docking/DockLayers.cs b/Example/Forms/Docking/DockLayers.cs new file mode 100644 index 0000000..9ed47ed --- /dev/null +++ b/Example/Forms/Docking/DockLayers.cs @@ -0,0 +1,23 @@ +using DarkUI; + +namespace Example +{ + public partial class DockLayers : DarkToolWindow + { + #region Constructor Region + + public DockLayers() + { + InitializeComponent(); + + // Build dummy list data + for (var i = 0; i < 100; i++) + { + var item = new DarkListItem(string.Format("List item #{0}", i)); + lstLayers.Items.Add(item); + } + } + + #endregion + } +} diff --git a/Example/Forms/Docking/DockLayers.resx b/Example/Forms/Docking/DockLayers.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Example/Forms/Docking/DockLayers.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Example/Forms/Docking/DockProperties.Designer.cs b/Example/Forms/Docking/DockProperties.Designer.cs index f3fecaf..c47ae7c 100644 --- a/Example/Forms/Docking/DockProperties.Designer.cs +++ b/Example/Forms/Docking/DockProperties.Designer.cs @@ -34,7 +34,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.DockArea = DarkUI.DarkDockArea.Left; + this.DockArea = DarkUI.DarkDockArea.Right; this.DockText = "Properties"; this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = global::Example.Icons.properties_16xLG; diff --git a/Example/Forms/MainForm.Designer.cs b/Example/Forms/MainForm.Designer.cs index 2e09db1..a7dc2d9 100644 --- a/Example/Forms/MainForm.Designer.cs +++ b/Example/Forms/MainForm.Designer.cs @@ -38,6 +38,11 @@ this.mnuDialog = new System.Windows.Forms.ToolStripMenuItem(); this.mnuTools = new System.Windows.Forms.ToolStripMenuItem(); this.mnuWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuProject = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuProperties = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuConsole = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuLayers = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuHistory = new System.Windows.Forms.ToolStripMenuItem(); this.mnuHelp = new System.Windows.Forms.ToolStripMenuItem(); this.mnuAbout = new System.Windows.Forms.ToolStripMenuItem(); this.toolMain = new DarkUI.DarkToolStrip(); @@ -47,9 +52,7 @@ this.toolStripStatusLabel6 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel5 = new System.Windows.Forms.ToolStripStatusLabel(); this.DockPanel = new DarkUI.DarkDockPanel(); - this.mnuProject = new System.Windows.Forms.ToolStripMenuItem(); - this.mnuProperties = new System.Windows.Forms.ToolStripMenuItem(); - this.mnuConsole = new System.Windows.Forms.ToolStripMenuItem(); + this.darkSeparator1 = new DarkUI.DarkSeparator(); this.mnuMain.SuspendLayout(); this.toolMain.SuspendLayout(); this.stripMain.SuspendLayout(); @@ -137,12 +140,54 @@ this.mnuWindow.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mnuProject, this.mnuProperties, - this.mnuConsole}); + this.mnuConsole, + this.mnuLayers, + this.mnuHistory}); this.mnuWindow.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); this.mnuWindow.Name = "mnuWindow"; this.mnuWindow.Size = new System.Drawing.Size(63, 20); this.mnuWindow.Text = "&Window"; // + // mnuProject + // + this.mnuProject.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuProject.Image = global::Example.Icons.application_16x; + this.mnuProject.Name = "mnuProject"; + this.mnuProject.Size = new System.Drawing.Size(156, 22); + this.mnuProject.Text = "&Project Explorer"; + // + // mnuProperties + // + this.mnuProperties.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuProperties.Image = global::Example.Icons.properties_16xLG; + this.mnuProperties.Name = "mnuProperties"; + this.mnuProperties.Size = new System.Drawing.Size(156, 22); + this.mnuProperties.Text = "P&roperties"; + // + // mnuConsole + // + this.mnuConsole.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuConsole.Image = global::Example.Icons.Console; + this.mnuConsole.Name = "mnuConsole"; + this.mnuConsole.Size = new System.Drawing.Size(156, 22); + this.mnuConsole.Text = "&Console"; + // + // mnuLayers + // + this.mnuLayers.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuLayers.Image = global::Example.Icons.Collection_16xLG; + this.mnuLayers.Name = "mnuLayers"; + this.mnuLayers.Size = new System.Drawing.Size(156, 22); + this.mnuLayers.Text = "&Layers"; + // + // mnuHistory + // + this.mnuHistory.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.mnuHistory.Image = ((System.Drawing.Image)(resources.GetObject("mnuHistory.Image"))); + this.mnuHistory.Name = "mnuHistory"; + this.mnuHistory.Size = new System.Drawing.Size(156, 22); + this.mnuHistory.Text = "&History"; + // // mnuHelp // this.mnuHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -168,7 +213,7 @@ this.toolMain.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.toolMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.btnNewFile}); - this.toolMain.Location = new System.Drawing.Point(0, 24); + this.toolMain.Location = new System.Drawing.Point(0, 26); this.toolMain.Name = "toolMain"; this.toolMain.Padding = new System.Windows.Forms.Padding(5, 0, 1, 0); this.toolMain.Size = new System.Drawing.Size(784, 28); @@ -232,34 +277,19 @@ // this.DockPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); this.DockPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.DockPanel.Location = new System.Drawing.Point(0, 52); + this.DockPanel.Location = new System.Drawing.Point(0, 54); this.DockPanel.Name = "DockPanel"; - this.DockPanel.Size = new System.Drawing.Size(784, 486); + this.DockPanel.Size = new System.Drawing.Size(784, 484); this.DockPanel.TabIndex = 3; // - // mnuProject + // darkSeparator1 // - this.mnuProject.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.mnuProject.Image = global::Example.Icons.application_16x; - this.mnuProject.Name = "mnuProject"; - this.mnuProject.Size = new System.Drawing.Size(156, 22); - this.mnuProject.Text = "&Project Explorer"; - // - // mnuProperties - // - this.mnuProperties.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.mnuProperties.Image = global::Example.Icons.properties_16xLG; - this.mnuProperties.Name = "mnuProperties"; - this.mnuProperties.Size = new System.Drawing.Size(156, 22); - this.mnuProperties.Text = "P&roperties"; - // - // mnuConsole - // - this.mnuConsole.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.mnuConsole.Image = global::Example.Icons.Console; - this.mnuConsole.Name = "mnuConsole"; - this.mnuConsole.Size = new System.Drawing.Size(156, 22); - this.mnuConsole.Text = "&Console"; + this.darkSeparator1.Dock = System.Windows.Forms.DockStyle.Top; + this.darkSeparator1.Location = new System.Drawing.Point(0, 24); + this.darkSeparator1.Name = "darkSeparator1"; + this.darkSeparator1.Size = new System.Drawing.Size(784, 2); + this.darkSeparator1.TabIndex = 4; + this.darkSeparator1.Text = "darkSeparator1"; // // MainForm // @@ -269,6 +299,7 @@ this.Controls.Add(this.DockPanel); this.Controls.Add(this.stripMain); this.Controls.Add(this.toolMain); + this.Controls.Add(this.darkSeparator1); this.Controls.Add(this.mnuMain); this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); @@ -311,6 +342,9 @@ private System.Windows.Forms.ToolStripMenuItem mnuProject; private System.Windows.Forms.ToolStripMenuItem mnuProperties; private System.Windows.Forms.ToolStripMenuItem mnuConsole; + private System.Windows.Forms.ToolStripMenuItem mnuLayers; + private System.Windows.Forms.ToolStripMenuItem mnuHistory; + private DarkUI.DarkSeparator darkSeparator1; } } diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index 3a2ce30..5672673 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -11,6 +11,8 @@ namespace Example private DockProject _dockProject; private DockProperties _dockProperties; private DockConsole _dockConsole; + private DockLayers _dockLayers; + private DockHistory _dockHistory; #endregion @@ -32,15 +34,21 @@ namespace Example _dockProject = new DockProject(); _dockProperties = new DockProperties(); _dockConsole = new DockConsole(); + _dockLayers = new DockLayers(); + _dockHistory = new DockHistory(); DockPanel.AddContent(_dockProject); DockPanel.AddContent(_dockProperties); DockPanel.AddContent(_dockConsole); + DockPanel.AddContent(_dockLayers); + DockPanel.AddContent(_dockHistory); // Show the tool windows as visible in the 'Window' menu mnuProject.Checked = true; mnuProperties.Checked = true; mnuConsole.Checked = true; + mnuLayers.Checked = true; + mnuHistory.Checked = true; // Hook in all the UI events manually for clarity. HookEvents(); @@ -62,10 +70,26 @@ namespace Example mnuProject.Click += Project_Click; mnuProperties.Click += Properties_Click; mnuConsole.Click += Console_Click; + mnuLayers.Click += Layers_Click; + mnuHistory.Click += History_Click; mnuAbout.Click += About_Click; } + private void ToggleToolWindow(DarkToolWindow toolWindow, ToolStripMenuItem menuItem) + { + if (toolWindow.DockPanel == null) + { + DockPanel.AddContent(toolWindow); + menuItem.Checked = true; + } + else + { + DockPanel.RemoveContent(toolWindow); + menuItem.Checked = false; + } + } + #endregion #region Event Handler Region @@ -89,44 +113,27 @@ namespace Example private void Project_Click(object sender, EventArgs e) { - if (_dockProject.DockPanel == null) - { - DockPanel.AddContent(_dockProject); - mnuProject.Checked = true; - } - else - { - DockPanel.RemoveContent(_dockProject); - mnuProject.Checked = false; - } + ToggleToolWindow(_dockProject, mnuProject); } private void Properties_Click(object sender, EventArgs e) { - if (_dockProperties.DockPanel == null) - { - DockPanel.AddContent(_dockProperties); - mnuProperties.Checked = true; - } - else - { - DockPanel.RemoveContent(_dockProperties); - mnuProperties.Checked = false; - } + ToggleToolWindow(_dockProperties, mnuProperties); } private void Console_Click(object sender, EventArgs e) { - if (_dockConsole.DockPanel == null) - { - DockPanel.AddContent(_dockConsole); - mnuConsole.Checked = true; - } - else - { - DockPanel.RemoveContent(_dockConsole); - mnuConsole.Checked = false; - } + ToggleToolWindow(_dockConsole, mnuConsole); + } + + private void Layers_Click(object sender, EventArgs e) + { + ToggleToolWindow(_dockLayers, mnuLayers); + } + + private void History_Click(object sender, EventArgs e) + { + ToggleToolWindow(_dockHistory, mnuHistory); } private void About_Click(object sender, EventArgs e) diff --git a/Example/Forms/MainForm.resx b/Example/Forms/MainForm.resx index c15ccc5..8e545dd 100644 --- a/Example/Forms/MainForm.resx +++ b/Example/Forms/MainForm.resx @@ -120,13 +120,268 @@ 17, 17 + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1 + MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsMAAA7DAcdvqGQAADnsaVRYdFhNTDpjb20uYWRvYmUu + eG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/ + Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29y + ZSA1LjY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ICA8ZXhpZjpDb2xvclNwYWNlPjY1NTM1PC9leGlmOkNvbG9yU3BhY2U+ + CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4xNjwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAg + ICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4xNjwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAg + IDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAog + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + IAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAK + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAog + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + IAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAK + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSJ3Ij8+iJwASgAA + AFdJREFUOE/tzjEOwCAMQ9GcLfe/S2HJ6oohCKVWCkhsDG8jHwsAMTPsaLc9oKpLPgGPlKf+ogEvs4No + aoEHR2mAPYrSQFyQoYH4S+YuOL1gFl2wqgf2QV5u4jFIagD6hAAAAABJRU5ErkJggg== + + 121, 17 222, 17 - AAABAAEAECAAAAEAIACcAAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAAFz diff --git a/Example/Icons.Designer.cs b/Example/Icons.Designer.cs index 27854a3..62df36a 100644 --- a/Example/Icons.Designer.cs +++ b/Example/Icons.Designer.cs @@ -80,6 +80,16 @@ namespace Example { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Collection_16xLG { + get { + object obj = ResourceManager.GetObject("Collection_16xLG", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -140,6 +150,16 @@ namespace Example { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap RefactoringLog_12810 { + get { + object obj = ResourceManager.GetObject("RefactoringLog_12810", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/Example/Icons.resx b/Example/Icons.resx index 480b287..02eb914 100644 --- a/Example/Icons.resx +++ b/Example/Icons.resx @@ -124,6 +124,9 @@ Resources\StatusAnnotations_Information_16xMD_color.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Resources\folder_Closed_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\StatusAnnotations_Information_16xLG_color.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -142,10 +145,13 @@ Resources\properties_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Resources\folder_Closed_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - Resources\Console.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Resources\Collection_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\RefactoringLog_12810.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Example/Resources/Collection_16xLG.png b/Example/Resources/Collection_16xLG.png new file mode 100644 index 0000000000000000000000000000000000000000..611a8fff89707743c56c23e469a5ea06b8023788 GIT binary patch literal 266 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAP*5S+ zBgmJ5p-Pp3p`n?9;pcxK{gQ#9)PRBERRRNp)eHs(@%%~gN8NyGCwRIzhE&{I5^TtK z*nq=E%fD{+bhGz4n}6hPyTp^yu|kSFY0d`OL&s$$lF}F$1Q$-(#H^gu^QC{L}j1QYJTuS_&1qJl|Fk{Zg(s?w>50vq6BG%*#>qw*=8#*1Kq~p>FVdQ I&MBb@0BXQnq5uE@ literal 0 HcmV?d00001 diff --git a/Example/Resources/RefactoringLog_12810.png b/Example/Resources/RefactoringLog_12810.png new file mode 100644 index 0000000000000000000000000000000000000000..6a59707827c84e65c2afe78d3982d9f519668465 GIT binary patch literal 15089 zcmeI3Ply{;7{JGivemi)okLmG1VSeR=b;J2aV@ z&dhGI3${g3Y(WJ7fQKF`9ux{f5B4JBp%sKe53L~fVnGj91+^7gz0^08|6h{Fg7qRV zkj#AVd*AoH_j}*>WiE4i`rz}UBU?uVK^UEyEX>gB=J31WVfy>jo%@JhHoB7wz94M6 z9DW~qf7hlb1wsGSnwt;ii!T`1sm77%lt{c@b?IzD$c)!rgpZLxERjXa&c=TG{L7eV znc3K3t*8{;JXx|P*E}-2c5n`_9mBdA8_$ho>IQXCB>@ua)r##K^=vHiYtZ{}SdNL& zl;Bu4HW3CC=Zn)~-tma2#ZwYi)ZJoQkE>cLt*4(A6I7O!F*%_~if(90LrI9uPb@b= z?=qfQHf9R@o8hRGjV%R%Yshk~R*Tn?amQPfRbAI*B_Ssg5}hIWt9F3ulI?GAIBEGQ z5FdM%8(5AlhJI1WSq`$XSQx1NY3{4)wgcIIlO3ff*O4o$aYY_tR4lU1s?~v(ez0$a zuB5rMfdT!wRhP&!#CMiGO!lo1JJ>#G5hiZ?ahJVH#K*)ksgNo)@#*5#flF|goWSvy zoFV&etB3ABu*#jo>DfZ48EQuA))2E$(=dxtp>aYPntw*#BPejZImfBw8d)~oTD_Rh zM_DC4bJ(&?r{?d>$k3#7-W_kGfC7@E`KZxMlvI6AO&ST+NRI7NR6|j^oHS+vA4Qt` zCJNAcy!6b4ejL*(udd5WXJ)UDV$qng{Q%jROcio;?{UjAX|5+rs)~_h?k1)*rtLV(Es6DfkVGF?V1P?xj5K!-ew_9ay5niKBDq`@>LrDD2zDXEyIluppSl#*#8>3X_U zLS)`kt`9-Of0z027_}v0v(mreDw;LiiSLwy8uG}* zBF&KXRA$3#uNicok;7hHvHpXD@X^Y@JBIaD)&JrcI$4aDkiAIEoZL#_*1-Bsu5q5d zmDQ@&{z}Z4*eE+*6$Lq~iWZ6N+KU;vGuVll>GYtyQ*peaW0G7lBM%zxvI_s44B91V z#-gY?X?N-ygY)OZYOgFu^YxTMKe8JBHch+L&~$-q+O3AB9m^MOE6CA)9W4|LcUgu1 zphg5^mOku}TuRfDT1JM$&|=!ElgfO-qJ7>E`<0q%+CarX!-ZjnU5ch*BNe(H%c2@@ zjM9fb`n)N(A2|EUzuhGtg_X0a}g=0AY(97n={za$EoiTjaRde1MkY0zlXz$HnFYv>X=z!WKC$ zHXoqnxBw8g$Z@gx04>J_fUrf5i_HgUIW7Q%Epl9JK0wQH0U&IV<6`pxT8;|} Date: Sat, 19 Sep 2015 14:11:04 +0100 Subject: [PATCH 28/97] Added dock region splitters --- DarkUI/Config/Enums.cs | 8 ++ DarkUI/Docking/DarkDockPanel.cs | 19 +++++ DarkUI/Docking/DarkDockRegion.cs | 34 ++++++++ DarkUI/Docking/Items/DarkDockSplitter.cs | 64 +++++++++++++- DarkUI/Win32/DarkDockResizeFilter.cs | 101 ++++++++++++++++++++++- 5 files changed, 224 insertions(+), 2 deletions(-) diff --git a/DarkUI/Config/Enums.cs b/DarkUI/Config/Enums.cs index 2f7b317..2e4d0c7 100644 --- a/DarkUI/Config/Enums.cs +++ b/DarkUI/Config/Enums.cs @@ -53,4 +53,12 @@ Right, Bottom } + + public enum DarkSplitterType + { + Left, + Right, + Top, + Bottom + } } diff --git a/DarkUI/Docking/DarkDockPanel.cs b/DarkUI/Docking/DarkDockPanel.cs index ed8e582..5ed2fa6 100644 --- a/DarkUI/Docking/DarkDockPanel.cs +++ b/DarkUI/Docking/DarkDockPanel.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.ComponentModel; using System.Windows.Forms; namespace DarkUI @@ -14,14 +15,32 @@ namespace DarkUI #region Property Region + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IMessageFilter MessageFilter { get; private set; } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public List Splitters { get; private set; } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public MouseButtons MouseButtonState + { + get + { + var buttonState = MouseButtons; + return buttonState; + } + } + #endregion #region Constructor Region public DarkDockPanel() { + Splitters = new List(); MessageFilter = new DarkDockResizeFilter(this); _regions = new Dictionary(); diff --git a/DarkUI/Docking/DarkDockRegion.cs b/DarkUI/Docking/DarkDockRegion.cs index e1874ea..7b26095 100644 --- a/DarkUI/Docking/DarkDockRegion.cs +++ b/DarkUI/Docking/DarkDockRegion.cs @@ -11,6 +11,7 @@ namespace DarkUI #region Field Region private List _groups; + private DarkDockSplitter _splitter; #endregion @@ -32,6 +33,7 @@ namespace DarkUI DockArea = dockArea; BuildProperties(); + CreateSplitter(); } #endregion @@ -152,6 +154,38 @@ namespace DarkUI } } + private void CreateSplitter() + { + switch (DockArea) + { + case DarkDockArea.Left: + _splitter = new DarkDockSplitter(this, DarkSplitterType.Right); + break; + case DarkDockArea.Right: + _splitter = new DarkDockSplitter(this, DarkSplitterType.Left); + break; + case DarkDockArea.Bottom: + _splitter = new DarkDockSplitter(this, DarkSplitterType.Top); + break; + default: + return; + } + + DockPanel.Splitters.Add(_splitter); + } + + #endregion + + #region Event Handler Region + + protected override void OnLayout(LayoutEventArgs e) + { + base.OnLayout(e); + + if (_splitter != null) + _splitter.UpdateBounds(); + } + #endregion #region Paint Region diff --git a/DarkUI/Docking/Items/DarkDockSplitter.cs b/DarkUI/Docking/Items/DarkDockSplitter.cs index 49a2b6f..7696e03 100644 --- a/DarkUI/Docking/Items/DarkDockSplitter.cs +++ b/DarkUI/Docking/Items/DarkDockSplitter.cs @@ -1,6 +1,68 @@ -namespace DarkUI +using System.Drawing; +using System.Windows.Forms; + +namespace DarkUI { public class DarkDockSplitter { + #region Field Region + + private Control _control; + private DarkSplitterType _splitterType; + + #endregion + + #region Property Region + + public Rectangle Bounds { get; set; } + + public Cursor ResizeCursor { get; private set; } + + #endregion + + #region Constructor Region + + public DarkDockSplitter(Control control, DarkSplitterType splitterType) + { + _control = control; + _splitterType = splitterType; + + switch (_splitterType) + { + case DarkSplitterType.Left: + case DarkSplitterType.Right: + ResizeCursor = Cursors.SizeWE; + break; + case DarkSplitterType.Top: + case DarkSplitterType.Bottom: + ResizeCursor = Cursors.SizeNS; + break; + } + } + + #endregion + + #region Method Region + + public void UpdateBounds() + { + switch (_splitterType) + { + case DarkSplitterType.Left: + Bounds = new Rectangle(_control.Left - 2, _control.Top, 5, _control.Height); + break; + case DarkSplitterType.Right: + Bounds = new Rectangle(_control.Right - 3, _control.Top, 5, _control.Height); + break; + case DarkSplitterType.Top: + Bounds = new Rectangle(_control.Left, _control.Top - 2, _control.Width, 5); + break; + case DarkSplitterType.Bottom: + Bounds = new Rectangle(_control.Left, _control.Bottom - 5, _control.Width, 5); + break; + } + } + + #endregion } } diff --git a/DarkUI/Win32/DarkDockResizeFilter.cs b/DarkUI/Win32/DarkDockResizeFilter.cs index 666b6e1..9ad7c9e 100644 --- a/DarkUI/Win32/DarkDockResizeFilter.cs +++ b/DarkUI/Win32/DarkDockResizeFilter.cs @@ -1,4 +1,5 @@ -using System.Windows.Forms; +using System.Drawing; +using System.Windows.Forms; namespace DarkUI { @@ -8,6 +9,9 @@ namespace DarkUI private DarkDockPanel _dockPanel; + private bool _isDragging; + private DarkDockSplitter _activeSplitter; + #endregion #region Constructor Region @@ -23,9 +27,104 @@ namespace DarkUI public bool PreFilterMessage(ref Message m) { + // We only care about mouse events + if (!(m.Msg == (int)WM.MOUSEMOVE || + m.Msg == (int)WM.LBUTTONDOWN || m.Msg == (int)WM.LBUTTONUP || m.Msg == (int)WM.LBUTTONDBLCLK || + m.Msg == (int)WM.RBUTTONDOWN || m.Msg == (int)WM.RBUTTONUP || m.Msg == (int)WM.RBUTTONDBLCLK)) + return false; + + // Exit out early if we're simply releasing a drag over the area + if (m.Msg == (int)WM.LBUTTONUP && !_isDragging) + return false; + + // Force cursor if already dragging. + ForceDraggingCursor(); + + // Stop all events from going through if we're dragging a splitter. + if (_isDragging) + return true; + + // Return out early if we're dragging something that's not a splitter. + if (m.Msg == (int)WM.MOUSEMOVE && !_isDragging && _dockPanel.MouseButtonState != MouseButtons.None) + return false; + + // Try and create a control from the message handle. + var control = Control.FromHandle(m.HWnd); + + // Exit out if we didn't manage to create a control. + if (control == null) + return false; + + // Exit out if the control is not the dock panel or a child control. + if (!(control == _dockPanel || _dockPanel.Contains(control))) + return false; + + // Update the mouse cursor + CheckCursor(); + + // Start drag. + if (m.Msg == (int)WM.LBUTTONDOWN) + { + } + + // Stop drag. + if (m.Msg == (int)WM.LBUTTONUP) + { + } + + // Stop events passing through if we just started to drag something + if (_isDragging) + return true; + + // Stop events passing through if we're hovering over a splitter + foreach (var splitter in _dockPanel.Splitters) + { + if (splitter.Bounds.Contains(_dockPanel.PointToClient(Cursor.Position))) + return true; + } + return false; } #endregion + + #region Method Region + + private void ForceDraggingCursor() + { + if (_isDragging) + { + SetCursor(_activeSplitter.ResizeCursor); + return; + } + } + + private void ResetCursor() + { + Cursor.Current = Cursors.Default; + CheckCursor(); + } + + private void CheckCursor() + { + if (_isDragging) + return; + + foreach (var splitter in _dockPanel.Splitters) + { + if (splitter.Bounds.Contains(_dockPanel.PointToClient(Cursor.Position))) + { + SetCursor(splitter.ResizeCursor); + return; + } + } + } + + private void SetCursor(Cursor cursor) + { + Cursor.Current = cursor; + } + + #endregion } } \ No newline at end of file From 12f227f5425a9cadd9f0eadba5acde97b98b74ac Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 19 Sep 2015 14:39:06 +0100 Subject: [PATCH 29/97] Can now resize dock regions --- DarkUI/DarkUI.csproj | 1 + DarkUI/Docking/DarkDockRegion.cs | 14 ++++- DarkUI/Docking/Items/DarkDockSplitter.cs | 19 +++++++ DarkUI/Extensions/BitmapExtensions.cs | 6 +-- DarkUI/Extensions/IEnumerableExtensions.cs | 31 +++++++++++ DarkUI/Win32/DarkDockResizeFilter.cs | 63 ++++++++++++++-------- Example/Forms/MainForm.cs | 5 ++ 7 files changed, 112 insertions(+), 27 deletions(-) create mode 100644 DarkUI/Extensions/IEnumerableExtensions.cs diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index 5cc190d..aaa2a5e 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -108,6 +108,7 @@ + Form diff --git a/DarkUI/Docking/DarkDockRegion.cs b/DarkUI/Docking/DarkDockRegion.cs index 7b26095..c91a72a 100644 --- a/DarkUI/Docking/DarkDockRegion.cs +++ b/DarkUI/Docking/DarkDockRegion.cs @@ -86,7 +86,6 @@ namespace DarkUI var newGroup = new DarkDockGroup(DockPanel, this); _groups.Add(newGroup); Controls.Add(newGroup); - newGroup.BringToFront(); PositionGroups(); @@ -121,10 +120,21 @@ namespace DarkUI } if (_groups.Count == 1) + { _groups[0].Dock = DockStyle.Fill; + } else if (_groups.Count > 1) + { foreach (var group in _groups) - group.Dock = dockStyle; + { + group.SendToBack(); + + if (_groups.IsLast(group)) + group.Dock = dockStyle; + else + group.Dock = DockStyle.Fill; + } + } } private void BuildProperties() diff --git a/DarkUI/Docking/Items/DarkDockSplitter.cs b/DarkUI/Docking/Items/DarkDockSplitter.cs index 7696e03..f913fad 100644 --- a/DarkUI/Docking/Items/DarkDockSplitter.cs +++ b/DarkUI/Docking/Items/DarkDockSplitter.cs @@ -44,6 +44,25 @@ namespace DarkUI #region Method Region + public void Move(Point difference) + { + switch (_splitterType) + { + case DarkSplitterType.Left: + _control.Width += difference.X; + break; + case DarkSplitterType.Right: + _control.Width -= difference.X; + break; + case DarkSplitterType.Top: + _control.Height += difference.Y; + break; + case DarkSplitterType.Bottom: + _control.Height -= difference.Y; + break; + } + } + public void UpdateBounds() { switch (_splitterType) diff --git a/DarkUI/Extensions/BitmapExtensions.cs b/DarkUI/Extensions/BitmapExtensions.cs index 82f68d6..77eef6b 100644 --- a/DarkUI/Extensions/BitmapExtensions.cs +++ b/DarkUI/Extensions/BitmapExtensions.cs @@ -2,9 +2,9 @@ namespace DarkUI { - public static class BitmapExtensions + internal static class BitmapExtensions { - public static Bitmap SetColor(this Bitmap bitmap, Color color) + internal static Bitmap SetColor(this Bitmap bitmap, Color color) { var newBitmap = new Bitmap(bitmap.Width, bitmap.Height); for (int i = 0; i < bitmap.Width; i++) @@ -19,7 +19,7 @@ namespace DarkUI return newBitmap; } - public static Bitmap ChangeColor(this Bitmap bitmap, Color oldColor, Color newColor) + internal static Bitmap ChangeColor(this Bitmap bitmap, Color oldColor, Color newColor) { var newBitmap = new Bitmap(bitmap.Width, bitmap.Height); for (int i = 0; i < bitmap.Width; i++) diff --git a/DarkUI/Extensions/IEnumerableExtensions.cs b/DarkUI/Extensions/IEnumerableExtensions.cs new file mode 100644 index 0000000..2855a3a --- /dev/null +++ b/DarkUI/Extensions/IEnumerableExtensions.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace DarkUI +{ + internal static class IEnumerableExtensions + { + internal static bool IsLast(this IEnumerable items, T item) + { + var last = items.LastOrDefault(); + if (last == null) + return false; + return item.Equals(last); // OR Object.ReferenceEquals(last, item) + } + + internal static bool IsFirst(this IEnumerable items, T item) + { + var first = items.FirstOrDefault(); + if (first == null) + return false; + return item.Equals(first); + } + + internal static bool IsFirstOrLast(this IEnumerable items, T item) + { + return items.IsFirst(item) || items.IsLast(item); + } + } +} diff --git a/DarkUI/Win32/DarkDockResizeFilter.cs b/DarkUI/Win32/DarkDockResizeFilter.cs index 9ad7c9e..b324e3d 100644 --- a/DarkUI/Win32/DarkDockResizeFilter.cs +++ b/DarkUI/Win32/DarkDockResizeFilter.cs @@ -1,4 +1,5 @@ -using System.Drawing; +using System; +using System.Drawing; using System.Windows.Forms; namespace DarkUI @@ -10,6 +11,7 @@ namespace DarkUI private DarkDockPanel _dockPanel; private bool _isDragging; + private Point _initialContact; private DarkDockSplitter _activeSplitter; #endregion @@ -33,16 +35,13 @@ namespace DarkUI m.Msg == (int)WM.RBUTTONDOWN || m.Msg == (int)WM.RBUTTONUP || m.Msg == (int)WM.RBUTTONDBLCLK)) return false; - // Exit out early if we're simply releasing a drag over the area + // Exit out early if we're simply releasing a non-splitter drag over the area if (m.Msg == (int)WM.LBUTTONUP && !_isDragging) return false; // Force cursor if already dragging. - ForceDraggingCursor(); - - // Stop all events from going through if we're dragging a splitter. if (_isDragging) - return true; + Cursor.Current = _activeSplitter.ResizeCursor; // Return out early if we're dragging something that's not a splitter. if (m.Msg == (int)WM.MOUSEMOVE && !_isDragging && _dockPanel.MouseButtonState != MouseButtons.None) @@ -65,17 +64,26 @@ namespace DarkUI // Start drag. if (m.Msg == (int)WM.LBUTTONDOWN) { + foreach (var splitter in _dockPanel.Splitters) + { + if (splitter.Bounds.Contains(_dockPanel.PointToClient(Cursor.Position))) + { + StartDrag(splitter); + return true; + } + } } // Stop drag. if (m.Msg == (int)WM.LBUTTONUP) { + if (_isDragging) + { + StopDrag(); + return true; + } } - // Stop events passing through if we just started to drag something - if (_isDragging) - return true; - // Stop events passing through if we're hovering over a splitter foreach (var splitter in _dockPanel.Splitters) { @@ -83,6 +91,10 @@ namespace DarkUI return true; } + // Stop all events from going through if we're dragging a splitter. + if (_isDragging) + return true; + return false; } @@ -90,19 +102,25 @@ namespace DarkUI #region Method Region - private void ForceDraggingCursor() + private void StartDrag(DarkDockSplitter splitter) { - if (_isDragging) - { - SetCursor(_activeSplitter.ResizeCursor); - return; - } + Console.WriteLine("Start drag"); + + _activeSplitter = splitter; + Cursor.Current = _activeSplitter.ResizeCursor; + + _initialContact = Cursor.Position; + _isDragging = true; } - private void ResetCursor() + private void StopDrag() { - Cursor.Current = Cursors.Default; - CheckCursor(); + Console.WriteLine("Stop drag"); + + var difference = new Point(_initialContact.X - Cursor.Position.X, _initialContact.Y - Cursor.Position.Y); + _activeSplitter.Move(difference); + + _isDragging = false; } private void CheckCursor() @@ -114,15 +132,16 @@ namespace DarkUI { if (splitter.Bounds.Contains(_dockPanel.PointToClient(Cursor.Position))) { - SetCursor(splitter.ResizeCursor); + Cursor.Current = splitter.ResizeCursor; return; } } } - private void SetCursor(Cursor cursor) + private void ResetCursor() { - Cursor.Current = cursor; + Cursor.Current = Cursors.Default; + CheckCursor(); } #endregion diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index 5672673..b6316ed 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -43,6 +43,11 @@ namespace Example DockPanel.AddContent(_dockLayers); DockPanel.AddContent(_dockHistory); + // Add 3 dummy documents to the main document area of the dock panel + DockPanel.AddContent(new DockDocument { DockText = "Document 1" }); + DockPanel.AddContent(new DockDocument { DockText = "Document 2" }); + DockPanel.AddContent(new DockDocument { DockText = "Document 3" }); + // Show the tool windows as visible in the 'Window' menu mnuProject.Checked = true; mnuProperties.Checked = true; From 3c71944591e8a202294b29266de2654f185d182e Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 19 Sep 2015 15:30:09 +0100 Subject: [PATCH 30/97] Added translucent form for splitters --- DarkUI/DarkUI.csproj | 3 ++ DarkUI/Docking/Items/DarkDockSplitter.cs | 37 ++++++++++++++++++++++++ DarkUI/Forms/DarkTranslucentForm.cs | 30 +++++++++++++++++++ DarkUI/Win32/DarkDockResizeFilter.cs | 34 ++++++++++++++++++++-- DarkUI/Win32/Native.cs | 6 ++-- DarkUI/Win32/WindowsMessages.cs | 2 +- 6 files changed, 105 insertions(+), 7 deletions(-) create mode 100644 DarkUI/Forms/DarkTranslucentForm.cs diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index aaa2a5e..93d3e2a 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -124,6 +124,9 @@ DarkMessageBox.cs + + Form + True True diff --git a/DarkUI/Docking/Items/DarkDockSplitter.cs b/DarkUI/Docking/Items/DarkDockSplitter.cs index f913fad..9156f40 100644 --- a/DarkUI/Docking/Items/DarkDockSplitter.cs +++ b/DarkUI/Docking/Items/DarkDockSplitter.cs @@ -9,6 +9,7 @@ namespace DarkUI private Control _control; private DarkSplitterType _splitterType; + private DarkTranslucentForm _overlayForm; #endregion @@ -26,6 +27,7 @@ namespace DarkUI { _control = control; _splitterType = splitterType; + _overlayForm = new DarkTranslucentForm(Color.Black); switch (_splitterType) { @@ -44,6 +46,41 @@ namespace DarkUI #region Method Region + public void ShowOverlay() + { + _overlayForm.Show(); + UpdateOverlay(new Point(0, 0)); + } + + public void HideOverlay() + { + _overlayForm.Hide(); + } + + public void UpdateOverlay(Point difference) + { + var bounds = _control.RectangleToScreen(Bounds); + + switch (_splitterType) + { + case DarkSplitterType.Left: + bounds.Location = new Point(bounds.Location.X - difference.X, bounds.Location.Y); + break; + case DarkSplitterType.Right: + bounds.Location = new Point(bounds.Location.X - difference.X, bounds.Location.Y); + break; + case DarkSplitterType.Top: + bounds.Location = new Point(bounds.Location.X, bounds.Location.Y - difference.Y); + break; + case DarkSplitterType.Bottom: + bounds.Location = new Point(bounds.Location.X, bounds.Location.Y - difference.Y); + break; + } + + _overlayForm.Location = bounds.Location; + _overlayForm.Size = bounds.Size; + } + public void Move(Point difference) { switch (_splitterType) diff --git a/DarkUI/Forms/DarkTranslucentForm.cs b/DarkUI/Forms/DarkTranslucentForm.cs new file mode 100644 index 0000000..af957da --- /dev/null +++ b/DarkUI/Forms/DarkTranslucentForm.cs @@ -0,0 +1,30 @@ +using System.Drawing; +using System.Windows.Forms; + +namespace DarkUI +{ + internal class DarkTranslucentForm : Form + { + #region Property Region + + protected override bool ShowWithoutActivation + { + get { return true; } + } + + #endregion + + #region Constructor Region + + public DarkTranslucentForm(Color backColor, double opacity = 0.6) + { + FormBorderStyle = FormBorderStyle.None; + ShowInTaskbar = false; + AllowTransparency = true; + Opacity = opacity; + BackColor = backColor; + } + + #endregion + } +} diff --git a/DarkUI/Win32/DarkDockResizeFilter.cs b/DarkUI/Win32/DarkDockResizeFilter.cs index b324e3d..4e2a550 100644 --- a/DarkUI/Win32/DarkDockResizeFilter.cs +++ b/DarkUI/Win32/DarkDockResizeFilter.cs @@ -10,6 +10,7 @@ namespace DarkUI private DarkDockPanel _dockPanel; + private Timer _dragTimer; private bool _isDragging; private Point _initialContact; private DarkDockSplitter _activeSplitter; @@ -21,6 +22,10 @@ namespace DarkUI public DarkDockResizeFilter(DarkDockPanel dockPanel) { _dockPanel = dockPanel; + + _dragTimer = new Timer(); + _dragTimer.Interval = 1; + _dragTimer.Tick += DragTimer_Tick; } #endregion @@ -100,22 +105,45 @@ namespace DarkUI #endregion + #region Event Handler Region + + private void DragTimer_Tick(object sender, EventArgs e) + { + if (_dockPanel.MouseButtonState != MouseButtons.Left) + _isDragging = false; + + if (!_isDragging) + { + _activeSplitter.HideOverlay(); + _dragTimer.Stop(); + ResetCursor(); + return; + } + + var difference = new Point(_initialContact.X - Cursor.Position.X, _initialContact.Y - Cursor.Position.Y); + _activeSplitter.UpdateOverlay(difference); + } + + #endregion + #region Method Region private void StartDrag(DarkDockSplitter splitter) { - Console.WriteLine("Start drag"); - _activeSplitter = splitter; Cursor.Current = _activeSplitter.ResizeCursor; _initialContact = Cursor.Position; _isDragging = true; + + _activeSplitter.ShowOverlay(); + _dragTimer.Start(); } private void StopDrag() { - Console.WriteLine("Stop drag"); + _activeSplitter.HideOverlay(); + _dragTimer.Stop(); var difference = new Point(_initialContact.X - Cursor.Position.X, _initialContact.Y - Cursor.Position.Y); _activeSplitter.Move(difference); diff --git a/DarkUI/Win32/Native.cs b/DarkUI/Win32/Native.cs index 0b4b781..e6b62e4 100644 --- a/DarkUI/Win32/Native.cs +++ b/DarkUI/Win32/Native.cs @@ -4,12 +4,12 @@ using System.Runtime.InteropServices; namespace DarkUI { - public sealed class Native + internal sealed class Native { [DllImport("user32.dll")] - public static extern IntPtr WindowFromPoint(Point point); + internal static extern IntPtr WindowFromPoint(Point point); [DllImport("user32.dll", CharSet = CharSet.Auto)] - public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam); + internal static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam); } } diff --git a/DarkUI/Win32/WindowsMessages.cs b/DarkUI/Win32/WindowsMessages.cs index 2fc798c..3d06e2c 100644 --- a/DarkUI/Win32/WindowsMessages.cs +++ b/DarkUI/Win32/WindowsMessages.cs @@ -7,7 +7,7 @@ namespace DarkUI /// Defined in winuser.h from Windows SDK v6.1 /// Documentation pulled from MSDN. /// - public enum WM : uint + internal enum WM : uint { /// /// The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore. From 99b405be393848b10bddad2abe42d696c029644c Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 19 Sep 2015 17:30:21 +0100 Subject: [PATCH 31/97] Fixed splitter highlights --- DarkUI/Docking/DarkDockRegion.cs | 2 +- DarkUI/Docking/Items/DarkDockSplitter.cs | 25 +++++++++------ DarkUI/Win32/DarkDockResizeFilter.cs | 41 ++++++++++++------------ 3 files changed, 38 insertions(+), 30 deletions(-) diff --git a/DarkUI/Docking/DarkDockRegion.cs b/DarkUI/Docking/DarkDockRegion.cs index c91a72a..ebbb10b 100644 --- a/DarkUI/Docking/DarkDockRegion.cs +++ b/DarkUI/Docking/DarkDockRegion.cs @@ -193,7 +193,7 @@ namespace DarkUI base.OnLayout(e); if (_splitter != null) - _splitter.UpdateBounds(); + _splitter.UpdateBounds(DockPanel); } #endregion diff --git a/DarkUI/Docking/Items/DarkDockSplitter.cs b/DarkUI/Docking/Items/DarkDockSplitter.cs index 9156f40..3d44b66 100644 --- a/DarkUI/Docking/Items/DarkDockSplitter.cs +++ b/DarkUI/Docking/Items/DarkDockSplitter.cs @@ -48,8 +48,10 @@ namespace DarkUI public void ShowOverlay() { - _overlayForm.Show(); UpdateOverlay(new Point(0, 0)); + + _overlayForm.Show(); + _overlayForm.BringToFront(); } public void HideOverlay() @@ -59,7 +61,7 @@ namespace DarkUI public void UpdateOverlay(Point difference) { - var bounds = _control.RectangleToScreen(Bounds); + var bounds = new Rectangle(Bounds.Location, Bounds.Size); switch (_splitterType) { @@ -89,10 +91,10 @@ namespace DarkUI _control.Width += difference.X; break; case DarkSplitterType.Right: - _control.Width -= difference.X; + _control.Width += difference.X; break; case DarkSplitterType.Top: - _control.Height += difference.Y; + _control.Height -= difference.Y; break; case DarkSplitterType.Bottom: _control.Height -= difference.Y; @@ -100,21 +102,26 @@ namespace DarkUI } } - public void UpdateBounds() + public void UpdateBounds(Control rootControl) { + if (rootControl == null) + rootControl = _control; + + var bounds = rootControl.RectangleToScreen(_control.Bounds); + switch (_splitterType) { case DarkSplitterType.Left: - Bounds = new Rectangle(_control.Left - 2, _control.Top, 5, _control.Height); + Bounds = new Rectangle(bounds.Left - 2, bounds.Top, 5, bounds.Height); break; case DarkSplitterType.Right: - Bounds = new Rectangle(_control.Right - 3, _control.Top, 5, _control.Height); + Bounds = new Rectangle(bounds.Right - 3, bounds.Top, 5, bounds.Height); break; case DarkSplitterType.Top: - Bounds = new Rectangle(_control.Left, _control.Top - 2, _control.Width, 5); + Bounds = new Rectangle(bounds.Left, bounds.Top - 2, bounds.Width, 5); break; case DarkSplitterType.Bottom: - Bounds = new Rectangle(_control.Left, _control.Bottom - 5, _control.Width, 5); + Bounds = new Rectangle(bounds.Left, bounds.Bottom - 5, bounds.Width, 5); break; } } diff --git a/DarkUI/Win32/DarkDockResizeFilter.cs b/DarkUI/Win32/DarkDockResizeFilter.cs index 4e2a550..4c22090 100644 --- a/DarkUI/Win32/DarkDockResizeFilter.cs +++ b/DarkUI/Win32/DarkDockResizeFilter.cs @@ -69,13 +69,11 @@ namespace DarkUI // Start drag. if (m.Msg == (int)WM.LBUTTONDOWN) { - foreach (var splitter in _dockPanel.Splitters) + var hotSplitter = HotSplitter(); + if (hotSplitter != null) { - if (splitter.Bounds.Contains(_dockPanel.PointToClient(Cursor.Position))) - { - StartDrag(splitter); - return true; - } + StartDrag(hotSplitter); + return true; } } @@ -90,11 +88,8 @@ namespace DarkUI } // Stop events passing through if we're hovering over a splitter - foreach (var splitter in _dockPanel.Splitters) - { - if (splitter.Bounds.Contains(_dockPanel.PointToClient(Cursor.Position))) - return true; - } + if (HotSplitter() != null) + return true; // Stop all events from going through if we're dragging a splitter. if (_isDragging) @@ -142,8 +137,8 @@ namespace DarkUI private void StopDrag() { - _activeSplitter.HideOverlay(); _dragTimer.Stop(); + _activeSplitter.HideOverlay(); var difference = new Point(_initialContact.X - Cursor.Position.X, _initialContact.Y - Cursor.Position.Y); _activeSplitter.Move(difference); @@ -151,19 +146,25 @@ namespace DarkUI _isDragging = false; } + private DarkDockSplitter HotSplitter() + { + foreach (var splitter in _dockPanel.Splitters) + { + if (splitter.Bounds.Contains(Cursor.Position)) + return splitter; + } + + return null; + } + private void CheckCursor() { if (_isDragging) return; - foreach (var splitter in _dockPanel.Splitters) - { - if (splitter.Bounds.Contains(_dockPanel.PointToClient(Cursor.Position))) - { - Cursor.Current = splitter.ResizeCursor; - return; - } - } + var hotSplitter = HotSplitter(); + if (hotSplitter != null) + Cursor.Current = hotSplitter.ResizeCursor; } private void ResetCursor() From a463149ad7495f84983905291d48b68ce4c7d01b Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 19 Sep 2015 17:56:37 +0100 Subject: [PATCH 32/97] Fixed PointToScreen issues with splitters --- DarkUI/Docking/DarkDockRegion.cs | 11 +++++---- DarkUI/Docking/Items/DarkDockSplitter.cs | 20 ++++++++------- DarkUI/Win32/DarkDockResizeFilter.cs | 31 ++++++++---------------- 3 files changed, 27 insertions(+), 35 deletions(-) diff --git a/DarkUI/Docking/DarkDockRegion.cs b/DarkUI/Docking/DarkDockRegion.cs index ebbb10b..f65ebc6 100644 --- a/DarkUI/Docking/DarkDockRegion.cs +++ b/DarkUI/Docking/DarkDockRegion.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; @@ -169,13 +170,13 @@ namespace DarkUI switch (DockArea) { case DarkDockArea.Left: - _splitter = new DarkDockSplitter(this, DarkSplitterType.Right); + _splitter = new DarkDockSplitter(DockPanel, this, DarkSplitterType.Right); break; case DarkDockArea.Right: - _splitter = new DarkDockSplitter(this, DarkSplitterType.Left); + _splitter = new DarkDockSplitter(DockPanel, this, DarkSplitterType.Left); break; case DarkDockArea.Bottom: - _splitter = new DarkDockSplitter(this, DarkSplitterType.Top); + _splitter = new DarkDockSplitter(DockPanel, this, DarkSplitterType.Top); break; default: return; @@ -193,7 +194,7 @@ namespace DarkUI base.OnLayout(e); if (_splitter != null) - _splitter.UpdateBounds(DockPanel); + _splitter.UpdateBounds(); } #endregion diff --git a/DarkUI/Docking/Items/DarkDockSplitter.cs b/DarkUI/Docking/Items/DarkDockSplitter.cs index 3d44b66..472a460 100644 --- a/DarkUI/Docking/Items/DarkDockSplitter.cs +++ b/DarkUI/Docking/Items/DarkDockSplitter.cs @@ -1,4 +1,5 @@ -using System.Drawing; +using System; +using System.Drawing; using System.Windows.Forms; namespace DarkUI @@ -7,6 +8,7 @@ namespace DarkUI { #region Field Region + private Control _parentControl; private Control _control; private DarkSplitterType _splitterType; private DarkTranslucentForm _overlayForm; @@ -23,8 +25,9 @@ namespace DarkUI #region Constructor Region - public DarkDockSplitter(Control control, DarkSplitterType splitterType) + public DarkDockSplitter(Control parentControl, Control control, DarkSplitterType splitterType) { + _parentControl = parentControl; _control = control; _splitterType = splitterType; _overlayForm = new DarkTranslucentForm(Color.Black); @@ -91,23 +94,22 @@ namespace DarkUI _control.Width += difference.X; break; case DarkSplitterType.Right: - _control.Width += difference.X; + _control.Width -= difference.X; break; case DarkSplitterType.Top: - _control.Height -= difference.Y; + _control.Height += difference.Y; break; case DarkSplitterType.Bottom: _control.Height -= difference.Y; break; } + + UpdateBounds(); } - public void UpdateBounds(Control rootControl) + public void UpdateBounds() { - if (rootControl == null) - rootControl = _control; - - var bounds = rootControl.RectangleToScreen(_control.Bounds); + var bounds = _parentControl.RectangleToScreen(_control.Bounds); switch (_splitterType) { diff --git a/DarkUI/Win32/DarkDockResizeFilter.cs b/DarkUI/Win32/DarkDockResizeFilter.cs index 4c22090..f5f6760 100644 --- a/DarkUI/Win32/DarkDockResizeFilter.cs +++ b/DarkUI/Win32/DarkDockResizeFilter.cs @@ -40,6 +40,16 @@ namespace DarkUI m.Msg == (int)WM.RBUTTONDOWN || m.Msg == (int)WM.RBUTTONUP || m.Msg == (int)WM.RBUTTONDBLCLK)) return false; + // Stop drag. + if (m.Msg == (int)WM.LBUTTONUP) + { + if (_isDragging) + { + StopDrag(); + return true; + } + } + // Exit out early if we're simply releasing a non-splitter drag over the area if (m.Msg == (int)WM.LBUTTONUP && !_isDragging) return false; @@ -77,16 +87,6 @@ namespace DarkUI } } - // Stop drag. - if (m.Msg == (int)WM.LBUTTONUP) - { - if (_isDragging) - { - StopDrag(); - return true; - } - } - // Stop events passing through if we're hovering over a splitter if (HotSplitter() != null) return true; @@ -104,17 +104,6 @@ namespace DarkUI private void DragTimer_Tick(object sender, EventArgs e) { - if (_dockPanel.MouseButtonState != MouseButtons.Left) - _isDragging = false; - - if (!_isDragging) - { - _activeSplitter.HideOverlay(); - _dragTimer.Stop(); - ResetCursor(); - return; - } - var difference = new Point(_initialContact.X - Cursor.Position.X, _initialContact.Y - Cursor.Position.Y); _activeSplitter.UpdateOverlay(difference); } From dc79f4dcef2e60ca30b751786412edcde7a8fd04 Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 19 Sep 2015 18:41:36 +0100 Subject: [PATCH 33/97] Added minimum sizes to dock regions --- DarkUI/Docking/DarkDockRegion.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DarkUI/Docking/DarkDockRegion.cs b/DarkUI/Docking/DarkDockRegion.cs index f65ebc6..7e1f865 100644 --- a/DarkUI/Docking/DarkDockRegion.cs +++ b/DarkUI/Docking/DarkDockRegion.cs @@ -140,6 +140,8 @@ namespace DarkUI private void BuildProperties() { + MinimumSize = new Size(50, 50); + switch (DockArea) { default: From 8aa5d67d6e6c97a006ecbf2d5055c79cf43d2a01 Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 20 Sep 2015 10:38:26 +0100 Subject: [PATCH 34/97] Moving form now updates splitter bounds --- DarkUI/Docking/DarkDockRegion.cs | 19 +++++++++++++++++-- DarkUI/Forms/DarkTranslucentForm.cs | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/DarkUI/Docking/DarkDockRegion.cs b/DarkUI/Docking/DarkDockRegion.cs index 7e1f865..c5710b5 100644 --- a/DarkUI/Docking/DarkDockRegion.cs +++ b/DarkUI/Docking/DarkDockRegion.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; @@ -12,6 +11,8 @@ namespace DarkUI #region Field Region private List _groups; + + private Form _parentForm; private DarkDockSplitter _splitter; #endregion @@ -191,6 +192,20 @@ namespace DarkUI #region Event Handler Region + protected override void OnCreateControl() + { + base.OnCreateControl(); + + _parentForm = FindForm(); + _parentForm.ResizeEnd += ParentForm_ResizeEnd; + } + + private void ParentForm_ResizeEnd(object sender, System.EventArgs e) + { + if (_splitter != null) + _splitter.UpdateBounds(); + } + protected override void OnLayout(LayoutEventArgs e) { base.OnLayout(e); diff --git a/DarkUI/Forms/DarkTranslucentForm.cs b/DarkUI/Forms/DarkTranslucentForm.cs index af957da..48fce7e 100644 --- a/DarkUI/Forms/DarkTranslucentForm.cs +++ b/DarkUI/Forms/DarkTranslucentForm.cs @@ -19,6 +19,7 @@ namespace DarkUI public DarkTranslucentForm(Color backColor, double opacity = 0.6) { FormBorderStyle = FormBorderStyle.None; + Size = new Size(0, 0); ShowInTaskbar = false; AllowTransparency = true; Opacity = opacity; From a6b6c376acf13a14d9e4a096ac5b38eef29d6400 Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 20 Sep 2015 11:57:27 +0100 Subject: [PATCH 35/97] Fixed splitter overlays not sizing correctly --- DarkUI/Docking/DarkDockRegion.cs | 11 ++++++----- DarkUI/Docking/Items/DarkDockSplitter.cs | 16 +++++++++------- DarkUI/Forms/DarkTranslucentForm.cs | 3 ++- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/DarkUI/Docking/DarkDockRegion.cs b/DarkUI/Docking/DarkDockRegion.cs index c5710b5..bd1a3c1 100644 --- a/DarkUI/Docking/DarkDockRegion.cs +++ b/DarkUI/Docking/DarkDockRegion.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; @@ -131,10 +132,10 @@ namespace DarkUI { group.SendToBack(); - if (_groups.IsLast(group)) - group.Dock = dockStyle; - else + if (_groups.IsFirst(group)) group.Dock = DockStyle.Fill; + else + group.Dock = dockStyle; } } } @@ -200,7 +201,7 @@ namespace DarkUI _parentForm.ResizeEnd += ParentForm_ResizeEnd; } - private void ParentForm_ResizeEnd(object sender, System.EventArgs e) + private void ParentForm_ResizeEnd(object sender, EventArgs e) { if (_splitter != null) _splitter.UpdateBounds(); diff --git a/DarkUI/Docking/Items/DarkDockSplitter.cs b/DarkUI/Docking/Items/DarkDockSplitter.cs index 472a460..6a337e7 100644 --- a/DarkUI/Docking/Items/DarkDockSplitter.cs +++ b/DarkUI/Docking/Items/DarkDockSplitter.cs @@ -10,7 +10,11 @@ namespace DarkUI private Control _parentControl; private Control _control; + private DarkSplitterType _splitterType; + + private int _minimum; + private int _maximum; private DarkTranslucentForm _overlayForm; #endregion @@ -30,7 +34,6 @@ namespace DarkUI _parentControl = parentControl; _control = control; _splitterType = splitterType; - _overlayForm = new DarkTranslucentForm(Color.Black); switch (_splitterType) { @@ -51,15 +54,15 @@ namespace DarkUI public void ShowOverlay() { - UpdateOverlay(new Point(0, 0)); + _overlayForm = new DarkTranslucentForm(Color.Black); + _overlayForm.Visible = true; - _overlayForm.Show(); - _overlayForm.BringToFront(); + UpdateOverlay(new Point(0, 0)); } public void HideOverlay() { - _overlayForm.Hide(); + _overlayForm.Visible = false; } public void UpdateOverlay(Point difference) @@ -82,8 +85,7 @@ namespace DarkUI break; } - _overlayForm.Location = bounds.Location; - _overlayForm.Size = bounds.Size; + _overlayForm.Bounds = bounds; } public void Move(Point difference) diff --git a/DarkUI/Forms/DarkTranslucentForm.cs b/DarkUI/Forms/DarkTranslucentForm.cs index 48fce7e..ac4d7d5 100644 --- a/DarkUI/Forms/DarkTranslucentForm.cs +++ b/DarkUI/Forms/DarkTranslucentForm.cs @@ -18,8 +18,9 @@ namespace DarkUI public DarkTranslucentForm(Color backColor, double opacity = 0.6) { + StartPosition = FormStartPosition.Manual; FormBorderStyle = FormBorderStyle.None; - Size = new Size(0, 0); + Size = new Size(1, 1); ShowInTaskbar = false; AllowTransparency = true; Opacity = opacity; From a6a2741922977d85e273021762bd3980460edc74 Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 20 Sep 2015 12:13:44 +0100 Subject: [PATCH 36/97] Added minimum & maximum splitter properties --- DarkUI/Docking/Items/DarkDockSplitter.cs | 36 ++++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/DarkUI/Docking/Items/DarkDockSplitter.cs b/DarkUI/Docking/Items/DarkDockSplitter.cs index 6a337e7..1a485a0 100644 --- a/DarkUI/Docking/Items/DarkDockSplitter.cs +++ b/DarkUI/Docking/Items/DarkDockSplitter.cs @@ -72,16 +72,36 @@ namespace DarkUI switch (_splitterType) { case DarkSplitterType.Left: - bounds.Location = new Point(bounds.Location.X - difference.X, bounds.Location.Y); + var leftX = Math.Max(bounds.Location.X - difference.X, _minimum); + + if (_maximum != 0 && leftX > _maximum) + leftX = _maximum; + + bounds.Location = new Point(leftX, bounds.Location.Y); break; case DarkSplitterType.Right: - bounds.Location = new Point(bounds.Location.X - difference.X, bounds.Location.Y); + var rightX = Math.Max(bounds.Location.X - difference.X, _minimum); + + if (_maximum != 0 && rightX > _maximum) + rightX = _maximum; + + bounds.Location = new Point(rightX, bounds.Location.Y); break; case DarkSplitterType.Top: - bounds.Location = new Point(bounds.Location.X, bounds.Location.Y - difference.Y); + var topY = Math.Max(bounds.Location.Y - difference.Y, _minimum); + + if (_maximum != 0 && topY > _maximum) + topY = _maximum; + + bounds.Location = new Point(bounds.Location.X, topY); break; case DarkSplitterType.Bottom: - bounds.Location = new Point(bounds.Location.X, bounds.Location.Y - difference.Y); + var bottomY = Math.Max(bounds.Location.Y - difference.Y, _minimum); + + if (_maximum != 0 && bottomY > _maximum) + topY = _maximum; + + bounds.Location = new Point(bounds.Location.X, bottomY); break; } @@ -117,15 +137,19 @@ namespace DarkUI { case DarkSplitterType.Left: Bounds = new Rectangle(bounds.Left - 2, bounds.Top, 5, bounds.Height); + _maximum = bounds.Right - 2 - _control.MinimumSize.Width; break; case DarkSplitterType.Right: - Bounds = new Rectangle(bounds.Right - 3, bounds.Top, 5, bounds.Height); + Bounds = new Rectangle(bounds.Right - 2, bounds.Top, 5, bounds.Height); + _minimum = bounds.Left - 2 + _control.MinimumSize.Width; break; case DarkSplitterType.Top: Bounds = new Rectangle(bounds.Left, bounds.Top - 2, bounds.Width, 5); + _maximum = bounds.Bottom - 2 - _control.MinimumSize.Height; break; case DarkSplitterType.Bottom: - Bounds = new Rectangle(bounds.Left, bounds.Bottom - 5, bounds.Width, 5); + Bounds = new Rectangle(bounds.Left, bounds.Bottom - 2, bounds.Width, 5); + _minimum = bounds.Top - 2 + _control.MinimumSize.Height; break; } } From a29c0555459aa96de90d49e23cd746a00070fe36 Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 20 Sep 2015 12:31:45 +0100 Subject: [PATCH 37/97] Fixed releasing splitter drag outside of form area --- DarkUI/Win32/DarkDockResizeFilter.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/DarkUI/Win32/DarkDockResizeFilter.cs b/DarkUI/Win32/DarkDockResizeFilter.cs index f5f6760..1d56437 100644 --- a/DarkUI/Win32/DarkDockResizeFilter.cs +++ b/DarkUI/Win32/DarkDockResizeFilter.cs @@ -104,6 +104,12 @@ namespace DarkUI private void DragTimer_Tick(object sender, EventArgs e) { + if (_dockPanel.MouseButtonState != MouseButtons.Left) + { + StopDrag(); + return; + } + var difference = new Point(_initialContact.X - Cursor.Position.X, _initialContact.Y - Cursor.Position.Y); _activeSplitter.UpdateOverlay(difference); } From baaab81736117491d4acae090890d34041e3e426 Mon Sep 17 00:00:00 2001 From: Robin Date: Mon, 30 Nov 2015 19:19:23 +0000 Subject: [PATCH 38/97] Minor refactoring and cleaning Removed unnecessary comments. Added string interpolation from C# 6.0. Removed unneeded library references. --- DarkUI/Collections/ObservableList.cs | 8 -------- DarkUI/Controls/DarkButton.cs | 1 + DarkUI/Controls/DarkListView.cs | 7 +++---- DarkUI/Controls/DarkScrollBar.cs | 7 +++---- DarkUI/Controls/DarkTreeView.cs | 15 +++------------ DarkUI/Controls/Items/DarkListItem.cs | 3 +++ DarkUI/Controls/Items/DarkTreeNode.cs | 4 ++++ DarkUI/Extensions/IEnumerableExtensions.cs | 6 ++---- DarkUI/Win32/DarkControlScrollFilter.cs | 3 +-- Example/Forms/Dialogs/DialogAbout.cs | 2 +- Example/Forms/Dialogs/DialogTest.cs | 6 +++--- Example/Forms/Docking/DockConsole.cs | 2 +- Example/Forms/Docking/DockHistory.cs | 2 +- Example/Forms/Docking/DockLayers.cs | 2 +- Example/Forms/Docking/DockProject.cs | 4 ++-- Example/Forms/MainForm.cs | 2 +- Example/Program.cs | 3 --- 17 files changed, 30 insertions(+), 47 deletions(-) diff --git a/DarkUI/Collections/ObservableList.cs b/DarkUI/Collections/ObservableList.cs index 6d6f307..24c5fc9 100644 --- a/DarkUI/Collections/ObservableList.cs +++ b/DarkUI/Collections/ObservableList.cs @@ -40,20 +40,12 @@ namespace DarkUI { if (!_disposed) { - if (disposing) - { - // Release managed resources - } - - // Release unmanaged resources. - // Set large fields to null. if (ItemsAdded != null) ItemsAdded = null; if (ItemsRemoved != null) ItemsRemoved = null; - // Set disposed flag _disposed = true; } } diff --git a/DarkUI/Controls/DarkButton.cs b/DarkUI/Controls/DarkButton.cs index a5acb9e..b82d019 100644 --- a/DarkUI/Controls/DarkButton.cs +++ b/DarkUI/Controls/DarkButton.cs @@ -33,6 +33,7 @@ namespace DarkUI Invalidate(); } } + public new bool Enabled { get { return base.Enabled; } diff --git a/DarkUI/Controls/DarkListView.cs b/DarkUI/Controls/DarkListView.cs index 326149f..5815345 100644 --- a/DarkUI/Controls/DarkListView.cs +++ b/DarkUI/Controls/DarkListView.cs @@ -208,7 +208,7 @@ namespace DarkUI public void SelectItem(int index) { if (index < 0 || index > Items.Count - 1) - throw new IndexOutOfRangeException(string.Format("Value '{0}' is outside of valid range.", index)); + throw new IndexOutOfRangeException($"Value '{index}' is outside of valid range."); _selectedIndices.Clear(); _selectedIndices.Add(index); @@ -228,7 +228,7 @@ namespace DarkUI foreach (var index in list) { if (index < 0 || index > Items.Count - 1) - throw new IndexOutOfRangeException(string.Format("Value '{0}' is outside of valid range.", index)); + throw new IndexOutOfRangeException($"Value '{index}' is outside of valid range."); _selectedIndices.Add(index); } @@ -428,7 +428,6 @@ namespace DarkUI var top = range.Min(); var bottom = range.Max(); - // Draw items for (var i = top; i <= bottom; i++) { var width = Math.Max(ContentSize.Width, Viewport.Width); @@ -446,7 +445,7 @@ namespace DarkUI g.FillRectangle(b, rect); } - // Border + // DEBUG: Border /*using (var p = new Pen(Colors.DarkBorder)) { g.DrawLine(p, new Point(rect.Left, rect.Bottom - 1), new Point(rect.Right, rect.Bottom - 1)); diff --git a/DarkUI/Controls/DarkScrollBar.cs b/DarkUI/Controls/DarkScrollBar.cs index 878f69c..35d8c5f 100644 --- a/DarkUI/Controls/DarkScrollBar.cs +++ b/DarkUI/Controls/DarkScrollBar.cs @@ -205,7 +205,7 @@ namespace DarkUI if (_trackArea.Contains(e.Location) && e.Button == MouseButtons.Left) { - // Check if our input is at least aligned with the thumb + // Step 1. Check if our input is at least aligned with the thumb if (_scrollOrientation == DarkOrientation.Vertical) { var modRect = new Rectangle(_thumbArea.Left, _trackArea.Top, _thumbArea.Width, _trackArea.Height); @@ -219,7 +219,7 @@ namespace DarkUI return; } - // Step 1. Scroll to the area initially clicked. + // Step 2. Scroll to the area initially clicked. if (_scrollOrientation == DarkOrientation.Vertical) { var loc = e.Location.Y; @@ -235,7 +235,7 @@ namespace DarkUI ScrollToPhysical(loc); } - // Step 2. Initiate a thumb drag. + // Step 3. Initiate a thumb drag. _isScrolling = true; _initialContact = e.Location; _thumbHot = true; @@ -246,7 +246,6 @@ namespace DarkUI _initialValue = _thumbArea.Left; Invalidate(); - return; } } diff --git a/DarkUI/Controls/DarkTreeView.cs b/DarkUI/Controls/DarkTreeView.cs index bcd104e..b3070b4 100644 --- a/DarkUI/Controls/DarkTreeView.cs +++ b/DarkUI/Controls/DarkTreeView.cs @@ -163,13 +163,6 @@ namespace DarkUI { if (!_disposed) { - if (disposing) - { - // Release managed resources - } - - // Release unmanaged resources. - // Set large fields to null. DisposeIcons(); if (SelectedNodesChanged != null) @@ -187,11 +180,9 @@ namespace DarkUI if (_selectedNodes != null) _selectedNodes.CollectionChanged -= SelectedNodes_CollectionChanged; - // Set disposed flag _disposed = true; } - // Call Dispose on your base class. base.Dispose(disposing); } @@ -1159,7 +1150,7 @@ namespace DarkUI if (node == dropNode) { if (isMoving) - DarkMessageBox.ShowError(String.Format(@"Cannot move {0}. The destination folder is the same as the source folder.", node.Text), Application.ProductName); + DarkMessageBox.ShowError($"Cannot move {node.Text}. The destination folder is the same as the source folder.", Application.ProductName); return false; } @@ -1167,7 +1158,7 @@ namespace DarkUI if (node.ParentNode != null && node.ParentNode == dropNode) { if (isMoving) - DarkMessageBox.ShowError(String.Format(@"Cannot move {0}. The destination folder is the same as the source folder.", node.Text), Application.ProductName); + DarkMessageBox.ShowError($"Cannot move {node.Text}. The destination folder is the same as the source folder.", Application.ProductName); return false; } @@ -1178,7 +1169,7 @@ namespace DarkUI if (node == parentNode) { if (isMoving) - DarkMessageBox.ShowError(String.Format(@"Cannot move {0}. The destination folder is a subfolder of the source folder.", node.Text), Application.ProductName); + DarkMessageBox.ShowError($"Cannot move {node.Text}. The destination folder is a subfolder of the source folder.", Application.ProductName); return false; } diff --git a/DarkUI/Controls/Items/DarkListItem.cs b/DarkUI/Controls/Items/DarkListItem.cs index 6b320c6..27712f9 100644 --- a/DarkUI/Controls/Items/DarkListItem.cs +++ b/DarkUI/Controls/Items/DarkListItem.cs @@ -7,8 +7,11 @@ namespace DarkUI #region Property Region public string Text { get; set; } + public Rectangle Area { get; set; } + public Color TextColor { get; set; } + public FontStyle FontStyle { get; set; } #endregion diff --git a/DarkUI/Controls/Items/DarkTreeNode.cs b/DarkUI/Controls/Items/DarkTreeNode.cs index ae1b931..93c2cce 100644 --- a/DarkUI/Controls/Items/DarkTreeNode.cs +++ b/DarkUI/Controls/Items/DarkTreeNode.cs @@ -46,13 +46,17 @@ namespace DarkUI } public Rectangle ExpandArea { get; set; } + public Rectangle IconArea { get; set; } + public Rectangle TextArea { get; set; } + public Rectangle FullArea { get; set; } public bool ExpandAreaHot { get; set; } public Bitmap Icon { get; set; } + public Bitmap ExpandedIcon { get; set; } public bool Expanded diff --git a/DarkUI/Extensions/IEnumerableExtensions.cs b/DarkUI/Extensions/IEnumerableExtensions.cs index 2855a3a..f6f02d8 100644 --- a/DarkUI/Extensions/IEnumerableExtensions.cs +++ b/DarkUI/Extensions/IEnumerableExtensions.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; namespace DarkUI { @@ -12,7 +10,7 @@ namespace DarkUI var last = items.LastOrDefault(); if (last == null) return false; - return item.Equals(last); // OR Object.ReferenceEquals(last, item) + return item.Equals(last); } internal static bool IsFirst(this IEnumerable items, T item) diff --git a/DarkUI/Win32/DarkControlScrollFilter.cs b/DarkUI/Win32/DarkControlScrollFilter.cs index bde8669..2d944f1 100644 --- a/DarkUI/Win32/DarkControlScrollFilter.cs +++ b/DarkUI/Win32/DarkControlScrollFilter.cs @@ -14,9 +14,8 @@ namespace DarkUI var hControlUnderMouse = Native.WindowFromPoint(new Point((int)m.LParam)); if (hControlUnderMouse == m.HWnd) - return false; // Already headed for the right control. + return false; - // Redirect the message to the control under the mouse. Native.SendMessage(hControlUnderMouse, (uint)m.Msg, m.WParam, m.LParam); return true; } diff --git a/Example/Forms/Dialogs/DialogAbout.cs b/Example/Forms/Dialogs/DialogAbout.cs index 9a5d340..e3cc762 100644 --- a/Example/Forms/Dialogs/DialogAbout.cs +++ b/Example/Forms/Dialogs/DialogAbout.cs @@ -11,7 +11,7 @@ namespace Example { InitializeComponent(); - lblVersion.Text = string.Format("Version: {0}", Application.ProductVersion.ToString()); + lblVersion.Text = $"Version: {Application.ProductVersion.ToString()}"; btnOk.Text = "Close"; } diff --git a/Example/Forms/Dialogs/DialogTest.cs b/Example/Forms/Dialogs/DialogTest.cs index b0a74d4..bfb7c59 100644 --- a/Example/Forms/Dialogs/DialogTest.cs +++ b/Example/Forms/Dialogs/DialogTest.cs @@ -11,7 +11,7 @@ namespace Example // Build dummy list data for (var i = 0; i < 100; i++) { - var item = new DarkListItem(string.Format("List item #{0}", i)); + var item = new DarkListItem($"List item #{i}"); lstTest.Items.Add(item); } @@ -19,13 +19,13 @@ namespace Example var childCount = 0; for (var i = 0; i < 20; i++) { - var node = new DarkTreeNode(string.Format("Root node #{0}", i)); + var node = new DarkTreeNode($"Root node #{i}"); node.ExpandedIcon = Icons.folder_open; node.Icon = Icons.folder_closed; for (var x = 0; x < 10; x++) { - var childNode = new DarkTreeNode(string.Format("Child node #{0}", childCount)); + var childNode = new DarkTreeNode($"Child node #{childCount}"); childNode.Icon = Icons.files; childCount++; node.Nodes.Add(childNode); diff --git a/Example/Forms/Docking/DockConsole.cs b/Example/Forms/Docking/DockConsole.cs index e7da119..2985d81 100644 --- a/Example/Forms/Docking/DockConsole.cs +++ b/Example/Forms/Docking/DockConsole.cs @@ -13,7 +13,7 @@ namespace Example // Build dummy list data for (var i = 0; i < 100; i++) { - var item = new DarkListItem(string.Format("List item #{0}", i)); + var item = new DarkListItem($"List item #{i}"); lstConsole.Items.Add(item); } } diff --git a/Example/Forms/Docking/DockHistory.cs b/Example/Forms/Docking/DockHistory.cs index 9cba5e5..19f5c48 100644 --- a/Example/Forms/Docking/DockHistory.cs +++ b/Example/Forms/Docking/DockHistory.cs @@ -13,7 +13,7 @@ namespace Example // Build dummy list data for (var i = 0; i < 100; i++) { - var item = new DarkListItem(string.Format("List item #{0}", i)); + var item = new DarkListItem($"List item #{i}"); lstHistory.Items.Add(item); } } diff --git a/Example/Forms/Docking/DockLayers.cs b/Example/Forms/Docking/DockLayers.cs index 9ed47ed..575fede 100644 --- a/Example/Forms/Docking/DockLayers.cs +++ b/Example/Forms/Docking/DockLayers.cs @@ -13,7 +13,7 @@ namespace Example // Build dummy list data for (var i = 0; i < 100; i++) { - var item = new DarkListItem(string.Format("List item #{0}", i)); + var item = new DarkListItem($"List item #{i}"); lstLayers.Items.Add(item); } } diff --git a/Example/Forms/Docking/DockProject.cs b/Example/Forms/Docking/DockProject.cs index 8b6ca6b..2e00e33 100644 --- a/Example/Forms/Docking/DockProject.cs +++ b/Example/Forms/Docking/DockProject.cs @@ -14,13 +14,13 @@ namespace Example var childCount = 0; for (var i = 0; i < 20; i++) { - var node = new DarkTreeNode(string.Format("Root node #{0}", i)); + var node = new DarkTreeNode($"Root node #{i}"); node.ExpandedIcon = Icons.folder_open; node.Icon = Icons.folder_closed; for (var x = 0; x < 10; x++) { - var childNode = new DarkTreeNode(string.Format("Child node #{0}", childCount)); + var childNode = new DarkTreeNode($"Child node #{childCount}"); childNode.Icon = Icons.files; childCount++; node.Nodes.Add(childNode); diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index b6316ed..244caab 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -43,7 +43,7 @@ namespace Example DockPanel.AddContent(_dockLayers); DockPanel.AddContent(_dockHistory); - // Add 3 dummy documents to the main document area of the dock panel + // Add dummy documents to the main document area of the dock panel DockPanel.AddContent(new DockDocument { DockText = "Document 1" }); DockPanel.AddContent(new DockDocument { DockText = "Document 2" }); DockPanel.AddContent(new DockDocument { DockText = "Document 3" }); diff --git a/Example/Program.cs b/Example/Program.cs index 683da87..7126327 100644 --- a/Example/Program.cs +++ b/Example/Program.cs @@ -5,9 +5,6 @@ namespace Example { static class Program { - /// - /// The main entry point for the application. - /// [STAThread] static void Main() { From c9c8f0b5dbfc76d76475d76c0b62a5dedebd2c0a Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 4 Dec 2015 18:16:24 +0000 Subject: [PATCH 39/97] Added tag property to DarkListItem --- DarkUI/Controls/Items/DarkListItem.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DarkUI/Controls/Items/DarkListItem.cs b/DarkUI/Controls/Items/DarkListItem.cs index 27712f9..12acd2c 100644 --- a/DarkUI/Controls/Items/DarkListItem.cs +++ b/DarkUI/Controls/Items/DarkListItem.cs @@ -14,6 +14,8 @@ namespace DarkUI public FontStyle FontStyle { get; set; } + public object Tag { get; set; } + #endregion #region Constructor Region From 91c3ac3daf7539434a984cf59c11f4c7ef226e7e Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 4 Dec 2015 18:47:04 +0000 Subject: [PATCH 40/97] Added GetItemIndex method to DarkListView. --- DarkUI/Controls/DarkListView.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/DarkUI/Controls/DarkListView.cs b/DarkUI/Controls/DarkListView.cs index 5815345..9d61d29 100644 --- a/DarkUI/Controls/DarkListView.cs +++ b/DarkUI/Controls/DarkListView.cs @@ -205,6 +205,19 @@ namespace DarkUI #region Method Region + public int GetItemIndex(DarkListItem item) + { + var index = -1; + foreach (var otherItem in Items) + { + index++; + if (item == otherItem) + break; + } + + return index; + } + public void SelectItem(int index) { if (index < 0 || index > Items.Count - 1) From 55ecd425968b8a70d3f89b04e16fe3671064edf5 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 4 Dec 2015 19:06:35 +0000 Subject: [PATCH 41/97] Added namespaces. --- DarkUI/Collections/ObservableList.cs | 2 +- DarkUI/Collections/ObservableListModified.cs | 2 +- DarkUI/Config/Colors.cs | 2 +- DarkUI/Config/Consts.cs | 2 +- DarkUI/Config/Enums.cs | 2 +- DarkUI/Controls/DarkButton.cs | 5 ++-- DarkUI/Controls/DarkContextMenu.cs | 5 ++-- DarkUI/Controls/DarkLabel.cs | 5 ++-- DarkUI/Controls/DarkListView.cs | 5 ++-- DarkUI/Controls/DarkMenuStrip.cs | 5 ++-- DarkUI/Controls/DarkScrollBar.cs | 6 ++-- DarkUI/Controls/DarkScrollBase.cs | 5 ++-- DarkUI/Controls/DarkScrollView.cs | 2 +- DarkUI/Controls/DarkSectionPanel.cs | 5 ++-- DarkUI/Controls/DarkSeparator.cs | 5 ++-- DarkUI/Controls/DarkStatusStrip.cs | 5 ++-- DarkUI/Controls/DarkTextBox.cs | 5 ++-- DarkUI/Controls/DarkToolStrip.cs | 4 +-- DarkUI/Controls/DarkTreeView.cs | 9 ++++-- .../EventArgs/ScrollValueEventArgs.cs | 2 +- DarkUI/Controls/Items/DarkListItem.cs | 5 ++-- DarkUI/Controls/Items/DarkTreeNode.cs | 5 ++-- DarkUI/Docking/DarkDockContent.cs | 5 ++-- DarkUI/Docking/DarkDockGroup.cs | 5 ++-- DarkUI/Docking/DarkDockPanel.cs | 6 ++-- DarkUI/Docking/DarkDockRegion.cs | 6 ++-- DarkUI/Docking/DarkDocument.cs | 5 ++-- DarkUI/Docking/DarkToolWindow.cs | 5 ++-- DarkUI/Docking/Items/DarkDockSplitter.cs | 6 ++-- DarkUI/Extensions/BitmapExtensions.cs | 2 +- DarkUI/Extensions/IEnumerableExtensions.cs | 2 +- DarkUI/Forms/DarkDialog.Designer.cs | 28 ++++++++----------- DarkUI/Forms/DarkDialog.cs | 19 +++++++++++-- DarkUI/Forms/DarkForm.cs | 5 ++-- DarkUI/Forms/DarkMessageBox.Designer.cs | 6 ++-- DarkUI/Forms/DarkMessageBox.cs | 6 ++-- DarkUI/Forms/DarkTranslucentForm.cs | 2 +- DarkUI/Icons/MenuIcons.Designer.cs | 2 +- DarkUI/Icons/MessageBoxIcons.Designer.cs | 2 +- DarkUI/Icons/ScrollIcons.Designer.cs | 2 +- DarkUI/Icons/TreeViewIcons.Designer.cs | 2 +- DarkUI/Renderers/DarkMenuRenderer.cs | 6 ++-- DarkUI/Renderers/DarkToolStripRenderer.cs | 7 +++-- DarkUI/Win32/DarkControlScrollFilter.cs | 2 +- DarkUI/Win32/DarkDockResizeFilter.cs | 5 ++-- DarkUI/Win32/Native.cs | 2 +- DarkUI/Win32/WindowsMessages.cs | 2 +- 47 files changed, 141 insertions(+), 92 deletions(-) diff --git a/DarkUI/Collections/ObservableList.cs b/DarkUI/Collections/ObservableList.cs index 24c5fc9..26d683b 100644 --- a/DarkUI/Collections/ObservableList.cs +++ b/DarkUI/Collections/ObservableList.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; -namespace DarkUI +namespace DarkUI.Collections { public class ObservableList : List, IDisposable { diff --git a/DarkUI/Collections/ObservableListModified.cs b/DarkUI/Collections/ObservableListModified.cs index f5d4d70..dd99bc3 100644 --- a/DarkUI/Collections/ObservableListModified.cs +++ b/DarkUI/Collections/ObservableListModified.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace DarkUI +namespace DarkUI.Collections { public class ObservableListModified : EventArgs { diff --git a/DarkUI/Config/Colors.cs b/DarkUI/Config/Colors.cs index 8731415..0f55f88 100644 --- a/DarkUI/Config/Colors.cs +++ b/DarkUI/Config/Colors.cs @@ -1,6 +1,6 @@ using System.Drawing; -namespace DarkUI +namespace DarkUI.Config { public sealed class Colors { diff --git a/DarkUI/Config/Consts.cs b/DarkUI/Config/Consts.cs index 23e63ea..b0c7324 100644 --- a/DarkUI/Config/Consts.cs +++ b/DarkUI/Config/Consts.cs @@ -1,4 +1,4 @@ -namespace DarkUI +namespace DarkUI.Config { public sealed class Consts { diff --git a/DarkUI/Config/Enums.cs b/DarkUI/Config/Enums.cs index 2e4d0c7..29a5508 100644 --- a/DarkUI/Config/Enums.cs +++ b/DarkUI/Config/Enums.cs @@ -1,4 +1,4 @@ -namespace DarkUI +namespace DarkUI.Config { public enum DarkButtonStyle { diff --git a/DarkUI/Controls/DarkButton.cs b/DarkUI/Controls/DarkButton.cs index b82d019..6ad0a02 100644 --- a/DarkUI/Controls/DarkButton.cs +++ b/DarkUI/Controls/DarkButton.cs @@ -1,9 +1,10 @@ -using System; +using DarkUI.Config; +using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Controls { [ToolboxBitmap(typeof(Button))] [DefaultEvent("Click")] diff --git a/DarkUI/Controls/DarkContextMenu.cs b/DarkUI/Controls/DarkContextMenu.cs index 7e66090..19d1cae 100644 --- a/DarkUI/Controls/DarkContextMenu.cs +++ b/DarkUI/Controls/DarkContextMenu.cs @@ -1,6 +1,7 @@ -using System.Windows.Forms; +using DarkUI.Renderers; +using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Controls { public class DarkContextMenu : ContextMenuStrip { diff --git a/DarkUI/Controls/DarkLabel.cs b/DarkUI/Controls/DarkLabel.cs index 6b88d4d..2ec280b 100644 --- a/DarkUI/Controls/DarkLabel.cs +++ b/DarkUI/Controls/DarkLabel.cs @@ -1,9 +1,10 @@ -using System; +using DarkUI.Config; +using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Controls { public class DarkLabel : Label { diff --git a/DarkUI/Controls/DarkListView.cs b/DarkUI/Controls/DarkListView.cs index 9d61d29..bf224c1 100644 --- a/DarkUI/Controls/DarkListView.cs +++ b/DarkUI/Controls/DarkListView.cs @@ -1,4 +1,5 @@ -using System; +using DarkUI.Config; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; @@ -7,7 +8,7 @@ using System.Drawing; using System.Linq; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Controls { public class DarkListView : DarkScrollView { diff --git a/DarkUI/Controls/DarkMenuStrip.cs b/DarkUI/Controls/DarkMenuStrip.cs index d70220c..0071b2b 100644 --- a/DarkUI/Controls/DarkMenuStrip.cs +++ b/DarkUI/Controls/DarkMenuStrip.cs @@ -1,6 +1,7 @@ -using System.Windows.Forms; +using DarkUI.Renderers; +using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Controls { public class DarkMenuStrip : MenuStrip { diff --git a/DarkUI/Controls/DarkScrollBar.cs b/DarkUI/Controls/DarkScrollBar.cs index 35d8c5f..3649f39 100644 --- a/DarkUI/Controls/DarkScrollBar.cs +++ b/DarkUI/Controls/DarkScrollBar.cs @@ -1,9 +1,11 @@ -using System; +using DarkUI.Config; +using DarkUI.Icons; +using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Controls { public class DarkScrollBar : Control { diff --git a/DarkUI/Controls/DarkScrollBase.cs b/DarkUI/Controls/DarkScrollBase.cs index df0d409..d1397aa 100644 --- a/DarkUI/Controls/DarkScrollBase.cs +++ b/DarkUI/Controls/DarkScrollBase.cs @@ -1,9 +1,10 @@ -using System; +using DarkUI.Config; +using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Controls { public abstract class DarkScrollBase : Control { diff --git a/DarkUI/Controls/DarkScrollView.cs b/DarkUI/Controls/DarkScrollView.cs index c6f9270..00f3832 100644 --- a/DarkUI/Controls/DarkScrollView.cs +++ b/DarkUI/Controls/DarkScrollView.cs @@ -1,7 +1,7 @@ using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Controls { public abstract class DarkScrollView : DarkScrollBase { diff --git a/DarkUI/Controls/DarkSectionPanel.cs b/DarkUI/Controls/DarkSectionPanel.cs index 769a27c..e449ec9 100644 --- a/DarkUI/Controls/DarkSectionPanel.cs +++ b/DarkUI/Controls/DarkSectionPanel.cs @@ -1,8 +1,9 @@ -using System.ComponentModel; +using DarkUI.Config; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Controls { public class DarkSectionPanel : Panel { diff --git a/DarkUI/Controls/DarkSeparator.cs b/DarkUI/Controls/DarkSeparator.cs index 6ac4398..adf17ae 100644 --- a/DarkUI/Controls/DarkSeparator.cs +++ b/DarkUI/Controls/DarkSeparator.cs @@ -1,7 +1,8 @@ -using System.Drawing; +using DarkUI.Config; +using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Controls { public class DarkSeparator : Control { diff --git a/DarkUI/Controls/DarkStatusStrip.cs b/DarkUI/Controls/DarkStatusStrip.cs index 1cac2dd..4ba17c9 100644 --- a/DarkUI/Controls/DarkStatusStrip.cs +++ b/DarkUI/Controls/DarkStatusStrip.cs @@ -1,7 +1,8 @@ -using System.Drawing; +using DarkUI.Config; +using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Controls { public class DarkStatusStrip : StatusStrip { diff --git a/DarkUI/Controls/DarkTextBox.cs b/DarkUI/Controls/DarkTextBox.cs index e27220f..d4b2ede 100644 --- a/DarkUI/Controls/DarkTextBox.cs +++ b/DarkUI/Controls/DarkTextBox.cs @@ -1,6 +1,7 @@ -using System.Windows.Forms; +using DarkUI.Config; +using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Controls { public class DarkTextBox : TextBox { diff --git a/DarkUI/Controls/DarkToolStrip.cs b/DarkUI/Controls/DarkToolStrip.cs index c1bd205..49586c2 100644 --- a/DarkUI/Controls/DarkToolStrip.cs +++ b/DarkUI/Controls/DarkToolStrip.cs @@ -1,8 +1,8 @@ -using DarkUI.Renderer; +using DarkUI.Renderers; using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Controls { public class DarkToolStrip : ToolStrip { diff --git a/DarkUI/Controls/DarkTreeView.cs b/DarkUI/Controls/DarkTreeView.cs index b3070b4..f633024 100644 --- a/DarkUI/Controls/DarkTreeView.cs +++ b/DarkUI/Controls/DarkTreeView.cs @@ -1,4 +1,9 @@ -using System; +using DarkUI.Collections; +using DarkUI.Config; +using DarkUI.Extensions; +using DarkUI.Forms; +using DarkUI.Icons; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; @@ -7,7 +12,7 @@ using System.Drawing; using System.Linq; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Controls { public class DarkTreeView : DarkScrollView { diff --git a/DarkUI/Controls/EventArgs/ScrollValueEventArgs.cs b/DarkUI/Controls/EventArgs/ScrollValueEventArgs.cs index 460fb21..6e9b784 100644 --- a/DarkUI/Controls/EventArgs/ScrollValueEventArgs.cs +++ b/DarkUI/Controls/EventArgs/ScrollValueEventArgs.cs @@ -1,6 +1,6 @@ using System; -namespace DarkUI +namespace DarkUI.Controls { public class ScrollValueEventArgs : EventArgs { diff --git a/DarkUI/Controls/Items/DarkListItem.cs b/DarkUI/Controls/Items/DarkListItem.cs index 12acd2c..f3a797a 100644 --- a/DarkUI/Controls/Items/DarkListItem.cs +++ b/DarkUI/Controls/Items/DarkListItem.cs @@ -1,6 +1,7 @@ -using System.Drawing; +using DarkUI.Config; +using System.Drawing; -namespace DarkUI +namespace DarkUI.Controls { public class DarkListItem { diff --git a/DarkUI/Controls/Items/DarkTreeNode.cs b/DarkUI/Controls/Items/DarkTreeNode.cs index 93c2cce..56608bb 100644 --- a/DarkUI/Controls/Items/DarkTreeNode.cs +++ b/DarkUI/Controls/Items/DarkTreeNode.cs @@ -1,7 +1,8 @@ -using System; +using DarkUI.Collections; +using System; using System.Drawing; -namespace DarkUI +namespace DarkUI.Controls { public class DarkTreeNode { diff --git a/DarkUI/Docking/DarkDockContent.cs b/DarkUI/Docking/DarkDockContent.cs index 13a993c..351ec4f 100644 --- a/DarkUI/Docking/DarkDockContent.cs +++ b/DarkUI/Docking/DarkDockContent.cs @@ -1,8 +1,9 @@ -using System.ComponentModel; +using DarkUI.Config; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Docking { [ToolboxItem(false)] public class DarkDockContent : UserControl diff --git a/DarkUI/Docking/DarkDockGroup.cs b/DarkUI/Docking/DarkDockGroup.cs index 278b86e..b386945 100644 --- a/DarkUI/Docking/DarkDockGroup.cs +++ b/DarkUI/Docking/DarkDockGroup.cs @@ -1,9 +1,10 @@ -using System.Collections.Generic; +using DarkUI.Config; +using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Docking { [ToolboxItem(false)] public class DarkDockGroup : Panel diff --git a/DarkUI/Docking/DarkDockPanel.cs b/DarkUI/Docking/DarkDockPanel.cs index 5ed2fa6..66e6ae5 100644 --- a/DarkUI/Docking/DarkDockPanel.cs +++ b/DarkUI/Docking/DarkDockPanel.cs @@ -1,8 +1,10 @@ -using System.Collections.Generic; +using DarkUI.Config; +using DarkUI.Win32; +using System.Collections.Generic; using System.ComponentModel; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Docking { public class DarkDockPanel : UserControl { diff --git a/DarkUI/Docking/DarkDockRegion.cs b/DarkUI/Docking/DarkDockRegion.cs index bd1a3c1..e79c2ae 100644 --- a/DarkUI/Docking/DarkDockRegion.cs +++ b/DarkUI/Docking/DarkDockRegion.cs @@ -1,10 +1,12 @@ -using System; +using DarkUI.Config; +using DarkUI.Extensions; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Docking { [ToolboxItem(false)] public class DarkDockRegion : Panel diff --git a/DarkUI/Docking/DarkDocument.cs b/DarkUI/Docking/DarkDocument.cs index 60c69c6..4296166 100644 --- a/DarkUI/Docking/DarkDocument.cs +++ b/DarkUI/Docking/DarkDocument.cs @@ -1,6 +1,7 @@ -using System.ComponentModel; +using DarkUI.Config; +using System.ComponentModel; -namespace DarkUI +namespace DarkUI.Docking { [ToolboxItem(false)] public class DarkDocument : DarkDockContent diff --git a/DarkUI/Docking/DarkToolWindow.cs b/DarkUI/Docking/DarkToolWindow.cs index a9d7067..ab07471 100644 --- a/DarkUI/Docking/DarkToolWindow.cs +++ b/DarkUI/Docking/DarkToolWindow.cs @@ -1,8 +1,9 @@ -using System.ComponentModel; +using DarkUI.Config; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Docking { [ToolboxItem(false)] public class DarkToolWindow : DarkDockContent diff --git a/DarkUI/Docking/Items/DarkDockSplitter.cs b/DarkUI/Docking/Items/DarkDockSplitter.cs index 1a485a0..7d800c8 100644 --- a/DarkUI/Docking/Items/DarkDockSplitter.cs +++ b/DarkUI/Docking/Items/DarkDockSplitter.cs @@ -1,8 +1,10 @@ -using System; +using DarkUI.Config; +using DarkUI.Forms; +using System; using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Docking { public class DarkDockSplitter { diff --git a/DarkUI/Extensions/BitmapExtensions.cs b/DarkUI/Extensions/BitmapExtensions.cs index 77eef6b..e4e057d 100644 --- a/DarkUI/Extensions/BitmapExtensions.cs +++ b/DarkUI/Extensions/BitmapExtensions.cs @@ -1,6 +1,6 @@ using System.Drawing; -namespace DarkUI +namespace DarkUI.Extensions { internal static class BitmapExtensions { diff --git a/DarkUI/Extensions/IEnumerableExtensions.cs b/DarkUI/Extensions/IEnumerableExtensions.cs index f6f02d8..591a99d 100644 --- a/DarkUI/Extensions/IEnumerableExtensions.cs +++ b/DarkUI/Extensions/IEnumerableExtensions.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -namespace DarkUI +namespace DarkUI.Extensions { internal static class IEnumerableExtensions { diff --git a/DarkUI/Forms/DarkDialog.Designer.cs b/DarkUI/Forms/DarkDialog.Designer.cs index ec0754e..b8e0ffb 100644 --- a/DarkUI/Forms/DarkDialog.Designer.cs +++ b/DarkUI/Forms/DarkDialog.Designer.cs @@ -1,4 +1,6 @@ -namespace DarkUI +using DarkUI.Controls; + +namespace DarkUI.Forms { partial class DarkDialog { @@ -30,14 +32,14 @@ { this.pnlFooter = new System.Windows.Forms.Panel(); this.flowInner = new System.Windows.Forms.FlowLayoutPanel(); - this.btnOk = new DarkUI.DarkButton(); - this.btnCancel = new DarkUI.DarkButton(); - this.btnClose = new DarkUI.DarkButton(); - this.btnYes = new DarkUI.DarkButton(); - this.btnNo = new DarkUI.DarkButton(); - this.btnAbort = new DarkUI.DarkButton(); - this.btnRetry = new DarkUI.DarkButton(); - this.btnIgnore = new DarkUI.DarkButton(); + this.btnOk = new DarkButton(); + this.btnCancel = new DarkButton(); + this.btnClose = new DarkButton(); + this.btnYes = new DarkButton(); + this.btnNo = new DarkButton(); + this.btnAbort = new DarkButton(); + this.btnRetry = new DarkButton(); + this.btnIgnore = new DarkButton(); this.pnlFooter.SuspendLayout(); this.flowInner.SuspendLayout(); this.SuspendLayout(); @@ -174,13 +176,5 @@ private System.Windows.Forms.Panel pnlFooter; private System.Windows.Forms.FlowLayoutPanel flowInner; - protected DarkButton btnOk; - protected DarkButton btnCancel; - protected DarkButton btnClose; - protected DarkButton btnYes; - protected DarkButton btnNo; - protected DarkButton btnAbort; - protected DarkButton btnRetry; - protected DarkButton btnIgnore; } } \ No newline at end of file diff --git a/DarkUI/Forms/DarkDialog.cs b/DarkUI/Forms/DarkDialog.cs index c3f5f00..667e679 100644 --- a/DarkUI/Forms/DarkDialog.cs +++ b/DarkUI/Forms/DarkDialog.cs @@ -1,8 +1,10 @@ -using System.Collections.Generic; +using DarkUI.Config; +using DarkUI.Controls; +using System.Collections.Generic; using System.ComponentModel; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Forms { public partial class DarkDialog : DarkForm { @@ -13,6 +15,19 @@ namespace DarkUI #endregion + #region Button Region + + protected DarkButton btnOk; + protected DarkButton btnCancel; + protected DarkButton btnClose; + protected DarkButton btnYes; + protected DarkButton btnNo; + protected DarkButton btnAbort; + protected DarkButton btnRetry; + protected DarkButton btnIgnore; + + #endregion + #region Property Region [Description("Determines the type of the dialog window.")] diff --git a/DarkUI/Forms/DarkForm.cs b/DarkUI/Forms/DarkForm.cs index 0d14107..f135c8a 100644 --- a/DarkUI/Forms/DarkForm.cs +++ b/DarkUI/Forms/DarkForm.cs @@ -1,8 +1,9 @@ -using System.ComponentModel; +using DarkUI.Config; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Forms { public class DarkForm : Form { diff --git a/DarkUI/Forms/DarkMessageBox.Designer.cs b/DarkUI/Forms/DarkMessageBox.Designer.cs index a285fd1..c794003 100644 --- a/DarkUI/Forms/DarkMessageBox.Designer.cs +++ b/DarkUI/Forms/DarkMessageBox.Designer.cs @@ -1,4 +1,6 @@ -namespace DarkUI +using DarkUI.Controls; + +namespace DarkUI.Forms { partial class DarkMessageBox { @@ -29,7 +31,7 @@ private void InitializeComponent() { this.picIcon = new System.Windows.Forms.PictureBox(); - this.lblText = new DarkUI.DarkLabel(); + this.lblText = new DarkLabel(); ((System.ComponentModel.ISupportInitialize)(this.picIcon)).BeginInit(); this.SuspendLayout(); // diff --git a/DarkUI/Forms/DarkMessageBox.cs b/DarkUI/Forms/DarkMessageBox.cs index 3eedfe4..0ac0ae2 100644 --- a/DarkUI/Forms/DarkMessageBox.cs +++ b/DarkUI/Forms/DarkMessageBox.cs @@ -1,9 +1,11 @@ -using System; +using DarkUI.Config; +using DarkUI.Icons; +using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Forms { public partial class DarkMessageBox : DarkDialog { diff --git a/DarkUI/Forms/DarkTranslucentForm.cs b/DarkUI/Forms/DarkTranslucentForm.cs index ac4d7d5..cf00306 100644 --- a/DarkUI/Forms/DarkTranslucentForm.cs +++ b/DarkUI/Forms/DarkTranslucentForm.cs @@ -1,7 +1,7 @@ using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Forms { internal class DarkTranslucentForm : Form { diff --git a/DarkUI/Icons/MenuIcons.Designer.cs b/DarkUI/Icons/MenuIcons.Designer.cs index 0ffedc4..ac95917 100644 --- a/DarkUI/Icons/MenuIcons.Designer.cs +++ b/DarkUI/Icons/MenuIcons.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace DarkUI { +namespace DarkUI.Icons { using System; diff --git a/DarkUI/Icons/MessageBoxIcons.Designer.cs b/DarkUI/Icons/MessageBoxIcons.Designer.cs index 7c94bba..53720f4 100644 --- a/DarkUI/Icons/MessageBoxIcons.Designer.cs +++ b/DarkUI/Icons/MessageBoxIcons.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace DarkUI { +namespace DarkUI.Icons { using System; diff --git a/DarkUI/Icons/ScrollIcons.Designer.cs b/DarkUI/Icons/ScrollIcons.Designer.cs index 1cbfd05..1d297f4 100644 --- a/DarkUI/Icons/ScrollIcons.Designer.cs +++ b/DarkUI/Icons/ScrollIcons.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace DarkUI { +namespace DarkUI.Icons { using System; diff --git a/DarkUI/Icons/TreeViewIcons.Designer.cs b/DarkUI/Icons/TreeViewIcons.Designer.cs index 0e71462..4604e37 100644 --- a/DarkUI/Icons/TreeViewIcons.Designer.cs +++ b/DarkUI/Icons/TreeViewIcons.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace DarkUI { +namespace DarkUI.Icons { using System; diff --git a/DarkUI/Renderers/DarkMenuRenderer.cs b/DarkUI/Renderers/DarkMenuRenderer.cs index 6c2eb1c..9997e66 100644 --- a/DarkUI/Renderers/DarkMenuRenderer.cs +++ b/DarkUI/Renderers/DarkMenuRenderer.cs @@ -1,8 +1,10 @@ -using System; +using DarkUI.Config; +using DarkUI.Icons; +using System; using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Renderers { public class DarkMenuRenderer : ToolStripRenderer { diff --git a/DarkUI/Renderers/DarkToolStripRenderer.cs b/DarkUI/Renderers/DarkToolStripRenderer.cs index 3c63b0d..334cfe7 100644 --- a/DarkUI/Renderers/DarkToolStripRenderer.cs +++ b/DarkUI/Renderers/DarkToolStripRenderer.cs @@ -1,7 +1,10 @@ -using System.Drawing; +using DarkUI.Config; +using DarkUI.Extensions; +using DarkUI.Icons; +using System.Drawing; using System.Windows.Forms; -namespace DarkUI.Renderer +namespace DarkUI.Renderers { public class DarkToolStripRenderer : DarkMenuRenderer { diff --git a/DarkUI/Win32/DarkControlScrollFilter.cs b/DarkUI/Win32/DarkControlScrollFilter.cs index 2d944f1..8c07a4d 100644 --- a/DarkUI/Win32/DarkControlScrollFilter.cs +++ b/DarkUI/Win32/DarkControlScrollFilter.cs @@ -1,7 +1,7 @@ using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Win32 { public class DarkControlScrollFilter : IMessageFilter { diff --git a/DarkUI/Win32/DarkDockResizeFilter.cs b/DarkUI/Win32/DarkDockResizeFilter.cs index 1d56437..0c5be57 100644 --- a/DarkUI/Win32/DarkDockResizeFilter.cs +++ b/DarkUI/Win32/DarkDockResizeFilter.cs @@ -1,8 +1,9 @@ -using System; +using DarkUI.Docking; +using System; using System.Drawing; using System.Windows.Forms; -namespace DarkUI +namespace DarkUI.Win32 { public class DarkDockResizeFilter : IMessageFilter { diff --git a/DarkUI/Win32/Native.cs b/DarkUI/Win32/Native.cs index e6b62e4..db5517e 100644 --- a/DarkUI/Win32/Native.cs +++ b/DarkUI/Win32/Native.cs @@ -2,7 +2,7 @@ using System.Drawing; using System.Runtime.InteropServices; -namespace DarkUI +namespace DarkUI.Win32 { internal sealed class Native { diff --git a/DarkUI/Win32/WindowsMessages.cs b/DarkUI/Win32/WindowsMessages.cs index 3d06e2c..3c00948 100644 --- a/DarkUI/Win32/WindowsMessages.cs +++ b/DarkUI/Win32/WindowsMessages.cs @@ -1,6 +1,6 @@ using System; -namespace DarkUI +namespace DarkUI.Win32 { /// /// Windows Messages From 466a9ec9d664b6f4ea3e5663fd3b2e64190f819d Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 4 Dec 2015 20:13:20 +0000 Subject: [PATCH 42/97] Button icons centralised by default --- DarkUI/Controls/DarkButton.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/DarkUI/Controls/DarkButton.cs b/DarkUI/Controls/DarkButton.cs index 6ad0a02..e9e53c6 100644 --- a/DarkUI/Controls/DarkButton.cs +++ b/DarkUI/Controls/DarkButton.cs @@ -374,7 +374,7 @@ namespace DarkUI.Controls { var stringSize = g.MeasureString(Text, Font, rect.Size); - var x = 0; + var x = (ClientSize.Width / 2) - (Image.Size.Width / 2); var y = (ClientSize.Height / 2) - (Image.Size.Height / 2); switch (TextImageRelation) @@ -388,7 +388,8 @@ namespace DarkUI.Controls y = y + ((int)(stringSize.Height / 2) + (ImagePadding / 2)); break; case TextImageRelation.ImageBeforeText: - textOffsetX = Image.Size.Width + ImagePadding; + textOffsetX = Image.Size.Width + (ImagePadding * 2); + x = ImagePadding; break; case TextImageRelation.TextBeforeImage: x = x + (int)stringSize.Width; @@ -405,11 +406,11 @@ namespace DarkUI.Controls rect.Height - Padding.Vertical); var stringFormat = new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center, - Trimming = StringTrimming.EllipsisCharacter - }; + { + LineAlignment = StringAlignment.Center, + Alignment = StringAlignment.Center, + Trimming = StringTrimming.EllipsisCharacter + }; g.DrawString(Text, Font, b, modRect, stringFormat); } From 99b88d09917965df2696d9130bdd1e6fc843391c Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 4 Dec 2015 20:53:16 +0000 Subject: [PATCH 43/97] Fixed Example project namespaces --- Example/Forms/Dialogs/DialogAbout.Designer.cs | 24 +++++++------- Example/Forms/Dialogs/DialogAbout.cs | 2 +- Example/Forms/Dialogs/DialogTest.Designer.cs | 32 ++++++++++--------- Example/Forms/Dialogs/DialogTest.cs | 3 +- Example/Forms/Docking/DockConsole.Designer.cs | 11 ++++--- Example/Forms/Docking/DockConsole.cs | 3 +- Example/Forms/Docking/DockDocument.cs | 4 ++- Example/Forms/Docking/DockHistory.Designer.cs | 11 ++++--- Example/Forms/Docking/DockHistory.cs | 3 +- Example/Forms/Docking/DockLayers.Designer.cs | 11 ++++--- Example/Forms/Docking/DockLayers.cs | 3 +- Example/Forms/Docking/DockProject.Designer.cs | 11 ++++--- Example/Forms/Docking/DockProject.cs | 3 +- .../Forms/Docking/DockProperties.Designer.cs | 6 ++-- Example/Forms/Docking/DockProperties.cs | 2 +- Example/Forms/MainForm.Designer.cs | 25 ++++++++------- Example/Forms/MainForm.cs | 4 ++- 17 files changed, 94 insertions(+), 64 deletions(-) diff --git a/Example/Forms/Dialogs/DialogAbout.Designer.cs b/Example/Forms/Dialogs/DialogAbout.Designer.cs index 9dbf1ed..53f5a23 100644 --- a/Example/Forms/Dialogs/DialogAbout.Designer.cs +++ b/Example/Forms/Dialogs/DialogAbout.Designer.cs @@ -1,4 +1,6 @@ -namespace Example +using DarkUI.Controls; + +namespace Example { partial class DialogAbout { @@ -30,11 +32,11 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DialogAbout)); this.pnlMain = new System.Windows.Forms.Panel(); - this.lblVersion = new DarkUI.DarkLabel(); - this.darkLabel3 = new DarkUI.DarkLabel(); - this.darkLabel2 = new DarkUI.DarkLabel(); - this.darkLabel1 = new DarkUI.DarkLabel(); - this.lblHeader = new DarkUI.DarkLabel(); + this.lblVersion = new DarkLabel(); + this.darkLabel3 = new DarkLabel(); + this.darkLabel2 = new DarkLabel(); + this.darkLabel1 = new DarkLabel(); + this.lblHeader = new DarkLabel(); this.pnlMain.SuspendLayout(); this.SuspendLayout(); // @@ -137,10 +139,10 @@ #endregion private System.Windows.Forms.Panel pnlMain; - private DarkUI.DarkLabel lblHeader; - private DarkUI.DarkLabel darkLabel1; - private DarkUI.DarkLabel darkLabel3; - private DarkUI.DarkLabel darkLabel2; - private DarkUI.DarkLabel lblVersion; + private DarkLabel lblHeader; + private DarkLabel darkLabel1; + private DarkLabel darkLabel3; + private DarkLabel darkLabel2; + private DarkLabel lblVersion; } } \ No newline at end of file diff --git a/Example/Forms/Dialogs/DialogAbout.cs b/Example/Forms/Dialogs/DialogAbout.cs index e3cc762..b33b110 100644 --- a/Example/Forms/Dialogs/DialogAbout.cs +++ b/Example/Forms/Dialogs/DialogAbout.cs @@ -1,4 +1,4 @@ -using DarkUI; +using DarkUI.Forms; using System.Windows.Forms; namespace Example diff --git a/Example/Forms/Dialogs/DialogTest.Designer.cs b/Example/Forms/Dialogs/DialogTest.Designer.cs index a71be7e..34abf47 100644 --- a/Example/Forms/Dialogs/DialogTest.Designer.cs +++ b/Example/Forms/Dialogs/DialogTest.Designer.cs @@ -1,4 +1,6 @@ -namespace Example +using DarkUI.Controls; + +namespace Example { partial class DialogTest { @@ -31,15 +33,15 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DialogTest)); this.pnlMain = new System.Windows.Forms.Panel(); this.tblMain = new System.Windows.Forms.TableLayoutPanel(); - this.pnlTreeView = new DarkUI.DarkSectionPanel(); - this.treeTest = new DarkUI.DarkTreeView(); - this.pnlListView = new DarkUI.DarkSectionPanel(); - this.lstTest = new DarkUI.DarkListView(); - this.pnlMessageBox = new DarkUI.DarkSectionPanel(); + this.pnlTreeView = new DarkSectionPanel(); + this.treeTest = new DarkTreeView(); + this.pnlListView = new DarkSectionPanel(); + this.lstTest = new DarkListView(); + this.pnlMessageBox = new DarkSectionPanel(); this.panel1 = new System.Windows.Forms.Panel(); - this.btnMessageBox = new DarkUI.DarkButton(); + this.btnMessageBox = new DarkButton(); this.panel2 = new System.Windows.Forms.Panel(); - this.btnDialog = new DarkUI.DarkButton(); + this.btnDialog = new DarkButton(); this.pnlMain.SuspendLayout(); this.tblMain.SuspendLayout(); this.pnlTreeView.SuspendLayout(); @@ -198,14 +200,14 @@ private System.Windows.Forms.Panel pnlMain; private System.Windows.Forms.TableLayoutPanel tblMain; - private DarkUI.DarkSectionPanel pnlTreeView; - private DarkUI.DarkTreeView treeTest; - private DarkUI.DarkSectionPanel pnlListView; - private DarkUI.DarkListView lstTest; - private DarkUI.DarkSectionPanel pnlMessageBox; + private DarkSectionPanel pnlTreeView; + private DarkTreeView treeTest; + private DarkSectionPanel pnlListView; + private DarkListView lstTest; + private DarkSectionPanel pnlMessageBox; private System.Windows.Forms.Panel panel1; - private DarkUI.DarkButton btnMessageBox; + private DarkButton btnMessageBox; private System.Windows.Forms.Panel panel2; - private DarkUI.DarkButton btnDialog; + private DarkButton btnDialog; } } \ No newline at end of file diff --git a/Example/Forms/Dialogs/DialogTest.cs b/Example/Forms/Dialogs/DialogTest.cs index bfb7c59..c64518f 100644 --- a/Example/Forms/Dialogs/DialogTest.cs +++ b/Example/Forms/Dialogs/DialogTest.cs @@ -1,4 +1,5 @@ -using DarkUI; +using DarkUI.Controls; +using DarkUI.Forms; namespace Example { diff --git a/Example/Forms/Docking/DockConsole.Designer.cs b/Example/Forms/Docking/DockConsole.Designer.cs index 0ee49df..ef96f59 100644 --- a/Example/Forms/Docking/DockConsole.Designer.cs +++ b/Example/Forms/Docking/DockConsole.Designer.cs @@ -1,4 +1,7 @@ -namespace Example +using DarkUI.Config; +using DarkUI.Controls; + +namespace Example { partial class DockConsole { @@ -28,7 +31,7 @@ /// private void InitializeComponent() { - this.lstConsole = new DarkUI.DarkListView(); + this.lstConsole = new DarkListView(); this.SuspendLayout(); // // lstConsole @@ -46,7 +49,7 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.lstConsole); - this.DockArea = DarkUI.DarkDockArea.Bottom; + this.DockArea = DarkDockArea.Bottom; this.DockText = "Console"; this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = global::Example.Icons.Console; @@ -58,6 +61,6 @@ #endregion - private DarkUI.DarkListView lstConsole; + private DarkListView lstConsole; } } diff --git a/Example/Forms/Docking/DockConsole.cs b/Example/Forms/Docking/DockConsole.cs index 2985d81..ecf4227 100644 --- a/Example/Forms/Docking/DockConsole.cs +++ b/Example/Forms/Docking/DockConsole.cs @@ -1,4 +1,5 @@ -using DarkUI; +using DarkUI.Controls; +using DarkUI.Docking; namespace Example { diff --git a/Example/Forms/Docking/DockDocument.cs b/Example/Forms/Docking/DockDocument.cs index bc478b1..4ce1416 100644 --- a/Example/Forms/Docking/DockDocument.cs +++ b/Example/Forms/Docking/DockDocument.cs @@ -1,4 +1,6 @@ -using DarkUI; +using DarkUI.Config; +using DarkUI.Docking; +using DarkUI.Forms; using System.Windows.Forms; namespace Example diff --git a/Example/Forms/Docking/DockHistory.Designer.cs b/Example/Forms/Docking/DockHistory.Designer.cs index 0cd4a7a..84d5a8f 100644 --- a/Example/Forms/Docking/DockHistory.Designer.cs +++ b/Example/Forms/Docking/DockHistory.Designer.cs @@ -1,4 +1,7 @@ -namespace Example +using DarkUI.Config; +using DarkUI.Controls; + +namespace Example { partial class DockHistory { @@ -28,7 +31,7 @@ /// private void InitializeComponent() { - this.lstHistory = new DarkUI.DarkListView(); + this.lstHistory = new DarkListView(); this.SuspendLayout(); // // lstHistory @@ -45,7 +48,7 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.lstHistory); - this.DockArea = DarkUI.DarkDockArea.Bottom; + this.DockArea = DarkDockArea.Bottom; this.DockText = "History"; this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = global::Example.Icons.RefactoringLog_12810; @@ -57,6 +60,6 @@ #endregion - private DarkUI.DarkListView lstHistory; + private DarkListView lstHistory; } } diff --git a/Example/Forms/Docking/DockHistory.cs b/Example/Forms/Docking/DockHistory.cs index 19f5c48..e546654 100644 --- a/Example/Forms/Docking/DockHistory.cs +++ b/Example/Forms/Docking/DockHistory.cs @@ -1,4 +1,5 @@ -using DarkUI; +using DarkUI.Controls; +using DarkUI.Docking; namespace Example { diff --git a/Example/Forms/Docking/DockLayers.Designer.cs b/Example/Forms/Docking/DockLayers.Designer.cs index 955126b..a7cb796 100644 --- a/Example/Forms/Docking/DockLayers.Designer.cs +++ b/Example/Forms/Docking/DockLayers.Designer.cs @@ -1,4 +1,7 @@ -namespace Example +using DarkUI.Config; +using DarkUI.Controls; + +namespace Example { partial class DockLayers { @@ -28,7 +31,7 @@ /// private void InitializeComponent() { - this.lstLayers = new DarkUI.DarkListView(); + this.lstLayers = new DarkListView(); this.SuspendLayout(); // // lstLayers @@ -45,7 +48,7 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.lstLayers); - this.DockArea = DarkUI.DarkDockArea.Right; + this.DockArea = DarkDockArea.Right; this.DockText = "Layers"; this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = global::Example.Icons.Collection_16xLG; @@ -57,6 +60,6 @@ #endregion - private DarkUI.DarkListView lstLayers; + private DarkListView lstLayers; } } diff --git a/Example/Forms/Docking/DockLayers.cs b/Example/Forms/Docking/DockLayers.cs index 575fede..14bf7c4 100644 --- a/Example/Forms/Docking/DockLayers.cs +++ b/Example/Forms/Docking/DockLayers.cs @@ -1,4 +1,5 @@ -using DarkUI; +using DarkUI.Controls; +using DarkUI.Docking; namespace Example { diff --git a/Example/Forms/Docking/DockProject.Designer.cs b/Example/Forms/Docking/DockProject.Designer.cs index 284084d..78a526b 100644 --- a/Example/Forms/Docking/DockProject.Designer.cs +++ b/Example/Forms/Docking/DockProject.Designer.cs @@ -1,4 +1,7 @@ -namespace Example +using DarkUI.Config; +using DarkUI.Controls; + +namespace Example { partial class DockProject { @@ -28,7 +31,7 @@ /// private void InitializeComponent() { - this.treeProject = new DarkUI.DarkTreeView(); + this.treeProject = new DarkTreeView(); this.SuspendLayout(); // // treeProject @@ -48,7 +51,7 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.treeProject); - this.DockArea = DarkUI.DarkDockArea.Left; + this.DockArea = DarkDockArea.Left; this.DockText = "Project Explorer"; this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = global::Example.Icons.application_16x; @@ -60,6 +63,6 @@ #endregion - private DarkUI.DarkTreeView treeProject; + private DarkTreeView treeProject; } } diff --git a/Example/Forms/Docking/DockProject.cs b/Example/Forms/Docking/DockProject.cs index 2e00e33..9fb539e 100644 --- a/Example/Forms/Docking/DockProject.cs +++ b/Example/Forms/Docking/DockProject.cs @@ -1,4 +1,5 @@ -using DarkUI; +using DarkUI.Controls; +using DarkUI.Docking; namespace Example { diff --git a/Example/Forms/Docking/DockProperties.Designer.cs b/Example/Forms/Docking/DockProperties.Designer.cs index c47ae7c..6bd766a 100644 --- a/Example/Forms/Docking/DockProperties.Designer.cs +++ b/Example/Forms/Docking/DockProperties.Designer.cs @@ -1,4 +1,6 @@ -namespace Example +using DarkUI.Config; + +namespace Example { partial class DockProperties { @@ -34,7 +36,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.DockArea = DarkUI.DarkDockArea.Right; + this.DockArea = DarkDockArea.Right; this.DockText = "Properties"; this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = global::Example.Icons.properties_16xLG; diff --git a/Example/Forms/Docking/DockProperties.cs b/Example/Forms/Docking/DockProperties.cs index 655df52..c32ad3b 100644 --- a/Example/Forms/Docking/DockProperties.cs +++ b/Example/Forms/Docking/DockProperties.cs @@ -1,4 +1,4 @@ -using DarkUI; +using DarkUI.Docking; namespace Example { diff --git a/Example/Forms/MainForm.Designer.cs b/Example/Forms/MainForm.Designer.cs index a7dc2d9..80d3c3a 100644 --- a/Example/Forms/MainForm.Designer.cs +++ b/Example/Forms/MainForm.Designer.cs @@ -1,4 +1,7 @@ -namespace Example +using DarkUI.Controls; +using DarkUI.Docking; + +namespace Example { partial class MainForm { @@ -29,7 +32,7 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - this.mnuMain = new DarkUI.DarkMenuStrip(); + this.mnuMain = new DarkMenuStrip(); this.mnuFile = new System.Windows.Forms.ToolStripMenuItem(); this.mnuNewFile = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); @@ -45,14 +48,14 @@ this.mnuHistory = new System.Windows.Forms.ToolStripMenuItem(); this.mnuHelp = new System.Windows.Forms.ToolStripMenuItem(); this.mnuAbout = new System.Windows.Forms.ToolStripMenuItem(); - this.toolMain = new DarkUI.DarkToolStrip(); + this.toolMain = new DarkToolStrip(); this.btnNewFile = new System.Windows.Forms.ToolStripButton(); - this.stripMain = new DarkUI.DarkStatusStrip(); + this.stripMain = new DarkStatusStrip(); this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel6 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel5 = new System.Windows.Forms.ToolStripStatusLabel(); - this.DockPanel = new DarkUI.DarkDockPanel(); - this.darkSeparator1 = new DarkUI.DarkSeparator(); + this.DockPanel = new DarkDockPanel(); + this.darkSeparator1 = new DarkSeparator(); this.mnuMain.SuspendLayout(); this.toolMain.SuspendLayout(); this.stripMain.SuspendLayout(); @@ -321,9 +324,9 @@ #endregion - private DarkUI.DarkMenuStrip mnuMain; - private DarkUI.DarkToolStrip toolMain; - private DarkUI.DarkStatusStrip stripMain; + private DarkMenuStrip mnuMain; + private DarkToolStrip toolMain; + private DarkStatusStrip stripMain; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel6; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel5; @@ -338,13 +341,13 @@ private System.Windows.Forms.ToolStripButton btnNewFile; private System.Windows.Forms.ToolStripMenuItem mnuNewFile; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private DarkUI.DarkDockPanel DockPanel; + private DarkDockPanel DockPanel; private System.Windows.Forms.ToolStripMenuItem mnuProject; private System.Windows.Forms.ToolStripMenuItem mnuProperties; private System.Windows.Forms.ToolStripMenuItem mnuConsole; private System.Windows.Forms.ToolStripMenuItem mnuLayers; private System.Windows.Forms.ToolStripMenuItem mnuHistory; - private DarkUI.DarkSeparator darkSeparator1; + private DarkSeparator darkSeparator1; } } diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index 244caab..0e7c0cd 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -1,4 +1,6 @@ -using DarkUI; +using DarkUI.Docking; +using DarkUI.Forms; +using DarkUI.Win32; using System; using System.Windows.Forms; From 46ac40154228cf21b087405406a19f849bffc735 Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 5 Dec 2015 13:13:31 +0000 Subject: [PATCH 44/97] Improved docking Added dock order. Made groups size properly to the containing region. Added DarkDockTab. --- DarkUI/DarkUI.csproj | 1 + DarkUI/Docking/DarkDockGroup.cs | 29 +++++--- DarkUI/Docking/DarkDockRegion.cs | 70 +++++++++++++++++-- DarkUI/Docking/Items/DarkDockTab.cs | 46 ++++++++++++ Example/Forms/Docking/DockHistory.Designer.cs | 4 +- 5 files changed, 132 insertions(+), 18 deletions(-) create mode 100644 DarkUI/Docking/Items/DarkDockTab.cs diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index 93d3e2a..c2855f9 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -107,6 +107,7 @@ UserControl + diff --git a/DarkUI/Docking/DarkDockGroup.cs b/DarkUI/Docking/DarkDockGroup.cs index b386945..c5a9dcb 100644 --- a/DarkUI/Docking/DarkDockGroup.cs +++ b/DarkUI/Docking/DarkDockGroup.cs @@ -1,7 +1,6 @@ using DarkUI.Config; using System.Collections.Generic; using System.ComponentModel; -using System.Drawing; using System.Windows.Forms; namespace DarkUI.Docking @@ -23,25 +22,25 @@ namespace DarkUI.Docking public DarkDockArea DockArea { get; private set; } - public int ContentCount - { - get - { - return _contents.Count; - } - } + public DarkDockContent VisibleContent { get; private set; } + + public int Order { get; set; } + + public int ContentCount { get { return _contents.Count; } } #endregion #region Constructor Region - public DarkDockGroup(DarkDockPanel dockPanel, DarkDockRegion dockRegion) + public DarkDockGroup(DarkDockPanel dockPanel, DarkDockRegion dockRegion, int order) { _contents = new List(); DockPanel = dockPanel; DockRegion = dockRegion; DockArea = dockRegion.DockArea; + + Order = order; } #endregion @@ -55,6 +54,9 @@ namespace DarkUI.Docking _contents.Add(dockContent); Controls.Add(dockContent); + + if (VisibleContent == null) + VisibleContent = dockContent; } public void RemoveContent(DarkDockContent dockContent) @@ -63,6 +65,15 @@ namespace DarkUI.Docking _contents.Remove(dockContent); Controls.Remove(dockContent); + + if (VisibleContent == dockContent) + { + VisibleContent = null; + + // todo: order? + foreach (var content in _contents) + VisibleContent = content; + } } #endregion diff --git a/DarkUI/Docking/DarkDockRegion.cs b/DarkUI/Docking/DarkDockRegion.cs index e79c2ae..c1e38ad 100644 --- a/DarkUI/Docking/DarkDockRegion.cs +++ b/DarkUI/Docking/DarkDockRegion.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; +using System.Linq; using System.Windows.Forms; namespace DarkUI.Docking @@ -68,6 +69,8 @@ namespace DarkUI.Docking // Show the region if it was previously hidden if (!Visible) Visible = true; + + PositionGroups(); } public void RemoveContent(DarkDockContent dockContent) @@ -84,25 +87,43 @@ namespace DarkUI.Docking // If we just removed the final group, and this isn't the document region, then hide if (_groups.Count == 0 && DockArea != DarkDockArea.Document) Visible = false; + + PositionGroups(); } private DarkDockGroup CreateGroup() { - var newGroup = new DarkDockGroup(DockPanel, this); + var order = 0; + + if (_groups.Count >= 1) + { + order = -1; + foreach (var group in _groups) + { + if (group.Order >= order) + order = group.Order + 1; + } + } + + var newGroup = new DarkDockGroup(DockPanel, this, order); _groups.Add(newGroup); Controls.Add(newGroup); - PositionGroups(); - return newGroup; } private void RemoveGroup(DarkDockGroup group) { + var lastOrder = group.Order; + _groups.Remove(group); Controls.Remove(group); - PositionGroups(); + foreach (var otherGroup in _groups) + { + if (otherGroup.Order > lastOrder) + otherGroup.Order--; + } } private void PositionGroups() @@ -127,21 +148,52 @@ namespace DarkUI.Docking if (_groups.Count == 1) { _groups[0].Dock = DockStyle.Fill; + return; } - else if (_groups.Count > 1) + + if (_groups.Count > 1) { - foreach (var group in _groups) + var lastGroup = _groups.OrderByDescending(g => g.Order).First(); + + foreach (var group in _groups.OrderByDescending(g => g.Order)) { group.SendToBack(); - if (_groups.IsFirst(group)) + if (group.Order == lastGroup.Order) group.Dock = DockStyle.Fill; else group.Dock = dockStyle; } + + SizeGroups(); } } + private void SizeGroups() + { + if (_groups.Count <= 1) + return; + + var size = new Size(0, 0); + + switch (DockArea) + { + default: + case DarkDockArea.Document: + return; + case DarkDockArea.Left: + case DarkDockArea.Right: + size = new Size(Width, Height / _groups.Count); + break; + case DarkDockArea.Bottom: + size = new Size(Width / _groups.Count, Height); + break; + } + + foreach (var group in _groups) + group.Size = size; + } + private void BuildProperties() { MinimumSize = new Size(50, 50); @@ -205,6 +257,8 @@ namespace DarkUI.Docking private void ParentForm_ResizeEnd(object sender, EventArgs e) { + SizeGroups(); + if (_splitter != null) _splitter.UpdateBounds(); } @@ -213,6 +267,8 @@ namespace DarkUI.Docking { base.OnLayout(e); + SizeGroups(); + if (_splitter != null) _splitter.UpdateBounds(); } diff --git a/DarkUI/Docking/Items/DarkDockTab.cs b/DarkUI/Docking/Items/DarkDockTab.cs new file mode 100644 index 0000000..8e17979 --- /dev/null +++ b/DarkUI/Docking/Items/DarkDockTab.cs @@ -0,0 +1,46 @@ +using System.Drawing; + +namespace DarkUI.Docking +{ + internal class DarkDockTab + { + #region Property Region + + public DarkDockContent DockContent { get; set; } + + public Rectangle ClientRectangle { get; set; } + + public Rectangle CloseButtonRectangle { get; set; } + + public bool Hot { get; set; } + + public bool Pressed { get; set; } + + public bool CloseButtonHot { get; set; } + + public bool ShowSeparator { get; set; } + + #endregion + + #region Constructor Region + + public DarkDockTab(DarkDockContent content) + { + DockContent = content; + } + + #endregion + + #region Method Region + + public int CalculateWidth(Graphics g, Font font) + { + var width = (int)g.MeasureString(DockContent.DockText, font).Width; + width += 10; + + return width; + } + + #endregion + } +} diff --git a/Example/Forms/Docking/DockHistory.Designer.cs b/Example/Forms/Docking/DockHistory.Designer.cs index 84d5a8f..461f574 100644 --- a/Example/Forms/Docking/DockHistory.Designer.cs +++ b/Example/Forms/Docking/DockHistory.Designer.cs @@ -31,7 +31,7 @@ namespace Example /// private void InitializeComponent() { - this.lstHistory = new DarkListView(); + this.lstHistory = new DarkUI.Controls.DarkListView(); this.SuspendLayout(); // // lstHistory @@ -48,7 +48,7 @@ namespace Example this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.lstHistory); - this.DockArea = DarkDockArea.Bottom; + this.DockArea = DarkUI.Config.DarkDockArea.Right; this.DockText = "History"; this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = global::Example.Icons.RefactoringLog_12810; From c39af6c1907c042f4a5a68e2c97cc0d8a8192d42 Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 5 Dec 2015 14:16:37 +0000 Subject: [PATCH 45/97] DockPanel now tracks active content --- DarkUI/Docking/DarkDockContent.cs | 19 +++++++++++++++---- DarkUI/Docking/DarkDockPanel.cs | 25 +++++++++++++++++++++++++ DarkUI/Docking/DarkToolWindow.cs | 20 +++++++++++++++++--- 3 files changed, 57 insertions(+), 7 deletions(-) diff --git a/DarkUI/Docking/DarkDockContent.cs b/DarkUI/Docking/DarkDockContent.cs index 351ec4f..5f1adcf 100644 --- a/DarkUI/Docking/DarkDockContent.cs +++ b/DarkUI/Docking/DarkDockContent.cs @@ -1,4 +1,5 @@ using DarkUI.Config; +using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; @@ -59,10 +60,6 @@ namespace DarkUI.Docking [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public DarkDockGroup DockGroup { get; internal set; } - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public bool IsActive { get; internal set; } - #endregion #region Constructor Region @@ -81,5 +78,19 @@ namespace DarkUI.Docking } #endregion + + #region Event Handler Region + + protected override void OnEnter(EventArgs e) + { + base.OnEnter(e); + + if (DockPanel == null) + return; + + DockPanel.ActiveContent = this; + } + + #endregion } } diff --git a/DarkUI/Docking/DarkDockPanel.cs b/DarkUI/Docking/DarkDockPanel.cs index 66e6ae5..4160818 100644 --- a/DarkUI/Docking/DarkDockPanel.cs +++ b/DarkUI/Docking/DarkDockPanel.cs @@ -13,10 +13,35 @@ namespace DarkUI.Docking private List _contents; private Dictionary _regions; + private DarkDockContent _activeContent; + #endregion #region Property Region + public DarkDockContent ActiveContent + { + get { return _activeContent; } + internal set + { + _activeContent = value; + + ActiveGroup = _activeContent.DockGroup; + ActiveRegion = ActiveGroup.DockRegion; + + foreach (var content in _contents) + content.Invalidate(); + } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public DarkDockRegion ActiveRegion { get; internal set; } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public DarkDockGroup ActiveGroup { get; internal set; } + [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IMessageFilter MessageFilter { get; private set; } diff --git a/DarkUI/Docking/DarkToolWindow.cs b/DarkUI/Docking/DarkToolWindow.cs index ab07471..280ac3b 100644 --- a/DarkUI/Docking/DarkToolWindow.cs +++ b/DarkUI/Docking/DarkToolWindow.cs @@ -33,6 +33,18 @@ namespace DarkUI.Docking #endregion + #region Method Region + + private bool IsActive() + { + if (DockPanel == null) + return false; + + return DockPanel.ActiveContent == this; + } + + #endregion + #region Paint Region protected override void OnPaint(PaintEventArgs e) @@ -45,10 +57,12 @@ namespace DarkUI.Docking g.FillRectangle(b, ClientRectangle); } + var isActive = IsActive(); + // Draw header - var bgColor = IsActive ? Colors.BlueBackground : Colors.HeaderBackground; - var darkColor = IsActive ? Colors.DarkBlueBorder : Colors.DarkBorder; - var lightColor = IsActive ? Colors.LightBlueBorder : Colors.LightBorder; + var bgColor = isActive ? Colors.BlueBackground : Colors.HeaderBackground; + var darkColor = isActive ? Colors.DarkBlueBorder : Colors.DarkBorder; + var lightColor = isActive ? Colors.LightBlueBorder : Colors.LightBorder; using (var b = new SolidBrush(bgColor)) { From 4de889ae6e8500f94c5b12c852d8a9b7daec3824 Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 5 Dec 2015 18:03:27 +0000 Subject: [PATCH 46/97] Added tab areas to dock groups --- DarkUI/DarkUI.csproj | 1 + DarkUI/Docking/DarkDockGroup.cs | 123 ++++++++++++++++++++++++ DarkUI/Docking/DarkDockPanel.cs | 7 +- DarkUI/Docking/DarkDockRegion.cs | 7 +- DarkUI/Docking/Items/DarkDockTabArea.cs | 41 ++++++++ Example/Forms/MainForm.cs | 2 +- 6 files changed, 175 insertions(+), 6 deletions(-) create mode 100644 DarkUI/Docking/Items/DarkDockTabArea.cs diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index c2855f9..731fc72 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -108,6 +108,7 @@ + diff --git a/DarkUI/Docking/DarkDockGroup.cs b/DarkUI/Docking/DarkDockGroup.cs index c5a9dcb..cd4df38 100644 --- a/DarkUI/Docking/DarkDockGroup.cs +++ b/DarkUI/Docking/DarkDockGroup.cs @@ -1,6 +1,8 @@ using DarkUI.Config; +using System; using System.Collections.Generic; using System.ComponentModel; +using System.Drawing; using System.Windows.Forms; namespace DarkUI.Docking @@ -12,6 +14,8 @@ namespace DarkUI.Docking private List _contents; + private DarkDockTabArea _tabArea; + #endregion #region Property Region @@ -41,6 +45,8 @@ namespace DarkUI.Docking DockArea = dockRegion.DockArea; Order = order; + + _tabArea = new DarkDockTabArea(DockArea); } #endregion @@ -57,6 +63,14 @@ namespace DarkUI.Docking if (VisibleContent == null) VisibleContent = dockContent; + + var menuItem = new ToolStripMenuItem(dockContent.DockText); + menuItem.Tag = dockContent; + menuItem.Click += TabMenuItem_Select; + menuItem.Image = dockContent.Icon; + _tabArea.TabMenu.Items.Add(menuItem); + + UpdateTabArea(); } public void RemoveContent(DarkDockContent dockContent) @@ -74,6 +88,115 @@ namespace DarkUI.Docking foreach (var content in _contents) VisibleContent = content; } + + ToolStripMenuItem itemToRemove = null; + foreach (ToolStripMenuItem item in _tabArea.TabMenu.Items) + { + var menuContent = item.Tag as DarkDockContent; + if (menuContent == null) + continue; + + if (menuContent == dockContent) + itemToRemove = item; + } + + if (itemToRemove != null) + { + itemToRemove.Click -= TabMenuItem_Select; + _tabArea.TabMenu.Items.Remove(itemToRemove); + } + + UpdateTabArea(); + } + + private void UpdateTabArea() + { + if (DockArea == DarkDockArea.Document) + _tabArea.Visible = (_contents.Count > 0); + else + _tabArea.Visible = (_contents.Count > 1); + + var size = 0; + + switch (DockArea) + { + case DarkDockArea.Document: + size = _tabArea.Visible ? Consts.DocumentTabAreaSize : 0; + Padding = new Padding(0, size, 0, 0); + _tabArea.Area = new Rectangle(Padding.Left, 0, ClientRectangle.Width - Padding.Horizontal, size); + break; + case DarkDockArea.Left: + case DarkDockArea.Right: + size = _tabArea.Visible ? Consts.ToolWindowTabAreaSize : 0; + Padding = new Padding(0, 0, 0, size); + _tabArea.Area = new Rectangle(Padding.Left, ClientRectangle.Height - size, ClientRectangle.Width - Padding.Horizontal, size); + break; + case DarkDockArea.Bottom: + size = _tabArea.Visible ? Consts.ToolWindowTabAreaSize : 0; + Padding = new Padding(1, 0, 0, size); + _tabArea.Area = new Rectangle(Padding.Left, ClientRectangle.Height - size, ClientRectangle.Width - Padding.Horizontal, size); + break; + } + + BuildTabs(); + } + + private void BuildTabs() + { + if (!_tabArea.Visible) + return; + + SuspendLayout(); + + + + ResumeLayout(); + + Invalidate(); + } + + #endregion + + #region Event Handler Region + + private void TabMenuItem_Select(object sender, EventArgs e) + { + var menuItem = sender as ToolStripMenuItem; + if (menuItem == null) + return; + + var content = menuItem.Tag as DarkDockContent; + if (content == null) + return; + + DockPanel.ActiveContent = content; + } + + #endregion + + #region Render Region + + protected override void OnPaint(PaintEventArgs e) + { + var g = e.Graphics; + + using (var b = new SolidBrush(Colors.GreyBackground)) + { + g.FillRectangle(b, ClientRectangle); + } + + if (!_tabArea.Visible) + return; + + using (var b = new SolidBrush(Colors.MediumBackground)) + { + g.FillRectangle(b, _tabArea.Area); + } + } + + protected override void OnPaintBackground(PaintEventArgs e) + { + // Absorb event } #endregion diff --git a/DarkUI/Docking/DarkDockPanel.cs b/DarkUI/Docking/DarkDockPanel.cs index 4160818..3c785df 100644 --- a/DarkUI/Docking/DarkDockPanel.cs +++ b/DarkUI/Docking/DarkDockPanel.cs @@ -83,6 +83,11 @@ namespace DarkUI.Docking #region Method Region public void AddContent(DarkDockContent dockContent) + { + AddContent(dockContent, null); + } + + public void AddContent(DarkDockContent dockContent, DarkDockGroup dockGroup) { if (_contents.Contains(dockContent)) return; @@ -94,7 +99,7 @@ namespace DarkUI.Docking _contents.Add(dockContent); var region = _regions[dockContent.DockArea]; - region.AddContent(dockContent); + region.AddContent(dockContent, dockGroup); } public void RemoveContent(DarkDockContent dockContent) diff --git a/DarkUI/Docking/DarkDockRegion.cs b/DarkUI/Docking/DarkDockRegion.cs index c1e38ad..b061668 100644 --- a/DarkUI/Docking/DarkDockRegion.cs +++ b/DarkUI/Docking/DarkDockRegion.cs @@ -1,5 +1,4 @@ using DarkUI.Config; -using DarkUI.Extensions; using System; using System.Collections.Generic; using System.ComponentModel; @@ -46,12 +45,12 @@ namespace DarkUI.Docking #region Method Region - public void AddContent(DarkDockContent dockContent) + internal void AddContent(DarkDockContent dockContent) { AddContent(dockContent, null); } - public void AddContent(DarkDockContent dockContent, DarkDockGroup dockGroup) + internal void AddContent(DarkDockContent dockContent, DarkDockGroup dockGroup) { // If no existing group is specified then create a new one if (dockGroup == null) @@ -73,7 +72,7 @@ namespace DarkUI.Docking PositionGroups(); } - public void RemoveContent(DarkDockContent dockContent) + internal void RemoveContent(DarkDockContent dockContent) { dockContent.DockRegion = null; diff --git a/DarkUI/Docking/Items/DarkDockTabArea.cs b/DarkUI/Docking/Items/DarkDockTabArea.cs new file mode 100644 index 0000000..8683a50 --- /dev/null +++ b/DarkUI/Docking/Items/DarkDockTabArea.cs @@ -0,0 +1,41 @@ +using DarkUI.Config; +using DarkUI.Controls; +using System.Collections.Generic; +using System.Drawing; + +namespace DarkUI.Docking +{ + public class DarkDockTabArea + { + #region Field Region + + private Dictionary _tabs = new Dictionary(); + + private DarkContextMenu _tabMenu = new DarkContextMenu(); + + #endregion + + #region Property Region + + public DarkDockArea DockArea { get; private set; } + + public Rectangle Area { get; set; } + + public int Offset { get; set; } + + public bool Visible { get; set; } + + public DarkContextMenu TabMenu { get { return _tabMenu; } } + + #endregion + + #region Constructor Region + + public DarkDockTabArea(DarkDockArea dockArea) + { + DockArea = dockArea; + } + + #endregion + } +} diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index 0e7c0cd..2c0b030 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -43,7 +43,7 @@ namespace Example DockPanel.AddContent(_dockProperties); DockPanel.AddContent(_dockConsole); DockPanel.AddContent(_dockLayers); - DockPanel.AddContent(_dockHistory); + DockPanel.AddContent(_dockHistory, _dockLayers.DockGroup); // Add dummy documents to the main document area of the dock panel DockPanel.AddContent(new DockDocument { DockText = "Document 1" }); From 04f116d333254a9be814f41e2030f486ce6c815f Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 5 Dec 2015 19:22:13 +0000 Subject: [PATCH 47/97] Dock panel tabs now calculated & drawn --- DarkUI/DarkUI.csproj | 29 +- DarkUI/Docking/DarkDockGroup.cs | 290 ++++++++++++++++++- DarkUI/Docking/DarkDockPanel.cs | 4 +- DarkUI/Docking/DarkDockRegion.cs | 16 +- DarkUI/Docking/Items/DarkDockTabArea.cs | 4 +- DarkUI/Icons/DockIcons.Designer.cs | 123 ++++++++ DarkUI/Icons/DockIcons.resx | 139 +++++++++ DarkUI/Resources/active-inactive-close.png | Bin 0 -> 15109 bytes DarkUI/Resources/arrow.png | Bin 0 -> 16391 bytes DarkUI/Resources/close-selected.png | Bin 0 -> 15314 bytes DarkUI/Resources/close.png | Bin 0 -> 15423 bytes DarkUI/Resources/inactive-close-selected.png | Bin 0 -> 15106 bytes DarkUI/Resources/inactive-close.png | Bin 0 -> 15099 bytes 13 files changed, 591 insertions(+), 14 deletions(-) create mode 100644 DarkUI/Icons/DockIcons.Designer.cs create mode 100644 DarkUI/Icons/DockIcons.resx create mode 100644 DarkUI/Resources/active-inactive-close.png create mode 100644 DarkUI/Resources/arrow.png create mode 100644 DarkUI/Resources/close-selected.png create mode 100644 DarkUI/Resources/close.png create mode 100644 DarkUI/Resources/inactive-close-selected.png create mode 100644 DarkUI/Resources/inactive-close.png diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index 731fc72..3156143 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -129,6 +129,11 @@ Form + + True + True + DockIcons.resx + True True @@ -164,6 +169,11 @@ DarkMessageBox.cs + + ResXFileCodeGenerator + DockIcons.Designer.cs + DarkUI + PublicResXFileCodeGenerator MenuIcons.Designer.cs @@ -224,7 +234,24 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\active-inactive-close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\arrow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\close-selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\inactive-close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\inactive-close-selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/DarkUI/Resources/active-inactive-close.png b/DarkUI/Resources/active-inactive-close.png new file mode 100644 index 0000000000000000000000000000000000000000..3a72b34bd12d3f824b1540a44e6e948f8165567a GIT binary patch literal 15109 zcmeI3U5Fc16vuC=wz|^#ptPlmjH%j|?qoiaNiyRkb=|bxMN^mEt-FheJDIuJ9h%I{ z&Pm$nL$g)zYr_%Fx9Y9x7 zUs=zD-sGYKxpC;(Wmkv04nWJ_((57&y&1wbZOGx6Oix+xcf-`UXwl{D0 zS$EUjclEwmXl+i%5&}|gEJ0REhz2W3@fe#o zk|GO5D2oY6&^1jC7uhNA3Z1p}a!^Ppbgl6XTSwuW<)OqyUQfp56f5YW%nAaOSWU`9 zRu)t7gpo{WaSb*SwFT=+^oVPsb4e?<%?Z|Gpk%26l#INPXOnr<@uC!uvnhj5v58bd z5M-#w^jM*hqDPpnR3oN`s%f#U%22I^C(i_2=p1c0ie`9%IGXFhpfS^tMrSsUoaTuV zXu<|pG(9+bGI~(H&``OK(bi=(m35ify`3vVP>bIt@1LVG4=qyp*FuG}`Ummsf?v^G zI5dYUWF?(hi`pr}!>e3yRu|3xU?V*3z`xsum37tsVjEgjtj}xK95gaqqktO&E8Dr+ zes*?Nqg%T>Q8jd>V7n#F&zL1`4swn)r*f^qR!+5b1`XRq+s)Yq%*0f#*KnIE_;XUw zDS;|h3%gTLxvnvM{&djo#d0`bPVnf(3BhMw+U~}sGh}JI8<)0}`z+JXi1lpPaGNUl z2US8C6X<3SW)hMVlT;2L#uZ~`6&9znCOYT6;JixKCHQzx-Ao@{+jw19D}=V2varKz zqv)0o-EDHs+s&@#Z=R9Y^G9nz*E1>>izdNek@;X=iVFimHYqMLAIwW}VL-?x5!XQL0ZwS4r#36-@yxqk-Fy#vw3E?C#&ZBH z-3!3MLje5wH~RhwfHDujwOIg^698A&9j=EF}vifp*N=k(B((+5{?+xh6i+6&Ap>Pv&aR`*>h zAN%9z;fLRe7|Aq^75_V(rtt97w)_LMs$H- Nbl2YOn-9)D^AB>;W>)|J literal 0 HcmV?d00001 diff --git a/DarkUI/Resources/arrow.png b/DarkUI/Resources/arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..cdd52f8db2f20fdb5b4b71228b7a0be1c3544177 GIT binary patch literal 16391 zcmeI3&5zqe6u^x@g|5_!3#wE&Sg9&e6~}gBJF!VpwMok^kg{xpx;@c}J=wK3@fh2? z$*zP{!2x=t5)yv`C$2s8fcQKjA%PI(z?rHNCy;t7V>_|mW|PjYwiF>vq{J`d_ukC> z=FOYugKsWhe(l)8$pt|Wjx8;=R_OIv`hDiPBlP#e_ov^dm!tmTwNMa_e;a?F`tE2<_|%%Z9r6|?e+Sfc-Br7D*cNii+GY$+vi{3$dRs8kD_p0(1t zH13Z6s~6Uz$hTy9I2;y-aeLeQ@{(%;AC7JHNH9QA!yTYCEc@PCP0kyEW)i*Dk{3qE zv++`^K^uy$>sXqhRLTZ6q@GsMq^hlzrK)OR$B+Kq;ien;GQk^Q2R2A!zSuuN(qwBbA7**ut9RX*1I(jQ`X(~j0pcBu< zp`BGVTkrNXQ^MtLMKUzakj$Q1l8|F!+d);6UM6#y;bu=)i*88cZX3iSjmjk1UBU0| zZk^odyGhdWQ4r#IPuB~RO`T=AEQ!T7Np7%^9jCj79S1sgYVxkud{~*~*v#F#oclwN z`UmFo`xvfc?@=2ib(Lt%cM_6bG(-VDzeXcuKYKX!y4!5peNB#!hratSEJTR54!I15 ziV-rARPAb5QhQoYsv5c~AyuhXF;eK4M&jX@A8-jMQ^=Zve0ERTs15kay|xdR_haIOvx+=Ij^ z7-fb@{GZMF&^vQ~=N;df*;y0s?8VD` zRSO(TlOmOhUS_z-dz+94fWZ-1%QBVK zBz+RJiGv&Enmnr+_>7Boi`GQ+d`?ndL#@es+NSkaQ_a9CezHhmT%k|XxMApeS+B{{&C?dk?g;l+TQ03?!?-%D zj7_H7XWCuM?KEfy+Q)Y3<^oT>$zrCh^qHDI&db^JJXmMAKOeK4Pv|i_hVFPLkOouc zxR{8b0>=euFlCO5i3loiT#yD+=D3)MpaRDQX)tAui-`y-a9ofEQ|7psh@b+;1!*v4 zj*E#1DsWto22=euFlCO5i3loiT#yD+ z=D3)MpaRDQX)tAui-`y-a9ofEQ|7psh@b+;1!*v4j*E#1DsWto22=euFlCO5i3loiT#yD+=D3)MpaRDQX)xtS;#$bxkjEZ< zEq+Mff4}|nUw7%d^P;`D(iViB(}Hm0LqT}(kY4`~giS>d?p+rI>oY+(L2kYK-6g7P zEVa&eMt7r|UmX?1=fByx{rca(e}3nuUv7SUWZ}%2-+uh)$h{YC-23F!#ap-T|N6s& f6V&A4!>0xFrITMb-|lwkUt#Iu<<=J$u7B_k0SeB3 literal 0 HcmV?d00001 diff --git a/DarkUI/Resources/close-selected.png b/DarkUI/Resources/close-selected.png new file mode 100644 index 0000000000000000000000000000000000000000..a179c696728e9409e52f0dfb865b874a08d0ab41 GIT binary patch literal 15314 zcmeI3O^n+_6o6e0EnTrK2c(vAF|H7xUB^F(9G))j?L6&(mg7+Iv0P4KsA8ZC`$H_t8@a$?} zyAB)11#9kRkm0y6QRix{t5WSGa{LxML{X@NsvyNgVT4mYPj;(RhI;zJ+!mTiYh^kQ+1c5ss@TVt zZO3$L{^Mx@cj@kTHyX@=0A^7=D!iEFR2~Cj_K;%`R8oUY<2A`4>DsO0V z5?We9F`*JIvfq6mbj~$4!#Y5rn+M-?4HUjpR=NR9Yb~w-UNR($mn5k0Kv{#lCZ`ff zQ%!;dfbB#*!3GkY@NCqVK)Gj3xE2#712Pnql%?^OBqe!ZBotmtp^SzlTPU9vmqpM{ zF(k}Ds(IT-)zs*zGE{3(=UIZ!^=sRPvK@7hD)4+59?T5aKAD}C)9EOoPjtX_V1&IV zYlP(s&9u;`?M|!X*>bZ7w{tuM&G|s#q*M`$>)z9#LrAk0tgR&a-D>$-W4J*OsLi#hNh4JRw zv#eRS?0R|EgxPqncURrTnl=sHa=i)&vUUZOpip&6X`!p^85#cP>Ztjlg9xIgBc+7_ z9X@^~Y+~ijXuOsb(IrUXcgwZcjJuvByY`xK*RJQ&jvZv>RyIuC;}t#_=n@SYFB5=#f1SO zixd}`4`!vfFd$@+;v)0GtP~dpge+2AWImXc;=+KCMT(2e2eVRK7!a~Zagq68R*DM) zLKZ15G9S!JabZBnBE?1KgIOsq3Vor!K@S) z281k9Tx33&mEyvHkVT4%%m=elTo@3tNO6(*U{;C?140%lE;1j?N^xO8$Rfo>=7U)& zE({1+q`1g@Fe}A{0U?V-Toc{*QlW!hMy;W@PLHjw&Y?F}S!2GCXPE6r80Ptx80POg z==W!a*%TS(m(%EF*NY6Z&wcaMr$^A(a|^kdV*R`6&mVs69c_P+N6f2X$NC$4;nU;Xj-%Y|D9-hK7k8EfnI%SSKl z{Y?Jj?9}TQjV0rSQ@>vOn0fNjmFpE~?VWt({oKt5E*FmN+jai-M~{A!`Z@*9?{?fX o=gwSkzd!hP!(IOClP~Tt#m3amt0&&z(6pF^x#PL3hflxw52!Sna{vGU literal 0 HcmV?d00001 diff --git a/DarkUI/Resources/close.png b/DarkUI/Resources/close.png new file mode 100644 index 0000000000000000000000000000000000000000..4809afa7abcb26e8fb4009623c1e7ce51e99104a GIT binary patch literal 15423 zcmeI3U5Fc16o5xtySlUmAKdy=F{D(Kb}~Pi$?QzCDceo!E;ifU?bc=ywKp?2*|EvY zI5WG+Zb3>F77+x6N+~G#plBaN`k;cPDy{gS^rbIqUltX?3e~>Us#v`<`M*gn5$lWG zKr%V^+;h%7-#z!tyvz$zlaFi|ymydcm<@3MHbCqy(P;B71r{$RGrlQ zq@ky~rsJEo6$$);oW0o0UpkEj@qt zB3el;v#tTX*(C>ZGtjdaTpjLSgqFXh+ajEK+qb=WyT|$)>YiB`dSfBZf?Es$8#)Jz zu!LfI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bV+y?pw_xI)8AfoPF+6t&hHzu;CUhS_>H^%Ji6uVY3b_^ fE^U^dy)nQ@Z?a1#ucyBVvYOaEnSOWIp<{mornJG5 literal 0 HcmV?d00001 diff --git a/DarkUI/Resources/inactive-close-selected.png b/DarkUI/Resources/inactive-close-selected.png new file mode 100644 index 0000000000000000000000000000000000000000..2a21b6735d13959177ab93b50bd46ff896fa5fc3 GIT binary patch literal 15106 zcmeI3U5Fc16o9W*YIm^(>x1GCPE!@NJDHhGX0kI)Qfkt67n<$5jqI*3?aj>1?$~4| z&P+Dh#fMT6tcaDOAbk;Kl_Fa3$p;mSwE7^3qF^a1`rv}~q5h&pLGMidZ<5P`^+j$V znK}2|bI!frJ?CUz=J@o~zRjbzjsgHSPflcK@b&uOyJ;i-JvTG^8NQ5ECgwc=www#T z*F3*t%WVK?m#qApKbPCD8%{Y2O{ajO^>PKz1|YesUV+9Dx>xGb6jwqsh9C9h8v|xq7)|dwM+;3H|E$J{T4vTsXx) zl8WpO0&;V?X)fcqh*P2}Z-`QyOK4F^Q4?BXjEiAe5XXg>$cvh;$hsKgnx9B|6yGIX zv#8Hx_cp^}DHU1t{faIKwOTD&lcSEiAV`{~31Uo$#dth}_m*uR)_L38-f+_LlSQ84 zS{2`NY%cH%3r^KfMIu3<_NTe8a-|)}_L}T4MWGHWf)o{nAx60z-K<<5XzBTTmheiN zI~y3#%P&`uFoQg&>KbUz60-g6gBD>LZ9kQ&TMGG@hJZ?_j7>becxm7gDvOTqc#F=E zeYe#^ckf%p&f)ZIAw$iJ8s@_O6f+HO}AFhWinw_ zare$zw&~Qo`;r1_(mC&rH5M1V_^5~^w1Ns5?4i}@REV6T9WV`R0@dK zV&ieuOsFspQ7cfFv%WwFTnqOlSn8S+?8U^vAW|jKR1Ll;OB!z!;xZ2rEb^MB7%@Xu z6oj-^hyiZ;LQPm6&ZgzAEW^1LcAkUi(caOPqGW{~qyk+J1%;W4v?{aRa@rjwun7xX zheptQ(ngTJ$V>`7qn%~7Et_Um|8cGlLBoHS`S2LEMP$>`zu_vJHQb5k6#W`>(e4GD zA?vBkhSy#*(tT10dUeVA4-UeEOaJZ|)>l>ki(}|yv9Sp41!Sg$Rsy#M)^~D^^X#px zR<-t5V$wA9qT`mKpSH?y0SOg*At`hQJ28`;9+YuPj+=8#l$Mjipy4j7;Ll0NT>@t; z4675j!M-ta{#;P)rD`}|Q$_p{q~Nz{+N~x{=jo>1YSOf0`H*e-=~y!wG2CSp{DbNt zjDz@L52aN_k(H!C4wDwsRvne*vKH?1UeK=+O%rl_pxyisyRPx3T_X{?9?HTBZ;awc zKK!&Pv>!M7ioe|>ujWl>Ls!!);fn zLd$RwKTdbp=G!TAas%8qVplN3>N`}E;3wn zK7^LxB7o3EhKtUJ&@x;E5W2{4(fJTshKm3~7a1-(A41D;5kTl7!$s#qXc;a72wh~j z=zIt*!$kn0iwqZ?520na2q1Kk;iB^)vIv+yIa1lW0A{EzY=LJq=cfq~AMc-j z&fW3KW3v|uPtV?d`LC_jC*-LcKmGbG@5>+m+yy?`Jhr;?i)|0$)q%-9Q`s{Q96t6B DsB2~{ literal 0 HcmV?d00001 diff --git a/DarkUI/Resources/inactive-close.png b/DarkUI/Resources/inactive-close.png new file mode 100644 index 0000000000000000000000000000000000000000..d985a149d5d0e19cfa185ed9564bd5d246130d2d GIT binary patch literal 15099 zcmeI3O^n+_6o6e0rCrokh^k!y2iFx9RqOaCaU2`RRoQI2E0MC=P1~)6#7^uTdL7Wg(%h>s!B%_rm7c`L) z`^}s8-pn`ez4+oc7EYbqHTC!u!!Wz%=L(DH`f&W+u^s(xE}s1!U3U6&=R$_ry%~SE zy?12y6AYu>c1p|9a`8Fc@){{%du5nvHGDLiVT@xfA6Tm}V#~1VxOwi*)h{{LvGd$n zr6?Bt8CY}XHUhY`ajIl(tXi7Q9W$qlmW~`WU89^EyHN`0$NFDXJZ3~ zrF9<)i!k)o0t?PwfNpef+#+nN=f__Q>Iom)5?~!RkV%LZFO6M-U-Kd_ta%gm-BVB8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Sat, 5 Dec 2015 19:35:52 +0000 Subject: [PATCH 48/97] Fixed label offsets on tabs. --- DarkUI/Docking/DarkDockGroup.cs | 16 +++++++++++----- DarkUI/Docking/Items/DarkDockTab.cs | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/DarkUI/Docking/DarkDockGroup.cs b/DarkUI/Docking/DarkDockGroup.cs index fc66978..55ce163 100644 --- a/DarkUI/Docking/DarkDockGroup.cs +++ b/DarkUI/Docking/DarkDockGroup.cs @@ -178,7 +178,13 @@ namespace DarkUI.Docking width = tab.CalculateWidth(g, Font); } - // Add area for the close button + // Add addition 5px width to tool window tabs + if (DockArea != DarkDockArea.Document) + { + width += 5; + } + + // Add additional width for document tab items if (DockArea == DarkDockArea.Document) { width += closeButtonSize; @@ -403,7 +409,7 @@ namespace DarkUI.Docking var tabTextFormat = new StringFormat { - Alignment = StringAlignment.Near, + Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center, FormatFlags = StringFormatFlags.NoWrap }; @@ -412,7 +418,7 @@ namespace DarkUI.Docking var textColor = isVisibleTab ? Colors.LightText : Colors.DisabledText; using (var b = new SolidBrush(textColor)) { - var textRect = new Rectangle(tabRect.Left + 5 + xOffset, tabRect.Top, tabRect.Width - tab.CloseButtonRectangle.Width - 7 - 5 - xOffset, tabRect.Height); + var textRect = new Rectangle(tabRect.Left + 2 + xOffset, tabRect.Top, tabRect.Width - tab.CloseButtonRectangle.Width - 7 - 5 - xOffset, tabRect.Height); g.DrawString(tab.DockContent.DockText, Font, b, textRect, tabTextFormat); } @@ -458,7 +464,7 @@ namespace DarkUI.Docking var tabTextFormat = new StringFormat { - Alignment = StringAlignment.Near, + Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center, FormatFlags = StringFormatFlags.NoWrap, Trimming = StringTrimming.EllipsisCharacter @@ -467,7 +473,7 @@ namespace DarkUI.Docking var textColor = isVisibleTab ? Colors.BlueHighlight : Colors.DisabledText; using (var b = new SolidBrush(textColor)) { - var textRect = new Rectangle(tabRect.Left + 5, tabRect.Top, tabRect.Width - 5, tabRect.Height); + var textRect = new Rectangle(tabRect.Left, tabRect.Top, tabRect.Width - 2, tabRect.Height); g.DrawString(tab.DockContent.DockText, Font, b, textRect, tabTextFormat); } } diff --git a/DarkUI/Docking/Items/DarkDockTab.cs b/DarkUI/Docking/Items/DarkDockTab.cs index 8e17979..d1fd586 100644 --- a/DarkUI/Docking/Items/DarkDockTab.cs +++ b/DarkUI/Docking/Items/DarkDockTab.cs @@ -35,7 +35,7 @@ namespace DarkUI.Docking public int CalculateWidth(Graphics g, Font font) { - var width = (int)g.MeasureString(DockContent.DockText, font).Width; + var width = (int)g.MeasureString(DockContent.DockText, font, 0, StringFormat.GenericTypographic).Width; width += 10; return width; From 3466c3a241a94593e2d28a23f9b5dcf9235d8855 Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 5 Dec 2015 22:16:48 +0000 Subject: [PATCH 49/97] Added input to dock tabs --- DarkUI/Docking/DarkDockGroup.cs | 132 ++++++++++++++++++++++++ DarkUI/Docking/Items/DarkDockTab.cs | 2 - DarkUI/Docking/Items/DarkDockTabArea.cs | 6 +- Example/Forms/Docking/DockDocument.cs | 4 +- Example/Forms/MainForm.cs | 8 +- 5 files changed, 144 insertions(+), 8 deletions(-) diff --git a/DarkUI/Docking/DarkDockGroup.cs b/DarkUI/Docking/DarkDockGroup.cs index 55ce163..17dcca4 100644 --- a/DarkUI/Docking/DarkDockGroup.cs +++ b/DarkUI/Docking/DarkDockGroup.cs @@ -272,6 +272,29 @@ namespace DarkUI.Docking Invalidate(); } + public void EnsureVisible() + { + if (DockArea != DarkDockArea.Document) + return; + + if (DockPanel.ActiveContent == null) + return; + + var width = ClientRectangle.Width - Padding.Horizontal - _tabArea.DropdownRectangle.Width; + var offsetArea = new Rectangle(Padding.Left, 0, width, 0); + var tab = _tabs[DockPanel.ActiveContent]; + + if (tab.ClientRectangle.IsEmpty) + return; + + if (RectangleToTabArea(tab.ClientRectangle).Left < offsetArea.Left) + _tabArea.Offset = tab.ClientRectangle.Left; + else if (RectangleToTabArea(tab.ClientRectangle).Right > offsetArea.Right) + _tabArea.Offset = tab.ClientRectangle.Right - width; + + Invalidate(); + } + private Point PointToTabArea(Point point) { return new Point(point.X - _tabArea.Offset, point.Y); @@ -293,6 +316,115 @@ namespace DarkUI.Docking UpdateTabArea(); } + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + + if (_tabArea.DropdownRectangle.Contains(e.Location)) + { + _tabArea.DropdownHot = true; + + foreach (var tab in _tabs.Values) + tab.Hot = false; + + Invalidate(); + return; + } + + _tabArea.DropdownHot = false; + + foreach (var tab in _tabs.Values) + { + var rect = RectangleToTabArea(tab.ClientRectangle); + var hot = rect.Contains(e.Location); + + if (tab.Hot != hot) + { + tab.Hot = hot; + Invalidate(); + } + + var closeRect = RectangleToTabArea(tab.CloseButtonRectangle); + var closeHot = closeRect.Contains(e.Location); + + if (tab.CloseButtonHot != closeHot) + { + tab.CloseButtonHot = closeHot; + Invalidate(); + } + } + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + if (_tabArea.DropdownRectangle.Contains(e.Location)) + { + _tabArea.DropdownHot = true; + return; + } + + foreach (var tab in _tabs.Values) + { + var rect = RectangleToTabArea(tab.ClientRectangle); + if (rect.Contains(e.Location)) + { + if (e.Button == MouseButtons.Middle) + { + tab.DockContent.Close(); + return; + } + + var closeRect = RectangleToTabArea(tab.CloseButtonRectangle); + if (closeRect.Contains(e.Location)) + { + _tabArea.ClickedCloseButton = tab; + return; + } + else + { + DockPanel.ActiveContent = tab.DockContent; + EnsureVisible(); + return; + } + } + } + + if (VisibleContent != null) + DockPanel.ActiveContent = VisibleContent; + } + + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseUp(e); + + if (_tabArea.DropdownRectangle.Contains(e.Location)) + { + if (_tabArea.DropdownHot) + _tabArea.TabMenu.Show(this, new Point(_tabArea.DropdownRectangle.Left, _tabArea.DropdownRectangle.Bottom - 2)); + + return; + } + + if (_tabArea.ClickedCloseButton == null) + return; + + var closeRect = RectangleToTabArea(_tabArea.ClickedCloseButton.CloseButtonRectangle); + if (closeRect.Contains(e.Location)) + _tabArea.ClickedCloseButton.DockContent.Close(); + } + + protected override void OnMouseLeave(EventArgs e) + { + base.OnMouseLeave(e); + + foreach (var tab in _tabs.Values) + tab.Hot = false; + + Invalidate(); + } + private void TabMenuItem_Select(object sender, EventArgs e) { var menuItem = sender as ToolStripMenuItem; diff --git a/DarkUI/Docking/Items/DarkDockTab.cs b/DarkUI/Docking/Items/DarkDockTab.cs index d1fd586..907daec 100644 --- a/DarkUI/Docking/Items/DarkDockTab.cs +++ b/DarkUI/Docking/Items/DarkDockTab.cs @@ -14,8 +14,6 @@ namespace DarkUI.Docking public bool Hot { get; set; } - public bool Pressed { get; set; } - public bool CloseButtonHot { get; set; } public bool ShowSeparator { get; set; } diff --git a/DarkUI/Docking/Items/DarkDockTabArea.cs b/DarkUI/Docking/Items/DarkDockTabArea.cs index 5b8c0df..0464b85 100644 --- a/DarkUI/Docking/Items/DarkDockTabArea.cs +++ b/DarkUI/Docking/Items/DarkDockTabArea.cs @@ -5,7 +5,7 @@ using System.Drawing; namespace DarkUI.Docking { - public class DarkDockTabArea + internal class DarkDockTabArea { #region Field Region @@ -23,12 +23,16 @@ namespace DarkUI.Docking public Rectangle DropdownRectangle { get; set; } + public bool DropdownHot { get; set; } + public int Offset { get; set; } public bool Visible { get; set; } public DarkContextMenu TabMenu { get { return _tabMenu; } } + public DarkDockTab ClickedCloseButton { get; set; } + #endregion #region Constructor Region diff --git a/Example/Forms/Docking/DockDocument.cs b/Example/Forms/Docking/DockDocument.cs index 4ce1416..6063b68 100644 --- a/Example/Forms/Docking/DockDocument.cs +++ b/Example/Forms/Docking/DockDocument.cs @@ -9,10 +9,12 @@ namespace Example { #region Constructor Region - public DockDocument() + public DockDocument(string text) { InitializeComponent(); + DockText = text; + // Workaround to stop the textbox from highlight all text. txtDocument.SelectionStart = txtDocument.Text.Length; } diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index 2c0b030..690a1ea 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -46,9 +46,9 @@ namespace Example DockPanel.AddContent(_dockHistory, _dockLayers.DockGroup); // Add dummy documents to the main document area of the dock panel - DockPanel.AddContent(new DockDocument { DockText = "Document 1" }); - DockPanel.AddContent(new DockDocument { DockText = "Document 2" }); - DockPanel.AddContent(new DockDocument { DockText = "Document 3" }); + DockPanel.AddContent(new DockDocument("Document 1")); + DockPanel.AddContent(new DockDocument("Document 2")); + DockPanel.AddContent(new DockDocument("Document 3")); // Show the tool windows as visible in the 'Window' menu mnuProject.Checked = true; @@ -103,7 +103,7 @@ namespace Example private void NewFile_Click(object sender, EventArgs e) { - var newFile = new DockDocument(); + var newFile = new DockDocument("New document"); DockPanel.AddContent(newFile); } From 2aeffecd0acc3d60dd06bd8f6cef38a4ae580681 Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 5 Dec 2015 23:35:31 +0000 Subject: [PATCH 50/97] Added ActiveContentChanged event to DockPanel --- DarkUI/DarkUI.csproj | 1 + DarkUI/Docking/DarkDockGroup.cs | 23 +++++++++++++++++++ DarkUI/Docking/DarkDockPanel.cs | 18 +++++++++++++++ .../Docking/EventArgs/DockContentEventArgs.cs | 14 +++++++++++ 4 files changed, 56 insertions(+) create mode 100644 DarkUI/Docking/EventArgs/DockContentEventArgs.cs diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index 3156143..f02f8c3 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -106,6 +106,7 @@ UserControl + diff --git a/DarkUI/Docking/DarkDockGroup.cs b/DarkUI/Docking/DarkDockGroup.cs index 17dcca4..22235ea 100644 --- a/DarkUI/Docking/DarkDockGroup.cs +++ b/DarkUI/Docking/DarkDockGroup.cs @@ -52,6 +52,8 @@ namespace DarkUI.Docking Order = order; _tabArea = new DarkDockTabArea(DockArea); + + DockPanel.ActiveContentChanged += DockPanel_ActiveContentChanged; } #endregion @@ -282,6 +284,10 @@ namespace DarkUI.Docking var width = ClientRectangle.Width - Padding.Horizontal - _tabArea.DropdownRectangle.Width; var offsetArea = new Rectangle(Padding.Left, 0, width, 0); + + if (!_tabs.ContainsKey(DockPanel.ActiveContent)) + return; + var tab = _tabs[DockPanel.ActiveContent]; if (tab.ClientRectangle.IsEmpty) @@ -438,6 +444,23 @@ namespace DarkUI.Docking DockPanel.ActiveContent = content; } + private void DockPanel_ActiveContentChanged(object sender, DockContentEventArgs e) + { + if (!_contents.Contains(e.Content)) + return; + + if (e.Content == VisibleContent) + return; + + VisibleContent = e.Content; + + foreach (var content in _contents) + content.Visible = content == VisibleContent; + + EnsureVisible(); + Invalidate(); + } + #endregion #region Render Region diff --git a/DarkUI/Docking/DarkDockPanel.cs b/DarkUI/Docking/DarkDockPanel.cs index bd87fc1..f2b6744 100644 --- a/DarkUI/Docking/DarkDockPanel.cs +++ b/DarkUI/Docking/DarkDockPanel.cs @@ -1,5 +1,6 @@ using DarkUI.Config; using DarkUI.Win32; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Windows.Forms; @@ -8,12 +9,19 @@ namespace DarkUI.Docking { public class DarkDockPanel : UserControl { + #region Event Region + + public event EventHandler ActiveContentChanged; + + #endregion + #region Field Region private List _contents; private Dictionary _regions; private DarkDockContent _activeContent; + private bool _switchingContent = false; #endregion @@ -24,6 +32,11 @@ namespace DarkUI.Docking get { return _activeContent; } internal set { + if (_switchingContent) + return; + + _switchingContent = true; + _activeContent = value; ActiveGroup = _activeContent.DockGroup; @@ -31,6 +44,11 @@ namespace DarkUI.Docking foreach (var region in _regions.Values) region.Redraw(); + + if (ActiveContentChanged != null) + ActiveContentChanged(this, new DockContentEventArgs(_activeContent)); + + _switchingContent = false; } } diff --git a/DarkUI/Docking/EventArgs/DockContentEventArgs.cs b/DarkUI/Docking/EventArgs/DockContentEventArgs.cs new file mode 100644 index 0000000..13ae74d --- /dev/null +++ b/DarkUI/Docking/EventArgs/DockContentEventArgs.cs @@ -0,0 +1,14 @@ +using System; + +namespace DarkUI.Docking +{ + public class DockContentEventArgs : EventArgs + { + public DarkDockContent Content { get; private set; } + + public DockContentEventArgs(DarkDockContent content) + { + Content = content; + } + } +} From f068c2f31180f67405db28b8833134c267933b71 Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 6 Dec 2015 00:20:36 +0000 Subject: [PATCH 51/97] Additional group content now hidden when added --- DarkUI/Docking/DarkDockGroup.cs | 2 ++ DarkUI/Docking/DarkDockPanel.cs | 1 + 2 files changed, 3 insertions(+) diff --git a/DarkUI/Docking/DarkDockGroup.cs b/DarkUI/Docking/DarkDockGroup.cs index 22235ea..1fedf6f 100644 --- a/DarkUI/Docking/DarkDockGroup.cs +++ b/DarkUI/Docking/DarkDockGroup.cs @@ -72,6 +72,8 @@ namespace DarkUI.Docking if (VisibleContent == null) VisibleContent = dockContent; + else + dockContent.Visible = false; var menuItem = new ToolStripMenuItem(dockContent.DockText); menuItem.Tag = dockContent; diff --git a/DarkUI/Docking/DarkDockPanel.cs b/DarkUI/Docking/DarkDockPanel.cs index f2b6744..01a3dd7 100644 --- a/DarkUI/Docking/DarkDockPanel.cs +++ b/DarkUI/Docking/DarkDockPanel.cs @@ -32,6 +32,7 @@ namespace DarkUI.Docking get { return _activeContent; } internal set { + // Don't let content visibility changes re-trigger event if (_switchingContent) return; From b5798df7cfa088e87d47057f34fee067fb831c08 Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 6 Dec 2015 01:22:38 +0000 Subject: [PATCH 52/97] Reverted text width calculation. Updated EnsureVisible. Text width calculation changes were causing the tab text to be cut off early. Updated EnsureVisible to better handle the total tab size being smaller/larger than the tab area. --- DarkUI/Docking/DarkDockGroup.cs | 47 +++++++++++++++---------- DarkUI/Docking/Items/DarkDockTab.cs | 2 +- DarkUI/Docking/Items/DarkDockTabArea.cs | 2 ++ 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/DarkUI/Docking/DarkDockGroup.cs b/DarkUI/Docking/DarkDockGroup.cs index 1fedf6f..37f643a 100644 --- a/DarkUI/Docking/DarkDockGroup.cs +++ b/DarkUI/Docking/DarkDockGroup.cs @@ -159,6 +159,8 @@ namespace DarkUI.Docking } BuildTabs(); + + EnsureVisible(); } private void BuildTabs() @@ -182,15 +184,10 @@ namespace DarkUI.Docking width = tab.CalculateWidth(g, Font); } - // Add addition 5px width to tool window tabs - if (DockArea != DarkDockArea.Document) - { - width += 5; - } - // Add additional width for document tab items if (DockArea == DarkDockArea.Document) { + width += 5; width += closeButtonSize; if (tab.DockContent.Icon != null) @@ -271,6 +268,12 @@ namespace DarkUI.Docking } } + // Update the tab area with the new total tab width + totalSize = 0; + foreach (var tab in _tabs.Values) + totalSize += tab.ClientRectangle.Width; + _tabArea.TotalTabSize = totalSize; + ResumeLayout(); Invalidate(); @@ -281,16 +284,10 @@ namespace DarkUI.Docking if (DockArea != DarkDockArea.Document) return; - if (DockPanel.ActiveContent == null) - return; - var width = ClientRectangle.Width - Padding.Horizontal - _tabArea.DropdownRectangle.Width; var offsetArea = new Rectangle(Padding.Left, 0, width, 0); - if (!_tabs.ContainsKey(DockPanel.ActiveContent)) - return; - - var tab = _tabs[DockPanel.ActiveContent]; + var tab = _tabs[VisibleContent]; if (tab.ClientRectangle.IsEmpty) return; @@ -300,6 +297,19 @@ namespace DarkUI.Docking else if (RectangleToTabArea(tab.ClientRectangle).Right > offsetArea.Right) _tabArea.Offset = tab.ClientRectangle.Right - width; + if (_tabArea.TotalTabSize < offsetArea.Width) + _tabArea.Offset = 0; + + if (_tabArea.TotalTabSize > offsetArea.Width) + { + var lastTab = _tabs.Values.Last(); + if (lastTab != null) + { + if (RectangleToTabArea(lastTab.ClientRectangle).Right < offsetArea.Right) + _tabArea.Offset = lastTab.ClientRectangle.Right - width; + } + } + Invalidate(); } @@ -566,16 +576,17 @@ namespace DarkUI.Docking var tabTextFormat = new StringFormat { - Alignment = StringAlignment.Center, + Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center, - FormatFlags = StringFormatFlags.NoWrap + FormatFlags = StringFormatFlags.NoWrap, + Trimming = StringTrimming.EllipsisCharacter }; // Draw text var textColor = isVisibleTab ? Colors.LightText : Colors.DisabledText; using (var b = new SolidBrush(textColor)) { - var textRect = new Rectangle(tabRect.Left + 2 + xOffset, tabRect.Top, tabRect.Width - tab.CloseButtonRectangle.Width - 7 - 5 - xOffset, tabRect.Height); + var textRect = new Rectangle(tabRect.Left + 5 + xOffset, tabRect.Top, tabRect.Width - tab.CloseButtonRectangle.Width - 7 - 5 - xOffset, tabRect.Height); g.DrawString(tab.DockContent.DockText, Font, b, textRect, tabTextFormat); } @@ -621,7 +632,7 @@ namespace DarkUI.Docking var tabTextFormat = new StringFormat { - Alignment = StringAlignment.Center, + Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center, FormatFlags = StringFormatFlags.NoWrap, Trimming = StringTrimming.EllipsisCharacter @@ -630,7 +641,7 @@ namespace DarkUI.Docking var textColor = isVisibleTab ? Colors.BlueHighlight : Colors.DisabledText; using (var b = new SolidBrush(textColor)) { - var textRect = new Rectangle(tabRect.Left, tabRect.Top, tabRect.Width - 2, tabRect.Height); + var textRect = new Rectangle(tabRect.Left + 5, tabRect.Top, tabRect.Width - 5, tabRect.Height); g.DrawString(tab.DockContent.DockText, Font, b, textRect, tabTextFormat); } } diff --git a/DarkUI/Docking/Items/DarkDockTab.cs b/DarkUI/Docking/Items/DarkDockTab.cs index 907daec..5aebdd9 100644 --- a/DarkUI/Docking/Items/DarkDockTab.cs +++ b/DarkUI/Docking/Items/DarkDockTab.cs @@ -33,7 +33,7 @@ namespace DarkUI.Docking public int CalculateWidth(Graphics g, Font font) { - var width = (int)g.MeasureString(DockContent.DockText, font, 0, StringFormat.GenericTypographic).Width; + var width = (int)g.MeasureString(DockContent.DockText, font).Width; width += 10; return width; diff --git a/DarkUI/Docking/Items/DarkDockTabArea.cs b/DarkUI/Docking/Items/DarkDockTabArea.cs index 0464b85..ecd1f75 100644 --- a/DarkUI/Docking/Items/DarkDockTabArea.cs +++ b/DarkUI/Docking/Items/DarkDockTabArea.cs @@ -27,6 +27,8 @@ namespace DarkUI.Docking public int Offset { get; set; } + public int TotalTabSize { get; set; } + public bool Visible { get; set; } public DarkContextMenu TabMenu { get { return _tabMenu; } } From ba2997b872a7f754a76586237e12230793cbd953 Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 6 Dec 2015 01:30:07 +0000 Subject: [PATCH 53/97] Clicking a dock group tab now focuses the content. --- DarkUI/Docking/DarkDockGroup.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DarkUI/Docking/DarkDockGroup.cs b/DarkUI/Docking/DarkDockGroup.cs index 37f643a..3d64aa6 100644 --- a/DarkUI/Docking/DarkDockGroup.cs +++ b/DarkUI/Docking/DarkDockGroup.cs @@ -469,6 +469,8 @@ namespace DarkUI.Docking foreach (var content in _contents) content.Visible = content == VisibleContent; + VisibleContent.Focus(); + EnsureVisible(); Invalidate(); } From 45bedfcbd7585c76abbd864dc228cdd02808eda6 Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 6 Dec 2015 18:58:30 +0000 Subject: [PATCH 54/97] Added ContentAdded and ContentRemoved events. --- DarkUI/Config/Enums.cs | 1 - DarkUI/Docking/DarkDockContent.cs | 2 +- DarkUI/Docking/DarkDockGroup.cs | 2 +- DarkUI/Docking/DarkDockPanel.cs | 17 ++++++- Example/Forms/MainForm.cs | 76 ++++++++++++++++++++----------- 5 files changed, 66 insertions(+), 32 deletions(-) diff --git a/DarkUI/Config/Enums.cs b/DarkUI/Config/Enums.cs index 29a5508..3856673 100644 --- a/DarkUI/Config/Enums.cs +++ b/DarkUI/Config/Enums.cs @@ -47,7 +47,6 @@ public enum DarkDockArea { - None, Document, Left, Right, diff --git a/DarkUI/Docking/DarkDockContent.cs b/DarkUI/Docking/DarkDockContent.cs index 5f1adcf..b1d11a8 100644 --- a/DarkUI/Docking/DarkDockContent.cs +++ b/DarkUI/Docking/DarkDockContent.cs @@ -45,7 +45,7 @@ namespace DarkUI.Docking [Category("Layout")] [Description("Determines which area of the dock panel this content will dock to.")] - [DefaultValue(DarkDockArea.None)] + [DefaultValue(DarkDockArea.Document)] public DarkDockArea DockArea { get; set; } [Browsable(false)] diff --git a/DarkUI/Docking/DarkDockGroup.cs b/DarkUI/Docking/DarkDockGroup.cs index 3d64aa6..2bc2486 100644 --- a/DarkUI/Docking/DarkDockGroup.cs +++ b/DarkUI/Docking/DarkDockGroup.cs @@ -233,7 +233,7 @@ namespace DarkUI.Docking { // Check if previous iteration of loop met the difference if (differenceMadeUp >= difference) - continue; + break; if (tab.ClientRectangle.Width >= largest) { diff --git a/DarkUI/Docking/DarkDockPanel.cs b/DarkUI/Docking/DarkDockPanel.cs index 01a3dd7..5961f0b 100644 --- a/DarkUI/Docking/DarkDockPanel.cs +++ b/DarkUI/Docking/DarkDockPanel.cs @@ -12,6 +12,8 @@ namespace DarkUI.Docking #region Event Region public event EventHandler ActiveContentChanged; + public event EventHandler ContentAdded; + public event EventHandler ContentRemoved; #endregion @@ -111,14 +113,17 @@ namespace DarkUI.Docking if (_contents.Contains(dockContent)) return; - if (dockContent.DockArea == DarkDockArea.None) - return; + if (dockContent.DockArea != dockGroup.DockArea) + throw new Exception($"Attempting to add '{dockContent.DockArea}' content to '{dockGroup.DockArea}' group."); dockContent.DockPanel = this; _contents.Add(dockContent); var region = _regions[dockContent.DockArea]; region.AddContent(dockContent, dockGroup); + + if (ContentAdded != null) + ContentAdded(this, new DockContentEventArgs(dockContent)); } public void RemoveContent(DarkDockContent dockContent) @@ -131,6 +136,14 @@ namespace DarkUI.Docking var region = _regions[dockContent.DockArea]; region.RemoveContent(dockContent); + + if (ContentRemoved != null) + ContentRemoved(this, new DockContentEventArgs(dockContent)); + } + + public bool ContainsContent(DarkDockContent dockContent) + { + return _contents.Contains(dockContent); } private void CreateRegions() diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index 690a1ea..c5ec856 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -2,6 +2,7 @@ using DarkUI.Forms; using DarkUI.Win32; using System; +using System.Collections.Generic; using System.Windows.Forms; namespace Example @@ -10,6 +11,8 @@ namespace Example { #region Field Region + private List _toolWindows = new List(); + private DockProject _dockProject; private DockProperties _dockProperties; private DockConsole _dockConsole; @@ -32,6 +35,9 @@ namespace Example // input before letting events pass through to the rest of the application. Application.AddMessageFilter(DockPanel.MessageFilter); + // Hook in all the UI events manually for clarity. + HookEvents(); + // Build the tool windows and add them to the dock panel _dockProject = new DockProject(); _dockProperties = new DockProperties(); @@ -39,26 +45,24 @@ namespace Example _dockLayers = new DockLayers(); _dockHistory = new DockHistory(); - DockPanel.AddContent(_dockProject); - DockPanel.AddContent(_dockProperties); - DockPanel.AddContent(_dockConsole); - DockPanel.AddContent(_dockLayers); - DockPanel.AddContent(_dockHistory, _dockLayers.DockGroup); + // Add the tool windows to a list + _toolWindows.Add(_dockProject); + _toolWindows.Add(_dockProperties); + _toolWindows.Add(_dockConsole); + _toolWindows.Add(_dockLayers); + _toolWindows.Add(_dockHistory); + + // Add the tool window list contents to the dock panel + foreach (var toolWindow in _toolWindows) + DockPanel.AddContent(toolWindow); + + // Check window menu items which are contained in the dock panel + BuildWindowMenu(); // Add dummy documents to the main document area of the dock panel DockPanel.AddContent(new DockDocument("Document 1")); DockPanel.AddContent(new DockDocument("Document 2")); DockPanel.AddContent(new DockDocument("Document 3")); - - // Show the tool windows as visible in the 'Window' menu - mnuProject.Checked = true; - mnuProperties.Checked = true; - mnuConsole.Checked = true; - mnuLayers.Checked = true; - mnuHistory.Checked = true; - - // Hook in all the UI events manually for clarity. - HookEvents(); } #endregion @@ -67,6 +71,9 @@ namespace Example private void HookEvents() { + DockPanel.ContentAdded += DockPanel_ContentAdded; + DockPanel.ContentRemoved += DockPanel_ContentRemoved; + mnuNewFile.Click += NewFile_Click; mnuClose.Click += Close_Click; @@ -83,24 +90,39 @@ namespace Example mnuAbout.Click += About_Click; } - private void ToggleToolWindow(DarkToolWindow toolWindow, ToolStripMenuItem menuItem) + private void ToggleToolWindow(DarkToolWindow toolWindow) { if (toolWindow.DockPanel == null) - { DockPanel.AddContent(toolWindow); - menuItem.Checked = true; - } else - { DockPanel.RemoveContent(toolWindow); - menuItem.Checked = false; - } + } + + private void BuildWindowMenu() + { + mnuProject.Checked = DockPanel.ContainsContent(_dockProject); + mnuProperties.Checked = DockPanel.ContainsContent(_dockProperties); + mnuConsole.Checked = DockPanel.ContainsContent(_dockConsole); + mnuLayers.Checked = DockPanel.Contains(_dockLayers); + mnuHistory.Checked = DockPanel.Contains(_dockHistory); } #endregion #region Event Handler Region + private void DockPanel_ContentAdded(object sender, DockContentEventArgs e) + { + if (_toolWindows.Contains(e.Content)) + BuildWindowMenu(); + } + + private void DockPanel_ContentRemoved(object sender, DockContentEventArgs e) + { + if (_toolWindows.Contains(e.Content)) + BuildWindowMenu(); + } + private void NewFile_Click(object sender, EventArgs e) { var newFile = new DockDocument("New document"); @@ -120,27 +142,27 @@ namespace Example private void Project_Click(object sender, EventArgs e) { - ToggleToolWindow(_dockProject, mnuProject); + ToggleToolWindow(_dockProject); } private void Properties_Click(object sender, EventArgs e) { - ToggleToolWindow(_dockProperties, mnuProperties); + ToggleToolWindow(_dockProperties); } private void Console_Click(object sender, EventArgs e) { - ToggleToolWindow(_dockConsole, mnuConsole); + ToggleToolWindow(_dockConsole); } private void Layers_Click(object sender, EventArgs e) { - ToggleToolWindow(_dockLayers, mnuLayers); + ToggleToolWindow(_dockLayers); } private void History_Click(object sender, EventArgs e) { - ToggleToolWindow(_dockHistory, mnuHistory); + ToggleToolWindow(_dockHistory); } private void About_Click(object sender, EventArgs e) From 11f45aaf3e4a0f1ffd075756ca32fff53a341aa0 Mon Sep 17 00:00:00 2001 From: Robin Date: Mon, 7 Dec 2015 15:09:16 +0000 Subject: [PATCH 55/97] Added DarkCheckBox Also added document icons to example project. --- DarkUI/Config/Colors.cs | 5 + DarkUI/Config/Consts.cs | 2 + DarkUI/Controls/DarkButton.cs | 28 +- DarkUI/Controls/DarkCheckBox.cs | 346 ++++++++++++++++++ DarkUI/DarkUI.csproj | 3 + DarkUI/Docking/DarkDockPanel.cs | 2 +- Example/Example.csproj | 13 +- ...Designer.cs => DialogControls.Designer.cs} | 54 ++- .../{DialogTest.cs => DialogControls.cs} | 4 +- .../{DialogTest.resx => DialogControls.resx} | 0 Example/Forms/Docking/DockDocument.cs | 12 +- Example/Forms/MainForm.Designer.cs | 69 +++- Example/Forms/MainForm.cs | 10 +- Example/Forms/MainForm.resx | 2 +- Example/Icons.Designer.cs | 10 + Example/Icons.resx | 3 + Example/Resources/document_16xLG.png | Bin 0 -> 223 bytes 17 files changed, 514 insertions(+), 49 deletions(-) create mode 100644 DarkUI/Controls/DarkCheckBox.cs rename Example/Forms/Dialogs/{DialogTest.Designer.cs => DialogControls.Designer.cs} (81%) rename Example/Forms/Dialogs/{DialogTest.cs => DialogControls.cs} (94%) rename Example/Forms/Dialogs/{DialogTest.resx => DialogControls.resx} (100%) create mode 100644 Example/Resources/document_16xLG.png diff --git a/DarkUI/Config/Colors.cs b/DarkUI/Config/Colors.cs index 0f55f88..6ebda15 100644 --- a/DarkUI/Config/Colors.cs +++ b/DarkUI/Config/Colors.cs @@ -44,6 +44,11 @@ namespace DarkUI.Config get { return Color.FromArgb(95, 101, 102); } } + public static Color LightestBackground + { + get { return Color.FromArgb(178, 178, 178); } + } + public static Color LightBorder { get { return Color.FromArgb(81, 81, 81); } diff --git a/DarkUI/Config/Consts.cs b/DarkUI/Config/Consts.cs index b0c7324..f234d2e 100644 --- a/DarkUI/Config/Consts.cs +++ b/DarkUI/Config/Consts.cs @@ -8,6 +8,8 @@ public static int ArrowButtonSize = 15; public static int MinimumThumbSize = 11; + public static int CheckBoxSize = 12; + public const int ToolWindowHeaderSize = 25; public const int DocumentTabAreaSize = 24; public const int ToolWindowTabAreaSize = 21; diff --git a/DarkUI/Controls/DarkButton.cs b/DarkUI/Controls/DarkButton.cs index e9e53c6..6f84d45 100644 --- a/DarkUI/Controls/DarkButton.cs +++ b/DarkUI/Controls/DarkButton.cs @@ -75,6 +75,13 @@ namespace DarkUI.Controls #region Code Property Region + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoEllipsis + { + get { return false; } + } + [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public DarkControlState ButtonState @@ -82,13 +89,6 @@ namespace DarkUI.Controls get { return _buttonState; } } - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new ContentAlignment TextAlign - { - get { return base.TextAlign; } - } - [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public new ContentAlignment ImageAlign @@ -96,13 +96,6 @@ namespace DarkUI.Controls get { return base.ImageAlign; } } - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new bool AutoEllipsis - { - get { return false; } - } - [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public new bool FlatAppearance @@ -117,6 +110,13 @@ namespace DarkUI.Controls get { return base.FlatStyle; } } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new ContentAlignment TextAlign + { + get { return base.TextAlign; } + } + [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public new bool UseCompatibleTextRendering diff --git a/DarkUI/Controls/DarkCheckBox.cs b/DarkUI/Controls/DarkCheckBox.cs new file mode 100644 index 0000000..a133f81 --- /dev/null +++ b/DarkUI/Controls/DarkCheckBox.cs @@ -0,0 +1,346 @@ +using DarkUI.Config; +using DarkUI.Icons; +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace DarkUI.Controls +{ + public class DarkCheckBox : CheckBox + { + #region Field Region + + private DarkControlState _controlState = DarkControlState.Normal; + + private bool _spacePressed; + + #endregion + + #region Property Region + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Appearance Appearance + { + get { return base.Appearance; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoEllipsis + { + get { return base.AutoEllipsis; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Image BackgroundImage + { + get { return base.BackgroundImage; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new ImageLayout BackgroundImageLayout + { + get { return base.BackgroundImageLayout; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool FlatAppearance + { + get { return false; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new FlatStyle FlatStyle + { + get { return base.FlatStyle; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Image Image + { + get { return base.Image; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new ContentAlignment ImageAlign + { + get { return base.ImageAlign; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new int ImageIndex + { + get { return base.ImageIndex; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new string ImageKey + { + get { return base.ImageKey; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new ImageList ImageList + { + get { return base.ImageList; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new ContentAlignment TextAlign + { + get { return base.TextAlign; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new TextImageRelation TextImageRelation + { + get { return base.TextImageRelation; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool ThreeState + { + get { return base.ThreeState; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool UseCompatibleTextRendering + { + get { return false; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool UseVisualStyleBackColor + { + get { return false; } + } + + #endregion + + #region Constructor Region + + public DarkCheckBox() + { + SetStyle(ControlStyles.SupportsTransparentBackColor | + ControlStyles.OptimizedDoubleBuffer | + ControlStyles.ResizeRedraw | + ControlStyles.UserPaint, true); + } + + #endregion + + #region Method Region + + private void SetControlState(DarkControlState controlState) + { + if (_controlState != controlState) + { + _controlState = controlState; + Invalidate(); + } + } + + #endregion + + #region Event Handler Region + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + + if (_spacePressed) + return; + + if (e.Button == MouseButtons.Left) + { + if (ClientRectangle.Contains(e.Location)) + SetControlState(DarkControlState.Pressed); + else + SetControlState(DarkControlState.Hover); + } + else + { + SetControlState(DarkControlState.Hover); + } + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + if (!ClientRectangle.Contains(e.Location)) + return; + + SetControlState(DarkControlState.Pressed); + } + + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseUp(e); + + if (_spacePressed) + return; + + SetControlState(DarkControlState.Normal); + } + + protected override void OnMouseLeave(EventArgs e) + { + base.OnMouseLeave(e); + + if (_spacePressed) + return; + + SetControlState(DarkControlState.Normal); + } + + protected override void OnMouseCaptureChanged(EventArgs e) + { + base.OnMouseCaptureChanged(e); + + if (_spacePressed) + return; + + var location = Cursor.Position; + + if (!ClientRectangle.Contains(location)) + SetControlState(DarkControlState.Normal); + } + + protected override void OnGotFocus(EventArgs e) + { + base.OnGotFocus(e); + + Invalidate(); + } + + protected override void OnLostFocus(EventArgs e) + { + base.OnLostFocus(e); + + _spacePressed = false; + + var location = Cursor.Position; + + if (!ClientRectangle.Contains(location)) + SetControlState(DarkControlState.Normal); + else + SetControlState(DarkControlState.Hover); + } + + protected override void OnKeyDown(KeyEventArgs e) + { + base.OnKeyDown(e); + + if (e.KeyCode == Keys.Space) + { + _spacePressed = true; + SetControlState(DarkControlState.Pressed); + } + } + + protected override void OnKeyUp(KeyEventArgs e) + { + base.OnKeyUp(e); + + if (e.KeyCode == Keys.Space) + { + _spacePressed = false; + + var location = Cursor.Position; + + if (!ClientRectangle.Contains(location)) + SetControlState(DarkControlState.Normal); + else + SetControlState(DarkControlState.Hover); + } + } + + #endregion + + #region Paint Region + + protected override void OnPaint(PaintEventArgs e) + { + var g = e.Graphics; + var rect = new Rectangle(0, 0, ClientSize.Width, ClientSize.Height); + + var size = Consts.CheckBoxSize; + + var textColor = Colors.LightText; + var borderColor = Colors.LightText; + var fillColor = Colors.LightestBackground; + + if (Enabled) + { + if (Focused) + { + textColor = Colors.BlueHighlight; + borderColor = Colors.BlueHighlight; + fillColor = Colors.BlueSelection; + } + + if (_controlState == DarkControlState.Hover) + { + borderColor = Colors.BlueHighlight; + fillColor = Colors.BlueSelection; + } + else if (_controlState == DarkControlState.Pressed) + { + borderColor = Colors.GreyHighlight; + fillColor = Colors.GreySelection; + } + } + else + { + textColor = Colors.DisabledText; + borderColor = Colors.GreyHighlight; + fillColor = Colors.GreySelection; + } + + using (var b = new SolidBrush(Colors.GreyBackground)) + { + g.FillRectangle(b, rect); + } + + using (var p = new Pen(borderColor)) + { + var boxRect = new Rectangle(0, (rect.Height / 2) - (size / 2), size, size); + g.DrawRectangle(p, boxRect); + } + + if (Checked) + { + using (var b = new SolidBrush(fillColor)) + { + Rectangle boxRect = new Rectangle(2, (rect.Height / 2) - ((size - 4) / 2), size - 3, size - 3); + g.FillRectangle(b, boxRect); + } + } + + using (var b = new SolidBrush(textColor)) + { + var modRect = new Rectangle(size + 5, 0, rect.Width - (size + 5), rect.Height); + g.DrawString(Text, Font, b, modRect); + } + } + + #endregion + } +} diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index f02f8c3..1acab31 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -43,6 +43,9 @@ + + Component + Component diff --git a/DarkUI/Docking/DarkDockPanel.cs b/DarkUI/Docking/DarkDockPanel.cs index 5961f0b..92c74e4 100644 --- a/DarkUI/Docking/DarkDockPanel.cs +++ b/DarkUI/Docking/DarkDockPanel.cs @@ -113,7 +113,7 @@ namespace DarkUI.Docking if (_contents.Contains(dockContent)) return; - if (dockContent.DockArea != dockGroup.DockArea) + if (dockGroup != null && dockContent.DockArea != dockGroup.DockArea) throw new Exception($"Attempting to add '{dockContent.DockArea}' content to '{dockGroup.DockArea}' group."); dockContent.DockPanel = this; diff --git a/Example/Example.csproj b/Example/Example.csproj index 8cf6514..965f6b2 100644 --- a/Example/Example.csproj +++ b/Example/Example.csproj @@ -47,11 +47,11 @@ DialogAbout.cs - + Form - - DialogTest.cs + + DialogControls.cs UserControl @@ -105,8 +105,8 @@ DialogAbout.cs - - DialogTest.cs + + DialogControls.cs DockDocument.cs @@ -195,6 +195,9 @@ + + + %FlzX-!(SObdc+MQZX0oMMAMPmMs_QV6kb;3E2=J9ShTWed(r-) zyNVttdadZIqMwS+8Z&mx1!M0W`?s-Qj@^0n^;f@t^`}>7jV~Pk(D?dmzPP4C@qps- z#j)Z=#XF1tR=i@u2NQmo(9Cz1?+V`pU#)MMZ?ErN-w(drlG93hmW(V3mdq$wU-DGR z$0c8t{8S?RUVk%xd;fX<3;hfHxBE{h-CVk>^sds+O1~-156lbP75Fr8VcGDqf0uPH z|Ej!gMbC=E6(TuP9X#aR19*Q5R z{8)cTKC>PPH@ZKB(JJfBocVCbw;v*s!nR=7x6~zHM+!$(qt^ zO7|(frwpGGoicOEnkn0+9GG(3ltWXxOr12fVd~pcKb!i))c;I%Pir!5;I#SE)=%3p zZTIw|8Q07xoAKhzw`RUQ>$cge=WLyG!<@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t`nS)3neZ86 zPGp|AO-XAl%>e!O|3jG(jX~y_%pZ{VUdo%|e~sL8)RM_Oz*BW>rGNKj4zV=!QPv8z zSNI0&G=Hb9Ei?F!6ZZtqErjZ8-)j2|rK!cEgj6W)Q5&xcaq5X``j(~o2C<&LlGde; z4f9>V*shaS(ivLfITin)l`v;*R7=NcxBh)CQzl;=$$g}nwQrP9(6;t*yS0A{JsqMY z8k^w^w@T8o7JtcHb?vltTS>Q-Pt^|dr~iVXRpiqw&Qbpi?PZp??- zYEf}ywr6SQ6wp1%NZtJX`Gq+f2y?7@|Nh@^$q4Wr+U0a*&(7bH{``G6{#GOKzW{)M B*_8kQ literal 0 HcmV?d00001 From 8a9e763fcf59c0908615e8856178963b11691b25 Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 22 Dec 2015 22:24:39 +0000 Subject: [PATCH 80/97] Tabs now invalidated when dock text changed. --- DarkUI/Docking/DarkDockContent.cs | 9 ++++++++- DarkUI/Docking/DarkDockGroup.cs | 9 +++++++++ Example/Forms/MainForm.cs | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/DarkUI/Docking/DarkDockContent.cs b/DarkUI/Docking/DarkDockContent.cs index e769bc1..23bb3e2 100644 --- a/DarkUI/Docking/DarkDockContent.cs +++ b/DarkUI/Docking/DarkDockContent.cs @@ -8,6 +8,12 @@ namespace DarkUI.Docking [ToolboxItem(false)] public class DarkDockContent : UserControl { + #region Event Handler Region + + public event EventHandler DockTextChanged; + + #endregion + #region Field Region private string _dockText; @@ -28,7 +34,8 @@ namespace DarkUI.Docking _dockText = value; - // todo: trigger tabs to re-calculate in parent group + if (DockTextChanged != null) + DockTextChanged(this, null); Invalidate(); } diff --git a/DarkUI/Docking/DarkDockGroup.cs b/DarkUI/Docking/DarkDockGroup.cs index 0a15df3..74665b6 100644 --- a/DarkUI/Docking/DarkDockGroup.cs +++ b/DarkUI/Docking/DarkDockGroup.cs @@ -68,6 +68,8 @@ namespace DarkUI.Docking _contents.Add(dockContent); Controls.Add(dockContent); + dockContent.DockTextChanged += DockContent_DockTextChanged; + _tabs.Add(dockContent, new DarkDockTab(dockContent)); if (VisibleContent == null) @@ -96,6 +98,8 @@ namespace DarkUI.Docking _contents.Remove(dockContent); Controls.Remove(dockContent); + dockContent.DockTextChanged -= DockContent_DockTextChanged; + if (_tabs.ContainsKey(dockContent)) _tabs.Remove(dockContent); @@ -514,6 +518,11 @@ namespace DarkUI.Docking Invalidate(); } + private void DockContent_DockTextChanged(object sender, EventArgs e) + { + Invalidate(); + } + #endregion #region Render Region diff --git a/Example/Forms/MainForm.cs b/Example/Forms/MainForm.cs index 64baf7d..a74d75a 100644 --- a/Example/Forms/MainForm.cs +++ b/Example/Forms/MainForm.cs @@ -213,7 +213,7 @@ namespace Example DockPanel.AddContent(content); } } - + private DarkDockContent GetContentBySerializationKey(string key) { foreach (var window in _toolWindows) From 3f2c37a4342a209c0c3a4058b7702eefeea7152d Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 22 Dec 2015 22:40:18 +0000 Subject: [PATCH 81/97] Tabs now re-sized when dock text changes. --- DarkUI/Docking/DarkDockGroup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DarkUI/Docking/DarkDockGroup.cs b/DarkUI/Docking/DarkDockGroup.cs index 74665b6..adbc1de 100644 --- a/DarkUI/Docking/DarkDockGroup.cs +++ b/DarkUI/Docking/DarkDockGroup.cs @@ -520,7 +520,7 @@ namespace DarkUI.Docking private void DockContent_DockTextChanged(object sender, EventArgs e) { - Invalidate(); + BuildTabs(); } #endregion From db07a006ece94c4337a78654c73455d73de0c92b Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 31 Dec 2015 22:28:25 +0000 Subject: [PATCH 82/97] Dock panel now focuses content when added --- DarkUI/Docking/DarkDockPanel.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DarkUI/Docking/DarkDockPanel.cs b/DarkUI/Docking/DarkDockPanel.cs index 31b1f35..54ac5b2 100644 --- a/DarkUI/Docking/DarkDockPanel.cs +++ b/DarkUI/Docking/DarkDockPanel.cs @@ -136,6 +136,8 @@ namespace DarkUI.Docking if (ContentAdded != null) ContentAdded(this, new DockContentEventArgs(dockContent)); + + dockContent.Select(); } public void RemoveContent(DarkDockContent dockContent) From 61cae9e978646b2b16f12afadd8d2335f71a0383 Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 31 Dec 2015 22:56:44 +0000 Subject: [PATCH 83/97] Added close buttons to tool windows. --- DarkUI/DarkUI.csproj | 12 +++ DarkUI/Docking/DarkToolWindow.cs | 90 ++++++++++++++++++ DarkUI/Icons/DockIcons.Designer.cs | 40 ++++++++ DarkUI/Icons/DockIcons.resx | 12 +++ DarkUI/Resources/tw_active_close.png | Bin 0 -> 18115 bytes DarkUI/Resources/tw_active_close_selected.png | Bin 0 -> 18116 bytes DarkUI/Resources/tw_close.png | Bin 0 -> 18088 bytes DarkUI/Resources/tw_close_selected.png | Bin 0 -> 18088 bytes 8 files changed, 154 insertions(+) create mode 100644 DarkUI/Resources/tw_active_close.png create mode 100644 DarkUI/Resources/tw_active_close_selected.png create mode 100644 DarkUI/Resources/tw_close.png create mode 100644 DarkUI/Resources/tw_close_selected.png diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj index dc4e2b5..9f868fa 100644 --- a/DarkUI/DarkUI.csproj +++ b/DarkUI/DarkUI.csproj @@ -274,6 +274,18 @@ + + + + + + + + + + + +