Source/Editors/VisualUpDownButton.cs

(开头部分) 16KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

#if FRAMEWORK20
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.ComponentModel;
using DevComponents.DotNetBar.Rendering;
using DevComponents.DotNetBar;

namespace DevComponents.Editors
{
    /// <summary>
    /// Represents the up down button which allows change of the value in currently focused input control.
    /// </summary>
    public class VisualUpDownButton : VisualButtonBase
    {
        #region Private Variables
        private bool _MouseOverButtonUp = false;
        private bool _MouseOverButtonDown = false;
        private bool _MouseDownButtonUp = false;
        private bool _MouseDownButtonDown = false;
        private Rectangle _DownButtonRectangle = Rectangle.Empty;
        private Rectangle _UpButtonRectangle = Rectangle.Empty;
        #endregion

        #region Events
        /// <summary>
        /// Occurs when Up part of the button has been clicked.
        /// </summary>
        public event EventHandler UpClick;
        /// <summary>
        /// Occurs when Down part of the button has been clicked.
        /// </summary>
        public event EventHandler DownClick;
        #endregion

        #region Constructor
        /// <summary>
        /// Initializes a new instance of the VisualUpDownButton class.
        /// </summary>
        public VisualUpDownButton()
        {
            this.Focusable = false;
            this.ClickAutoRepeat = true;
        }
        #endregion

        #region Internal Implementation
        public override void PerformLayout(PaintInfo pi)
        {
            int height = pi.AvailableSize.Height;
            if (height % 2 != 0)
                height++;
            Size size = new Size(_ButtonWidth, height);

            if (_UpImage != null && _DownImage != null)
                size.Width = Math.Max(_UpImage.Width, _DownImage.Width);

            this.Size = size;
            base.PerformLayout(pi);
后面还有 436 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。