Exemple #1
0
 protected void DrawCheckBox(GraphicsCache cache, Rectangle r, bool?Checked)
 {
     DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo      info;
     DevExpress.XtraEditors.Drawing.CheckEditPainter        painter;
     DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs args;
     info           = edit.CreateViewInfo() as DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo;
     painter        = edit.CreatePainter() as DevExpress.XtraEditors.Drawing.CheckEditPainter;
     info.EditValue = Checked;
     info.Bounds    = r;
     info.CalcViewInfo();
     args = new DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs(info, cache, r);
     painter.Draw(args);
 }
Exemple #2
0
 protected void DrawCheckBox(Graphics g, RepositoryItemCheckEdit edit, Rectangle r, bool Checked)
 {
     DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo      info;
     DevExpress.XtraEditors.Drawing.CheckEditPainter        painter;
     DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs args;
     info           = edit.CreateViewInfo() as DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo;
     painter        = edit.CreatePainter() as DevExpress.XtraEditors.Drawing.CheckEditPainter;
     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();
 }
        protected void DrawCheckBox(Graphics g, Rectangle r, bool?Checked = null)
        {
            RepositoryItemCheckEdit chkedit = new RepositoryItemCheckEdit();

            DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo      info;
            DevExpress.XtraEditors.Drawing.CheckEditPainter        painter;
            DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs args;
            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();
        }
Exemple #4
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();
 }
Exemple #5
0
        /// <summary>
        /// 列头画多选框
        /// </summary>
        /// <param name="e"></param>
        /// <param name="chk"></param>

        private static void DrawCheckBox(DevExpress.XtraGrid.Views.Grid.ColumnHeaderCustomDrawEventArgs e, bool chk)
        {
            DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit repositoryCheck = e.Column.ColumnEdit as DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit;
            if (repositoryCheck != null)
            {
                System.Drawing.Graphics  g = e.Graphics;
                System.Drawing.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();
            }
        }
        protected void DrawCheckBox(Graphics g, Rectangle r, bool Checked)
        {
            if (!_desenharCheckBox)
                return;

            DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo info;
            DevExpress.XtraEditors.Drawing.CheckEditPainter painter;
            DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs args;
            info = edit.CreateViewInfo() as DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo;
            painter = edit.CreatePainter() as DevExpress.XtraEditors.Drawing.CheckEditPainter;
            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();
        }
Exemple #7
0
 protected override void DrawContent(DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs info)
 {
     DevExpress.XtraEditors.ViewInfo.BaseButtonViewInfo vi = info.ViewInfo as DevExpress.XtraEditors.ViewInfo.BaseButtonViewInfo;
     vi.ButtonInfo.DrawFocusRectangle = false;
     base.DrawContent(info);
 }
        /// <summary>
        /// 在列头设置为Checkbox样式
        /// </summary>
        /// <param name="e"></param>
        /// <param name="chk"></param>
        private 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();
            }
        }
Exemple #9
0
        protected void DrawCheckBox(Graphics g, Rectangle r, bool Checked)
        {
            DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo info;
            DevExpress.XtraEditors.Drawing.CheckEditPainter painter;
            DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs args;
            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();
        }