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.
128 lines
4.3 KiB
C#
128 lines
4.3 KiB
C#
// ***********************************************************************
|
|
// Assembly : Construction
|
|
// Author : flythink
|
|
// Created : 06-30-2020
|
|
//
|
|
// Last Modified By : flythink
|
|
// Last Modified On : 09-01-2020
|
|
// ***********************************************************************
|
|
// <copyright file="CustomSearchControl.cs" company="jindongfang">
|
|
// Copyright (c) jindongfang. All rights reserved.
|
|
// </copyright>
|
|
// <summary></summary>
|
|
// ***********************************************************************
|
|
|
|
namespace WellWorkDataUI.CustomControls
|
|
{
|
|
using DevExpress.XtraEditors;
|
|
using DevExpress.XtraEditors.Drawing;
|
|
using DevExpress.XtraEditors.Repository;
|
|
using DevExpress.XtraEditors.ViewInfo;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
|
|
/// <summary>
|
|
/// Class CustomSearchControl.
|
|
/// Implements the <see cref="DevExpress.XtraEditors.SearchControl" />
|
|
/// </summary>
|
|
/// <seealso cref="DevExpress.XtraEditors.SearchControl" />
|
|
public class CustomSearchControl : SearchControl
|
|
{
|
|
/// <summary>
|
|
/// Gets the painter.
|
|
/// </summary>
|
|
/// <value>The painter.</value>
|
|
protected override BaseControlPainter Painter
|
|
{
|
|
get
|
|
{
|
|
return HighDpiPainter.GetNewPainter(base.Painter);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Creates the repository item core.
|
|
/// </summary>
|
|
/// <returns>RepositoryItem.</returns>
|
|
protected override RepositoryItem CreateRepositoryItemCore()
|
|
{
|
|
return new CustomRepositoryItemSearchControl();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Updates the mask box properties.
|
|
/// </summary>
|
|
/// <param name="always">if set to <c>true</c> [always].</param>
|
|
protected override void UpdateMaskBoxProperties(bool always)
|
|
{
|
|
base.UpdateMaskBoxProperties(always);
|
|
|
|
this.MaskBox.Font = HightDpiHelper.ScaleFont(this.Font);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Class CustomSearchControlViewInfo.
|
|
/// Implements the <see cref="DevExpress.XtraEditors.ViewInfo.SearchControlViewInfo" />
|
|
/// </summary>
|
|
/// <seealso cref="DevExpress.XtraEditors.ViewInfo.SearchControlViewInfo" />
|
|
public class CustomSearchControlViewInfo : SearchControlViewInfo
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="CustomSearchControlViewInfo" /> class.
|
|
/// </summary>
|
|
/// <param name="item">The item.</param>
|
|
public CustomSearchControlViewInfo(RepositoryItem item)
|
|
: base(item)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the mask box rect.
|
|
/// </summary>
|
|
/// <value>The mask box rect.</value>
|
|
public override Rectangle MaskBoxRect
|
|
{
|
|
get
|
|
{
|
|
Rectangle bound = this.Bounds;
|
|
bound.Inflate(-2, -2);
|
|
|
|
return bound;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Class CustomRepositoryItemSearchControl.
|
|
/// Implements the <see cref="DevExpress.XtraEditors.Repository.RepositoryItemSearchControl" />
|
|
/// </summary>
|
|
/// <seealso cref="DevExpress.XtraEditors.Repository.RepositoryItemSearchControl" />
|
|
public class CustomRepositoryItemSearchControl : RepositoryItemSearchControl
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="CustomRepositoryItemSearchControl" /> class.
|
|
/// </summary>
|
|
public CustomRepositoryItemSearchControl()
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// This member supports the editors library's internal infrastructure and is not intended to be used in your applications.
|
|
/// </summary>
|
|
/// <returns>A <b>DevExpress.XtraEditors.ViewInfo.BaseEditViewInfo</b> descendant containing the editor's view information.</returns>
|
|
public override BaseEditViewInfo CreateViewInfo()
|
|
{
|
|
return new CustomSearchControlViewInfo(this);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Raises the query pop up.
|
|
/// </summary>
|
|
/// <param name="e">The <see cref="CancelEventArgs" /> instance containing the event data.</param>
|
|
protected override void RaiseQueryPopUp(CancelEventArgs e)
|
|
{
|
|
base.RaiseQueryPopUp(e);
|
|
}
|
|
}
|
|
} |