前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Naki.CI升级到1.0.6.5版

Naki.CI升级到1.0.6.5版

作者头像
天堂向左
发布2022-06-14 15:38:57
2990
发布2022-06-14 15:38:57
举报
文章被收录于专栏:天堂向左程序员向右

1

新功能介绍

Introduction to new functions

  1. 在PN码library界面增加了PN码多选功能,方便通过批量勾选进行删除操作,本来不想做这么琐碎的功能,结果自己用到这里发现没有还真不行。因为是PN码一般是批量生成,一错就是N个编码一起,一个一个地删除真是麻烦死了。这个复选框效果看着很简单,做起来细节非常多,你要做全乎了,还得把全选那个按钮做上,可真不是一般的麻烦,为此我还得专门自己写个复选框控件DataGridViewDisableCheckBoxCell(当然也是在网上大神的开源控件的基础上魔改的)

图1:PN码Library界面增加了复选框

图2:多选删除的效果演示

2

有关问题

Answer

Q1

关于DataGridViewDisableCheckBoxCell

自己魔改的一个开源checkbox控件,专门放在datagridview的行里作为行控件使用,包括head行用的也是这个,利用.net开发的优势,可以做各种复杂的控件效果。DataGridViewDisableCheckBoxCell控件的代码直接分享:

代码语言:javascript
复制
public class DataGridViewDisableCheckBoxCell : DataGridViewCheckBoxCell
{

    private bool enabledValue;
    /// <summary>  
    /// This property decides whether the checkbox should be shown checked or unchecked.  
    /// </summary>  
    public bool Enabled
    {
        get
        {
            return enabledValue;
        }
        set
        {
            enabledValue = value;
        }
    }
    /// Override the Clone method so that the Enabled property is copied.  
    public override object Clone()
    {
        DataGridViewDisableCheckBoxCell cell =
            (DataGridViewDisableCheckBoxCell)base.Clone();
        cell.Enabled = this.Enabled;
        return cell;
    }


    public DataGridViewDisableCheckBoxCell()
    {
        this.enabledValue = true;
    }

    protected override void Paint(Graphics graphics,
        Rectangle clipBounds, Rectangle cellBounds, int rowIndex,
        DataGridViewElementStates elementState, object value,
        object formattedValue, string errorText,
        DataGridViewCellStyle cellStyle,
        DataGridViewAdvancedBorderStyle advancedBorderStyle,
        DataGridViewPaintParts paintParts)
    {
        // The checkBox cell is disabled, so paint the border,  
        // background, and disabled checkBox for the cell.
        if (!this.enabledValue)
        {
            // Draw the cell background, if specified.
            if ((paintParts & DataGridViewPaintParts.Background) ==
                DataGridViewPaintParts.Background)
            {
                SolidBrush cellBackground =
                    new SolidBrush(cellStyle.BackColor);
                graphics.FillRectangle(cellBackground, cellBounds);
                cellBackground.Dispose();
            }

            // Draw the cell borders, if specified.
            if ((paintParts & DataGridViewPaintParts.Border) ==
                DataGridViewPaintParts.Border)
            {
                PaintBorder(graphics, clipBounds, cellBounds, cellStyle,
                    advancedBorderStyle);
            }

            // Calculate the area in which to draw the checkBox.
            CheckBoxState state = value.ToString() != "0" && (bool)value ?
                CheckBoxState.CheckedDisabled : CheckBoxState.UncheckedDisabled;
            Size size = CheckBoxRenderer.GetGlyphSize(graphics, state);
            Point center = new Point(cellBounds.X, cellBounds.Y);
            center.X += (cellBounds.Width - size.Width) / 2;
            center.Y += (cellBounds.Height - size.Height) / 2;

            // Draw the disabled checkBox.
            CheckBoxRenderer.DrawCheckBox(graphics, center, state);
        }
        else
        {
            // The checkBox cell is enabled, so let the base class 
            // handle the painting.
            base.Paint(graphics, clipBounds, cellBounds, rowIndex,
                elementState, value, formattedValue, errorText,
                cellStyle, advancedBorderStyle, paintParts);
        }
    }
}

3

什么是Naki.CI

What is Naki.CI

Naki.CI 是一个PDMS二次开发插件,执行一套简易的、可维护的编码规则,根据编码规则正向生成物资编码(CC码)和采购编码(PN码),编码信息写入到PDMS,出图和出材料表直接带编码和材料描述,打通设计建模和材料管理,一次性解决材料赋码问题。

4

Naki.CI介绍PPT

https://pan.baidu.com/s/1Ql_Qf9QWsYpU9J1KNtmwkg?pwd=ene9

Naki.CI视频《先睹为快》

https://www.bilibili.com/video/BV1m34y187es?share_source=copy_web

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2022-06-08,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 天堂向左程序员向右 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档