Initial commit
This commit is contained in:
23
Handler/Sub/arFrameControl/GridView/ColorListItem.cs
Normal file
23
Handler/Sub/arFrameControl/GridView/ColorListItem.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace arFrame.Control
|
||||
{
|
||||
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
|
||||
public class ColorListItem
|
||||
{
|
||||
public System.Drawing.Color BackColor1 { get; set; }
|
||||
public System.Drawing.Color BackColor2 { get; set; }
|
||||
public string Remark { get; set; }
|
||||
|
||||
public ColorListItem()
|
||||
{
|
||||
BackColor1 = System.Drawing.Color.Transparent;
|
||||
BackColor2 = System.Drawing.Color.Transparent;
|
||||
Remark = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
50
Handler/Sub/arFrameControl/GridView/GridItem.cs
Normal file
50
Handler/Sub/arFrameControl/GridView/GridItem.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace arFrame.Control
|
||||
{
|
||||
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
|
||||
public class GridViewItem
|
||||
{
|
||||
public int row { get; private set; }
|
||||
public int col { get; private set; }
|
||||
|
||||
public int idx { get; private set; }
|
||||
[Category("arFrame"), DisplayName("Tag")]
|
||||
public string Tag { get; set; }
|
||||
[Category("arFrame"), DisplayName("글자 정렬 방식")]
|
||||
public System.Drawing.ContentAlignment TextAlign { get; set; }
|
||||
[Category("arFrame"), DisplayName("글자 여백")]
|
||||
public System.Windows.Forms.Padding Padding { get; set; }
|
||||
[Category("arFrame"), DisplayName("메뉴 사용여부"), Description("활성화시 메뉴의 클릭이벤트가 발생하지 않습니다")]
|
||||
public Boolean Enable { get; set; }
|
||||
|
||||
public System.Drawing.Color BackColor1 { get; set; }
|
||||
public System.Drawing.Color BackColor2 { get; set; }
|
||||
|
||||
public Boolean Dirty { get; set; }
|
||||
|
||||
public System.Drawing.RectangleF rect { get; set; }
|
||||
|
||||
[Category("arFrame"), DisplayName("번호")]
|
||||
public int No { get; set; }
|
||||
|
||||
public GridViewItem(int idx_,int _r,int _c)
|
||||
{
|
||||
this.row = _r;
|
||||
this.col = _c;
|
||||
BackColor1 = System.Drawing.Color.Transparent;
|
||||
BackColor2 = System.Drawing.Color.Transparent;
|
||||
rect = System.Drawing.RectangleF.Empty;
|
||||
Enable = true;
|
||||
this.idx = idx_;
|
||||
TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
Padding = new System.Windows.Forms.Padding(0, 0, 0, 0);
|
||||
No = 0;
|
||||
this.Dirty = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Handler/Sub/arFrameControl/GridView/GridView.Designer.cs
generated
Normal file
36
Handler/Sub/arFrameControl/GridView/GridView.Designer.cs
generated
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace arFrame.Control
|
||||
{
|
||||
partial class GridView
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
632
Handler/Sub/arFrameControl/GridView/GridView.cs
Normal file
632
Handler/Sub/arFrameControl/GridView/GridView.cs
Normal file
@@ -0,0 +1,632 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace arFrame.Control
|
||||
{
|
||||
public partial class GridView : System.Windows.Forms.Control
|
||||
{
|
||||
private int bordersize = 0;
|
||||
private int menubordersize = 1;
|
||||
private int menugap = 5;
|
||||
private System.Windows.Forms.Padding padding = new Padding(3, 3, 3, 3);
|
||||
private System.Drawing.Color backcolor = System.Drawing.Color.White;
|
||||
private System.Drawing.Color bordercolor = System.Drawing.Color.Black;
|
||||
private Boolean textattachtoimage = true;
|
||||
private Boolean _showIndexString = true;
|
||||
|
||||
private System.Drawing.Color _shadowColor = System.Drawing.Color.Transparent;
|
||||
private System.Drawing.Color foreColorPin = System.Drawing.Color.WhiteSmoke;
|
||||
private System.Drawing.Font fontPin = new Font("Consolas", 8, FontStyle.Bold);
|
||||
|
||||
private Point _matrixsize = new Point(8, 2);
|
||||
public Point MatrixSize { get { return _matrixsize; } set { _matrixsize = value; ResetArray(); RemakeChartRect(); } }
|
||||
|
||||
public Boolean arVeriticalDraw { get; set; }
|
||||
|
||||
[Browsable(false)]
|
||||
public int ColumnCount { get { return _matrixsize.X; } }
|
||||
[Browsable(false)]
|
||||
public int RowCount { get { return _matrixsize.Y; } }
|
||||
public int ItemCount { get { return ColumnCount * RowCount; } }
|
||||
|
||||
private GridViewItem[] Items;
|
||||
|
||||
private UInt16[] _values;
|
||||
private string[] _titles;
|
||||
private string[] _tags;
|
||||
private string[] _names;
|
||||
private ColorListItem[] _colorlist;
|
||||
public ColorListItem[] ColorList { get { return _colorlist; } set { _colorlist = value; this.Invalidate(); } }
|
||||
|
||||
public string[] Names { get { return _names; } set { _names = value; Invalidate(); } }
|
||||
public string[] Titles { get { return _titles; } set { _titles = value; Invalidate(); } }
|
||||
public UInt16[] Values { get { return _values; } set { _values = value; Invalidate(); } }
|
||||
public string[] Tags { get { return _tags; } set { _tags = value; } }
|
||||
|
||||
private bool _showdebuginfo = false;
|
||||
public Boolean showDebugInfo { get { return _showdebuginfo; } set { _showdebuginfo = value; Invalidate(); } }
|
||||
|
||||
public void setNames(string[] value)
|
||||
{
|
||||
_names = value;
|
||||
}
|
||||
|
||||
public void setTitle(string[] value)
|
||||
{
|
||||
List<string> titlerows = new List<string>();
|
||||
List<string> tagrows = new List<string>();
|
||||
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
var r = (int)(Math.Floor((double)(i / ColumnCount)));
|
||||
var c = i % ColumnCount;
|
||||
|
||||
//세로 그리기 였을때에는 다르게 처리해야함 201215
|
||||
if(arVeriticalDraw)
|
||||
{
|
||||
c = (int)(Math.Floor((double)(i / ColumnCount)));
|
||||
r = i % ColumnCount;
|
||||
}
|
||||
|
||||
if (titlerows.Count < r + 1) titlerows.Add(string.Empty);
|
||||
if (tagrows.Count < r + 1) tagrows.Add(string.Empty);
|
||||
|
||||
var prestr = titlerows[r];
|
||||
if (c > 0 ) prestr += "|";
|
||||
titlerows[r] = prestr + value[i];
|
||||
|
||||
var prestr_t = tagrows[r];
|
||||
if (prestr_t != "") prestr_t += "|";
|
||||
tagrows[r] = prestr_t + "";
|
||||
|
||||
if (i < itemCount) this.Items[i].Enable = true;
|
||||
}
|
||||
this._titles = titlerows.ToArray();
|
||||
this._tags = tagrows.ToArray();
|
||||
}
|
||||
public void setTags(string[] value)
|
||||
{
|
||||
List<string> titlerows = new List<string>();
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
var r = (int)(Math.Floor((double)(i / ColumnCount)));
|
||||
var c = i % ColumnCount;
|
||||
if (titlerows.Count < r + 1) titlerows.Add(string.Empty);
|
||||
var prestr = titlerows[r];
|
||||
if (c > 0 ) prestr += "|";
|
||||
titlerows[r] = prestr + value[i];
|
||||
if (i < itemCount) this.Items[i].Enable = true;
|
||||
}
|
||||
this._tags = titlerows.ToArray();
|
||||
}
|
||||
public Boolean setTitle(int row, int col, string value, string itemtag = "")
|
||||
{
|
||||
if (_titles == null) _titles = new string[0];
|
||||
if (_tags == null) _tags = new string[0];
|
||||
|
||||
if (row >= _titles.Length) Array.Resize(ref _titles, row + 1);
|
||||
if (row >= _tags.Length) Array.Resize(ref _tags, row + 1);
|
||||
|
||||
if (_titles[row] == null) _titles[row] = string.Empty;
|
||||
if (_tags[row] == null) _tags[row] = string.Empty;
|
||||
|
||||
var linebuf = _titles[row].Split('|');
|
||||
var linebuf_t = _tags[row].Split('|');
|
||||
|
||||
if (col >= linebuf.Length) Array.Resize(ref linebuf, col + 1);
|
||||
if (col >= linebuf_t.Length) Array.Resize(ref linebuf_t, col + 1);
|
||||
|
||||
linebuf[col] = value;
|
||||
linebuf_t[col] = itemtag;
|
||||
|
||||
_titles[row] = string.Join("|", linebuf);
|
||||
_tags[row] = string.Join("|", linebuf_t);
|
||||
return true;
|
||||
//var idx = row * this.ColumnCount + col;
|
||||
//return setTitle(idx, value);
|
||||
}
|
||||
public Boolean setTitle(int idx, string value)
|
||||
{
|
||||
if (idx < ColumnCount) return setTitle(0, idx, value);
|
||||
else
|
||||
{
|
||||
//줄값이 필요하다
|
||||
var row = (int)(Math.Floor((double)(idx / ColumnCount)));
|
||||
var col = idx % ColumnCount;
|
||||
return setTitle(row, col, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setValue(bool[] value)
|
||||
{
|
||||
var v = new UInt16[value.Length];
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
v[i] = (UInt16)(value[i] ? 1 : 0);
|
||||
_values = v;
|
||||
|
||||
//값이 잇으니 enable 한다
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
if (i < Items.Length)
|
||||
this.Items[i].Enable = true;
|
||||
}
|
||||
|
||||
}
|
||||
public void setValue(UInt16[] value)
|
||||
{
|
||||
_values = value;
|
||||
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
if (i < Items.Length)
|
||||
this.Items[i].Enable = true;
|
||||
}
|
||||
|
||||
}
|
||||
public Boolean setValue(int idx, ushort value)
|
||||
{
|
||||
if (idx >= _values.Length || idx >= this.Items.Length) return false;
|
||||
this._values[idx] = value;
|
||||
this.Items[idx].Enable = true;
|
||||
return true;
|
||||
}
|
||||
public void ClearValue(ushort defaultValue = 0)
|
||||
{
|
||||
if (_values != null)
|
||||
for (int i = 0; i < _values.Length; i++)
|
||||
_values[i] = defaultValue;
|
||||
}
|
||||
public void ClearTitle(string defaultValue = "")
|
||||
{
|
||||
if (_values != null)
|
||||
for (int i = 0; i < _titles.Length; i++)
|
||||
_titles[i] = defaultValue;
|
||||
}
|
||||
|
||||
public void setValue(ushort value)
|
||||
{
|
||||
for (int i = 0; i < _values.Length; i++)
|
||||
this._values[i] = value;
|
||||
}
|
||||
public void setItemEnable(int idx, bool value)
|
||||
{
|
||||
if (idx >= _values.Length || idx >= this.Items.Length) return;
|
||||
this.Items[idx].Enable = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 지정된 컬러태그값을 입력한다.
|
||||
/// </summary>
|
||||
/// <param name="idx"></param>
|
||||
/// <param name="tagString"></param>
|
||||
/// <returns></returns>
|
||||
public Boolean setValue(int idx, string tagString)
|
||||
{
|
||||
//동일태그값을 찾는다
|
||||
if (idx >= _values.Length) return false;
|
||||
|
||||
int value = -1;
|
||||
for (int i = 0; i < ColorList.Length; i++)
|
||||
if (ColorList[i].Remark.ToLower() == tagString.ToLower())
|
||||
{
|
||||
value = i;
|
||||
break;
|
||||
}
|
||||
|
||||
if (value != -1)
|
||||
{
|
||||
this._values[idx] = (ushort)value;
|
||||
this.Items[idx].Enable = true;
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
|
||||
|
||||
}
|
||||
public Boolean setValue(int idx, bool value)
|
||||
{
|
||||
return setValue(idx, (ushort)(value ? 1 : 0));
|
||||
}
|
||||
public Boolean setValue(int row, int col, ushort value)
|
||||
{
|
||||
var idx = row * this.ColumnCount + col;
|
||||
return setValue(idx, value);
|
||||
}
|
||||
public Boolean setValueToggle(int row, int col, ushort value1, ushort value2)
|
||||
{
|
||||
var idx = row * this.ColumnCount + col;
|
||||
if (getValue(idx) == value1) return setValue(idx, value2);
|
||||
else return setValue(idx, value1);
|
||||
}
|
||||
public Boolean setValue(int row, int col, bool value)
|
||||
{
|
||||
var idx = row * this.ColumnCount + col;
|
||||
return setValue(idx, (ushort)(value ? 1 : 0));
|
||||
}
|
||||
public Boolean setValue(int row, int col, string value)
|
||||
{
|
||||
var idx = row * this.ColumnCount + col;
|
||||
return setValue(idx, value);
|
||||
}
|
||||
|
||||
public ushort getValue(int idx)
|
||||
{
|
||||
if (idx >= _values.Length) return 0;
|
||||
return _values[idx];
|
||||
}
|
||||
public ushort getValue(int row, int col)
|
||||
{
|
||||
var idx = row * this.ColumnCount + col;
|
||||
return getValue(idx);
|
||||
}
|
||||
|
||||
[Category("arFrame")]
|
||||
public bool ShowIndexString { get { return _showIndexString; } set { _showIndexString = value; Invalidate(); } }
|
||||
|
||||
[Category("arFrame"), DisplayName("테두리 굵기")]
|
||||
public int BorderSize { get { return bordersize; } set { this.bordersize = value; Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("메뉴 테두리 굵기")]
|
||||
public int MenuBorderSize { get { return menubordersize; } set { this.menubordersize = value; Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("메뉴 간격")]
|
||||
public int MenuGap { get { return menugap; } set { this.menugap = value; RemakeChartRect(); Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("글자를 이미지 다음에 표시"), Description("이미지가 있는 경우 해당 이미지 옆에 글자를 붙입니다")]
|
||||
public Boolean TextAttachToImage { get { return textattachtoimage; } set { this.textattachtoimage = value; Invalidate(); } }
|
||||
|
||||
[Category("arFrame"), DisplayName("색상-테두리")]
|
||||
public System.Drawing.Color BorderColor { get { return bordercolor; } set { this.bordercolor = value; Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("내부 여백")]
|
||||
public new System.Windows.Forms.Padding Padding { get { return padding; } set { this.padding = value; RemakeChartRect(); Invalidate(); } }
|
||||
|
||||
[Category("arFrame"), DisplayName("색상-전체배경색")]
|
||||
public override System.Drawing.Color BackColor { get { return backcolor; } set { this.backcolor = value; Invalidate(); } }
|
||||
|
||||
[Category("arFrame"), DisplayName("색상-글자(그림자)")]
|
||||
public System.Drawing.Color ShadowColor { get { return _shadowColor; } set { _shadowColor = value; this.Invalidate(); } }
|
||||
|
||||
[Category("arFrame"), DisplayName("색상-글자")]
|
||||
public override Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } }
|
||||
|
||||
[Category("arFrame"), DisplayName("색상-글자(번호)")]
|
||||
public Color ForeColorPin { get { return foreColorPin; } set { foreColorPin = value; } }
|
||||
|
||||
[Category("arFrame"), DisplayName("글꼴-번호")]
|
||||
public Font FontPin { get { return fontPin; } set { fontPin = value; Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("글꼴-항목")]
|
||||
public override Font Font { get { return base.Font; } set { base.Font = value; Invalidate(); } }
|
||||
|
||||
private int mouseOverItemIndex = -1;
|
||||
public GridView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// Set Optimized Double Buffer to reduce flickering
|
||||
this.SetStyle(ControlStyles.UserPaint, true);
|
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
|
||||
// Redraw when resized
|
||||
this.SetStyle(ControlStyles.ResizeRedraw, true);
|
||||
|
||||
//값과 이름은 외부의 값을 사용한다
|
||||
ResetArray();
|
||||
|
||||
if (MinimumSize.Width == 0 || MinimumSize.Height == 0)
|
||||
MinimumSize = new Size(100, 50);
|
||||
}
|
||||
|
||||
|
||||
void ResetArray()
|
||||
{
|
||||
if (this._values != null) Array.Resize(ref this._values, itemCount);// = new UInt16[itemCount];
|
||||
// if (this._titles != null) Array.Resize(ref this._titles, itemCount);//
|
||||
// if (this._names != null) Array.Resize(ref this._names, itemCount);//
|
||||
}
|
||||
|
||||
int itemCount { get { return ColumnCount * RowCount; } }
|
||||
protected override void OnSizeChanged(EventArgs e)
|
||||
{
|
||||
base.OnSizeChanged(e);
|
||||
RemakeChartRect();
|
||||
}
|
||||
|
||||
public event EventHandler<ItemClickEventArgs> ItemClick;
|
||||
public class ItemClickEventArgs : EventArgs
|
||||
{
|
||||
public int idx { get; set; }
|
||||
public GridViewItem Item { get; set; }
|
||||
public ItemClickEventArgs(int idx_, GridViewItem item)
|
||||
{
|
||||
this.Item = item;
|
||||
this.idx = idx_;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseClick(MouseEventArgs e)
|
||||
{
|
||||
//마우스클릭시 해당 버튼을 찾아서 반환한다.
|
||||
if (Items == null || Items.Length < 1) return;
|
||||
for (int i = 0; i < Items.Length; i++)
|
||||
{
|
||||
var rect = Items[i].rect;//[i];
|
||||
if (rect.Contains(e.Location))
|
||||
{
|
||||
var menu = Items[i];
|
||||
|
||||
//미사용개체는 이벤트를 아에 발생하지 않는다
|
||||
if (menu.Enable == true && ItemClick != null)
|
||||
ItemClick(this, new ItemClickEventArgs(i, menu));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseLeave(EventArgs e)
|
||||
{
|
||||
this.mouseOverItemIndex = -1;
|
||||
this.Invalidate();
|
||||
}
|
||||
protected override void OnMouseMove(MouseEventArgs e)
|
||||
{
|
||||
if (Items == null || Items.Length < 1)
|
||||
{
|
||||
this.mouseOverItemIndex = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < Items.Length; i++)
|
||||
{
|
||||
var rect = Items[i].rect;// rects[i];
|
||||
if (rect.Contains(e.Location))
|
||||
{
|
||||
if (i != mouseOverItemIndex)
|
||||
{
|
||||
mouseOverItemIndex = i;
|
||||
this.Invalidate();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void setItemTextAlign(int row, int col, System.Drawing.ContentAlignment TextAlign)
|
||||
{
|
||||
var item = this.Items.Where(t => t.row == row && t.col == col).FirstOrDefault();
|
||||
if (item != null) item.TextAlign = TextAlign;
|
||||
}
|
||||
public void setItemTextAlign(System.Drawing.ContentAlignment TextAlign)
|
||||
{
|
||||
foreach (var item in this.Items)
|
||||
item.TextAlign = TextAlign;
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs pe)
|
||||
{
|
||||
//배경그리기
|
||||
//using (var sb = new System.Drawing.Drawing2D.LinearGradientBrush(DisplayRectangle, BackColor, BackColor2On, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
|
||||
pe.Graphics.FillRectangle(new SolidBrush(BackColor), DisplayRectangle);
|
||||
|
||||
if (Items == null)
|
||||
{
|
||||
pe.Graphics.DrawString("no items", this.Font, Brushes.Red, 100, 100);
|
||||
return;
|
||||
}
|
||||
|
||||
var items = Items.OrderBy(t => t.No);
|
||||
foreach (var menu in items)
|
||||
{
|
||||
drawItem(menu.idx, pe.Graphics);
|
||||
}
|
||||
|
||||
//테두리 그리기
|
||||
if (BorderSize > 0)
|
||||
{
|
||||
pe.Graphics.DrawRectangle(new Pen(this.BorderColor, BorderSize),
|
||||
this.DisplayRectangle.Left,
|
||||
this.DisplayRectangle.Top,
|
||||
this.DisplayRectangle.Width - 1,
|
||||
this.DisplayRectangle.Height - 1);
|
||||
}
|
||||
}
|
||||
|
||||
public void drawItem(int itemIndex, Graphics g = null)
|
||||
{
|
||||
if (g == null) g = this.CreateGraphics();
|
||||
var menu = this.Items[itemIndex];
|
||||
|
||||
if (menu.rect == RectangleF.Empty) return;
|
||||
|
||||
var rect = menu.rect;// rects[i];
|
||||
|
||||
var diplayText = string.Empty;
|
||||
|
||||
// if(_titles[1].Trim() != "")
|
||||
// Console.WriteLine("sdf");
|
||||
//타이틀이 줄번호별로 처리됨
|
||||
if (_titles != null && menu.row < _titles.Length)
|
||||
{
|
||||
if (_titles[menu.row] == null) _titles[menu.row] = string.Empty;
|
||||
var linebif = _titles[menu.row].Split('|');
|
||||
if (menu.col < linebif.Length)
|
||||
diplayText = linebif[menu.col];
|
||||
}
|
||||
|
||||
UInt16 Value = 0;
|
||||
if (_values != null && menu.idx < _values.Length) Value = _values[menu.idx];
|
||||
|
||||
//배경이 투명이 아니라면 그린다.
|
||||
var bgColor1 = Color.FromArgb(30, 30, 30);// BackColor1Off;
|
||||
var bgColor2 = Color.FromArgb(30, 30, 30);// BackColor2Off;
|
||||
|
||||
//해당 값에 따른 컬러값을 읽는다.
|
||||
if (ColorList != null && Value < ColorList.Length)
|
||||
{
|
||||
bgColor1 = this.ColorList[Value].BackColor1;
|
||||
bgColor2 = this.ColorList[Value].BackColor2;
|
||||
}
|
||||
|
||||
using (var sb = new System.Drawing.Drawing2D.LinearGradientBrush(rect, bgColor1, bgColor2, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
|
||||
g.FillRectangle(sb, rect);
|
||||
|
||||
// if (mouseOverItemIndex == menu.idx)
|
||||
// this.Cursor = Cursors.Hand;
|
||||
// else
|
||||
// this.Cursor = Cursors.Arrow;
|
||||
|
||||
//테두리를 그리는 속성과 트기가 설정된 경우에만 표시
|
||||
//if (mouseOverItemIndex == i)
|
||||
// {
|
||||
// pe.Graphics.DrawRectangle(new Pen(Color.DeepSkyBlue), rect.Left, rect.Top, rect.Width, rect.Height);
|
||||
//}
|
||||
//else
|
||||
{
|
||||
if (MenuBorderSize > 0)
|
||||
{
|
||||
using (var p = new Pen(BorderColor, MenuBorderSize))
|
||||
g.DrawRectangle(p, rect.Left, rect.Top, rect.Width, rect.Height);
|
||||
}
|
||||
}
|
||||
|
||||
//인덱스번호 출력
|
||||
if (ShowIndexString && _names != null && menu.idx < _names.Length)
|
||||
{
|
||||
//표시글자
|
||||
var idxstr = string.Format("[{0}] {1}", menu.idx, _names[menu.idx]);
|
||||
|
||||
//그림자 추가
|
||||
if (ShadowColor != System.Drawing.Color.Transparent)
|
||||
g.DrawString(idxstr, FontPin, new SolidBrush(ShadowColor), menu.rect.Left + 4, menu.rect.Top + 4);
|
||||
|
||||
//일반글자표시
|
||||
g.DrawString(idxstr, FontPin, new SolidBrush(this.ForeColorPin), menu.rect.Left + 3, menu.rect.Top + 3);
|
||||
}
|
||||
|
||||
if (diplayText != "")
|
||||
{
|
||||
using (StringFormat sf = new StringFormat(StringFormatFlags.NoClip))
|
||||
{
|
||||
//글자를 텍스트 이후에 붙이는 거라면?
|
||||
if (menu.TextAlign == ContentAlignment.BottomCenter || menu.TextAlign == ContentAlignment.BottomLeft ||
|
||||
menu.TextAlign == ContentAlignment.BottomRight) sf.LineAlignment = StringAlignment.Far;
|
||||
else if (menu.TextAlign == ContentAlignment.MiddleCenter || menu.TextAlign == ContentAlignment.MiddleLeft ||
|
||||
menu.TextAlign == ContentAlignment.MiddleRight) sf.LineAlignment = StringAlignment.Center;
|
||||
else if (menu.TextAlign == ContentAlignment.TopCenter || menu.TextAlign == ContentAlignment.TopLeft ||
|
||||
menu.TextAlign == ContentAlignment.TopRight) sf.LineAlignment = StringAlignment.Near;
|
||||
|
||||
if (menu.TextAlign == ContentAlignment.BottomCenter || menu.TextAlign == ContentAlignment.MiddleCenter ||
|
||||
menu.TextAlign == ContentAlignment.TopCenter) sf.Alignment = StringAlignment.Center;
|
||||
else if (menu.TextAlign == ContentAlignment.BottomLeft || menu.TextAlign == ContentAlignment.MiddleLeft ||
|
||||
menu.TextAlign == ContentAlignment.TopLeft) sf.Alignment = StringAlignment.Near;
|
||||
else if (menu.TextAlign == ContentAlignment.BottomRight || menu.TextAlign == ContentAlignment.MiddleRight ||
|
||||
menu.TextAlign == ContentAlignment.TopRight) sf.Alignment = StringAlignment.Far;
|
||||
|
||||
//그림자 추가
|
||||
if (ShadowColor != System.Drawing.Color.Transparent)
|
||||
g.DrawString(diplayText, this.Font, new SolidBrush(ShadowColor),
|
||||
new RectangleF((float)(rect.Left + 1f), (float)(rect.Top + 1f), (float)rect.Width, (float)rect.Height), sf);
|
||||
|
||||
g.DrawString($"{diplayText}", this.Font, new SolidBrush(ForeColor), rect, sf);
|
||||
}
|
||||
}
|
||||
|
||||
if (showDebugInfo)
|
||||
{
|
||||
g.DrawString(Value.ToString(), this.fontPin, Brushes.SkyBlue, rect.Left, rect.Top);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// arFrame 전용 속성값을 복사 합니다
|
||||
/// </summary>
|
||||
/// <param name="ctl"></param>
|
||||
public void copyTo(GridView ctl)
|
||||
{
|
||||
ctl.backcolor = this.backcolor;
|
||||
ctl.menugap = this.menugap;
|
||||
ctl.Items = this.Items;
|
||||
ctl.menubordersize = this.menubordersize;
|
||||
ctl.padding = this.padding;
|
||||
ctl.ForeColor = this.ForeColor;
|
||||
ctl.Font = this.Font;
|
||||
ctl.TextAttachToImage = this.TextAttachToImage;
|
||||
ctl.bordercolor = this.bordercolor;
|
||||
ctl.bordersize = this.bordersize;
|
||||
}
|
||||
|
||||
public void RemakeChartRect()
|
||||
{
|
||||
if (DisplayRectangle == Rectangle.Empty) return;
|
||||
|
||||
double x = 0;
|
||||
double y = 0;
|
||||
double w = DisplayRectangle.Width / (ColumnCount * 1.0);
|
||||
double h = DisplayRectangle.Height / (RowCount * 1.0);
|
||||
|
||||
|
||||
//아이템갯수가 달라졌으므로 다시 갱신해야함
|
||||
GridViewItem[] item = new GridViewItem[RowCount * ColumnCount];
|
||||
|
||||
if(arVeriticalDraw)
|
||||
{
|
||||
for (int c = 0; c < ColumnCount; c++)
|
||||
{
|
||||
for (int r = 0; r < RowCount; r++)
|
||||
{
|
||||
int idx = c * ColumnCount + r;
|
||||
item[idx] = new GridViewItem(idx, r, c);
|
||||
|
||||
if (this.Items != null && idx < this.Items.Length)
|
||||
item[idx].Enable = this.Items[idx].Enable; // false;
|
||||
else
|
||||
item[idx].Enable = false;
|
||||
|
||||
item[idx].Padding = new Padding(0, 0, 0, 0);
|
||||
item[idx].TextAlign = ContentAlignment.MiddleCenter;
|
||||
x = (c * w);
|
||||
y = (r * h);
|
||||
item[idx].Dirty = true;
|
||||
item[idx].rect = new RectangleF((float)x, (float)y, (float)w, (float)h);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int r = 0; r < RowCount; r++)
|
||||
{
|
||||
for (int c = 0; c < ColumnCount; c++)
|
||||
{
|
||||
int idx = r * ColumnCount + c;
|
||||
item[idx] = new GridViewItem(idx, r, c);
|
||||
|
||||
if (this.Items != null && idx < this.Items.Length)
|
||||
item[idx].Enable = this.Items[idx].Enable; // false;
|
||||
else
|
||||
item[idx].Enable = false;
|
||||
|
||||
item[idx].Padding = new Padding(0, 0, 0, 0);
|
||||
item[idx].TextAlign = ContentAlignment.MiddleCenter;
|
||||
x = (c * w);
|
||||
y = (r * h);
|
||||
item[idx].Dirty = true;
|
||||
item[idx].rect = new RectangleF((float)x, (float)y, (float)w, (float)h);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.Items = item;
|
||||
|
||||
|
||||
this.Invalidate();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Handler/Sub/arFrameControl/MenuBar/MenuControl.Designer.cs
generated
Normal file
36
Handler/Sub/arFrameControl/MenuBar/MenuControl.Designer.cs
generated
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace arFrame.Control
|
||||
{
|
||||
partial class MenuControl
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
676
Handler/Sub/arFrameControl/MenuBar/MenuControl.cs
Normal file
676
Handler/Sub/arFrameControl/MenuBar/MenuControl.cs
Normal file
@@ -0,0 +1,676 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
|
||||
namespace arFrame.Control
|
||||
{
|
||||
|
||||
public partial class MenuControl : System.Windows.Forms.Control
|
||||
{
|
||||
private int bordersize = 0;
|
||||
private int menubordersize = 1;
|
||||
private int menuwidth = 100;
|
||||
private int menugap = 5;
|
||||
private System.Windows.Forms.Padding padding = new Padding(3, 3, 3, 3);
|
||||
private System.Drawing.Color backcolor = System.Drawing.Color.White;
|
||||
private System.Drawing.Color backcolor2 = System.Drawing.Color.Gainsboro;
|
||||
private System.Drawing.Color bordercolor = System.Drawing.Color.Black;
|
||||
private Boolean enablemenubakcolor = false;
|
||||
private Boolean enablemenuborder = false;
|
||||
private Boolean textattachtoimage = true;
|
||||
|
||||
[Category("arFrame"), DisplayName("메뉴")]
|
||||
public MenuItem[] menus { get; set; }
|
||||
|
||||
private Rectangle[] rects = null;
|
||||
|
||||
[Category("arFrame"), DisplayName("테두리 굵기")]
|
||||
public int BorderSize { get { return bordersize; } set { this.bordersize = value; Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("메뉴 테두리 굵기")]
|
||||
public int MenuBorderSize { get { return menubordersize; } set { this.menubordersize = value; Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("메뉴 너비")]
|
||||
public int MenuWidth { get { return menuwidth; } set { this.menuwidth = value; RemakeChartRect(); Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("메뉴 간격")]
|
||||
public int MenuGap { get { return menugap; } set { this.menugap = value; RemakeChartRect(); Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("기능-메뉴별 배경색")]
|
||||
public Boolean EnableMenuBackColor { get { return enablemenubakcolor; } set { this.enablemenubakcolor = value; Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("기능-메뉴별 테두리")]
|
||||
public Boolean EnableMenuBorder { get { return enablemenuborder; } set { this.enablemenuborder = value; Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("글자를 이미지 다음에 표시"), Description("이미지가 있는 경우 해당 이미지 옆에 글자를 붙입니다")]
|
||||
public Boolean TextAttachToImage { get { return textattachtoimage; } set { this.textattachtoimage = value; Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("이미지 표시 여백(좌,상)")]
|
||||
public System.Drawing.Point ImagePadding { get; set; }
|
||||
[Category("arFrame"), DisplayName("이미지 표시 크기(너비,높이)")]
|
||||
public System.Drawing.Size ImageSize { get; set; }
|
||||
[Category("arFrame"), DisplayName("색상-테두리")]
|
||||
public System.Drawing.Color BorderColor { get { return bordercolor; } set { this.bordercolor = value; Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("내부 여백")]
|
||||
public new System.Windows.Forms.Padding Padding { get { return padding; } set { this.padding = value; RemakeChartRect(); Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("색상-배경1")]
|
||||
public override System.Drawing.Color BackColor { get { return backcolor; } set { this.backcolor = value; Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("색상-배경2")]
|
||||
public System.Drawing.Color BackColor2 { get { return backcolor2; } set { this.backcolor2 = value; Invalidate(); } }
|
||||
[Category("arFrame"), DisplayName("색상-글자")]
|
||||
public override Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } }
|
||||
|
||||
private int mouseOverItemIndex = -1;
|
||||
public MenuControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// Set Optimized Double Buffer to reduce flickering
|
||||
this.SetStyle(ControlStyles.UserPaint, true);
|
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
|
||||
// Redraw when resized
|
||||
this.SetStyle(ControlStyles.ResizeRedraw, true);
|
||||
|
||||
|
||||
ImagePadding = new System.Drawing.Point(0, 0);
|
||||
ImageSize = new System.Drawing.Size(24, 24);
|
||||
|
||||
|
||||
if (MinimumSize.Width == 0 || MinimumSize.Height == 0)
|
||||
MinimumSize = new Size(100, 50);
|
||||
|
||||
}
|
||||
protected override void OnSizeChanged(EventArgs e)
|
||||
{
|
||||
base.OnSizeChanged(e);
|
||||
RemakeChartRect();
|
||||
}
|
||||
|
||||
|
||||
public event EventHandler<MenuEventArgs> ItemClick;
|
||||
public class MenuEventArgs : EventArgs
|
||||
{
|
||||
public string Command { get; set; }
|
||||
public int idx { get; set; }
|
||||
public MenuEventArgs(string cmd_, int idx_)
|
||||
{
|
||||
this.Command = cmd_;
|
||||
this.idx = idx_;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseClick(MouseEventArgs e)
|
||||
{
|
||||
// if(DesignMode)
|
||||
// {
|
||||
// if(e.Button == System.Windows.Forms.MouseButtons.Right)
|
||||
// {
|
||||
// System.Windows.Forms.MessageBox.Show("Sdf");
|
||||
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
{
|
||||
//마우스클릭시 해당 버튼을 찾아서 반환한다.
|
||||
if (menus == null || menus.Length < 1) return;
|
||||
for (int i = 0; i < menus.Length; i++)
|
||||
{
|
||||
var rect = rects[i];
|
||||
if (rect.Contains(e.Location))
|
||||
{
|
||||
var menu = menus[i];
|
||||
|
||||
//미사용개체는 이벤트를 아에 발생하지 않는다
|
||||
if (menu.Enable == true && ItemClick != null)
|
||||
ItemClick(this, new MenuEventArgs(menu.Command, i));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
protected override void OnMouseLeave(EventArgs e)
|
||||
{
|
||||
this.mouseOverItemIndex = -1;
|
||||
this.Invalidate();
|
||||
}
|
||||
protected override void OnMouseMove(MouseEventArgs e)
|
||||
{
|
||||
if (menus == null || menus.Length < 1)
|
||||
{
|
||||
this.mouseOverItemIndex = -1;
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < menus.Length; i++)
|
||||
{
|
||||
var rect = rects[i];
|
||||
if (rect.Contains(e.Location))
|
||||
{
|
||||
if (i != mouseOverItemIndex)
|
||||
{
|
||||
mouseOverItemIndex = i;
|
||||
this.Invalidate();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs pe)
|
||||
{
|
||||
|
||||
|
||||
// if(DesignMode)
|
||||
// {
|
||||
// pe.Graphics.FillRectangle(Brushes.Red, this.DisplayRectangle);
|
||||
// }
|
||||
//else
|
||||
{
|
||||
//배경그리기
|
||||
using (var sb = new System.Drawing.Drawing2D.LinearGradientBrush(DisplayRectangle, BackColor, BackColor2, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
|
||||
pe.Graphics.FillRectangle(sb, DisplayRectangle);
|
||||
}
|
||||
|
||||
//테두리 그리기
|
||||
if (BorderSize > 0)
|
||||
{
|
||||
pe.Graphics.DrawRectangle(new Pen(this.BorderColor, BorderSize),
|
||||
this.DisplayRectangle.Left,
|
||||
this.DisplayRectangle.Top,
|
||||
this.DisplayRectangle.Width - 1,
|
||||
this.DisplayRectangle.Height - 1);
|
||||
}
|
||||
|
||||
//커서모양
|
||||
if (mouseOverItemIndex == -1) this.Cursor = Cursors.Arrow;
|
||||
else this.Cursor = Cursors.Hand;
|
||||
|
||||
if (rects == null) RemakeChartRect();
|
||||
if (rects != null && rects.Length > 0)
|
||||
{
|
||||
StringFormat sf = new StringFormat(StringFormatFlags.NoClip);
|
||||
var items = menus.OrderBy(t => t.No);
|
||||
int i = 0;
|
||||
foreach (var menu in items)
|
||||
{
|
||||
var rect = rects[i];
|
||||
|
||||
//배경이 투명이 아니라면 그린다.
|
||||
if (mouseOverItemIndex == i)
|
||||
{
|
||||
//마우스오버된놈이다.
|
||||
using (var sb = new System.Drawing.Drawing2D.LinearGradientBrush(rect, Color.FromArgb(100, Color.LightSkyBlue), Color.FromArgb(100, Color.DeepSkyBlue), System.Drawing.Drawing2D.LinearGradientMode.Vertical))
|
||||
pe.Graphics.FillRectangle(sb, rect);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.enablemenubakcolor == true && menu.BackColor != System.Drawing.Color.Transparent && menu.BackColor2 != System.Drawing.Color.Transparent)
|
||||
{
|
||||
using (var sb = new System.Drawing.Drawing2D.LinearGradientBrush(rect, menu.BackColor, menu.BackColor2, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
|
||||
pe.Graphics.FillRectangle(sb, rect);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//이미지표시
|
||||
int ix, iy, iw, ih;
|
||||
ix = iy = iw = ih = 0;
|
||||
if (menu.Image != null)
|
||||
{
|
||||
ix = rect.Left;
|
||||
iy = rect.Top;
|
||||
iw = ImageSize.Width;
|
||||
ih = ImageSize.Height;
|
||||
|
||||
if (menu.ImageAlign == ContentAlignment.BottomCenter || menu.ImageAlign == ContentAlignment.BottomLeft ||
|
||||
menu.ImageAlign == ContentAlignment.BottomRight) iy += DisplayRectangle.Bottom - ih;
|
||||
else if (menu.ImageAlign == ContentAlignment.MiddleCenter || menu.ImageAlign == ContentAlignment.MiddleLeft ||
|
||||
menu.ImageAlign == ContentAlignment.MiddleRight) iy += (int)(DisplayRectangle.Top + ((rect.Height - ih) / 2.0));
|
||||
else if (menu.ImageAlign == ContentAlignment.TopCenter || menu.ImageAlign == ContentAlignment.TopLeft ||
|
||||
menu.ImageAlign == ContentAlignment.TopRight) iy += DisplayRectangle.Top;
|
||||
|
||||
if (menu.ImageAlign == ContentAlignment.BottomCenter || menu.ImageAlign == ContentAlignment.MiddleCenter ||
|
||||
menu.ImageAlign == ContentAlignment.TopCenter) ix += (int)(DisplayRectangle.Left + ((rect.Width - iw) / 2.0));
|
||||
else if (menu.ImageAlign == ContentAlignment.BottomLeft || menu.ImageAlign == ContentAlignment.MiddleLeft ||
|
||||
menu.ImageAlign == ContentAlignment.TopLeft) ix += DisplayRectangle.Left;
|
||||
else if (menu.ImageAlign == ContentAlignment.BottomRight || menu.ImageAlign == ContentAlignment.MiddleRight ||
|
||||
menu.ImageAlign == ContentAlignment.TopRight) ix += DisplayRectangle.Right - iw;
|
||||
|
||||
if (menu.ImagePadding.X != 0 || menu.ImagePadding.Y != 0)
|
||||
{
|
||||
ix += menu.ImagePadding.X;
|
||||
iy += menu.ImagePadding.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
ix += ImagePadding.X;
|
||||
iy += ImagePadding.Y;
|
||||
}
|
||||
if (menu.ImageSize.Width != 0 && menu.ImageSize.Height != 0)
|
||||
{
|
||||
iw = menu.ImageSize.Width;
|
||||
ih = menu.ImageSize.Height;
|
||||
}
|
||||
|
||||
pe.Graphics.DrawImage(menu.Image,
|
||||
new Rectangle(ix, iy, iw, ih));
|
||||
}
|
||||
|
||||
//테두리를 그리는 속성과 트기가 설정된 경우에만 표시
|
||||
if (mouseOverItemIndex == i)
|
||||
{
|
||||
pe.Graphics.DrawRectangle(new Pen(Color.DeepSkyBlue), rect);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (EnableMenuBorder && MenuBorderSize > 0)
|
||||
{
|
||||
using (var p = new Pen(menu.BorderColor, MenuBorderSize))
|
||||
pe.Graphics.DrawRectangle(p, rect);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//글자를 텍스트 이후에 붙이는 거라면?
|
||||
if (menu.Image != null && TextAttachToImage)
|
||||
{
|
||||
var fsize = pe.Graphics.MeasureString(menu.Text, this.Font);
|
||||
pe.Graphics.DrawString(menu.Text, this.Font, new SolidBrush(menu.ForeColor),
|
||||
(float)(ix + iw + 1),
|
||||
(float)(iy + ((ih - fsize.Height) / 2.0)));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (menu.TextAlign == ContentAlignment.BottomCenter || menu.TextAlign == ContentAlignment.BottomLeft ||
|
||||
menu.TextAlign == ContentAlignment.BottomRight) sf.LineAlignment = StringAlignment.Far;
|
||||
else if (menu.TextAlign == ContentAlignment.MiddleCenter || menu.TextAlign == ContentAlignment.MiddleLeft ||
|
||||
menu.TextAlign == ContentAlignment.MiddleRight) sf.LineAlignment = StringAlignment.Center;
|
||||
else if (menu.TextAlign == ContentAlignment.TopCenter || menu.TextAlign == ContentAlignment.TopLeft ||
|
||||
menu.TextAlign == ContentAlignment.TopRight) sf.LineAlignment = StringAlignment.Near;
|
||||
|
||||
if (menu.TextAlign == ContentAlignment.BottomCenter || menu.TextAlign == ContentAlignment.MiddleCenter ||
|
||||
menu.TextAlign == ContentAlignment.TopCenter) sf.Alignment = StringAlignment.Center;
|
||||
else if (menu.TextAlign == ContentAlignment.BottomLeft || menu.TextAlign == ContentAlignment.MiddleLeft ||
|
||||
menu.TextAlign == ContentAlignment.TopLeft) sf.Alignment = StringAlignment.Near;
|
||||
else if (menu.TextAlign == ContentAlignment.BottomRight || menu.TextAlign == ContentAlignment.MiddleRight ||
|
||||
menu.TextAlign == ContentAlignment.TopRight) sf.Alignment = StringAlignment.Far;
|
||||
|
||||
pe.Graphics.DrawString(menu.Text, this.Font, new SolidBrush(menu.ForeColor), rect, sf);
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
sf.Dispose();
|
||||
}
|
||||
//if(DesignMode)
|
||||
//{
|
||||
// pe.Graphics.DrawString("deisgn", this.Font, Brushes.Red, 1, 1);
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// arFrame 전용 속성값을 복사 합니다
|
||||
/// </summary>
|
||||
/// <param name="ctl"></param>
|
||||
public void copyTo(MenuControl ctl)
|
||||
{
|
||||
ctl.backcolor = this.backcolor;
|
||||
ctl.backcolor2 = this.BackColor2;
|
||||
ctl.MenuWidth = this.menuwidth;
|
||||
ctl.menugap = this.menugap;
|
||||
ctl.menus = this.menus;
|
||||
ctl.menubordersize = this.menubordersize;
|
||||
ctl.padding = this.padding;
|
||||
ctl.ForeColor = this.ForeColor;
|
||||
ctl.Font = this.Font;
|
||||
ctl.EnableMenuBackColor = this.EnableMenuBackColor;
|
||||
ctl.EnableMenuBorder = this.EnableMenuBorder;
|
||||
ctl.ImagePadding = this.ImagePadding;
|
||||
ctl.ImageSize = this.ImageSize;
|
||||
ctl.TextAttachToImage = this.TextAttachToImage;
|
||||
ctl.bordercolor = this.bordercolor;
|
||||
ctl.bordersize = this.bordersize;
|
||||
}
|
||||
|
||||
public void Save(string File)
|
||||
{
|
||||
//xml로 데이터를 저장자
|
||||
System.Text.StringBuilder NewXml = new System.Text.StringBuilder();
|
||||
NewXml.AppendLine("<?xml version='1.0' encoding='UTF-8'?>");
|
||||
NewXml.AppendLine("<tindevil create='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'> ");
|
||||
NewXml.AppendLine("</tindevil>");
|
||||
|
||||
if (System.IO.File.Exists(File)) System.IO.File.Delete(File);
|
||||
System.IO.File.WriteAllText(File, NewXml.ToString().Replace('\'', '\"'), System.Text.Encoding.UTF8);
|
||||
var vDocu = new XmlDocument();
|
||||
vDocu.Load(File);
|
||||
//var nsmgr = new XmlNamespaceManager(new System.Xml.NameTable());
|
||||
//nsmgr.AddNamespace("x", "http://tindevil.com");
|
||||
var Root = vDocu.DocumentElement;
|
||||
|
||||
//저장하려는 속성목록을 먼저 생성한다
|
||||
//미사용 목록이 너무 많아서 그렇게 함
|
||||
foreach (var m in this.GetType().GetMethods())
|
||||
{
|
||||
var mName = m.Name.ToLower();
|
||||
if (mName.StartsWith("get_") == false || mName == "get_menus") continue;
|
||||
|
||||
var pt = this.GetType().GetProperty(m.Name.Substring(4));
|
||||
if (pt != null)
|
||||
{
|
||||
var categoryName = GetCategoryName(pt);
|
||||
if (categoryName.ToLower() != "arframe") continue;
|
||||
|
||||
//자료형에따라서 그값을 변경한다
|
||||
var value = m.Invoke(this, null);
|
||||
var newNode = vDocu.CreateElement(pt.Name);// m.Name.Substring(4));
|
||||
newNode.InnerText = getValueString(m, value);
|
||||
Root.AppendChild(newNode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach (var item in this.menus.OrderBy(t => t.No))
|
||||
{
|
||||
var node = vDocu.CreateElement("Item");
|
||||
var attNo = vDocu.CreateAttribute("No");
|
||||
attNo.Value = item.No.ToString();
|
||||
node.Attributes.Append(attNo);
|
||||
|
||||
foreach (var m in item.GetType().GetMethods())
|
||||
{
|
||||
var mName = m.Name.ToLower();
|
||||
if (mName.StartsWith("get_") == false || mName == "get_no") continue;
|
||||
|
||||
var value = m.Invoke(item, null);
|
||||
var sNode = vDocu.CreateElement(m.Name.Substring(4));
|
||||
sNode.InnerText = getValueString(m, value);
|
||||
node.AppendChild(sNode);
|
||||
}
|
||||
Root.AppendChild(node);
|
||||
}
|
||||
vDocu.Save(File);
|
||||
}
|
||||
|
||||
public void Load(string File)
|
||||
{
|
||||
if (System.IO.File.Exists(File) == false) return;
|
||||
|
||||
List<MenuItem> NewMenu = new List<MenuItem>();
|
||||
var vDocu = new XmlDocument();
|
||||
vDocu.Load(File);
|
||||
var Root = vDocu.DocumentElement; //루트요소(Tindevil)
|
||||
|
||||
|
||||
|
||||
//저장하려는 속성목록을 먼저 생성한다
|
||||
//미사용 목록이 너무 많아서 그렇게 함
|
||||
foreach (var m in this.GetType().GetMethods())
|
||||
{
|
||||
var mName = m.Name.ToLower();
|
||||
if (mName.StartsWith("get_") == false || mName == "get_menus") continue;
|
||||
|
||||
var methodName = m.Name.Substring(4);
|
||||
var pt = this.GetType().GetProperty(methodName);
|
||||
if (pt != null)
|
||||
{
|
||||
var categoryName = GetCategoryName(pt);
|
||||
if (categoryName.ToLower() != "arframe") continue;
|
||||
|
||||
//SEt명령이 있어야 사용이 가능하다
|
||||
var setMethod = this.GetType().GetMethod("set_" + methodName);
|
||||
if (setMethod == null) continue;
|
||||
|
||||
//값을 읽어온다
|
||||
var Node = Root.SelectSingleNode(methodName);
|
||||
if (Node != null)
|
||||
{
|
||||
var strValue = Node.InnerText;
|
||||
var value = getValueFromString(m.ReturnType, strValue); // setValueString(m.ReturnType, setMethod, strValue);
|
||||
setMethod.Invoke(this, new object[] { value });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//foreach (var item in this.menus.OrderBy(t => t.No))
|
||||
//{
|
||||
// var node = vDocu.CreateElement("Item");
|
||||
// var attNo = vDocu.CreateAttribute("No");
|
||||
// attNo.Value = item.No.ToString();
|
||||
// node.Attributes.Append(attNo);
|
||||
|
||||
// foreach (var m in item.GetType().GetMethods())
|
||||
// {
|
||||
// var mName = m.Name.ToLower();
|
||||
// if (mName.StartsWith("get_") == false || mName == "get_no") continue;
|
||||
|
||||
// var value = m.Invoke(item, null);
|
||||
// var sNode = vDocu.CreateElement(m.Name.Substring(4));
|
||||
// sNode.InnerText = getValueString(m, value);
|
||||
// node.AppendChild(sNode);
|
||||
// }
|
||||
// Root.AppendChild(node);
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
private string getValueString(System.Reflection.MethodInfo m, object value)
|
||||
{
|
||||
var strValue = "";
|
||||
string valuetype = m.ReturnType.Name.ToLower();
|
||||
if (m.ReturnType == typeof(System.Drawing.Color))
|
||||
strValue = ((System.Drawing.Color)value).ToArgb().ToString();
|
||||
else if (m.ReturnType == typeof(System.Drawing.Rectangle))
|
||||
{
|
||||
var rect = (System.Drawing.Rectangle)value;
|
||||
strValue = string.Format("{0};{1};{2};{3}", rect.Left, rect.Top, rect.Width, rect.Height);
|
||||
}
|
||||
else if (m.ReturnType == typeof(System.Drawing.RectangleF))
|
||||
{
|
||||
var rectf = (System.Drawing.RectangleF)value;
|
||||
strValue = string.Format("{0};{1};{2};{3}", rectf.Left, rectf.Top, rectf.Width, rectf.Height);
|
||||
}
|
||||
else if (m.ReturnType == typeof(Boolean))
|
||||
{
|
||||
strValue = ((Boolean)value) ? "1" : "0";
|
||||
}
|
||||
else if (m.ReturnType == typeof(System.Drawing.Point))
|
||||
{
|
||||
var pt1 = (Point)value;
|
||||
strValue = string.Format("{0};{1}", pt1.X, pt1.Y);
|
||||
}
|
||||
else if (m.ReturnType == typeof(System.Drawing.PointF))
|
||||
{
|
||||
var ptf = (PointF)value;
|
||||
strValue = string.Format("{0};{1}", ptf.X, ptf.Y);
|
||||
}
|
||||
else if (m.ReturnType == typeof(System.Drawing.Size))
|
||||
{
|
||||
var sz = (Size)value;
|
||||
strValue = string.Format("{0};{1}", sz.Width, sz.Height);
|
||||
}
|
||||
else if (m.ReturnType == typeof(System.Drawing.SizeF))
|
||||
{
|
||||
var szf = (SizeF)value;
|
||||
strValue = string.Format("{0};{1}", szf.Width, szf.Height);
|
||||
}
|
||||
else if (m.ReturnType == typeof(System.Drawing.Bitmap))
|
||||
{
|
||||
var bitmap = (Bitmap)value;
|
||||
|
||||
// Convert the image to byte[]
|
||||
System.IO.MemoryStream stream = new System.IO.MemoryStream();
|
||||
bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp);
|
||||
byte[] imageBytes = stream.ToArray();
|
||||
strValue = Convert.ToBase64String(imageBytes);
|
||||
}
|
||||
else if (m.ReturnType == typeof(System.Windows.Forms.Padding))
|
||||
{
|
||||
var pd = (System.Windows.Forms.Padding)value;
|
||||
strValue = string.Format("{0};{1};{2};{3}", pd.Left, pd.Top, pd.Right, pd.Bottom);
|
||||
}
|
||||
else
|
||||
strValue = value.ToString();
|
||||
return strValue;
|
||||
}
|
||||
|
||||
|
||||
private object getValueFromString(Type ReturnType, string strValue)
|
||||
{
|
||||
|
||||
|
||||
if (ReturnType == typeof(System.Drawing.Color))
|
||||
{
|
||||
var cint = int.Parse(strValue);
|
||||
return System.Drawing.Color.FromArgb(cint);
|
||||
}
|
||||
else if (ReturnType == typeof(System.Drawing.Rectangle))
|
||||
{
|
||||
var buf = strValue.Split(';');
|
||||
var x = int.Parse(buf[0]);
|
||||
var y = int.Parse(buf[1]);
|
||||
var w = int.Parse(buf[2]);
|
||||
var h = int.Parse(buf[3]);
|
||||
return new Rectangle(x, y, w, h);
|
||||
}
|
||||
else if (ReturnType == typeof(System.Drawing.RectangleF))
|
||||
{
|
||||
var buf = strValue.Split(';');
|
||||
var x = float.Parse(buf[0]);
|
||||
var y = float.Parse(buf[1]);
|
||||
var w = float.Parse(buf[2]);
|
||||
var h = float.Parse(buf[3]);
|
||||
return new RectangleF(x, y, w, h);
|
||||
}
|
||||
else if (ReturnType == typeof(Boolean))
|
||||
{
|
||||
return strValue == "1";
|
||||
}
|
||||
else if (ReturnType == typeof(System.Drawing.Point))
|
||||
{
|
||||
var buf = strValue.Split(';');
|
||||
var x = int.Parse(buf[0]);
|
||||
var y = int.Parse(buf[1]);
|
||||
return new Point(x, y);
|
||||
}
|
||||
else if (ReturnType == typeof(System.Drawing.PointF))
|
||||
{
|
||||
var buf = strValue.Split(';');
|
||||
var x = float.Parse(buf[0]);
|
||||
var y = float.Parse(buf[1]);
|
||||
return new PointF(x, y);
|
||||
}
|
||||
else if (ReturnType == typeof(System.Drawing.Size))
|
||||
{
|
||||
var buf = strValue.Split(';');
|
||||
var x = int.Parse(buf[0]);
|
||||
var y = int.Parse(buf[1]);
|
||||
return new Size(x, y);
|
||||
}
|
||||
else if (ReturnType == typeof(System.Drawing.SizeF))
|
||||
{
|
||||
var buf = strValue.Split(';');
|
||||
var x = float.Parse(buf[0]);
|
||||
var y = float.Parse(buf[1]);
|
||||
return new SizeF(x, y);
|
||||
}
|
||||
else if (ReturnType == typeof(System.Drawing.Bitmap))
|
||||
{
|
||||
//문자을을 바이트로 전환다
|
||||
byte[] imageBytes = Convert.FromBase64String(strValue);
|
||||
|
||||
Bitmap retval = null;
|
||||
using (System.IO.MemoryStream stream = new System.IO.MemoryStream(imageBytes))
|
||||
retval = new Bitmap(stream);
|
||||
return retval;
|
||||
}
|
||||
else if (ReturnType == typeof(System.Windows.Forms.Padding))
|
||||
{
|
||||
var buf = strValue.Split(';');
|
||||
var x = int.Parse(buf[0]);
|
||||
var y = int.Parse(buf[1]);
|
||||
var w = int.Parse(buf[2]);
|
||||
var h = int.Parse(buf[3]);
|
||||
return new Padding(x, y, w, h);
|
||||
}
|
||||
else if (ReturnType == typeof(Int16)) return Int16.Parse(strValue);
|
||||
else if (ReturnType == typeof(Int32)) return Int32.Parse(strValue);
|
||||
else if (ReturnType == typeof(Int64)) return Int64.Parse(strValue);
|
||||
else if (ReturnType == typeof(UInt16)) return UInt16.Parse(strValue);
|
||||
else if (ReturnType == typeof(UInt32)) return UInt32.Parse(strValue);
|
||||
else
|
||||
return strValue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public string GetCategoryName(System.Reflection.PropertyInfo m)
|
||||
{
|
||||
var displayName = m
|
||||
.GetCustomAttributes(typeof(CategoryAttribute), true)
|
||||
.FirstOrDefault() as CategoryAttribute;
|
||||
|
||||
if (displayName != null)
|
||||
return displayName.Category;
|
||||
|
||||
return "";
|
||||
}
|
||||
public string GetDisplayName(System.Reflection.MethodInfo m)
|
||||
{
|
||||
var displayName = m
|
||||
.GetCustomAttributes(typeof(DisplayNameAttribute), true)
|
||||
.FirstOrDefault() as DisplayNameAttribute;
|
||||
|
||||
if (displayName != null)
|
||||
return displayName.DisplayName;
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public void RemakeChartRect()
|
||||
{
|
||||
if (rects != null) rects = null;
|
||||
if (menus == null || menus.Length < 1) return;
|
||||
|
||||
rects = new Rectangle[menus.Length];
|
||||
int leftIdx = 0;
|
||||
int rightIdx = 0;
|
||||
int leftAcc = 0;
|
||||
int rightAcc = 0;
|
||||
|
||||
|
||||
int i = 0;
|
||||
var menuList = this.menus.OrderBy(t => t.No).ToArray();
|
||||
foreach (var menu in menuList)
|
||||
{
|
||||
int x, y, w, h;
|
||||
// var menu = menus[i];
|
||||
|
||||
var mWidth = menuwidth;
|
||||
if (menu.MenuWidth > 0) mWidth = menu.MenuWidth;
|
||||
|
||||
w = mWidth;
|
||||
h = DisplayRectangle.Height - Padding.Top - Padding.Bottom;
|
||||
|
||||
if (menu.isRightMenu)
|
||||
{
|
||||
x = DisplayRectangle.Right - Padding.Right - (rightAcc) - (MenuGap * rightIdx);
|
||||
y = DisplayRectangle.Top + Padding.Top;
|
||||
rightAcc += 0;// = 0;// x;
|
||||
rightIdx += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = DisplayRectangle.Left + Padding.Left + leftAcc + (MenuGap * leftIdx);
|
||||
y = DisplayRectangle.Top + Padding.Top;
|
||||
leftAcc += mWidth;
|
||||
leftIdx += 1;
|
||||
}
|
||||
rects[i] = new Rectangle(x, y, w, h);
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
69
Handler/Sub/arFrameControl/MenuBar/MenuItem.cs
Normal file
69
Handler/Sub/arFrameControl/MenuBar/MenuItem.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace arFrame.Control
|
||||
{
|
||||
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
|
||||
public class MenuItem
|
||||
{
|
||||
[Category("arFrame"),DisplayName("메뉴이름")]
|
||||
public string Text { get; set; }
|
||||
[Category("arFrame"), DisplayName("색상-테두리"), Description("메뉴속성의 테두리 기능이 켜져야 합니다")]
|
||||
public System.Drawing.Color BorderColor { get; set; }
|
||||
[Category("arFrame"),DisplayName("색상-배경1"),Description("메뉴속성의 배경 기능이 켜져야 합니다")]
|
||||
public System.Drawing.Color BackColor { get; set; }
|
||||
[Category("arFrame"), DisplayName("색상-배경2"), Description("메뉴속성의 배경 기능이 켜져야 합니다")]
|
||||
public System.Drawing.Color BackColor2 { get; set; }
|
||||
[Category("arFrame"),DisplayName("색상-글자")]
|
||||
public System.Drawing.Color ForeColor { get; set; }
|
||||
[Category("arFrame"),DisplayName("메뉴 구분자로 사용합니다")]
|
||||
public Boolean isSeparate { get; set; }
|
||||
[Category("arFrame"),DisplayName("오른쪽 붙임")]
|
||||
public Boolean isRightMenu { get; set; }
|
||||
[Category("arFrame"),DisplayName("실행 명령")]
|
||||
public string Command { get; set; }
|
||||
[Category("arFrame"),DisplayName("아이콘 이미지")]
|
||||
public System.Drawing.Bitmap Image { get; set; }
|
||||
[Category("arFrame"),DisplayName("글자 정렬 방식")]
|
||||
public System.Drawing.ContentAlignment TextAlign { get; set; }
|
||||
[Category("arFrame"),DisplayName("이미지 정렬 방식")]
|
||||
public System.Drawing.ContentAlignment ImageAlign { get; set; }
|
||||
[Category("arFrame"),DisplayName("글자 여백")]
|
||||
public System.Windows.Forms.Padding Padding { get; set; }
|
||||
[Category("arFrame"),DisplayName("메뉴 사용여부"),Description("활성화시 메뉴의 클릭이벤트가 발생하지 않습니다")]
|
||||
public Boolean Enable { get; set; }
|
||||
[Category("arFrame"),DisplayName("이미지 표시 여백(좌,상)")]
|
||||
public System.Drawing.Point ImagePadding { get; set; }
|
||||
[Category("arFrame"),DisplayName("이미지 표시 크기(너비,높이)")]
|
||||
public System.Drawing.Size ImageSize { get; set; }
|
||||
[Category("arFrame"),DisplayName("메뉴 간격")]
|
||||
public int MenuWidth { get; set; }
|
||||
|
||||
[Category("arFrame"),DisplayName("번호")]
|
||||
public int No { get; set; }
|
||||
|
||||
public MenuItem()
|
||||
{
|
||||
Enable = true;
|
||||
BorderColor = System.Drawing.Color.FromArgb(20, 20, 20);
|
||||
BackColor = System.Drawing.Color.DimGray;
|
||||
BackColor2 = System.Drawing.Color.FromArgb(100, 100, 100);
|
||||
ForeColor = System.Drawing.Color.Black;
|
||||
Text = "Menu";
|
||||
isRightMenu = false;
|
||||
Command = string.Empty;
|
||||
Image = null;
|
||||
isSeparate = false;
|
||||
TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
Padding = new System.Windows.Forms.Padding(0, 0, 0, 0);
|
||||
ImagePadding = new System.Drawing.Point(0, 0);
|
||||
ImageSize = new System.Drawing.Size(0, 0);
|
||||
MenuWidth = 0;
|
||||
No = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Handler/Sub/arFrameControl/MotCommandButton.Designer.cs
generated
Normal file
36
Handler/Sub/arFrameControl/MotCommandButton.Designer.cs
generated
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace arFrame.Control
|
||||
{
|
||||
partial class MotCommandButton
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
33
Handler/Sub/arFrameControl/MotCommandButton.cs
Normal file
33
Handler/Sub/arFrameControl/MotCommandButton.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
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 arFrame.Control
|
||||
{
|
||||
public partial class MotCommandButton : Button
|
||||
{
|
||||
public enum eCommand
|
||||
{
|
||||
AbsoluteMove = 0,
|
||||
RelativeMove ,
|
||||
AcceptPosition
|
||||
}
|
||||
public MotCommandButton()
|
||||
{
|
||||
InitializeComponent();
|
||||
motCommand = eCommand.AbsoluteMove;
|
||||
motValueControl = null;
|
||||
motAccControl = null;
|
||||
motSpdControl = null;
|
||||
}
|
||||
public MotValueNumericUpDown motValueControl { get; set; }
|
||||
public MotValueNumericUpDown motAccControl { get; set; }
|
||||
public MotValueNumericUpDown motSpdControl { get; set; }
|
||||
public eCommand motCommand { get; set; }
|
||||
}
|
||||
}
|
||||
36
Handler/Sub/arFrameControl/MotLinkLabel.Designer.cs
generated
Normal file
36
Handler/Sub/arFrameControl/MotLinkLabel.Designer.cs
generated
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace arFrame.Control
|
||||
{
|
||||
partial class MotLinkLabel
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
21
Handler/Sub/arFrameControl/MotLinkLabel.cs
Normal file
21
Handler/Sub/arFrameControl/MotLinkLabel.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
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 arFrame.Control
|
||||
{
|
||||
public partial class MotLinkLabel : System.Windows.Forms.LinkLabel
|
||||
{
|
||||
public MotLinkLabel()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.LinkColor = Color.Chartreuse;
|
||||
}
|
||||
public MotValueNumericUpDown motValueControl { get; set; }
|
||||
}
|
||||
}
|
||||
36
Handler/Sub/arFrameControl/MotValueNumericUpDown.Designer.cs
generated
Normal file
36
Handler/Sub/arFrameControl/MotValueNumericUpDown.Designer.cs
generated
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace arFrame.Control
|
||||
{
|
||||
partial class MotValueNumericUpDown
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
21
Handler/Sub/arFrameControl/MotValueNumericUpDown.cs
Normal file
21
Handler/Sub/arFrameControl/MotValueNumericUpDown.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
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 arFrame.Control
|
||||
{
|
||||
public partial class MotValueNumericUpDown : NumericUpDown
|
||||
{
|
||||
public MotValueNumericUpDown()
|
||||
{
|
||||
InitializeComponent();
|
||||
MotionIndex = -1;
|
||||
}
|
||||
public int MotionIndex { get; set; }
|
||||
}
|
||||
}
|
||||
56
Handler/Sub/arFrameControl/MotionView/MotITem.cs
Normal file
56
Handler/Sub/arFrameControl/MotionView/MotITem.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace arFrame.Control
|
||||
{
|
||||
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
|
||||
public class MotITem
|
||||
{
|
||||
public int idx { get; private set; }
|
||||
[Category("arFrame"), DisplayName("Tag")]
|
||||
public string Tag { get; set; }
|
||||
[Category("arFrame"), DisplayName("글자 정렬 방식")]
|
||||
public System.Drawing.ContentAlignment TextAlign { get; set; }
|
||||
[Category("arFrame"), DisplayName("글자 여백")]
|
||||
public System.Windows.Forms.Padding Padding { get; set; }
|
||||
[Category("arFrame"), DisplayName("메뉴 사용여부"), Description("활성화시 메뉴의 클릭이벤트가 발생하지 않습니다")]
|
||||
public Boolean Enable { get; set; }
|
||||
public string Text { get; set; }
|
||||
|
||||
public Boolean Dirty { get; set; }
|
||||
|
||||
public System.Drawing.Rectangle[] subRect = null;
|
||||
|
||||
//모션 상태값
|
||||
public Boolean[] State;
|
||||
public double Position { get; set; }
|
||||
public double PositionCmd { get; set; }
|
||||
public System.Drawing.Color PositionColor { get; set; }
|
||||
|
||||
public System.Drawing.RectangleF rect { get; set; }
|
||||
|
||||
[Category("arFrame"), DisplayName("번호")]
|
||||
public int No { get; set; }
|
||||
|
||||
public MotITem(int idx_)
|
||||
{
|
||||
this.Dirty = true;
|
||||
PositionColor = System.Drawing.Color.White;
|
||||
subRect = new System.Drawing.Rectangle[6];
|
||||
rect = System.Drawing.RectangleF.Empty;
|
||||
Enable = true;
|
||||
this.idx = idx_;
|
||||
TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
Padding = new System.Windows.Forms.Padding(0, 0, 0, 0);
|
||||
No = 0;
|
||||
this.Text = string.Empty;
|
||||
this.Enable = true;
|
||||
this.State = new bool[] { false,false,false,false,false,false};
|
||||
Position = 0;
|
||||
PositionCmd = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Handler/Sub/arFrameControl/MotionView/MotionDisplay.Designer.cs
generated
Normal file
36
Handler/Sub/arFrameControl/MotionView/MotionDisplay.Designer.cs
generated
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace arFrame.Control
|
||||
{
|
||||
partial class MotionDisplay
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
306
Handler/Sub/arFrameControl/MotionView/MotionDisplay.cs
Normal file
306
Handler/Sub/arFrameControl/MotionView/MotionDisplay.cs
Normal file
@@ -0,0 +1,306 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace arFrame.Control
|
||||
{
|
||||
public partial class MotionDisplay : System.Windows.Forms.Control
|
||||
{
|
||||
private Color[] colorB1 = new Color[] {
|
||||
Color.MediumSeaGreen,
|
||||
Color.DeepSkyBlue,
|
||||
Color.Tomato,
|
||||
Color.Purple,
|
||||
Color.Tomato,
|
||||
Color.FromArgb(40,40,40)
|
||||
};
|
||||
private Color[] colorB2 = new Color[] {
|
||||
Color.SeaGreen,
|
||||
Color.SteelBlue,
|
||||
Color.Red,
|
||||
Color.Indigo,
|
||||
Color.Red,
|
||||
Color.FromArgb(30,30,30)
|
||||
};
|
||||
|
||||
private StringFormat sf = new StringFormat();
|
||||
private string[] IndiName = new string[] { "INP","ORG","LIM","HST","ALM","" };
|
||||
public MotITem[] Items;
|
||||
private int _colcount = 3;
|
||||
private int _rowcount = 2;
|
||||
private Color _bordercolor = Color.Black;
|
||||
private Color _gridcolor = Color.FromArgb(50, 50, 50);
|
||||
private int _bordersize = 1;
|
||||
private Padding _padding;
|
||||
private string _postionformat = "";
|
||||
private int _headerHeight = 16;
|
||||
private Font _headerfont = new Font("Consolas",7f);
|
||||
|
||||
|
||||
private int itemCount { get { return _colcount * _rowcount; } }
|
||||
|
||||
public new Font Font { get { return base.Font; } set { base.Font = value; this.Invalidate(); } }
|
||||
public Font HeaderFont { get { return _headerfont; } set { _headerfont = value; this.Invalidate(); } }
|
||||
public int HeaderHeight { get { return _headerHeight; } set { _headerHeight = value; RemakeChartRect(); this.Invalidate(); } }
|
||||
public new Padding Padding { get { if (_padding == null) return Padding.Empty; else return _padding; } set { _padding = value; RemakeChartRect(); Invalidate(); } }
|
||||
public int ColumnCount { get { return _colcount; } set { _colcount = value; ResetArray(); RemakeChartRect(); } }
|
||||
public int RowCount { get { return _rowcount; } set { _rowcount = value; ResetArray(); RemakeChartRect(); } }
|
||||
public int BorderSize { get { return _bordersize; } set { _bordersize = value; Invalidate(); } }
|
||||
public Color BorderColor { get { return _bordercolor; } set { _bordercolor = value; Invalidate(); } }
|
||||
public string PositionDisplayFormat { get { return _postionformat; } set { _postionformat = value; Invalidate(); } }
|
||||
public Color GridColor { get { return _gridcolor; } set { _gridcolor = value; Invalidate(); } }
|
||||
|
||||
public new Boolean Enabled { get { return base.Enabled; } set { base.Enabled = value; Invalidate(); } }
|
||||
|
||||
public MotionDisplay()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// Set Optimized Double Buffer to reduce flickering
|
||||
this.SetStyle(ControlStyles.UserPaint, true);
|
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
|
||||
// Redraw when resized
|
||||
this.SetStyle(ControlStyles.ResizeRedraw, true);
|
||||
sf.LineAlignment = StringAlignment.Center;
|
||||
sf.Alignment = StringAlignment.Center;
|
||||
|
||||
|
||||
//값과 이름은 외부의 값을 사용한다
|
||||
ResetArray();
|
||||
|
||||
if (MinimumSize.Width == 0 || MinimumSize.Height == 0)
|
||||
MinimumSize = new Size(100, 50);
|
||||
}
|
||||
|
||||
void ResetArray()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected override void OnSizeChanged(EventArgs e)
|
||||
{
|
||||
base.OnSizeChanged(e);
|
||||
RemakeChartRect();
|
||||
}
|
||||
|
||||
public void RemakeChartRect()
|
||||
{
|
||||
if (DisplayRectangle == Rectangle.Empty) return;
|
||||
|
||||
var baseRect = new Rectangle(
|
||||
DisplayRectangle.Left + _padding.Left,
|
||||
DisplayRectangle.Top + _padding.Top,
|
||||
DisplayRectangle.Width - _padding.Left - _padding.Right,
|
||||
DisplayRectangle.Height - _padding.Top - _padding.Bottom);
|
||||
|
||||
double x = 0;
|
||||
double y = 0;
|
||||
double w = baseRect.Width / (_colcount * 1.0);
|
||||
double h = baseRect.Height / (_rowcount * 1.0);
|
||||
|
||||
if (this.Items == null || itemCount != this.Items.Length)
|
||||
{
|
||||
//아이템갯수가 달라졌으므로 다시 갱신해야함
|
||||
var item = new MotITem[RowCount * ColumnCount];
|
||||
for (int r = 0; r < RowCount; r++)
|
||||
{
|
||||
for (int c = 0; c < ColumnCount; c++)
|
||||
{
|
||||
int idx = r * ColumnCount + c;
|
||||
item[idx] = new MotITem(idx);
|
||||
item[idx].Enable = false;
|
||||
item[idx].Padding = new Padding(0, 0, 0, 0);
|
||||
item[idx].TextAlign = ContentAlignment.MiddleCenter;
|
||||
x = baseRect.Left + (c * w);
|
||||
y = baseRect.Top + (r * h);
|
||||
item[idx].rect = new RectangleF((float)x, (float)y, (float)w, (float)h);
|
||||
item[idx].Dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
this.Items = item;
|
||||
}
|
||||
else
|
||||
{
|
||||
//아이템의 갯수는 같으므로 좌표값만 변경해준다.
|
||||
for (int r = 0; r < RowCount; r++)
|
||||
{
|
||||
for (int c = 0; c < ColumnCount; c++)
|
||||
{
|
||||
int idx = r * ColumnCount + c;
|
||||
var item = Items[idx];
|
||||
x = (c * w);
|
||||
y = (r * h);
|
||||
item.rect = new RectangleF((float)x, (float)y, (float)w, (float)h);
|
||||
item.Dirty = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.Invalidate();
|
||||
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs pe)
|
||||
{
|
||||
//배경그리기
|
||||
//using (var sb = new System.Drawing.Drawing2D.LinearGradientBrush(DisplayRectangle, BackColor, BackColor2On, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
|
||||
pe.Graphics.FillRectangle(new SolidBrush(this.BackColor), DisplayRectangle);
|
||||
|
||||
if (Items == null)
|
||||
{
|
||||
pe.Graphics.DrawString("no items", this.Font, Brushes.Red, 100, 100);
|
||||
return;
|
||||
}
|
||||
|
||||
var items = Items.OrderBy(t => t.No);
|
||||
foreach (var menu in items)
|
||||
{
|
||||
drawItem(menu.idx, pe.Graphics);
|
||||
}
|
||||
|
||||
//테두리 그리기
|
||||
if (BorderSize > 0)
|
||||
{
|
||||
pe.Graphics.DrawRectangle(new Pen(this.BorderColor, BorderSize),
|
||||
this.DisplayRectangle.Left,
|
||||
this.DisplayRectangle.Top,
|
||||
this.DisplayRectangle.Width - 1,
|
||||
this.DisplayRectangle.Height - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void drawItem(int itemIndex, Graphics g = null)
|
||||
{
|
||||
if (g == null) g = this.CreateGraphics();
|
||||
var item = this.Items[itemIndex];
|
||||
|
||||
// g.DrawString("rect null", this.Font, Brushes.White, 100, 100);
|
||||
|
||||
if (item.rect == RectangleF.Empty) return;
|
||||
|
||||
var rect = item.rect;// rects[i];
|
||||
|
||||
var diplayText = item.Text;
|
||||
|
||||
//byte Value = 0;
|
||||
|
||||
//배경이 투명이 아니라면 그린다.
|
||||
//var bgColor1 = Color.DarkBlue; //BackColor1Off;
|
||||
//var bgColor2 = Color.Blue;// BackColor2Off;
|
||||
|
||||
//if (Value != 0 && item.Enable != false)
|
||||
//{
|
||||
// //bgColor1 = Value == 1 ? BackColor1On : BackColor1Err;
|
||||
// //bgColor2 = Value == 1 ? BackColor2On : BackColor2Err;
|
||||
//}
|
||||
|
||||
//using (var sb = new System.Drawing.Drawing2D.LinearGradientBrush(rect, bgColor1, bgColor2, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
|
||||
// g.FillRectangle(sb, rect);
|
||||
|
||||
// if (mouseOverItemIndex == menu.idx)
|
||||
// this.Cursor = Cursors.Hand;
|
||||
// else
|
||||
// this.Cursor = Cursors.Arrow;
|
||||
|
||||
//테두리를 그리는 속성과 트기가 설정된 경우에만 표시
|
||||
//if (mouseOverItemIndex == i)
|
||||
// {
|
||||
// pe.Graphics.DrawRectangle(new Pen(Color.DeepSkyBlue), rect.Left, rect.Top, rect.Width, rect.Height);
|
||||
//}
|
||||
//else
|
||||
{
|
||||
// using (var p = new Pen(BorderColor, 1))
|
||||
// g.DrawRectangle(p, rect.Left, rect.Top, rect.Width, rect.Height);
|
||||
}
|
||||
|
||||
//총 5개의 인디게이터와 하단에 위치값을 표시하는 영역이 있따.
|
||||
//줄 영역은 50%비율로 처리함
|
||||
if(item.Dirty)
|
||||
{
|
||||
//각 영역을 다시 그려줘야한다.
|
||||
var indiWidth = rect.Width / 5.0;
|
||||
// var indiHeight = rect.Height / 2.0;
|
||||
for (int c = 0; c < 5; c++)
|
||||
{
|
||||
item.subRect[c] = new Rectangle((int)(c * indiWidth + item.rect.Left), (int)(item.rect.Top), (int)indiWidth, (int)HeaderHeight);
|
||||
}
|
||||
item.Dirty = false;
|
||||
|
||||
//위치값을 나타내는 영역
|
||||
item.subRect[5] = new Rectangle((int)item.rect.Left, (int)(item.rect.Top + HeaderHeight), (int)rect.Width, (int)rect.Height - HeaderHeight );
|
||||
|
||||
}
|
||||
|
||||
for(int i = 0 ; i < item.subRect.Length;i++)
|
||||
{
|
||||
var B1 = colorB1[i];
|
||||
var B2 = colorB2[i];
|
||||
|
||||
if (i < (item.subRect.Length - 1)) //상태표시칸은 현재 값에 따라서 색상을 달리한다
|
||||
{
|
||||
if ( this.Enabled == false || (item.State[i] == false && DesignMode == false))
|
||||
{
|
||||
B1 = Color.FromArgb(20,20,20);
|
||||
B2 = Color.FromArgb(50,50,50);
|
||||
}
|
||||
}
|
||||
|
||||
var rt = item.subRect[i];
|
||||
using (var br = new System.Drawing.Drawing2D.LinearGradientBrush(rt, B1, B2, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
|
||||
g.FillRectangle(br, rt);
|
||||
|
||||
// g.DrawRectangle(Pens.Yellow, rt);
|
||||
if (i < (item.subRect.Length-1))
|
||||
{
|
||||
sf.Alignment = StringAlignment.Center;
|
||||
sf.LineAlignment = StringAlignment.Center;
|
||||
g.DrawString(IndiName[i], HeaderFont, Brushes.White, rt, sf);
|
||||
}
|
||||
else
|
||||
{
|
||||
sf.LineAlignment = StringAlignment.Center;
|
||||
sf.Alignment = StringAlignment.Far;
|
||||
g.DrawString(item.Position.ToString(PositionDisplayFormat) + " [" + item.PositionCmd.ToString(PositionDisplayFormat) + "] ",
|
||||
this.Font,
|
||||
new SolidBrush(item.PositionColor),
|
||||
rt,
|
||||
sf);
|
||||
}
|
||||
}
|
||||
|
||||
//테두리선은 우측만 처리한다
|
||||
for (int i = 0; i < item.subRect.Length ; i++)
|
||||
{
|
||||
var rt = item.subRect[i];
|
||||
var x1 = rt.Right;
|
||||
var y1 = rt.Top;
|
||||
var x2 = rt.Right;
|
||||
var y2 = rt.Bottom;
|
||||
g.DrawLine(new Pen(GridColor), x1, y1, x2, y2);
|
||||
}
|
||||
var posRect = item.subRect[item.subRect.Length - 1];
|
||||
g.DrawLine(new Pen(Color.Black,1), posRect.Left, posRect.Top, posRect.Right, posRect.Top);
|
||||
|
||||
|
||||
//인덱스번호 출력
|
||||
if (diplayText != "")
|
||||
{
|
||||
g.DrawString(string.Format("[{0}] {1}", item.idx, diplayText),
|
||||
this.Font, new SolidBrush(this.ForeColor),
|
||||
item.rect.Left + 3, item.rect.Top + 3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
36
Handler/Sub/arFrameControl/Properties/AssemblyInfo.cs
Normal file
36
Handler/Sub/arFrameControl/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 어셈블리의 일반 정보는 다음 특성 집합을 통해 제어됩니다.
|
||||
// 어셈블리와 관련된 정보를 수정하려면
|
||||
// 이 특성 값을 변경하십시오.
|
||||
[assembly: AssemblyTitle("arFrameControl")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("arFrameControl")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
|
||||
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
|
||||
// 해당 형식에 대해 ComVisible 특성을 true로 설정하십시오.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
|
||||
[assembly: Guid("9fa3ef10-3c75-40a2-b3e6-a37900b26d0e")]
|
||||
|
||||
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
|
||||
//
|
||||
// 주 버전
|
||||
// 부 버전
|
||||
// 빌드 번호
|
||||
// 수정 버전
|
||||
//
|
||||
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 버전이 자동으로
|
||||
// 지정되도록 할 수 있습니다.
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
104
Handler/Sub/arFrameControl/arFrameControl.csproj
Normal file
104
Handler/Sub/arFrameControl/arFrameControl.csproj
Normal file
@@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{A16C9667-5241-4313-888E-548375F85D29}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>arFrame.Control</RootNamespace>
|
||||
<AssemblyName>arFrameControl</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="GridView\ColorListItem.cs" />
|
||||
<Compile Include="MotCommandButton.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MotCommandButton.Designer.cs">
|
||||
<DependentUpon>MotCommandButton.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MotionView\MotITem.cs" />
|
||||
<Compile Include="GridView\GridView.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GridView\GridView.Designer.cs">
|
||||
<DependentUpon>GridView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MenuBar\MenuControl.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MenuBar\MenuControl.Designer.cs">
|
||||
<DependentUpon>MenuControl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GridView\GridItem.cs" />
|
||||
<Compile Include="MenuBar\MenuItem.cs" />
|
||||
<Compile Include="MotionView\MotionDisplay.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MotionView\MotionDisplay.Designer.cs">
|
||||
<DependentUpon>MotionDisplay.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MotLinkLabel.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MotLinkLabel.Designer.cs">
|
||||
<DependentUpon>MotLinkLabel.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MotValueNumericUpDown.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MotValueNumericUpDown.Designer.cs">
|
||||
<DependentUpon>MotValueNumericUpDown.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\arCtl\arControl.csproj">
|
||||
<Project>{f31c242c-1b15-4518-9733-48558499fe4b}</Project>
|
||||
<Name>arControl</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
Reference in New Issue
Block a user