Commit 88186024 kwwwvagaa

修改日历备忘控件

1 个父辈 969d38ae
...@@ -1308,6 +1308,7 @@ ...@@ -1308,6 +1308,7 @@
this.ucCalendarNotes_Week1.DataSource = null; this.ucCalendarNotes_Week1.DataSource = null;
this.ucCalendarNotes_Week1.Location = new System.Drawing.Point(1, 1); this.ucCalendarNotes_Week1.Location = new System.Drawing.Point(1, 1);
this.ucCalendarNotes_Week1.Name = "ucCalendarNotes_Week1"; this.ucCalendarNotes_Week1.Name = "ucCalendarNotes_Week1";
this.ucCalendarNotes_Week1.ShowAddButton = true;
this.ucCalendarNotes_Week1.ShowCloseButton = true; this.ucCalendarNotes_Week1.ShowCloseButton = true;
this.ucCalendarNotes_Week1.Size = new System.Drawing.Size(439, 344); this.ucCalendarNotes_Week1.Size = new System.Drawing.Size(439, 344);
this.ucCalendarNotes_Week1.SplitLineColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(153)))), ((int)(((byte)(153))))); this.ucCalendarNotes_Week1.SplitLineColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(153)))), ((int)(((byte)(153)))));
...@@ -1316,6 +1317,7 @@ ...@@ -1316,6 +1317,7 @@
this.ucCalendarNotes_Week1.Visible = false; this.ucCalendarNotes_Week1.Visible = false;
this.ucCalendarNotes_Week1.ClickNote += new HZH_Controls.Controls.UCCalendarNotes_Week.ClickNoteEvent(this.ucCalendarNotes_Week1_ClickNote); this.ucCalendarNotes_Week1.ClickNote += new HZH_Controls.Controls.UCCalendarNotes_Week.ClickNoteEvent(this.ucCalendarNotes_Week1_ClickNote);
this.ucCalendarNotes_Week1.CloseClick += new System.EventHandler(this.ucCalendarNotes_Week1_CloseClick); this.ucCalendarNotes_Week1.CloseClick += new System.EventHandler(this.ucCalendarNotes_Week1_CloseClick);
this.ucCalendarNotes_Week1.AddClick += this.ucCalendarNotes_Week1_AddClick;
// //
// btnMouthNext // btnMouthNext
// //
......
...@@ -22,7 +22,8 @@ namespace HZH_Controls.Controls ...@@ -22,7 +22,8 @@ namespace HZH_Controls.Controls
/// </summary> /// </summary>
[Description("点击节点事件"), Category("自定义")] [Description("点击节点事件"), Category("自定义")]
public event ClickNoteEvent ClickNote; public event ClickNoteEvent ClickNote;
[Description("点击添加按钮事件"), Category("自定义")]
public event UCCalendarNotes_Week.AddNoteEvent AddClick;
private object dataSource; private object dataSource;
List<NoteEntity> _dataSource; List<NoteEntity> _dataSource;
...@@ -324,6 +325,12 @@ namespace HZH_Controls.Controls ...@@ -324,6 +325,12 @@ namespace HZH_Controls.Controls
return default(bool); return default(bool);
} }
private void ucCalendarNotes_Week1_AddClick(DateTime beginTime)
{
if (AddClick != null)
AddClick(beginTime);
}
} }
[Serializable] [Serializable]
public class NoteEntity public class NoteEntity
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
this.panMain = new System.Windows.Forms.Panel(); this.panMain = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
this.lblClose = new System.Windows.Forms.Label(); this.lblClose = new System.Windows.Forms.Label();
this.lblAdd = new System.Windows.Forms.Label();
this.panWeek.SuspendLayout(); this.panWeek.SuspendLayout();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
...@@ -75,16 +76,16 @@ ...@@ -75,16 +76,16 @@
this.panWeek.Name = "panWeek"; this.panWeek.Name = "panWeek";
this.panWeek.RowCount = 1; this.panWeek.RowCount = 1;
this.panWeek.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.panWeek.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.panWeek.Size = new System.Drawing.Size(438, 51); this.panWeek.Size = new System.Drawing.Size(394, 51);
this.panWeek.TabIndex = 3; this.panWeek.TabIndex = 3;
// //
// lblRight // lblRight
// //
this.lblRight.Dock = System.Windows.Forms.DockStyle.Fill; this.lblRight.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblRight.Font = new System.Drawing.Font("宋体", 15F); this.lblRight.Font = new System.Drawing.Font("宋体", 15F);
this.lblRight.Location = new System.Drawing.Point(415, 0); this.lblRight.Location = new System.Drawing.Point(373, 0);
this.lblRight.Name = "lblRight"; this.lblRight.Name = "lblRight";
this.lblRight.Size = new System.Drawing.Size(20, 51); this.lblRight.Size = new System.Drawing.Size(18, 51);
this.lblRight.TabIndex = 8; this.lblRight.TabIndex = 8;
this.lblRight.Text = "▶"; this.lblRight.Text = "▶";
this.lblRight.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblRight.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
...@@ -95,9 +96,9 @@ ...@@ -95,9 +96,9 @@
this.lblWeek_7.Dock = System.Windows.Forms.DockStyle.Fill; this.lblWeek_7.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblWeek_7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblWeek_7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWeek_7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59))))); this.lblWeek_7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.lblWeek_7.Location = new System.Drawing.Point(359, 0); this.lblWeek_7.Location = new System.Drawing.Point(323, 0);
this.lblWeek_7.Name = "lblWeek_7"; this.lblWeek_7.Name = "lblWeek_7";
this.lblWeek_7.Size = new System.Drawing.Size(50, 51); this.lblWeek_7.Size = new System.Drawing.Size(44, 51);
this.lblWeek_7.TabIndex = 6; this.lblWeek_7.TabIndex = 6;
this.lblWeek_7.Text = "六"; this.lblWeek_7.Text = "六";
this.lblWeek_7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblWeek_7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
...@@ -108,9 +109,9 @@ ...@@ -108,9 +109,9 @@
this.lblWeek_6.Dock = System.Windows.Forms.DockStyle.Fill; this.lblWeek_6.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblWeek_6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblWeek_6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWeek_6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59))))); this.lblWeek_6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.lblWeek_6.Location = new System.Drawing.Point(303, 0); this.lblWeek_6.Location = new System.Drawing.Point(273, 0);
this.lblWeek_6.Name = "lblWeek_6"; this.lblWeek_6.Name = "lblWeek_6";
this.lblWeek_6.Size = new System.Drawing.Size(50, 51); this.lblWeek_6.Size = new System.Drawing.Size(44, 51);
this.lblWeek_6.TabIndex = 5; this.lblWeek_6.TabIndex = 5;
this.lblWeek_6.Text = "五"; this.lblWeek_6.Text = "五";
this.lblWeek_6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblWeek_6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
...@@ -121,9 +122,9 @@ ...@@ -121,9 +122,9 @@
this.lblWeek_5.Dock = System.Windows.Forms.DockStyle.Fill; this.lblWeek_5.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblWeek_5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblWeek_5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWeek_5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59))))); this.lblWeek_5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.lblWeek_5.Location = new System.Drawing.Point(247, 0); this.lblWeek_5.Location = new System.Drawing.Point(223, 0);
this.lblWeek_5.Name = "lblWeek_5"; this.lblWeek_5.Name = "lblWeek_5";
this.lblWeek_5.Size = new System.Drawing.Size(50, 51); this.lblWeek_5.Size = new System.Drawing.Size(44, 51);
this.lblWeek_5.TabIndex = 4; this.lblWeek_5.TabIndex = 4;
this.lblWeek_5.Text = "四"; this.lblWeek_5.Text = "四";
this.lblWeek_5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblWeek_5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
...@@ -134,9 +135,9 @@ ...@@ -134,9 +135,9 @@
this.lblWeek_4.Dock = System.Windows.Forms.DockStyle.Fill; this.lblWeek_4.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblWeek_4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblWeek_4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWeek_4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59))))); this.lblWeek_4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.lblWeek_4.Location = new System.Drawing.Point(191, 0); this.lblWeek_4.Location = new System.Drawing.Point(173, 0);
this.lblWeek_4.Name = "lblWeek_4"; this.lblWeek_4.Name = "lblWeek_4";
this.lblWeek_4.Size = new System.Drawing.Size(50, 51); this.lblWeek_4.Size = new System.Drawing.Size(44, 51);
this.lblWeek_4.TabIndex = 3; this.lblWeek_4.TabIndex = 3;
this.lblWeek_4.Text = "三"; this.lblWeek_4.Text = "三";
this.lblWeek_4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblWeek_4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
...@@ -147,9 +148,9 @@ ...@@ -147,9 +148,9 @@
this.lblWeek_3.Dock = System.Windows.Forms.DockStyle.Fill; this.lblWeek_3.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblWeek_3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblWeek_3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWeek_3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59))))); this.lblWeek_3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.lblWeek_3.Location = new System.Drawing.Point(135, 0); this.lblWeek_3.Location = new System.Drawing.Point(123, 0);
this.lblWeek_3.Name = "lblWeek_3"; this.lblWeek_3.Name = "lblWeek_3";
this.lblWeek_3.Size = new System.Drawing.Size(50, 51); this.lblWeek_3.Size = new System.Drawing.Size(44, 51);
this.lblWeek_3.TabIndex = 2; this.lblWeek_3.TabIndex = 2;
this.lblWeek_3.Text = "二"; this.lblWeek_3.Text = "二";
this.lblWeek_3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblWeek_3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
...@@ -160,9 +161,9 @@ ...@@ -160,9 +161,9 @@
this.lblWeek_2.Dock = System.Windows.Forms.DockStyle.Fill; this.lblWeek_2.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblWeek_2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblWeek_2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWeek_2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59))))); this.lblWeek_2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.lblWeek_2.Location = new System.Drawing.Point(79, 0); this.lblWeek_2.Location = new System.Drawing.Point(73, 0);
this.lblWeek_2.Name = "lblWeek_2"; this.lblWeek_2.Name = "lblWeek_2";
this.lblWeek_2.Size = new System.Drawing.Size(50, 51); this.lblWeek_2.Size = new System.Drawing.Size(44, 51);
this.lblWeek_2.TabIndex = 1; this.lblWeek_2.TabIndex = 1;
this.lblWeek_2.Text = "一"; this.lblWeek_2.Text = "一";
this.lblWeek_2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblWeek_2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
...@@ -175,7 +176,7 @@ ...@@ -175,7 +176,7 @@
this.lblWeek_1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59))))); this.lblWeek_1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.lblWeek_1.Location = new System.Drawing.Point(23, 0); this.lblWeek_1.Location = new System.Drawing.Point(23, 0);
this.lblWeek_1.Name = "lblWeek_1"; this.lblWeek_1.Name = "lblWeek_1";
this.lblWeek_1.Size = new System.Drawing.Size(50, 51); this.lblWeek_1.Size = new System.Drawing.Size(44, 51);
this.lblWeek_1.TabIndex = 0; this.lblWeek_1.TabIndex = 0;
this.lblWeek_1.Text = "日"; this.lblWeek_1.Text = "日";
this.lblWeek_1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblWeek_1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
...@@ -209,7 +210,7 @@ ...@@ -209,7 +210,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.panMain.Location = new System.Drawing.Point(0, 0); this.panMain.Location = new System.Drawing.Point(0, 0);
this.panMain.Name = "panMain"; this.panMain.Name = "panMain";
this.panMain.Size = new System.Drawing.Size(465, 1220); this.panMain.Size = new System.Drawing.Size(482, 1220);
this.panMain.TabIndex = 5; this.panMain.TabIndex = 5;
this.panMain.Paint += new System.Windows.Forms.PaintEventHandler(this.panMain_Paint); this.panMain.Paint += new System.Windows.Forms.PaintEventHandler(this.panMain_Paint);
this.panMain.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panMain_MouseClick); this.panMain.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panMain_MouseClick);
...@@ -217,6 +218,7 @@ ...@@ -217,6 +218,7 @@
// panel2 // panel2
// //
this.panel2.Controls.Add(this.panWeek); this.panel2.Controls.Add(this.panWeek);
this.panel2.Controls.Add(this.lblAdd);
this.panel2.Controls.Add(this.lblClose); this.panel2.Controls.Add(this.lblClose);
this.panel2.Dock = System.Windows.Forms.DockStyle.Top; this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(0, 0); this.panel2.Location = new System.Drawing.Point(0, 0);
...@@ -237,6 +239,19 @@ ...@@ -237,6 +239,19 @@
this.lblClose.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblClose.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblClose.Click += new System.EventHandler(this.lblClose_Click); this.lblClose.Click += new System.EventHandler(this.lblClose_Click);
// //
// lblAdd
//
this.lblAdd.Dock = System.Windows.Forms.DockStyle.Right;
this.lblAdd.Font = new System.Drawing.Font("微软雅黑", 9F);
this.lblAdd.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.lblAdd.Location = new System.Drawing.Point(394, 0);
this.lblAdd.Name = "lblAdd";
this.lblAdd.Size = new System.Drawing.Size(44, 51);
this.lblAdd.TabIndex = 8;
this.lblAdd.Text = "添加\r\n日程";
this.lblAdd.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblAdd.Click += new System.EventHandler(this.lblAdd_Click);
//
// UCCalendarNotes_Week // UCCalendarNotes_Week
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -269,5 +284,6 @@ ...@@ -269,5 +284,6 @@
private System.Windows.Forms.Panel panMain; private System.Windows.Forms.Panel panMain;
private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label lblClose; private System.Windows.Forms.Label lblClose;
private System.Windows.Forms.Label lblAdd;
} }
} }
...@@ -18,6 +18,7 @@ namespace HZH_Controls.Controls ...@@ -18,6 +18,7 @@ namespace HZH_Controls.Controls
/// <param name="note">节点</param> /// <param name="note">节点</param>
/// <returns>是否刷新列表显示</returns> /// <returns>是否刷新列表显示</returns>
public delegate bool ClickNoteEvent(NoteEntity note); public delegate bool ClickNoteEvent(NoteEntity note);
public delegate void AddNoteEvent(DateTime beginTime);
/// <summary> /// <summary>
/// 点击节点时间 /// 点击节点时间
/// </summary> /// </summary>
...@@ -26,6 +27,9 @@ namespace HZH_Controls.Controls ...@@ -26,6 +27,9 @@ namespace HZH_Controls.Controls
[Description("点击关闭按钮事件"), Category("自定义")] [Description("点击关闭按钮事件"), Category("自定义")]
public event EventHandler CloseClick; public event EventHandler CloseClick;
[Description("点击添加按钮事件"), Category("自定义")]
public event AddNoteEvent AddClick;
private object dataSource; private object dataSource;
List<NoteEntity> _dataSource; List<NoteEntity> _dataSource;
...@@ -34,6 +38,7 @@ namespace HZH_Controls.Controls ...@@ -34,6 +38,7 @@ namespace HZH_Controls.Controls
/// 每个时间点的数据 /// 每个时间点的数据
/// </summary> /// </summary>
Dictionary<int, List<NoteEntity>> m_lstHourSource = new Dictionary<int, List<NoteEntity>>(); Dictionary<int, List<NoteEntity>> m_lstHourSource = new Dictionary<int, List<NoteEntity>>();
Dictionary<int, Rectangle> m_lstAddRect = new Dictionary<int, Rectangle>();
Dictionary<NoteEntity, Rectangle> m_lstRects = new Dictionary<NoteEntity, Rectangle>(); Dictionary<NoteEntity, Rectangle> m_lstRects = new Dictionary<NoteEntity, Rectangle>();
int maxSplit = 1; int maxSplit = 1;
int splitWidth = 1; int splitWidth = 1;
...@@ -61,6 +66,8 @@ namespace HZH_Controls.Controls ...@@ -61,6 +66,8 @@ namespace HZH_Controls.Controls
} }
[Description("是否显示关闭按钮"), Category("自定义")] [Description("是否显示关闭按钮"), Category("自定义")]
public bool ShowCloseButton { get { return lblClose.Visible; } set { lblClose.Visible = value; } } public bool ShowCloseButton { get { return lblClose.Visible; } set { lblClose.Visible = value; } }
[Description("是否显示添加按钮"), Category("自定义")]
public bool ShowAddButton { get { return lblAdd.Visible; } set { lblAdd.Visible = value; } }
DateTime m_dt = DateTime.Now; DateTime m_dt = DateTime.Now;
[Description("当前日期"), Category("自定义")] [Description("当前日期"), Category("自定义")]
...@@ -192,6 +199,9 @@ namespace HZH_Controls.Controls ...@@ -192,6 +199,9 @@ namespace HZH_Controls.Controls
index++; index++;
} }
} }
Rectangle rectAdd = new Rectangle(5, 20 + i * 50, 35, 30);
m_lstAddRect[i] = rectAdd;
} }
} }
...@@ -248,11 +258,11 @@ namespace HZH_Controls.Controls ...@@ -248,11 +258,11 @@ namespace HZH_Controls.Controls
for (int i = 0; i < 24; i++) for (int i = 0; i < 24; i++)
{ {
g.DrawString(i.ToString().PadLeft(2, '0') + ":00", new Font("Arial Unicode MS", 9), new SolidBrush(splitTimeForeColor), new PointF(5, 2 + i * 50)); g.DrawString(i.ToString().PadLeft(2, '0') + ":00", new Font("Arial Unicode MS", 9), new SolidBrush(splitTimeForeColor), new PointF(5, 2 + i * 50));
g.DrawLine(new Pen(new SolidBrush(splitLineColor), 1), new Point(40, 10 + i * 50), new Point(panMain.Width - 10, 10 + i * 50)); g.DrawLine(new Pen(new SolidBrush(splitLineColor), 1), new Point(40, 10 + i * 50), new Point(panMain.Width, 10 + i * 50));
} }
g.DrawString("00:00", new Font("Arial Unicode MS", 9), new SolidBrush(splitTimeForeColor), new PointF(5, 2 + 24 * 50)); g.DrawString("00:00", new Font("Arial Unicode MS", 9), new SolidBrush(splitTimeForeColor), new PointF(5, 2 + 24 * 50));
g.DrawLine(new Pen(new SolidBrush(splitLineColor), 1), new Point(40, 10 + 24 * 50), new Point(panMain.Width - 10, 10 + 24 * 50)); g.DrawLine(new Pen(new SolidBrush(splitLineColor), 1), new Point(40, 10 + 24 * 50), new Point(panMain.Width, 10 + 24 * 50));
foreach (var item in m_lstRects) foreach (var item in m_lstRects)
{ {
...@@ -260,6 +270,11 @@ namespace HZH_Controls.Controls ...@@ -260,6 +270,11 @@ namespace HZH_Controls.Controls
g.DrawLine(new Pen(new SolidBrush(item.Key.NoteLeftLineColor), 2), new Point(item.Value.Left + 1, item.Value.Top + 2), new Point(item.Value.Left + 1, item.Value.Bottom - 2)); g.DrawLine(new Pen(new SolidBrush(item.Key.NoteLeftLineColor), 2), new Point(item.Value.Left + 1, item.Value.Top + 2), new Point(item.Value.Left + 1, item.Value.Bottom - 2));
g.DrawString(item.Key.Title, new Font("微软雅黑", 9), new SolidBrush(item.Key.NoteForeColor), new Rectangle(item.Value.Left + 4, item.Value.Top + 1, item.Value.Width - 4, item.Value.Height - 1)); g.DrawString(item.Key.Title, new Font("微软雅黑", 9), new SolidBrush(item.Key.NoteForeColor), new Rectangle(item.Value.Left + 4, item.Value.Top + 1, item.Value.Width - 4, item.Value.Height - 1));
} }
foreach (var item in m_lstAddRect)
{
g.DrawString("+", new Font("微软雅黑", 15), new SolidBrush(splitTimeForeColor), item.Value, new StringFormat() { Alignment= StringAlignment.Center, LineAlignment= StringAlignment.Center});
}
} }
private void lblLeft_MouseClick(object sender, MouseEventArgs e) private void lblLeft_MouseClick(object sender, MouseEventArgs e)
...@@ -283,6 +298,16 @@ namespace HZH_Controls.Controls ...@@ -283,6 +298,16 @@ namespace HZH_Controls.Controls
if (e.Button == System.Windows.Forms.MouseButtons.Left) if (e.Button == System.Windows.Forms.MouseButtons.Left)
{ {
foreach (var item in m_lstAddRect)
{
if (item.Value.Contains(e.Location))
{
if (AddClick != null)
AddClick(DateTime.Parse(CurrentTime.ToString("yyyy-MM-dd") + " " + item.Key + ":00:00"));
return;
}
}
foreach (var item in m_lstRects) foreach (var item in m_lstRects)
{ {
if (item.Value.Contains(e.Location)) if (item.Value.Contains(e.Location))
...@@ -302,7 +327,7 @@ namespace HZH_Controls.Controls ...@@ -302,7 +327,7 @@ namespace HZH_Controls.Controls
} }
ControlHelper.FreezeControl(panel1, false); ControlHelper.FreezeControl(panel1, false);
} }
break; return;
} }
} }
} }
...@@ -329,5 +354,11 @@ namespace HZH_Controls.Controls ...@@ -329,5 +354,11 @@ namespace HZH_Controls.Controls
panMain.Focus(); panMain.Focus();
} }
} }
private void lblAdd_Click(object sender, EventArgs e)
{
if (AddClick != null)
AddClick(DateTime.Parse(CurrentTime.ToString("yyyy-MM-dd")));
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!