亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? resizebar.cs

?? Magic Library 1.7,有說(shuō)明文檔
?? CS
字號(hào):
// *****************************************************************************
// 
//  (c) Crownwood Consulting Limited 2002 
//  All rights reserved. The software and associated documentation 
//  supplied hereunder are the proprietary information of Crownwood Consulting 
//	Limited, Haxey, North Lincolnshire, England and are supplied subject to 
//	licence terms.
// 
//  Magic Version 1.7 	www.dotnetmagic.com
// *****************************************************************************

using System;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using Crownwood.Magic.Common;
using Crownwood.Magic.Docking;

namespace Crownwood.Magic.Controls
{
    public interface IResizeSource
    {
        bool CanResize(ResizeBar bar);
        bool StartResizeOperation(ResizeBar bar, ref Rectangle screenBoundary);
        void EndResizeOperation(ResizeBar bar, int delta);
        Color ResizeBarColor { get; }
        int ResizeBarVector { get; }
        VisualStyle Style { get; }
        Color BackgroundColor { get; }
    }

    [ToolboxItem(false)]
    public class ResizeBar : Control
    {
        // Class constants
        protected static int _ideLength = 4;
        protected static int _plainLength = 6;

        // Instance fields
        protected VisualStyle _style;
        protected Direction _direction;
        protected bool _resizing;
        protected Point _pointStart;
        protected Point _pointCurrent;
        protected Rectangle _boundary;
        protected IResizeSource _resizeSource;

        public ResizeBar(Direction direction, IResizeSource resizeSource)
        {
            // Define initial state
            _direction = direction;
            _resizing = false;
            _resizeSource = resizeSource;

			// Always default to Control color
			this.BackColor = _resizeSource.ResizeBarColor;
			this.ForeColor = SystemColors.ControlText;

            UpdateStyle(_resizeSource.Style);
        }

        public VisualStyle Style
        {
            get { return _style; }

            set
            {
                if (_style != value)
                    UpdateStyle(value);
            }
        }

        public Direction Direction
        {
            get { return _direction; }

            set
            {
                if (_direction != value)
                {
                    _direction = value;
                    UpdateStyle(_style);
                }
            }
        }

        public int Length
        {
            get
            {
                int vector = _resizeSource.ResizeBarVector;
                
                if (vector == -1)
                {
                    if (_style == VisualStyle.IDE)
                        vector = _ideLength;
                    else 
                        vector = _plainLength;
                }
               
                return vector;
            }
            
            set
            {
                // If a change in vector...
                if (value != this.Length)
                {
                    // Force update of the height/width
                    UpdateStyle(_resizeSource.Style);
                }
            }
        }

        public virtual void PropogateNameValue(PropogateName name, object value)
        {
            if (name == PropogateName.ResizeBarVector)
                this.Length = (int)value;

            if (name == PropogateName.ResizeBarColor)
            {
                this.BackColor = (Color)value;
                Invalidate();
            }
        }
        
        protected void UpdateStyle(VisualStyle newStyle)
        {
            _style = newStyle;

            int vector = this.Length;

            if (_direction == Direction.Vertical)
                this.Height = vector;
            else
                this.Width = vector;

            Invalidate();
        }

        protected bool StartResizeOperation(MouseEventArgs e)
        {
            if (_resizeSource != null)
            {
                if (_resizeSource.CanResize(this))
                {
                    if (_resizeSource.StartResizeOperation(this, ref _boundary))
                    {
                        // Record the starting screen position
                        _pointStart = PointToScreen(new Point(e.X, e.Y));

                        // Record the current position being drawn
                        _pointCurrent = _pointStart;

                        // Draw the starting position
                        DrawResizeIndicator(_pointCurrent);

                        return true;
                    }
                }
            }

            return false;
        }

        protected void EndResizeOperation(MouseEventArgs e)
        {
            if (_resizeSource != null)
            {
                // Undraw the current position
                DrawResizeIndicator(_pointCurrent);

                // Find new screen position
                Point newCurrent = PointToScreen(new Point(e.X, e.Y));

                // Limit the extend the bar can be moved
                ApplyBoundaryToPoint(ref newCurrent);

                // Calculate delta from initial resize
                Point delta = new Point(newCurrent.X - _pointStart.X, 
                                        newCurrent.Y - _pointStart.Y);

                // Inform the Zone of requested change
                if (_direction == Direction.Horizontal)
                    _resizeSource.EndResizeOperation(this, delta.X);
                else
                    _resizeSource.EndResizeOperation(this, delta.Y);
            }

            _resizing = false;
        }

