mirror of
https://github.com/colhountech/DarkUI.Net5.git
synced 2025-07-02 07:09:27 +03:00
Added DarkCheckBox
Also added document icons to example project.
This commit is contained in:
parent
45bedfcbd7
commit
11f45aaf3e
@ -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); }
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
346
DarkUI/Controls/DarkCheckBox.cs
Normal file
346
DarkUI/Controls/DarkCheckBox.cs
Normal file
@ -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
|
||||
}
|
||||
}
|
@ -43,6 +43,9 @@
|
||||
<Compile Include="Config\Colors.cs" />
|
||||
<Compile Include="Config\Consts.cs" />
|
||||
<Compile Include="Config\Enums.cs" />
|
||||
<Compile Include="Controls\DarkCheckBox.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\DarkTreeView.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
|
@ -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;
|
||||
|
@ -47,11 +47,11 @@
|
||||
<Compile Include="Forms\Dialogs\DialogAbout.Designer.cs">
|
||||
<DependentUpon>DialogAbout.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Dialogs\DialogTest.cs">
|
||||
<Compile Include="Forms\Dialogs\DialogControls.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Dialogs\DialogTest.Designer.cs">
|
||||
<DependentUpon>DialogTest.cs</DependentUpon>
|
||||
<Compile Include="Forms\Dialogs\DialogControls.Designer.cs">
|
||||
<DependentUpon>DialogControls.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Docking\DockDocument.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
@ -105,8 +105,8 @@
|
||||
<EmbeddedResource Include="Forms\Dialogs\DialogAbout.resx">
|
||||
<DependentUpon>DialogAbout.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\Dialogs\DialogTest.resx">
|
||||
<DependentUpon>DialogTest.cs</DependentUpon>
|
||||
<EmbeddedResource Include="Forms\Dialogs\DialogControls.resx">
|
||||
<DependentUpon>DialogControls.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\Docking\DockDocument.resx">
|
||||
<DependentUpon>DockDocument.cs</DependentUpon>
|
||||
@ -195,6 +195,9 @@
|
||||
<ItemGroup>
|
||||
<None Include="Resources\RefactoringLog_12810.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\document_16xLG.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Example
|
||||
{
|
||||
partial class DialogTest
|
||||
partial class DialogControls
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
@ -30,18 +30,20 @@ namespace Example
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DialogTest));
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DialogControls));
|
||||
this.pnlMain = new System.Windows.Forms.Panel();
|
||||
this.tblMain = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.pnlTreeView = new DarkSectionPanel();
|
||||
this.treeTest = new DarkTreeView();
|
||||
this.pnlListView = new DarkSectionPanel();
|
||||
this.lstTest = new DarkListView();
|
||||
this.pnlMessageBox = new DarkSectionPanel();
|
||||
this.pnlTreeView = new DarkUI.Controls.DarkSectionPanel();
|
||||
this.treeTest = new DarkUI.Controls.DarkTreeView();
|
||||
this.pnlListView = new DarkUI.Controls.DarkSectionPanel();
|
||||
this.lstTest = new DarkUI.Controls.DarkListView();
|
||||
this.pnlMessageBox = new DarkUI.Controls.DarkSectionPanel();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.btnMessageBox = new DarkButton();
|
||||
this.darkCheckBox2 = new DarkUI.Controls.DarkCheckBox();
|
||||
this.darkCheckBox1 = new DarkUI.Controls.DarkCheckBox();
|
||||
this.btnMessageBox = new DarkUI.Controls.DarkButton();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.btnDialog = new DarkButton();
|
||||
this.btnDialog = new DarkUI.Controls.DarkButton();
|
||||
this.pnlMain.SuspendLayout();
|
||||
this.tblMain.SuspendLayout();
|
||||
this.pnlTreeView.SuspendLayout();
|
||||
@ -129,12 +131,14 @@ namespace Example
|
||||
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.SectionHeader = "Controls test";
|
||||
this.pnlMessageBox.Size = new System.Drawing.Size(222, 400);
|
||||
this.pnlMessageBox.TabIndex = 12;
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.darkCheckBox2);
|
||||
this.panel1.Controls.Add(this.darkCheckBox1);
|
||||
this.panel1.Controls.Add(this.btnMessageBox);
|
||||
this.panel1.Controls.Add(this.panel2);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
@ -144,6 +148,27 @@ namespace Example
|
||||
this.panel1.Size = new System.Drawing.Size(220, 374);
|
||||
this.panel1.TabIndex = 0;
|
||||
//
|
||||
// darkCheckBox2
|
||||
//
|
||||
this.darkCheckBox2.AutoSize = true;
|
||||
this.darkCheckBox2.Checked = true;
|
||||
this.darkCheckBox2.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.darkCheckBox2.Enabled = false;
|
||||
this.darkCheckBox2.Location = new System.Drawing.Point(10, 111);
|
||||
this.darkCheckBox2.Name = "darkCheckBox2";
|
||||
this.darkCheckBox2.Size = new System.Drawing.Size(124, 19);
|
||||
this.darkCheckBox2.TabIndex = 9;
|
||||
this.darkCheckBox2.Text = "Disabled checkbox";
|
||||
//
|
||||
// darkCheckBox1
|
||||
//
|
||||
this.darkCheckBox1.AutoSize = true;
|
||||
this.darkCheckBox1.Location = new System.Drawing.Point(10, 86);
|
||||
this.darkCheckBox1.Name = "darkCheckBox1";
|
||||
this.darkCheckBox1.Size = new System.Drawing.Size(121, 19);
|
||||
this.darkCheckBox1.TabIndex = 8;
|
||||
this.darkCheckBox1.Text = "Enabled checkbox";
|
||||
//
|
||||
// btnMessageBox
|
||||
//
|
||||
this.btnMessageBox.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
@ -173,7 +198,7 @@ namespace Example
|
||||
this.btnDialog.TabIndex = 4;
|
||||
this.btnDialog.Text = "Dialog";
|
||||
//
|
||||
// DialogTest
|
||||
// DialogControls
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
@ -181,9 +206,9 @@ namespace Example
|
||||
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.Name = "DialogControls";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Dialog test";
|
||||
this.Text = "Controls";
|
||||
this.Controls.SetChildIndex(this.pnlMain, 0);
|
||||
this.pnlMain.ResumeLayout(false);
|
||||
this.tblMain.ResumeLayout(false);
|
||||
@ -191,6 +216,7 @@ namespace Example
|
||||
this.pnlListView.ResumeLayout(false);
|
||||
this.pnlMessageBox.ResumeLayout(false);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
@ -209,5 +235,7 @@ namespace Example
|
||||
private DarkButton btnMessageBox;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private DarkButton btnDialog;
|
||||
private DarkCheckBox darkCheckBox1;
|
||||
private DarkCheckBox darkCheckBox2;
|
||||
}
|
||||
}
|
@ -3,9 +3,9 @@ using DarkUI.Forms;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public partial class DialogTest : DarkDialog
|
||||
public partial class DialogControls : DarkDialog
|
||||
{
|
||||
public DialogTest()
|
||||
public DialogControls()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
@ -1,6 +1,7 @@
|
||||
using DarkUI.Config;
|
||||
using DarkUI.Docking;
|
||||
using DarkUI.Forms;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Example
|
||||
@ -9,16 +10,21 @@ namespace Example
|
||||
{
|
||||
#region Constructor Region
|
||||
|
||||
public DockDocument(string text)
|
||||
public DockDocument()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
DockText = text;
|
||||
|
||||
// Workaround to stop the textbox from highlight all text.
|
||||
txtDocument.SelectionStart = txtDocument.Text.Length;
|
||||
}
|
||||
|
||||
public DockDocument(string text, Image icon)
|
||||
: this()
|
||||
{
|
||||
DockText = text;
|
||||
Icon = icon;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Event Handler Region
|
||||
|
69
Example/Forms/MainForm.Designer.cs
generated
69
Example/Forms/MainForm.Designer.cs
generated
@ -32,7 +32,7 @@ namespace Example
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
|
||||
this.mnuMain = new DarkMenuStrip();
|
||||
this.mnuMain = new DarkUI.Controls.DarkMenuStrip();
|
||||
this.mnuFile = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuNewFile = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
@ -48,14 +48,19 @@ namespace Example
|
||||
this.mnuHistory = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuHelp = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuAbout = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolMain = new DarkToolStrip();
|
||||
this.toolMain = new DarkUI.Controls.DarkToolStrip();
|
||||
this.btnNewFile = new System.Windows.Forms.ToolStripButton();
|
||||
this.stripMain = new DarkStatusStrip();
|
||||
this.stripMain = new DarkUI.Controls.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 DarkDockPanel();
|
||||
this.darkSeparator1 = new DarkSeparator();
|
||||
this.DockPanel = new DarkUI.Docking.DarkDockPanel();
|
||||
this.darkSeparator1 = new DarkUI.Controls.DarkSeparator();
|
||||
this.checkableToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.checkableWithIconToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.checkedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.checkedWithIconToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuMain.SuspendLayout();
|
||||
this.toolMain.SuspendLayout();
|
||||
this.stripMain.SuspendLayout();
|
||||
@ -133,6 +138,12 @@ namespace Example
|
||||
//
|
||||
// mnuTools
|
||||
//
|
||||
this.mnuTools.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.checkableToolStripMenuItem,
|
||||
this.checkableWithIconToolStripMenuItem,
|
||||
this.toolStripSeparator2,
|
||||
this.checkedToolStripMenuItem,
|
||||
this.checkedWithIconToolStripMenuItem});
|
||||
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);
|
||||
@ -294,6 +305,49 @@ namespace Example
|
||||
this.darkSeparator1.TabIndex = 4;
|
||||
this.darkSeparator1.Text = "darkSeparator1";
|
||||
//
|
||||
// checkableToolStripMenuItem
|
||||
//
|
||||
this.checkableToolStripMenuItem.CheckOnClick = true;
|
||||
this.checkableToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
|
||||
this.checkableToolStripMenuItem.Name = "checkableToolStripMenuItem";
|
||||
this.checkableToolStripMenuItem.Size = new System.Drawing.Size(181, 22);
|
||||
this.checkableToolStripMenuItem.Text = "Checkable";
|
||||
//
|
||||
// checkableWithIconToolStripMenuItem
|
||||
//
|
||||
this.checkableWithIconToolStripMenuItem.CheckOnClick = true;
|
||||
this.checkableWithIconToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
|
||||
this.checkableWithIconToolStripMenuItem.Image = global::Example.Icons.properties_16xLG;
|
||||
this.checkableWithIconToolStripMenuItem.Name = "checkableWithIconToolStripMenuItem";
|
||||
this.checkableWithIconToolStripMenuItem.Size = new System.Drawing.Size(181, 22);
|
||||
this.checkableWithIconToolStripMenuItem.Text = "Checkable with icon";
|
||||
//
|
||||
// toolStripSeparator2
|
||||
//
|
||||
this.toolStripSeparator2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
|
||||
this.toolStripSeparator2.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1);
|
||||
this.toolStripSeparator2.Name = "toolStripSeparator2";
|
||||
this.toolStripSeparator2.Size = new System.Drawing.Size(178, 6);
|
||||
//
|
||||
// checkedToolStripMenuItem
|
||||
//
|
||||
this.checkedToolStripMenuItem.Checked = true;
|
||||
this.checkedToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.checkedToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
|
||||
this.checkedToolStripMenuItem.Name = "checkedToolStripMenuItem";
|
||||
this.checkedToolStripMenuItem.Size = new System.Drawing.Size(181, 22);
|
||||
this.checkedToolStripMenuItem.Text = "Checked";
|
||||
//
|
||||
// checkedWithIconToolStripMenuItem
|
||||
//
|
||||
this.checkedWithIconToolStripMenuItem.Checked = true;
|
||||
this.checkedWithIconToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.checkedWithIconToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
|
||||
this.checkedWithIconToolStripMenuItem.Image = global::Example.Icons.properties_16xLG;
|
||||
this.checkedWithIconToolStripMenuItem.Name = "checkedWithIconToolStripMenuItem";
|
||||
this.checkedWithIconToolStripMenuItem.Size = new System.Drawing.Size(181, 22);
|
||||
this.checkedWithIconToolStripMenuItem.Text = "Checked with icon";
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
@ -348,6 +402,11 @@ namespace Example
|
||||
private System.Windows.Forms.ToolStripMenuItem mnuLayers;
|
||||
private System.Windows.Forms.ToolStripMenuItem mnuHistory;
|
||||
private DarkSeparator darkSeparator1;
|
||||
private System.Windows.Forms.ToolStripMenuItem checkableToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem checkableWithIconToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
||||
private System.Windows.Forms.ToolStripMenuItem checkedToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem checkedWithIconToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,9 +60,9 @@ namespace Example
|
||||
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"));
|
||||
DockPanel.AddContent(new DockDocument("Document 1", Icons.document_16xLG));
|
||||
DockPanel.AddContent(new DockDocument("Document 2", Icons.document_16xLG));
|
||||
DockPanel.AddContent(new DockDocument("Document 3", Icons.document_16xLG));
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -125,7 +125,7 @@ namespace Example
|
||||
|
||||
private void NewFile_Click(object sender, EventArgs e)
|
||||
{
|
||||
var newFile = new DockDocument("New document");
|
||||
var newFile = new DockDocument("New document", Icons.document_16xLG);
|
||||
DockPanel.AddContent(newFile);
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ namespace Example
|
||||
|
||||
private void Dialog_Click(object sender, EventArgs e)
|
||||
{
|
||||
var test = new DialogTest();
|
||||
var test = new DialogControls();
|
||||
test.ShowDialog();
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@
|
||||
<data name="mnuHistory.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1
|
||||
MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsMAAA7DAcdvqGQAADnsaVRYdFhNTDpjb20uYWRvYmUu
|
||||
MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsIAAA7CARUoSoAAADnsaVRYdFhNTDpjb20uYWRvYmUu
|
||||
eG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/
|
||||
Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29y
|
||||
ZSA1LjYtYzAxNCA3OS4xNTY3OTcsIDIwMTQvMDgvMjAtMDk6NTM6MDIgICAgICAgICI+CiAgIDxyZGY6
|
||||
|
10
Example/Icons.Designer.cs
generated
10
Example/Icons.Designer.cs
generated
@ -100,6 +100,16 @@ namespace Example {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap document_16xLG {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("document_16xLG", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
@ -154,4 +154,7 @@
|
||||
<data name="RefactoringLog_12810" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\RefactoringLog_12810.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="document_16xLG" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\document_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
BIN
Example/Resources/document_16xLG.png
Normal file
BIN
Example/Resources/document_16xLG.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 223 B |
Loading…
x
Reference in New Issue
Block a user