예제 #1
0
        public static void DrawCheckBox
            (DevExpress.XtraGrid.Views.Grid.ColumnHeaderCustomDrawEventArgs e, bool chk)
        {
            RepositoryItemCheckEdit repositoryCheck =
                e.Column.ColumnEdit as RepositoryItemCheckEdit;

            if (repositoryCheck != null)
            {
                Graphics  g = e.Graphics;
                Rectangle r = e.Bounds;

                DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo      info;
                DevExpress.XtraEditors.Drawing.CheckEditPainter        painter;
                DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs args;
                info = repositoryCheck.CreateViewInfo() as
                       DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo;

                painter = repositoryCheck.CreatePainter()
                          as DevExpress.XtraEditors.Drawing.CheckEditPainter;
                info.EditValue = chk;
                info.Bounds    = r;
                info.CalcViewInfo(g);
                args = new DevExpress.XtraEditors.
                       Drawing.ControlGraphicsInfoArgs(info, new DevExpress.Utils.Drawing.GraphicsCache(g), r);
                painter.Draw(args);
                args.Cache.Dispose();
            }
        }
        private void DrawCheckBox(Graphics g, Rectangle r, RepositoryItemCheckEdit checkEdit, CheckState state)
        {
            DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo      info;
            DevExpress.XtraEditors.Drawing.CheckEditPainter        painter;
            DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs args;
            checkEdit.AllowGrayed = true;

            info = checkEdit.CreateViewInfo() as DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo;
            if (state == CheckState.Unchecked)
            {
                info.EditValue = false;
            }
            else if (state == CheckState.Checked)
            {
                info.EditValue = true;
            }
            else
            {
                info.EditValue = null;
            }

            painter = checkEdit.CreatePainter() as DevExpress.XtraEditors.Drawing.CheckEditPainter;

            info.Bounds = r;
            info.PaintAppearance.ForeColor = Color.FromArgb(180, 180, 180);
            info.CalcViewInfo(g);
            args = new DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs(info, new DevExpress.Utils.Drawing.GraphicsCache(g), r);
            painter.Draw(args);
            args.Cache.Dispose();
        }
예제 #3
0
 private void CheckBoxEkle(GraphicsCache cache, Rectangle r, bool check)
 {
     var info = (CheckEditViewInfo)_checkEdit.CreateViewInfo();
     var painter = (CheckEditPainter)_checkEdit.CreatePainter();
     if (info == null) return;
     info.EditValue = check;
     info.Bounds = r;
     info.CalcViewInfo(cache.Graphics);
     var arg = new ControlGraphicsInfoArgs(info, cache, r);
     painter?.Draw(arg);
 }
예제 #4
0
 protected void DrawCheckBox(Graphics g, RepositoryItemCheckEdit edit, Rectangle r, bool Checked)
 {
     var info = edit.CreateViewInfo() as CheckEditViewInfo;
     var painter = edit.CreatePainter() as CheckEditPainter;
     info.EditValue = Checked;
     info.Bounds = r;
     info.CalcViewInfo(g);
     var args = new ControlGraphicsInfoArgs(info, new GraphicsCache(g), r);
     painter.Draw(args);
     args.Cache.Dispose();
 }
예제 #5
0
 protected void DrawCheckBox(Graphics g, Rectangle r, bool Checked)
 {
     DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo      info    = edit.CreateViewInfo() as DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo;
     DevExpress.XtraEditors.Drawing.CheckEditPainter        painter = edit.CreatePainter() as DevExpress.XtraEditors.Drawing.CheckEditPainter;
     DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs args;
     info.EditValue = Checked;
     info.Bounds    = r;
     info.CalcViewInfo(g);
     args = new DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs(info, new DevExpress.Utils.Drawing.GraphicsCache(g), r);
     painter.Draw(args);
     args.Cache.Dispose();
 }
예제 #6
0
        protected void DrawCheckBox(Graphics g, Rectangle r, bool Checked)
        {
            var info    = _edit.CreateViewInfo() as CheckEditViewInfo;
            var painter = _edit.CreatePainter() as CheckEditPainter;
            ControlGraphicsInfoArgs args;

            info.EditValue = Checked;
            info.Bounds    = r;
            info.CalcViewInfo(g);
            args = new ControlGraphicsInfoArgs(info, new GraphicsCache(g), r);
            painter.Draw(args);
            args.Cache.Dispose();
        }