        protected void UpdateResizePosition(MouseEventArgs e)
        {
            // Find new screen position
            Point newCurrent = PointToScreen(new Point(e.X, e.Y));

            // Limit the extend the bar can be moved
            ApplyBoundaryToPoint(ref newCurrent);

            // Has change in position occured?
            if (newCurrent != _pointCurrent)
            {
                // Undraw the old position
                DrawResizeIndicator(_pointCurrent);

                // Record the new screen position
                _pointCurrent = newCurrent;

                // Draw the new position
                DrawResizeIndicator(_pointCurrent);
            }
        }
	
        protected void ApplyBoundaryToPoint(ref Point newCurrent)
        {
            // Calculate mouse position delta from mouse down
            Point delta = new Point(newCurrent.X - _pointStart.X, 
                newCurrent.Y - _pointStart.Y);
			
            // Get our dimensions in screen coordinates
            Rectangle client = RectangleToScreen(this.ClientRectangle);

            if (_direction == Direction.Horizontal)
            {
                client.Offset(delta.X, 0);

                // Test against left hand edge
                if (client.X < _boundary.X)
                    newCurrent.X += _boundary.X - client.X;
				
                // Test against right hand edge
                if (client.Right > _boundary.Right)
                    newCurrent.X -= client.Right - _boundary.Right;
            }
            else
            {
                client.Offset(0, delta.Y);

                // Test against top edge
                if (client.Y < _boundary.Y)
                    newCurrent.Y += _boundary.Y - client.Y;
				
                // Test against bottom edge
                if (client.Bottom > _boundary.Bottom)
                    newCurrent.Y -= client.Bottom - _boundary.Bottom;
            }		
        }

        protected void DrawResizeIndicator(Point screenPosition)
        {
            // Calculate mouse position delta from mouse down
            Point delta = new Point(screenPosition.X - _pointStart.X, 
                                    screenPosition.Y - _pointStart.Y);

            // Get our dimensions in screen coordinates
            Rectangle client = RectangleToScreen(this.ClientRectangle);

            if (_direction == Direction.Horizontal)
                client.Offset(delta.X, 0);
            else
                client.Offset(0, delta.Y);

            DrawHelper.DrawDragRectangle(client, 0);
        }

        protected override void OnMouseDown(MouseEventArgs e)
        {
            // Mouse down occured inside control
            _resizing = StartResizeOperation(e);

            base.OnMouseDown(e);
        }

        protected override void OnMouseUp(MouseEventArgs e)
        {
            // Currently in a resizing operation?
            if (_resizing)
            {
                // Reset resizing state
                EndResizeOperation(e);
            }

            base.OnMouseUp(e);
        }

        protected override void OnMouseMove(MouseEventArgs e)
        {
            if ((_resizeSource != null) && (_resizeSource.CanResize(this)))
            {
                // Display the correct mouse shape
                if (_direction == Direction.Vertical)
                    this.Cursor = Cursors.SizeNS;
                else
                    this.Cursor = Cursors.SizeWE;
            }
            else
                this.Cursor = Cursors.Arrow;

            // Currently in a resizing operation?
            if (_resizing)
            {
                UpdateResizePosition(e);
            }

            base.OnMouseMove(e);
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            // Plain style draws a 3D effect around edges
            if (_style == VisualStyle.Plain)
            {
                // Drawing is relative to client area
                Size ourSize = this.ClientSize;

                Point[] light = new Point[2];
                Point[] dark = new Point[2];
                Point[] black = new Point[2];

                // Painting depends on orientation
                if (_direction == Direction.Vertical)
                {
                    // Draw as a horizontal bar
                    dark[0].Y = dark[1].Y = ourSize.Height - 2;
                    black[0].Y = black[1].Y = ourSize.Height - 1;
                    light[1].X = dark[1].X = black[1].X = ourSize.Width;
                }
                else
                {
                    // Draw as a vertical bar
                    dark[0].X = dark[1].X = ourSize.Width - 2;
                    black[0].X = black[1].X = ourSize.Width - 1;
                    light[1].Y = dark[1].Y = black[1].Y = ourSize.Height;
                }

                using (Pen penLightLight = new Pen(ControlPaint.LightLight(_resizeSource.BackgroundColor)),
                           penDark = new Pen(ControlPaint.Dark(_resizeSource.BackgroundColor)),
                           penBlack = new Pen(ControlPaint.DarkDark(_resizeSource.BackgroundColor)))
                {
                    e.Graphics.DrawLine(penLightLight, light[0], light[1]);
                    e.Graphics.DrawLine(penDark, dark[0], dark[1]);
                    e.Graphics.DrawLine(penBlack, black[0], black[1]);
                }	
            }
				
            // Let delegates fire through base
            base.OnPaint(e);
        }
    }
    
