Exemplo n.º 1
0
        protected override void OnRenderSkinFormControlBox(SkinFormControlBoxRenderEventArgs e)
        {
            FormBase        form           = e.Form;
            Graphics        g              = e.Graphics;
            Rectangle       clipRectangle  = e.ClipRectangle;
            ControlBoxState controlBoxtate = e.ControlBoxtate;
            CmSysButton     cmSysButton    = e.CmSysButton;
            bool            active         = e.Active;
            bool            minimizeBox    = form.ControlBox && form.MinimizeBox;
            bool            maximizeBox    = form.ControlBox && form.MaximizeBox;

            switch (e.ControlBoxStyle)
            {
            case ControlBoxStyle.Minimize:
                this.RenderSkinFormMinimizeBoxInternal(g, clipRectangle, controlBoxtate, active, form);
                return;

            case ControlBoxStyle.Maximize:
                this.RenderSkinFormMaximizeBoxInternal(g, clipRectangle, controlBoxtate, active, minimizeBox, form.WindowState == FormWindowState.Maximized, form);
                return;

            case ControlBoxStyle.Close:
                this.RenderSkinFormCloseBoxInternal(g, clipRectangle, controlBoxtate, active, minimizeBox, maximizeBox, form);
                return;

            case ControlBoxStyle.CmSysBottom:
                this.RenderSkinFormCmSysBottomInternal(g, clipRectangle, controlBoxtate, active, form, cmSysButton);
                return;
            }
        }
Exemplo n.º 2
0
        public void Remove(CmSysButton item)
        {
            int index = this.IndexOf(item);

            if (-1 != index)
            {
                this.RemoveAt(index);
            }
        }
Exemplo n.º 3
0
 public SkinFormControlBoxRenderEventArgs(Forms.FormBase form, Graphics graphics, Rectangle clipRect, bool active, ControlBoxStyle controlBoxStyle, ControlBoxState controlBoxState, CmSysButton cmSysbutton = null)
     : base(graphics, clipRect)
 {
     this._form            = form;
     this._active          = active;
     this._controlBoxState = controlBoxState;
     this._controlBoxStyle = controlBoxStyle;
     this._CmSysbutton     = cmSysbutton;
 }
Exemplo n.º 4
0
 private void EnsureSpace(int elements)
 {
     if (this.m_arrItem == null)
     {
         this.m_arrItem = new CmSysButton[Math.Max(elements, 4)];
     }
     else if ((this.count + elements) > this.m_arrItem.Length)
     {
         CmSysButton[] array = new CmSysButton[Math.Max((int)(this.count + elements), (int)(this.m_arrItem.Length * 2))];
         this.m_arrItem.CopyTo(array, 0);
         this.m_arrItem = array;
     }
 }
Exemplo n.º 5
0
 public void Add(CmSysButton item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("Item cannot be null");
     }
     this.EnsureSpace(1);
     if (-1 == this.IndexOf(item))
     {
         item.OwnerForm = this.owner;
         this.m_arrItem[this.count++] = item;
         this.owner.Invalidate();
     }
 }
Exemplo n.º 6
0
 public void Insert(int index, CmSysButton item)
 {
     if ((index < 0) || (index >= this.count))
     {
         throw new IndexOutOfRangeException("Index was outside the bounds of the array");
     }
     if (item == null)
     {
         throw new ArgumentNullException("Item cannot be null");
     }
     this.EnsureSpace(1);
     for (int i = this.count; i > index; i--)
     {
         this.m_arrItem[i] = this.m_arrItem[i - 1];
     }
     item.OwnerForm        = this.owner;
     this.m_arrItem[index] = item;
     this.count++;
     this.owner.Invalidate();
 }
Exemplo n.º 7
0
 public int IndexOf(CmSysButton item)
 {
     return(Array.IndexOf <CmSysButton>(this.m_arrItem, item));
 }
Exemplo n.º 8
0
 public bool Contains(CmSysButton item)
 {
     return(this.IndexOf(item) != -1);
 }
Exemplo n.º 9
0
        private void RenderSkinFormCmSysBottomInternal(Graphics g, Rectangle rect, ControlBoxState state, bool active, FormBase form, CmSysButton cmSysButton)
        {
            Bitmap image            = null;
            Color  controlBoxActive = this.ColorTable.ControlBoxActive;

            if (cmSysButton.BoxState == ControlBoxState.Pressed)
            {
                image            = (Bitmap)cmSysButton.SysButtonDown;
                controlBoxActive = this.ColorTable.ControlBoxPressed;
            }
            else if (state == ControlBoxState.Hover)
            {
                image            = (Bitmap)cmSysButton.SysButtonMouse;
                controlBoxActive = this.ColorTable.ControlBoxHover;
            }
            else
            {
                image            = (Bitmap)cmSysButton.SysButtonNorml;
                controlBoxActive = active ? this.ColorTable.ControlBoxActive : this.ColorTable.ControlBoxDeactive;
            }
            if (image != null)
            {
                g.DrawImage(image, rect);
            }
            else
            {
                RoundStyle bottomLeft = RoundStyle.BottomLeft;
                using (new AntiAliasGraphics(g))
                {
                    RenderHelper.RenderBackgroundInternal(g, rect, controlBoxActive, controlBoxActive, this.ColorTable.ControlBoxInnerBorder, bottomLeft, 6, 0.38f, true, false, LinearGradientMode.Vertical);
                    using (Pen pen = new Pen(this.ColorTable.Border))
                    {
                        g.DrawLine(pen, rect.X, rect.Y, rect.Right, rect.Y);
                    }
                }
            }
        }
Exemplo n.º 10
0
 public SysButtonEventArgs(CmSysButton sysButton)
 {
     this.SysButton = sysButton;
 }