예제 #7
0
        protected void DrawCheckBox(Graphics g, Rectangle r, bool @checked)
        {
            var info    = (CheckEditViewInfo)m_Edit.CreateViewInfo();
            var painter = (CheckEditPainter)m_Edit.CreatePainter();

            info.EditValue = @checked;
            info.Bounds    = r;
            info.CalcViewInfo(g);
            var args = new ControlGraphicsInfoArgs(info, new DevExpress.Utils.Drawing.GraphicsCache(g), r);

            painter.Draw(args);
            args.Cache.Dispose();
        }
        protected void DrawCheckBox(GraphicsCache cache, Rectangle r, bool Checked)
        {
            CheckEditViewInfo       info;
            CheckEditPainter        painter;
            ControlGraphicsInfoArgs args;

            info           = edit.CreateViewInfo() as CheckEditViewInfo;
            painter        = edit.CreatePainter() as CheckEditPainter;
            info.EditValue = Checked;
            info.Bounds    = r;
            info.CalcViewInfo(null);
            args = new ControlGraphicsInfoArgs(info, cache, r);
            painter.Draw(args);
        }
예제 #9
0
        private static void DrawHeaderCheckBox(RepositoryItemCheckEdit checkItem, Graphics g, Rectangle r, bool Checked)
        {
            CheckEditViewInfo       _info;
            CheckEditPainter        _painter;
            ControlGraphicsInfoArgs _args;

            _info           = checkItem.CreateViewInfo() as CheckEditViewInfo;
            _painter        = checkItem.CreatePainter() as CheckEditPainter;
            _info.EditValue = Checked;
            _info.Bounds    = r;
            _info.PaintAppearance.ForeColor = Color.Black;
            _info.CalcViewInfo(g);
            _args = new ControlGraphicsInfoArgs(_info, new DevExpress.Utils.Drawing.GraphicsCache(g), r);
            _painter.Draw(_args);
            _args.Cache.Dispose();
        }
예제 #10
0
        /// <summary>
        /// 画GridControl首列复选框
        /// </summary>
        /// <param name="g"></param>
        /// <param name="r"></param>
        /// <param name="Checked"></param>
        protected void DrawCheckBox(Graphics g, Rectangle r, bool Checked)
        {
            DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo      info;
            DevExpress.XtraEditors.Drawing.CheckEditPainter        painter;
            DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs args;
            RepositoryItemCheckEdit chkEdit = new RepositoryItemCheckEdit();

            info           = chkEdit.CreateViewInfo() as DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo;
            painter        = chkEdit.CreatePainter() as DevExpress.XtraEditors.Drawing.CheckEditPainter;
            info.EditValue = Checked;
            info.Bounds    = r;
            info.PaintAppearance.ForeColor = Color.Black;
            info.CalcViewInfo(g);
            args = new DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs(info, new DevExpress.Utils.Drawing.GraphicsCache(g), r);
            painter.Draw(args);
            args.Cache.Dispose();
        }
예제 #11
0
        protected void DrawCheckBox(Graphics g, Rectangle r, bool Checked)
        {
            var info    = _edit.CreateViewInfo() as CheckEditViewInfo;
            var painter = _edit.CreatePainter() as CheckEditPainter;

            if (info != null)
            {
                info.EditValue = Checked;
                info.Bounds    = r;
                info.CalcViewInfo(g);
                var args = new ControlGraphicsInfoArgs(info, new DevExpress.Utils.Drawing.GraphicsCache(g), r);
                if (painter != null)
                {
                    painter.Draw(args);
                }
                args.Cache.Dispose();
            }
        }
예제 #12
0
 protected void DrawCheckBox(Graphics g, Rectangle r, bool Checked, bool Grayed)
 {
     DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo      info    = default(DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo);
     DevExpress.XtraEditors.Drawing.CheckEditPainter        painter = default(DevExpress.XtraEditors.Drawing.CheckEditPainter);
     DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs args    = default(DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs);
     info    = (DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo)_CheckEdit.CreateViewInfo();
     painter = (DevExpress.XtraEditors.Drawing.CheckEditPainter)_CheckEdit.CreatePainter();
     if (Grayed)
     {
         info.EditValue = _CheckEdit.ValueGrayed;
     }
     else
     {
         info.EditValue = Checked;
     }
     info.Bounds = r;
     info.CalcViewInfo(g);
     args = new DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs(info, new DevExpress.Utils.Drawing.GraphicsCache(g), r);
     painter.Draw(args);
     args.Cache.Dispose();
 }
예제 #13
0
        void DrawCheckBox(Graphics g, Rectangle r, bool chk, bool colHeader)
        {
            CheckEditViewInfo       info    = (edit.CreateViewInfo() as CheckEditViewInfo);
            CheckEditPainter        painter = (edit.CreatePainter() as CheckEditPainter);
            ControlGraphicsInfoArgs args;

            info.EditValue = chk;
            if (colHeader)
            {
                r.Height += 20;
            }
            else
            {
                r.Width += 40;
            }
            info.Bounds = r;
            info.CalcViewInfo(g);
            args = new ControlGraphicsInfoArgs(info, new DevExpress.Utils.Drawing.GraphicsCache(g), r);
            painter.Draw(args);
            args.Cache.Dispose();
        }