    [ToolboxItem(false)]
    public class ResizeAutoBar : ResizeBar
    {
        public ResizeAutoBar(Direction direction, IResizeSource resizeSource)
            : base(direction, resizeSource) 
        {
        }    
            
        protected override void OnPaint(PaintEventArgs e)
        {
            Color backColor = this.BackColor;
        
            switch(this.Dock)
            {
                case DockStyle.Right:
                    using(Pen penD = new Pen(ControlPaint.Dark(backColor)),
                              penDD = new Pen(ControlPaint.DarkDark(backColor)))
                    {
                        e.Graphics.DrawLine(penD, this.Width - 2, 0, this.Width - 2, this.Height);
                        e.Graphics.DrawLine(penDD, this.Width - 1, 0, this.Width - 1, this.Height);
                    }
                    break;
                case DockStyle.Left:
                    using(Pen penLL = new Pen(ControlPaint.LightLight(backColor)))
                        e.Graphics.DrawLine(penLL, 1, 0, 1, this.Height);
                    break;
                case DockStyle.Bottom:
                    using(Pen penD = new Pen(ControlPaint.Dark(backColor)),
                              penDD = new Pen(ControlPaint.DarkDark(backColor)))
                    {
                        e.Graphics.DrawLine(penD, 0, this.Height - 2, this.Width, this.Height - 2);
                        e.Graphics.DrawLine(penDD, 0, this.Height - 1, this.Width, this.Height - 1);
                    }
                    break;
                case DockStyle.Top:
                    using(Pen penLL = new Pen(ControlPaint.LightLight(backColor)))
                        e.Graphics.DrawLine(penLL, 0, 1, this.Width, 1);
                    break;
            }
        }
    }
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲尤物在线视频观看| 精品一区二区三区在线播放| 国产精品久久久久一区| 久久久91精品国产一区二区三区| 欧美大片拔萝卜| 日韩一区二区三区视频| 91精品国产色综合久久不卡蜜臀 | 91色视频在线| av电影一区二区| 成人国产电影网| 成人app软件下载大全免费| 成人午夜av电影| 99久久99久久综合| 日本黄色一区二区| 欧美日韩一区二区三区不卡| 欧美久久免费观看| 欧美一区二区播放| 久久久久久亚洲综合| 国产日韩欧美a| 日韩久久一区二区| 亚洲大型综合色站| 日本一道高清亚洲日美韩| 裸体健美xxxx欧美裸体表演| 成人国产电影网| 在线免费观看成人短视频| 欧美日韩激情一区二区三区| 欧美一级黄色大片| 久久一二三国产| 国产精品家庭影院| 亚洲狠狠爱一区二区三区| 免费成人在线观看视频| 国产成人8x视频一区二区| 91香蕉视频黄| 91麻豆精品国产91久久久久久 | 欧美国产激情二区三区| 中文字幕综合网| 亚洲午夜私人影院| 免费人成网站在线观看欧美高清| 经典三级在线一区| 91小视频在线观看| 日韩欧美国产不卡| 亚洲欧美在线另类| 免费成人av在线播放| 成人综合在线网站| 欧美日韩久久一区| 欧美激情综合在线| 婷婷成人激情在线网| 国产乱码精品一区二区三区忘忧草| 97久久超碰国产精品电影| 欧美精品亚洲二区| 久久久久久久网| 亚洲视频一二三区| 蓝色福利精品导航| av激情综合网| 欧美欧美午夜aⅴ在线观看| 日韩美一区二区三区| 最近日韩中文字幕| 韩国av一区二区三区在线观看| 色综合久久精品| 久久久国产精品麻豆| 亚洲一区二区三区四区五区中文 | 国产成人综合在线| 欧美日韩一区二区三区在线看 | 一区二区三区欧美| 国产乱码精品一区二区三| 欧美日韩中字一区| 国产精品乱码久久久久久| 美女一区二区三区| 欧美综合天天夜夜久久| 欧美激情艳妇裸体舞| 免费观看成人鲁鲁鲁鲁鲁视频| 色偷偷一区二区三区| 国产亚洲成av人在线观看导航 | 欧美日韩久久久| 中文字幕一区视频| 国产一区二区三区不卡在线观看 | 天天综合天天综合色| www.综合网.com| 2023国产精品自拍| 琪琪久久久久日韩精品| 色噜噜狠狠一区二区三区果冻| 国产日韩精品一区二区三区在线| 日韩精品乱码免费| 欧美亚洲国产一区在线观看网站| 中文字幕日韩一区| 成人av在线一区二区| 久久精品日产第一区二区三区高清版 | 欧美美女bb生活片| 一区二区三区在线视频免费 | 欧美高清在线一区二区| 国产精品综合一区二区| 日韩视频在线永久播放| 三级欧美在线一区| 欧美日韩另类一区| 亚洲国产视频一区二区| 91搞黄在线观看| 一区二区三区在线观看欧美 | 久久蜜桃香蕉精品一区二区三区| 免费日本视频一区| 日韩免费在线观看| 精品午夜一区二区三区在线观看| 欧美一区二区三区视频免费播放| 性做久久久久久免费观看| 欧美日韩一级黄| 性久久久久久久| 欧美日韩电影在线播放| 日韩福利视频导航| 91精品国产综合久久精品麻豆| 亚洲第一福利一区| 欧美久久婷婷综合色| 麻豆精品在线看| 久久夜色精品国产噜噜av| 狠狠色综合日日| 国产色产综合色产在线视频| 成人午夜私人影院| 亚洲同性gay激情无套| 欧美亚洲综合另类| 天堂影院一区二区| 91超碰这里只有精品国产| 蜜桃av噜噜一区二区三区小说| 欧美大尺度电影在线| 国产乱子轮精品视频| 国产欧美日本一区视频| 一道本成人在线| 视频一区二区欧美| 久久影音资源网| 成人av网站大全| 亚洲成人一区在线| 日韩精品一区二区在线观看| 国内精品久久久久影院薰衣草| 国产精品久久精品日日| 91黄色免费观看| 人人精品人人爱| 欧美国产日韩精品免费观看| 一本久久a久久免费精品不卡| 亚洲va天堂va国产va久| 日本视频免费一区| 亚洲精品在线观看视频| 99久久国产综合精品女不卡| 亚洲国产精品一区二区久久| 日韩美女一区二区三区| av一二三不卡影片| 亚洲大片在线观看| 26uuu精品一区二区在线观看| 91视视频在线观看入口直接观看www| 午夜精品久久久久久久99水蜜桃 | 日韩一区二区视频| aaa欧美大片| 日韩精品欧美精品| 国产精品久久福利| 日韩欧美国产小视频| 92精品国产成人观看免费| 美女性感视频久久| 亚洲精品一二三四区| 精品国产乱码久久久久久闺蜜| 99久久精品国产导航| 美国欧美日韩国产在线播放| 中文字幕在线不卡一区二区三区| 欧美高清视频不卡网| 成人三级伦理片| 免费高清不卡av| 亚洲精品v日韩精品| 久久精品一区八戒影视| 欧美日韩亚州综合| 蜜臀精品一区二区三区在线观看| 精品视频免费看| 国产一区在线观看麻豆| 亚洲天堂福利av| 精品久久国产老人久久综合| av资源网一区| 国产精品资源网| 免费xxxx性欧美18vr| 一区二区三区在线看| 久久精品视频免费观看| 在线亚洲人成电影网站色www| 亚洲乱码中文字幕| 国产在线精品一区二区| 亚洲欧美日韩人成在线播放| 亚洲精品一区二区三区99| 欧美三级电影精品| 99久精品国产| 成人午夜视频在线观看| 国内精品视频666| 日韩福利电影在线| 亚洲高清视频在线| 国产精品夫妻自拍| 久久久久久99久久久精品网站| 色综合色综合色综合| a级精品国产片在线观看| 国产一区二区精品久久99| 亚洲成av人在线观看| 亚洲人成在线观看一区二区| 91精品国产aⅴ一区二区| 欧美艳星brazzers| 色菇凉天天综合网| 91猫先生在线| 99国产精品一区| 91偷拍与自偷拍精品| 成人一级片在线观看| 国产一区二区视频在线|