mirror of
https://github.com/colhountech/DarkUI.Net5.git
synced 2024-10-17 07:16:49 +03:00
DarkScrollBar
This commit is contained in:
parent
4d5bf78403
commit
038171c588
@ -3,5 +3,9 @@
|
||||
public sealed class Consts
|
||||
{
|
||||
public static int Padding = 10;
|
||||
|
||||
public static int ScrollBarSize = 15;
|
||||
public static int ArrowButtonSize = 15;
|
||||
public static int MinimumThumbSize = 11;
|
||||
}
|
||||
}
|
||||
|
@ -19,4 +19,10 @@
|
||||
Left,
|
||||
Right
|
||||
}
|
||||
|
||||
public enum DarkOrientation
|
||||
{
|
||||
Vertical,
|
||||
Horizontal
|
||||
}
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ namespace DarkUI
|
||||
|
||||
#region Property Region
|
||||
|
||||
[Category("Appearance")]
|
||||
[Description("Determines whether the label will automatically update height based on content.")]
|
||||
[Category("Layout")]
|
||||
[Description("Enables automatic height sizing based on the contents of the label.")]
|
||||
[DefaultValue(false)]
|
||||
public bool AutoUpdateHeight
|
||||
{
|
||||
@ -34,6 +34,21 @@ 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; }
|
||||
set
|
||||
{
|
||||
base.AutoSize = value;
|
||||
|
||||
if (AutoSize)
|
||||
AutoUpdateHeight = false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor Region
|
||||
|
531
DarkUI/Controls/DarkScrollBar.cs
Normal file
531
DarkUI/Controls/DarkScrollBar.cs
Normal file
@ -0,0 +1,531 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DarkUI
|
||||
{
|
||||
public class DarkScrollBar : Control
|
||||
{
|
||||
#region Event Region
|
||||
|
||||
public event EventHandler<ScrollValueEventArgs> ValueChanged;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Field Region
|
||||
|
||||
private DarkOrientation _scrollOrientation;
|
||||
|
||||
private int _value;
|
||||
private int _minimum = 0;
|
||||
private int _maximum = 100;
|
||||
|
||||
private int _viewSize;
|
||||
|
||||
private Rectangle _trackArea;
|
||||
private float _viewContentRatio;
|
||||
|
||||
private Rectangle _thumbArea;
|
||||
private Rectangle _upArrowArea;
|
||||
private Rectangle _downArrowArea;
|
||||
|
||||
private bool _thumbHot;
|
||||
private bool _upArrowHot;
|
||||
private bool _downArrowHot;
|
||||
|
||||
private bool _thumbClicked;
|
||||
private bool _upArrowClicked;
|
||||
private bool _downArrowClicked;
|
||||
|
||||
private bool _isScrolling;
|
||||
private int _initialValue;
|
||||
private Point _initialContact;
|
||||
|
||||
private Timer _scrollTimer;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property Region
|
||||
|
||||
[Category("Behavior")]
|
||||
[Description("The orientation type of the scrollbar.")]
|
||||
[DefaultValue(DarkOrientation.Vertical)]
|
||||
public DarkOrientation ScrollOrientation
|
||||
{
|
||||
get { return _scrollOrientation; }
|
||||
set
|
||||
{
|
||||
_scrollOrientation = value;
|
||||
UpdateScrollBar();
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Behavior")]
|
||||
[Description("The value that the scroll thumb position represents.")]
|
||||
[DefaultValue(0)]
|
||||
public int Value
|
||||
{
|
||||
get { return _value; }
|
||||
set
|
||||
{
|
||||
if (value < Minimum)
|
||||
value = Minimum;
|
||||
|
||||
var maximumValue = Maximum - ViewSize;
|
||||
if (value > maximumValue)
|
||||
value = maximumValue;
|
||||
|
||||
if (_value == value)
|
||||
return;
|
||||
|
||||
_value = value;
|
||||
|
||||
UpdateThumb(true);
|
||||
|
||||
if (ValueChanged != null)
|
||||
ValueChanged(this, new ScrollValueEventArgs(Value));
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Behavior")]
|
||||
[Description("The lower limit value of the scrollable range.")]
|
||||
[DefaultValue(0)]
|
||||
public int Minimum
|
||||
{
|
||||
get { return _minimum; }
|
||||
set
|
||||
{
|
||||
_minimum = value;
|
||||
UpdateScrollBar();
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Behavior")]
|
||||
[Description("The upper limit value of the scrollable range.")]
|
||||
[DefaultValue(100)]
|
||||
public int Maximum
|
||||
{
|
||||
get { return _maximum; }
|
||||
set
|
||||
{
|
||||
_maximum = value;
|
||||
UpdateScrollBar();
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Behavior")]
|
||||
[Description("The view size for the scrollable area.")]
|
||||
[DefaultValue(0)]
|
||||
public int ViewSize
|
||||
{
|
||||
get { return _viewSize; }
|
||||
set
|
||||
{
|
||||
_viewSize = value;
|
||||
UpdateScrollBar();
|
||||
}
|
||||
}
|
||||
|
||||
public new bool Visible
|
||||
{
|
||||
get { return base.Visible; }
|
||||
set
|
||||
{
|
||||
if (base.Visible == value)
|
||||
return;
|
||||
|
||||
base.Visible = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor Region
|
||||
|
||||
public DarkScrollBar()
|
||||
{
|
||||
SetStyle(ControlStyles.OptimizedDoubleBuffer |
|
||||
ControlStyles.ResizeRedraw |
|
||||
ControlStyles.UserPaint, true);
|
||||
|
||||
SetStyle(ControlStyles.Selectable, false);
|
||||
|
||||
_scrollTimer = new Timer();
|
||||
_scrollTimer.Interval = 1;
|
||||
_scrollTimer.Tick += ScrollTimerTick;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Event Handler Region
|
||||
|
||||
protected override void OnResize(EventArgs e)
|
||||
{
|
||||
base.OnResize(e);
|
||||
|
||||
UpdateScrollBar();
|
||||
}
|
||||
|
||||
protected override void OnMouseDown(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseDown(e);
|
||||
|
||||
if (_thumbArea.Contains(e.Location) && e.Button == MouseButtons.Left)
|
||||
{
|
||||
_isScrolling = true;
|
||||
_initialContact = e.Location;
|
||||
|
||||
if (_scrollOrientation == DarkOrientation.Vertical)
|
||||
_initialValue = _thumbArea.Top;
|
||||
else
|
||||
_initialValue = _thumbArea.Left;
|
||||
|
||||
Invalidate();
|
||||
return;
|
||||
}
|
||||
|
||||
if (_upArrowArea.Contains(e.Location) && e.Button == MouseButtons.Left)
|
||||
{
|
||||
_upArrowClicked = true;
|
||||
_scrollTimer.Enabled = true;
|
||||
|
||||
Invalidate();
|
||||
return;
|
||||
}
|
||||
|
||||
if (_downArrowArea.Contains(e.Location) && e.Button == MouseButtons.Left)
|
||||
{
|
||||
_downArrowClicked = true;
|
||||
_scrollTimer.Enabled = true;
|
||||
|
||||
Invalidate();
|
||||
return;
|
||||
}
|
||||
|
||||
if (_trackArea.Contains(e.Location) && e.Button == MouseButtons.Left)
|
||||
{
|
||||
// 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);
|
||||
if (!modRect.Contains(e.Location))
|
||||
return;
|
||||
}
|
||||
else if (_scrollOrientation == DarkOrientation.Horizontal)
|
||||
{
|
||||
var modRect = new Rectangle(_trackArea.Left, _thumbArea.Top, _trackArea.Width, _thumbArea.Height);
|
||||
if (!modRect.Contains(e.Location))
|
||||
return;
|
||||
}
|
||||
|
||||
// Step 1. Scroll to the area initially clicked.
|
||||
if (_scrollOrientation == DarkOrientation.Vertical)
|
||||
{
|
||||
var loc = e.Location.Y;
|
||||
loc -= _upArrowArea.Bottom - 1;
|
||||
loc -= _thumbArea.Height / 2;
|
||||
ScrollToPhysical(loc);
|
||||
}
|
||||
else
|
||||
{
|
||||
var loc = e.Location.X;
|
||||
loc -= _upArrowArea.Right - 1;
|
||||
loc -= _thumbArea.Width / 2;
|
||||
ScrollToPhysical(loc);
|
||||
}
|
||||
|
||||
// Step 2. Initiate a thumb drag.
|
||||
_isScrolling = true;
|
||||
_initialContact = e.Location;
|
||||
_thumbHot = true;
|
||||
|
||||
if (_scrollOrientation == DarkOrientation.Vertical)
|
||||
_initialValue = _thumbArea.Top;
|
||||
else
|
||||
_initialValue = _thumbArea.Left;
|
||||
|
||||
Invalidate();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseUp(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseUp(e);
|
||||
|
||||
_isScrolling = false;
|
||||
|
||||
_thumbClicked = false;
|
||||
_upArrowClicked = false;
|
||||
_downArrowClicked = false;
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
protected override void OnMouseMove(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseMove(e);
|
||||
|
||||
if (!_isScrolling)
|
||||
{
|
||||
var thumbHot = _thumbArea.Contains(e.Location);
|
||||
if (_thumbHot != thumbHot)
|
||||
{
|
||||
_thumbHot = thumbHot;
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
var upArrowHot = _upArrowArea.Contains(e.Location);
|
||||
if (_upArrowHot != upArrowHot)
|
||||
{
|
||||
_upArrowHot = upArrowHot;
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
var downArrowHot = _downArrowArea.Contains(e.Location);
|
||||
if (_downArrowHot != downArrowHot)
|
||||
{
|
||||
_downArrowHot = downArrowHot;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
if (_isScrolling)
|
||||
{
|
||||
if (e.Button != MouseButtons.Left)
|
||||
{
|
||||
OnMouseUp(null);
|
||||
return;
|
||||
}
|
||||
|
||||
var difference = new Point(e.Location.X - _initialContact.X, e.Location.Y - _initialContact.Y);
|
||||
|
||||
if (_scrollOrientation == DarkOrientation.Vertical)
|
||||
{
|
||||
var thumbPos = (_initialValue - _trackArea.Top);
|
||||
var newPosition = thumbPos + difference.Y;
|
||||
|
||||
ScrollToPhysical(newPosition);
|
||||
}
|
||||
else if (_scrollOrientation == DarkOrientation.Horizontal)
|
||||
{
|
||||
var thumbPos = (_initialValue - _trackArea.Left);
|
||||
var newPosition = thumbPos + difference.X;
|
||||
|
||||
ScrollToPhysical(newPosition);
|
||||
}
|
||||
|
||||
UpdateScrollBar();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseLeave(EventArgs e)
|
||||
{
|
||||
base.OnMouseLeave(e);
|
||||
|
||||
_thumbHot = false;
|
||||
_upArrowHot = false;
|
||||
_downArrowHot = false;
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
private void ScrollTimerTick(object sender, EventArgs e)
|
||||
{
|
||||
if (!_upArrowClicked && !_downArrowClicked)
|
||||
{
|
||||
_scrollTimer.Enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_upArrowClicked)
|
||||
ScrollBy(-1);
|
||||
else if (_downArrowClicked)
|
||||
ScrollBy(1);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method Region
|
||||
|
||||
public void ScrollTo(int position)
|
||||
{
|
||||
Value = position;
|
||||
}
|
||||
|
||||
public void ScrollToPhysical(int positionInPixels)
|
||||
{
|
||||
var isVert = _scrollOrientation == DarkOrientation.Vertical;
|
||||
|
||||
var trackAreaSize = isVert ? _trackArea.Height - _thumbArea.Height : _trackArea.Width - _thumbArea.Width;
|
||||
|
||||
var positionRatio = (float)positionInPixels / (float)trackAreaSize;
|
||||
var viewScrollSize = (Maximum - ViewSize);
|
||||
|
||||
var newValue = (int)(positionRatio * viewScrollSize);
|
||||
Value = newValue;
|
||||
}
|
||||
|
||||
public void ScrollBy(int offset)
|
||||
{
|
||||
var newValue = Value + offset;
|
||||
ScrollTo(newValue);
|
||||
}
|
||||
|
||||
public void ScrollByPhysical(int offsetInPixels)
|
||||
{
|
||||
var isVert = _scrollOrientation == DarkOrientation.Vertical;
|
||||
|
||||
var thumbPos = isVert ? (_thumbArea.Top - _trackArea.Top) : (_thumbArea.Left - _trackArea.Left);
|
||||
|
||||
var newPosition = thumbPos - offsetInPixels;
|
||||
|
||||
ScrollToPhysical(newPosition);
|
||||
}
|
||||
|
||||
public void UpdateScrollBar()
|
||||
{
|
||||
if (ViewSize >= Maximum)
|
||||
return;
|
||||
|
||||
var area = ClientRectangle;
|
||||
|
||||
// Cap to maximum value
|
||||
var maximumValue = Maximum - ViewSize;
|
||||
if (Value > maximumValue)
|
||||
Value = maximumValue;
|
||||
|
||||
// Arrow buttons
|
||||
if (_scrollOrientation == DarkOrientation.Vertical)
|
||||
{
|
||||
_upArrowArea = new Rectangle(area.Left, area.Top, Consts.ArrowButtonSize, Consts.ArrowButtonSize);
|
||||
_downArrowArea = new Rectangle(area.Left, area.Bottom - Consts.ArrowButtonSize, Consts.ArrowButtonSize, Consts.ArrowButtonSize);
|
||||
}
|
||||
else if (_scrollOrientation == DarkOrientation.Horizontal)
|
||||
{
|
||||
_upArrowArea = new Rectangle(area.Left, area.Top, Consts.ArrowButtonSize, Consts.ArrowButtonSize);
|
||||
_downArrowArea = new Rectangle(area.Right - Consts.ArrowButtonSize, area.Top, Consts.ArrowButtonSize, Consts.ArrowButtonSize);
|
||||
}
|
||||
|
||||
// Track
|
||||
if (_scrollOrientation == DarkOrientation.Vertical)
|
||||
{
|
||||
_trackArea = new Rectangle(area.Left, area.Top + Consts.ArrowButtonSize, area.Width, area.Height - (Consts.ArrowButtonSize * 2));
|
||||
}
|
||||
else if (_scrollOrientation == DarkOrientation.Horizontal)
|
||||
{
|
||||
_trackArea = new Rectangle(area.Left + Consts.ArrowButtonSize, area.Top, area.Width - (Consts.ArrowButtonSize * 2), area.Height);
|
||||
}
|
||||
|
||||
// Thumb
|
||||
UpdateThumb();
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
private void UpdateThumb(bool forceRefresh = false)
|
||||
{
|
||||
// Calculate size ratio
|
||||
_viewContentRatio = (float)ViewSize / (float)Maximum;
|
||||
var viewAreaSize = Maximum - ViewSize;
|
||||
var positionRatio = (float)Value / (float)viewAreaSize;
|
||||
|
||||
// Update area
|
||||
if (_scrollOrientation == DarkOrientation.Vertical)
|
||||
{
|
||||
var thumbSize = (int)(_trackArea.Height * _viewContentRatio);
|
||||
|
||||
if (thumbSize < Consts.MinimumThumbSize)
|
||||
thumbSize = Consts.MinimumThumbSize;
|
||||
|
||||
var trackAreaSize = _trackArea.Height - thumbSize;
|
||||
var thumbPosition = (int)(trackAreaSize * positionRatio);
|
||||
|
||||
_thumbArea = new Rectangle(_trackArea.Left + 3, _trackArea.Top + thumbPosition, Consts.ScrollBarSize - 6, thumbSize);
|
||||
}
|
||||
else if (_scrollOrientation == DarkOrientation.Horizontal)
|
||||
{
|
||||
var thumbSize = (int)(_trackArea.Width * _viewContentRatio);
|
||||
|
||||
if (thumbSize < Consts.MinimumThumbSize)
|
||||
thumbSize = Consts.MinimumThumbSize;
|
||||
|
||||
var trackAreaSize = _trackArea.Width - thumbSize;
|
||||
var thumbPosition = (int)(trackAreaSize * positionRatio);
|
||||
|
||||
_thumbArea = new Rectangle(_trackArea.Left + thumbPosition, _trackArea.Top + 3, thumbSize, Consts.ScrollBarSize - 6);
|
||||
}
|
||||
|
||||
if (forceRefresh)
|
||||
{
|
||||
Invalidate();
|
||||
Update();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Paint Region
|
||||
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
var g = e.Graphics;
|
||||
|
||||
// DEBUG: Scrollbar bg
|
||||
/*using (var b = new SolidBrush(Colors.MediumBackground))
|
||||
{
|
||||
g.FillRectangle(b, ClientRectangle);
|
||||
}*/
|
||||
|
||||
// DEBUG: Arrow backgrounds
|
||||
/*using (var b = new SolidBrush(Color.White))
|
||||
{
|
||||
g.FillRectangle(b, _upArrowArea);
|
||||
g.FillRectangle(b, _downArrowArea);
|
||||
}*/
|
||||
|
||||
// Up arrow
|
||||
var upIcon = _upArrowHot ? ScrollIcons.scrollbar_arrow_hot : ScrollIcons.scrollbar_arrow_standard;
|
||||
|
||||
if (_upArrowClicked)
|
||||
upIcon = ScrollIcons.scrollbar_arrow_clicked;
|
||||
|
||||
if (_scrollOrientation == DarkOrientation.Vertical)
|
||||
upIcon.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
else if (_scrollOrientation == DarkOrientation.Horizontal)
|
||||
upIcon.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
|
||||
g.DrawImageUnscaled(upIcon,
|
||||
_upArrowArea.Left + (_upArrowArea.Width / 2) - (upIcon.Width / 2),
|
||||
_upArrowArea.Top + (_upArrowArea.Height / 2) - (upIcon.Height / 2));
|
||||
|
||||
// Down arrow
|
||||
var downIcon = _downArrowHot ? ScrollIcons.scrollbar_arrow_hot : ScrollIcons.scrollbar_arrow_standard;
|
||||
|
||||
if (_downArrowClicked)
|
||||
downIcon = ScrollIcons.scrollbar_arrow_clicked;
|
||||
|
||||
if (_scrollOrientation == DarkOrientation.Horizontal)
|
||||
downIcon.RotateFlip(RotateFlipType.Rotate270FlipNone);
|
||||
|
||||
g.DrawImageUnscaled(downIcon,
|
||||
_downArrowArea.Left + (_downArrowArea.Width / 2) - (downIcon.Width / 2),
|
||||
_downArrowArea.Top + (_downArrowArea.Height / 2) - (downIcon.Height / 2));
|
||||
|
||||
// Draw thumb
|
||||
var scrollColor = _thumbHot ? Colors.GreyHighlight : Colors.GreySelection;
|
||||
|
||||
if (_isScrolling)
|
||||
scrollColor = Colors.ActiveControl;
|
||||
|
||||
using (var b = new SolidBrush(scrollColor))
|
||||
{
|
||||
g.FillRectangle(b, _thumbArea);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
14
DarkUI/Controls/EventArgs/ScrollValueEventArgs.cs
Normal file
14
DarkUI/Controls/EventArgs/ScrollValueEventArgs.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace DarkUI
|
||||
{
|
||||
public class ScrollValueEventArgs : EventArgs
|
||||
{
|
||||
public int Value { get; private set; }
|
||||
|
||||
public ScrollValueEventArgs(int value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
}
|
||||
}
|
@ -49,12 +49,16 @@
|
||||
<Compile Include="Controls\DarkMenuStrip.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\DarkScrollBar.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\DarkStatusStrip.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\DarkToolStrip.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\EventArgs\ScrollValueEventArgs.cs" />
|
||||
<Compile Include="Extensions\BitmapExtensions.cs" />
|
||||
<Compile Include="Forms\DarkForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
@ -64,6 +68,11 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>MenuIcons.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Icons\ScrollIcons.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>ScrollIcons.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Renderers\DarkMenuRenderer.cs" />
|
||||
<Compile Include="Renderers\DarkToolStripRenderer.cs" />
|
||||
@ -74,6 +83,11 @@
|
||||
<LastGenOutput>MenuIcons.Designer.cs</LastGenOutput>
|
||||
<CustomToolNamespace>DarkUI</CustomToolNamespace>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Icons\ScrollIcons.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>ScrollIcons.Designer.cs</LastGenOutput>
|
||||
<CustomToolNamespace>DarkUI</CustomToolNamespace>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\grip.png" />
|
||||
@ -81,6 +95,18 @@
|
||||
<ItemGroup>
|
||||
<None Include="Resources\tick.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\scrollbar_arrow.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\scrollbar_arrow_clicked.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\scrollbar_arrow_hot.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\scrollbar_arrow_standard.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.
|
||||
|
103
DarkUI/Icons/ScrollIcons.Designer.cs
generated
Normal file
103
DarkUI/Icons/ScrollIcons.Designer.cs
generated
Normal file
@ -0,0 +1,103 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 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.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DarkUI {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// 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 ScrollIcons {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal ScrollIcons() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[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.ScrollIcons", typeof(ScrollIcons).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap scrollbar_arrow {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("scrollbar_arrow", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap scrollbar_arrow_clicked {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("scrollbar_arrow_clicked", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap scrollbar_arrow_hot {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("scrollbar_arrow_hot", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap scrollbar_arrow_standard {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("scrollbar_arrow_standard", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
133
DarkUI/Icons/ScrollIcons.resx
Normal file
133
DarkUI/Icons/ScrollIcons.resx
Normal file
@ -0,0 +1,133 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="scrollbar_arrow" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\scrollbar_arrow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="scrollbar_arrow_clicked" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\scrollbar_arrow_clicked.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="scrollbar_arrow_hot" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\scrollbar_arrow_hot.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="scrollbar_arrow_standard" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\scrollbar_arrow_standard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
BIN
DarkUI/Resources/scrollbar_arrow.png
Normal file
BIN
DarkUI/Resources/scrollbar_arrow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
BIN
DarkUI/Resources/scrollbar_arrow_clicked.png
Normal file
BIN
DarkUI/Resources/scrollbar_arrow_clicked.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
BIN
DarkUI/Resources/scrollbar_arrow_hot.png
Normal file
BIN
DarkUI/Resources/scrollbar_arrow_hot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
BIN
DarkUI/Resources/scrollbar_arrow_standard.png
Normal file
BIN
DarkUI/Resources/scrollbar_arrow_standard.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
46
Example/Forms/MainForm.Designer.cs
generated
46
Example/Forms/MainForm.Designer.cs
generated
@ -77,6 +77,9 @@
|
||||
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();
|
||||
@ -538,11 +541,51 @@
|
||||
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);
|
||||
@ -613,6 +656,9 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user