+++ /dev/null
-using System.Windows.Forms;\r
-using System.Drawing;\r
-using com.andoutomo.kybernetes.data.DAO;\r
-using System;\r
-\r
-namespace com.andoutomo.kybernetes.view\r
-{\r
- internal class PanelController\r
- {\r
- private BaseForm baseForm;\r
- internal PanelController(BaseForm form)\r
- {\r
- this.baseForm = form;\r
- }\r
- internal Panel createRow(int point,TaskData data)\r
- {\r
- Panel rowPanel=new Panel();\r
- Color frColor = Color.FromArgb(data.FrColor);\r
- Color bgColor = Color.FromArgb(data.BgColor);\r
- FontStyle style;\r
- FontStyle timeStyle;\r
- float fontsize;\r
- int rowsize;\r
-\r
- if (data.ForecastMin >= 90|| data.RealMin >=90)\r
- {\r
- fontsize = 10F;\r
- rowsize = 24;\r
- \r
- if (data.isComplete)\r
- {\r
- style = FontStyle.Strikeout;\r
- timeStyle = FontStyle.Strikeout;\r
- frColor = Color.Gray;\r
- }\r
- else if (data.ForecastMin >= 120 || data.RealMin >=120)\r
- {\r
- style = FontStyle.Regular;\r
- timeStyle = FontStyle.Bold;\r
- }\r
- else\r
- {\r
- timeStyle = FontStyle.Regular;\r
- style = FontStyle.Regular;\r
- }\r
- }\r
- else if (data.ForecastMin >= 60 || data.RealMin >= 60)\r
- {\r
- fontsize = 9F;\r
- rowsize = 20;\r
-\r
- if (data.isComplete)\r
- {\r
- timeStyle = FontStyle.Strikeout;\r
- style = FontStyle.Strikeout;\r
- frColor = Color.Gray;\r
- }\r
- else\r
- {\r
- timeStyle = FontStyle.Regular;\r
- style = FontStyle.Regular;\r
- }\r
-\r
- }\r
- else\r
- {\r
- fontsize = 9F;\r
- rowsize = 16;\r
-\r
- if (data.isComplete)\r
- {\r
- timeStyle = FontStyle.Strikeout;\r
- style = FontStyle.Strikeout;\r
- frColor = Color.Gray;\r
- }\r
- else\r
- {\r
- timeStyle = FontStyle.Regular;\r
- style = FontStyle.Regular;\r
- }\r
-\r
- }\r
- //全体サイズからContentの長さを決める。\r
- \r
- int wkPanelSize = baseForm.getPanelSize();\r
-\r
- int wkContentSize = wkPanelSize - 689;\r
- int wkDelaySize = wkContentSize - 211;\r
- sortID = data.SortID;\r
-\r
- //rowPanel.Controls.Add(new CustomLabel(data.Indicator, frColor, bgColor, FontStyle.Regular, 9F, 0, 21, rowsize,ContentAlignment.MiddleCenter));\r
- rowPanel.Controls.Add(new CustomLabel(data.SortID.ToString(), frColor, bgColor, FontStyle.Regular, 9F, 0, 41, rowsize, ContentAlignment.MiddleRight));\r
- rowPanel.Controls.Add(new CustomLabel(data.DoDate.getDateString(), frColor, bgColor, style, 9F, 40, 56, rowsize,ContentAlignment.MiddleCenter));\r
- rowPanel.Controls.Add(new CustomLabel(data.DoDate.getDowStr(), frColor, bgColor, style, 9F, 95, 26, rowsize,ContentAlignment.MiddleCenter));\r
- rowPanel.Controls.Add(new CustomLabel(data.TimeArea, frColor, bgColor, style, 9F, 120, 21, rowsize,ContentAlignment.MiddleCenter));\r
- rowPanel.Controls.Add(new CustomLabel(data.Category, frColor, bgColor, style, 9F, 140, 81, rowsize));\r
- rowPanel.Controls.Add(new CustomLabel(data.Contents, frColor, bgColor, style, 9F, 220, wkContentSize, rowsize));\r
- rowPanel.Controls.Add(new CustomLabel(data.getForcastHourStr, frColor, bgColor, timeStyle, fontsize, wkDelaySize + 430, 51, rowsize,ContentAlignment.MiddleRight));\r
- rowPanel.Controls.Add(new CustomLabel(data.ForecastMin.ToString(), frColor, bgColor, timeStyle, fontsize, wkDelaySize + 480, 51, rowsize, ContentAlignment.MiddleRight));\r
- rowPanel.Controls.Add(new CustomLabel(data.RealMin.ToString(), frColor, bgColor, timeStyle, fontsize, wkDelaySize + 530, 51, rowsize, ContentAlignment.MiddleRight));\r
- rowPanel.Controls.Add(new CustomLabel(data.StartTime.ToString(), frColor, bgColor, style, 9F, wkDelaySize + 580, 61, rowsize, ContentAlignment.MiddleCenter));\r
- rowPanel.Controls.Add(new CustomLabel(data.EndTime.ToString(), frColor, bgColor, style, 9F, wkDelaySize + 640, 61, rowsize, ContentAlignment.MiddleCenter));\r
- \r
- rowPanel.Controls.Add(new CustomLabel(data.Project, frColor, bgColor, style, 9F, wkDelaySize + 700, 81, rowsize));\r
- rowPanel.Controls.Add(new CustomLabel((data.IsRepeat == 1 ? "R" : ""), frColor, bgColor, style, 9F, wkDelaySize + 780, 21, rowsize, ContentAlignment.MiddleCenter));\r
- rowPanel.Controls.Add(new CustomLabel((data.HasComment == 1 ? "*" : ""), frColor, bgColor, style, 9F, wkDelaySize + 800, 21, rowsize, ContentAlignment.MiddleCenter));\r
- rowPanel.Controls.Add(new CustomLabel((string.IsNullOrEmpty(data.Tags) ? "" : "*"), frColor, bgColor, style, 9F, wkDelaySize + 820, 21, rowsize, ContentAlignment.MiddleCenter,data.Tags));\r
- rowPanel.Controls.Add(new CustomLabel(data.SortID.ToString(), frColor, bgColor, FontStyle.Regular, 9F, wkDelaySize + 840, 41, rowsize, ContentAlignment.MiddleRight));\r
-\r
- rowPanel.Location = new Point(0, point);\r
- rowPanel.Size = new Size(wkPanelSize - 19, rowsize);\r
- \r
- rowPanel.TabStop = false;\r
- foreach (Control eachControls in rowPanel.Controls)\r
- {\r
- eachControls.DoubleClick += new System.EventHandler(rowPanelDblClickAction);\r
- }\r
-\r
- return rowPanel;\r
- }\r
- private int sortID;\r
-\r
- private void rowPanelDblClickAction(object sender, EventArgs args)\r
- {\r
- baseForm.AddIDToText(sortID.ToString());\r
- }\r
- \r
- }\r
-\r
- internal class CustomLabel:Label\r
- {\r
- internal CustomLabel(string text,Color FRColor,Color BGColor,FontStyle style,float size,int location,int colsize,int rowSize)\r
- {\r
- //innerLabel = new Label();\r
- //可変要素\r
- this.Text = text;\r
- this.BackColor = BGColor;\r
- this.ForeColor = FRColor;\r
- this.Font = new Font("MS UI Gothic", size, style, GraphicsUnit.Point, 128);\r
- this.Location = new Point(location, 0);\r
- this.Size = new Size(colsize, rowSize);\r
-\r
- //固定要素\r
- this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
- this.TabIndex = 0;\r
- this.TextAlign = ContentAlignment.MiddleLeft;\r
- this.Anchor = (AnchorStyles.Left | AnchorStyles.Top);\r
- }\r
- internal CustomLabel(string text, Color FRColor, Color BGColor, FontStyle style, float size, int location, int colsize, int rowSize, ContentAlignment align)\r
- :this(text,FRColor,BGColor,style,size,location,colsize,rowSize)\r
- {\r
- this.TextAlign = align;\r
- }\r
-\r
- internal CustomLabel(string text, Color FRColor, Color BGColor, FontStyle style, float size, int location, int colsize, int rowSize, ContentAlignment align, string tooltipStr)\r
- : this(text, FRColor, BGColor, style, size, location, colsize, rowSize,align)\r
- {\r
- ToolTip pop = new ToolTip();\r
- //ToolTipの設定を行う\r
- //ToolTipが表示されるまでの時間\r
- pop.InitialDelay = 500;\r
- //ToolTipが表示されている時に、別のToolTipを表示するまでの時間\r
- pop.ReshowDelay = 100;\r
- //ToolTipを表示する時間\r
- pop.AutoPopDelay = 4000;\r
- //フォームがアクティブでない時でもToolTipを表示する\r
- pop.ShowAlways = false;\r
-\r
- //このオブジェクトにToolTipが表示されるようにする\r
- pop.SetToolTip(this, tooltipStr);\r
- \r
-\r
- }\r
- }\r
-}\r