private void DrawQuickCustomisationIconCore(GridViewDrawArgs e, QuickCustomizationIcon icon, Rectangle bounds,
     QuickCustomisationIconStatusEnum status)
 {
     if (icon == null)
     {
         return;
     }
     var patchedRec = new Rectangle(bounds.X + 1, bounds.Y, bounds.Width - 1, bounds.Height);
     var args = new GridColumnInfoArgs(e.Cache, e.ViewInfo.ColumnsInfo[0].Column)
     {
         Cache = e.Cache,
         Bounds = patchedRec,
         HeaderPosition = HeaderPositionKind.Center
     };
     if (status == QuickCustomisationIconStatusEnum.Hot)
     {
         args.State = ObjectState.Hot;
     }
     ElementsPainter.Column.DrawObject(args);
     if (icon.Image == null)
     {
         icon.Image = Resources.Customization;
     }
     var rec = new Rectangle
     {
         Location = new Point(bounds.Left + (bounds.Width - icon.Image.Width) / 2, bounds.Top + (bounds.Height - icon.Image.Height) / 2),
         Size = new Size(icon.Image.Width, icon.Image.Height)
     };
     e.Graphics.PageUnit = GraphicsUnit.Pixel;
     e.Graphics.DrawImageUnscaled(icon.Image, rec);
 }
Exemple #2
0
        private void DrawQuickCustomisationIconCore(GridViewDrawArgs e, QuickCustomizationIcon icon, Rectangle bounds,
                                                    QuickCustomisationIconStatusEnum status)
        {
            if (icon == null)
            {
                return;
            }
            var patchedRec = new Rectangle(bounds.X + 1, bounds.Y, bounds.Width - 1, bounds.Height);
            var args       = new GridColumnInfoArgs(e.Cache, e.ViewInfo.ColumnsInfo[0].Column)
            {
                Cache          = e.Cache,
                Bounds         = patchedRec,
                HeaderPosition = HeaderPositionKind.Center
            };

            if (status == QuickCustomisationIconStatusEnum.Hot)
            {
                args.State = ObjectState.Hot;
            }
            ElementsPainter.Column.DrawObject(args);
            if (icon.Image == null)
            {
                icon.Image = Resources.Customization;
            }
            var rec = new Rectangle
            {
                Location = new Point(bounds.Left + (bounds.Width - icon.Image.Width) / 2, bounds.Top + (bounds.Height - icon.Image.Height) / 2),
                Size     = new Size(icon.Image.Width, icon.Image.Height)
            };

            e.Graphics.PageUnit = GraphicsUnit.Pixel;
            e.Graphics.DrawImageUnscaled(icon.Image, rec);
        }
 public CommonTreeListViewInfo(TreeList _treeList)
     : base(_treeList)
 {
     treeList = _treeList;
     QuickCustomisationIconStatus = QuickCustomisationIconStatusEnum.Hot;
 }
 public CommonGridViewInfo(GridView gridView)
     : base(gridView)
 {
     QuickCustomisationIconStatus = QuickCustomisationIconStatusEnum.Hot;
 }
 public CommonGridViewInfo(GridView gridView)
     : base(gridView)
 {
     QuickCustomisationIconStatus = QuickCustomisationIconStatusEnum.Hot;
 }