You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kev/Drawer/UCDraw/PcgDrawR_wellPole/WellWorkDataUI/CustomSplitContainerControl.cs

89 lines
3.1 KiB
C#

1 month ago
// ***********************************************************************
// Assembly : Construction
// Author : flythink
// Created : 06-29-2020
//
// Last Modified By : flythink
// Last Modified On : 09-01-2020
// ***********************************************************************
// <copyright file="CustomSplitContainerControl.cs" company="jindongfang">
// Copyright (c) jindongfang. All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
namespace WellWorkDataUI.CustomControls
{
using DevExpress.Utils.DPI;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Drawing;
using System;
using System.ComponentModel;
/// <summary>
/// Class CustomSplitContainerControl.
/// Implements the <see cref="DevExpress.XtraEditors.SplitContainerControl" />
/// </summary>
/// <seealso cref="DevExpress.XtraEditors.SplitContainerControl" />
public class CustomSplitContainerControl : SplitContainerControl
{
private ScaleHelper helper;
/// <summary>
/// Initializes a new instance of the <see cref="CustomSplitContainerControl" /> class.
/// </summary>
public CustomSplitContainerControl()
{
this.helper = ScaleHelper.CreateScaleHelperByDPI(this);
}
/// <summary>
/// Gets or sets the size of the splitter.
/// </summary>
/// <value>The size of the splitter.</value>
[Browsable(false)]
public int SplitterSize { get; set; } = 3;
/// <summary>
/// Gets the size of the scale splitter.
/// </summary>
/// <value>The size of the scale splitter.</value>
internal int ScaleSplitterSize => Convert.ToInt32(this.SplitterSize * this.helper.ScaleFactorVert);
/// <summary>
/// Creates the container information.
/// </summary>
/// <returns>SplitContainerViewInfo.</returns>
protected override SplitContainerViewInfo CreateContainerInfo()
{
return new CustomSplitContainerViewInfo(this);
}
/// <summary>
/// Class CustomSplitContainerViewInfo.
/// Implements the <see cref="DevExpress.XtraEditors.Drawing.SplitContainerViewInfo" />
/// </summary>
/// <seealso cref="DevExpress.XtraEditors.Drawing.SplitContainerViewInfo" />
public class CustomSplitContainerViewInfo : SplitContainerViewInfo
{
private CustomSplitContainerControl owner;
/// <summary>
/// Initializes a new instance of the <see cref="CustomSplitContainerViewInfo" /> class.
/// </summary>
/// <param name="container">The container.</param>
public CustomSplitContainerViewInfo(CustomSplitContainerControl container)
: base(container)
{
this.owner = container;
}
/// <inheritdoc/>
protected override int GetSplitterSize()
{
return this.owner.ScaleSplitterSize;
}
}
}
}