mirror of
https://github.com/eggplantlwj/VisionEdit.git
synced 2026-03-26 18:11:33 +08:00
1、优化LOG显示与引用
2、添加PMA工具,工具内容待完善 3、修复流程树显示 4、添加开源项目,优化UI空间 5、其他BUG更改
This commit is contained in:
81
UsingControl/HZHControls/Controls/BtnsGroup/UCBtnsGroup.Designer.cs
generated
Normal file
81
UsingControl/HZHControls/Controls/BtnsGroup/UCBtnsGroup.Designer.cs
generated
Normal file
@@ -0,0 +1,81 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : HZH_Controls
|
||||
// Created : 08-15-2019
|
||||
//
|
||||
// ***********************************************************************
|
||||
// <copyright file="UCBtnsGroup.Designer.cs">
|
||||
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
|
||||
// </copyright>
|
||||
//
|
||||
// Blog: https://www.cnblogs.com/bfyx
|
||||
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
|
||||
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
|
||||
//
|
||||
// If you use this code, please keep this note.
|
||||
// ***********************************************************************
|
||||
namespace HZH_Controls.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UCBtnsGroup.
|
||||
/// Implements the <see cref="System.Windows.Forms.UserControl" />
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Windows.Forms.UserControl" />
|
||||
partial class UCBtnsGroup
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(420, 50);
|
||||
this.flowLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// UCBtnsGroup
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
this.Controls.Add(this.flowLayoutPanel1);
|
||||
this.MinimumSize = new System.Drawing.Size(0, 50);
|
||||
this.Name = "UCBtnsGroup";
|
||||
this.Size = new System.Drawing.Size(420, 50);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// The flow layout panel1
|
||||
/// </summary>
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
}
|
||||
}
|
||||
229
UsingControl/HZHControls/Controls/BtnsGroup/UCBtnsGroup.cs
Normal file
229
UsingControl/HZHControls/Controls/BtnsGroup/UCBtnsGroup.cs
Normal file
@@ -0,0 +1,229 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : HZH_Controls
|
||||
// Created : 08-15-2019
|
||||
//
|
||||
// ***********************************************************************
|
||||
// <copyright file="UCBtnsGroup.cs">
|
||||
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
|
||||
// </copyright>
|
||||
//
|
||||
// Blog: https://www.cnblogs.com/bfyx
|
||||
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
|
||||
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
|
||||
//
|
||||
// If you use this code, please keep this note.
|
||||
// ***********************************************************************
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace HZH_Controls.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UCBtnsGroup.
|
||||
/// Implements the <see cref="System.Windows.Forms.UserControl" />
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Windows.Forms.UserControl" />
|
||||
public partial class UCBtnsGroup : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 选中改变事件
|
||||
/// </summary>
|
||||
[Description("选中改变事件"), Category("自定义")]
|
||||
public event EventHandler SelectedItemChanged;
|
||||
/// <summary>
|
||||
/// The m data source
|
||||
/// </summary>
|
||||
private Dictionary<string, string> m_dataSource = new Dictionary<string, string>();
|
||||
/// <summary>
|
||||
/// 数据源
|
||||
/// </summary>
|
||||
/// <value>The data source.</value>
|
||||
[Description("数据源"), Category("自定义")]
|
||||
public Dictionary<string, string> DataSource
|
||||
{
|
||||
get { return m_dataSource; }
|
||||
set
|
||||
{
|
||||
m_dataSource = value;
|
||||
Reload();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The m select item
|
||||
/// </summary>
|
||||
private List<string> m_selectItem = new List<string>();
|
||||
/// <summary>
|
||||
/// 选中项
|
||||
/// </summary>
|
||||
/// <value>The select item.</value>
|
||||
[Description("选中项"), Category("自定义")]
|
||||
public List<string> SelectItem
|
||||
{
|
||||
get { return m_selectItem; }
|
||||
set
|
||||
{
|
||||
m_selectItem = value;
|
||||
if (m_selectItem == null)
|
||||
m_selectItem = new List<string>();
|
||||
SetSelected();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The m is multiple
|
||||
/// </summary>
|
||||
private bool m_isMultiple = false;
|
||||
/// <summary>
|
||||
/// 是否多选
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is multiple; otherwise, <c>false</c>.</value>
|
||||
[Description("是否多选"), Category("自定义")]
|
||||
public bool IsMultiple
|
||||
{
|
||||
get { return m_isMultiple; }
|
||||
set { m_isMultiple = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UCBtnsGroup" /> class.
|
||||
/// </summary>
|
||||
public UCBtnsGroup()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reloads this instance.
|
||||
/// </summary>
|
||||
private void Reload()
|
||||
{
|
||||
try
|
||||
{
|
||||
ControlHelper.FreezeControl(flowLayoutPanel1, true);
|
||||
this.flowLayoutPanel1.Controls.Clear();
|
||||
if (DataSource != null)
|
||||
{
|
||||
foreach (var item in DataSource)
|
||||
{
|
||||
UCBtnExt btn = new UCBtnExt();
|
||||
btn.BackColor = System.Drawing.Color.Transparent;
|
||||
btn.BtnBackColor = System.Drawing.Color.White;
|
||||
btn.BtnFont = new System.Drawing.Font("微软雅黑", 10F);
|
||||
btn.BtnForeColor = System.Drawing.Color.Gray;
|
||||
btn.BtnText = item.Value;
|
||||
btn.ConerRadius = 5;
|
||||
btn.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
btn.FillColor = System.Drawing.Color.White;
|
||||
btn.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
|
||||
btn.IsRadius = true;
|
||||
btn.IsShowRect = true;
|
||||
btn.IsShowTips = false;
|
||||
btn.Location = new System.Drawing.Point(5, 5);
|
||||
btn.Margin = new System.Windows.Forms.Padding(5);
|
||||
btn.Name = item.Key;
|
||||
btn.RectColor = System.Drawing.Color.FromArgb(224, 224, 224);
|
||||
btn.RectWidth = 1;
|
||||
btn.Size = new System.Drawing.Size(72, 38);
|
||||
btn.TabStop = false;
|
||||
btn.BtnClick += btn_BtnClick;
|
||||
this.flowLayoutPanel1.Controls.Add(btn);
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
ControlHelper.FreezeControl(flowLayoutPanel1, false);
|
||||
}
|
||||
SetSelected();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the BtnClick event of the btn control.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
|
||||
void btn_BtnClick(object sender, EventArgs e)
|
||||
{
|
||||
var btn = sender as UCBtnExt;
|
||||
if (m_selectItem.Contains(btn.Name))
|
||||
{
|
||||
btn.RectColor = System.Drawing.Color.FromArgb(224, 224, 224);
|
||||
m_selectItem.Remove(btn.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!m_isMultiple)
|
||||
{
|
||||
foreach (var item in m_selectItem)
|
||||
{
|
||||
var lst = this.flowLayoutPanel1.Controls.Find(item, false);
|
||||
if (lst.Length == 1)
|
||||
{
|
||||
var _btn = lst[0] as UCBtnExt;
|
||||
_btn.RectColor = System.Drawing.Color.FromArgb(224, 224, 224);
|
||||
}
|
||||
}
|
||||
m_selectItem.Clear();
|
||||
}
|
||||
btn.RectColor = System.Drawing.Color.FromArgb(255, 77, 59);
|
||||
m_selectItem.Add(btn.Name);
|
||||
}
|
||||
if (SelectedItemChanged != null)
|
||||
SelectedItemChanged(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the selected.
|
||||
/// </summary>
|
||||
private void SetSelected()
|
||||
{
|
||||
if (m_selectItem != null && m_selectItem.Count > 0 && DataSource != null && DataSource.Count > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
ControlHelper.FreezeControl(flowLayoutPanel1, true);
|
||||
if (m_isMultiple)
|
||||
{
|
||||
foreach (var item in m_selectItem)
|
||||
{
|
||||
var lst = this.flowLayoutPanel1.Controls.Find(item, false);
|
||||
if (lst.Length == 1)
|
||||
{
|
||||
var btn = lst[0] as UCBtnExt;
|
||||
btn.RectColor = System.Drawing.Color.FromArgb(255, 77, 59);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UCBtnExt btn = null;
|
||||
foreach (var item in m_selectItem)
|
||||
{
|
||||
var lst = this.flowLayoutPanel1.Controls.Find(item, false);
|
||||
if (lst.Length == 1)
|
||||
{
|
||||
btn = lst[0] as UCBtnExt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (btn != null)
|
||||
{
|
||||
m_selectItem = new List<string>() { btn.Name };
|
||||
btn.RectColor = System.Drawing.Color.FromArgb(255, 77, 59);
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
ControlHelper.FreezeControl(flowLayoutPanel1, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
UsingControl/HZHControls/Controls/BtnsGroup/UCBtnsGroup.resx
Normal file
120
UsingControl/HZHControls/Controls/BtnsGroup/UCBtnsGroup.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Reference in New Issue
Block a user