NodeDescription.cs 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace LYFZ.Software.UI.DoorCityProcess.NewOrderCustomControls
  6. {
  7. public class NodeDescription
  8. {
  9. ComponentLibrary.PanelEx panelLine = new ComponentLibrary.PanelEx();
  10. ComponentLibrary.LabelEx labelText = new ComponentLibrary.LabelEx();
  11. ComponentLibrary.LabelEx labelText2 = new ComponentLibrary.LabelEx();
  12. ComponentLibrary.PanelEx panelBg = new ComponentLibrary.PanelEx();
  13. ComponentLibrary.LabelEx labelDescription = new ComponentLibrary.LabelEx();
  14. ComponentLibrary.PanelEx panelGroup = new ComponentLibrary.PanelEx();
  15. public NodeDescription()
  16. {
  17. this.labelText.BackColor = System.Drawing.Color.Transparent;
  18. this.labelText.Font = new System.Drawing.Font( "微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)) );
  19. this.labelText.ForeColor = System.Drawing.Color.DodgerBlue;
  20. this.labelText.Location = new System.Drawing.Point( 4, 4 );
  21. this.labelText.Size = new System.Drawing.Size( 136, 24 );
  22. this.labelText.Text = "";
  23. this.labelText.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  24. this.panelLine.BackColor = System.Drawing.Color.FromArgb( ((int)(((byte)(0)))), ((int)(((byte)(183)))), ((int)(((byte)(238)))) );
  25. this.panelLine.BorderColor = System.Drawing.Color.FromArgb( ((int)(((byte)(255)))), ((int)(((byte)(204)))), ((int)(((byte)(209)))) );
  26. this.panelLine.BorderType = LYFZ.ComponentLibrary.PlBorderType.all;
  27. this.panelLine.BorderWidth = 1;
  28. this.panelLine.Location = new System.Drawing.Point( 0, 31 );
  29. this.panelLine.Size = new System.Drawing.Size( 148, 1 );
  30. this.labelText2.BackColor = System.Drawing.Color.Transparent;
  31. this.labelText2.Font = new System.Drawing.Font( "微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)) );
  32. this.labelText2.ForeColor = System.Drawing.Color.DodgerBlue;
  33. this.labelText2.Location = new System.Drawing.Point( 10, 35 );
  34. this.labelText2.Size = new System.Drawing.Size( 130, 24 );
  35. this.labelText2.Text = "";
  36. this.labelText2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  37. this.labelDescription.BackColor = System.Drawing.Color.Transparent;
  38. this.labelDescription.Dock = System.Windows.Forms.DockStyle.Fill;
  39. this.labelDescription.Font = new System.Drawing.Font( "微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)) );
  40. this.labelDescription.ForeColor = System.Drawing.Color.DodgerBlue;
  41. this.labelDescription.Location = new System.Drawing.Point( 0, 0 );
  42. this.labelDescription.Size = new System.Drawing.Size( 455, 40 );
  43. this.labelDescription.Text = "";
  44. this.labelDescription.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
  45. this.labelDescription.Padding = new System.Windows.Forms.Padding( 3, 0, 0, 0 );
  46. this.panelBg.BackgroundImage = LYFZ.Software.Properties.Resources.方框2;
  47. this.panelBg.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
  48. this.panelBg.Controls.Add( this.labelDescription );
  49. this.panelBg.Location = new System.Drawing.Point( 145, 10 );
  50. this.panelBg.Size = new System.Drawing.Size( 455, 40 );
  51. this.panelGroup.Size = new System.Drawing.Size( 610, 78 );
  52. this.panelGroup.BorderColor = System.Drawing.Color.FromArgb( ((int)(((byte)(255)))), ((int)(((byte)(204)))), ((int)(((byte)(209)))) );
  53. this.panelGroup.BorderType = LYFZ.ComponentLibrary.PlBorderType.all;
  54. this.panelGroup.BorderWidth = 1;
  55. this.panelGroup.Controls.Add( this.panelLine );
  56. this.panelGroup.Controls.Add( this.labelText );
  57. this.panelGroup.Controls.Add( this.labelText2 );
  58. this.panelGroup.Controls.Add( this.panelBg );
  59. }
  60. /// <summary>
  61. /// 节点描述组
  62. /// </summary>
  63. public ComponentLibrary.PanelEx PanelGroup
  64. {
  65. get
  66. {
  67. return panelGroup;
  68. }
  69. }
  70. /// <summary>
  71. /// 状态描述1
  72. /// </summary>
  73. public ComponentLibrary.LabelEx LabelText
  74. {
  75. get
  76. {
  77. return labelText;
  78. }
  79. }
  80. /// <summary>
  81. /// 状态描述2
  82. /// </summary>
  83. public ComponentLibrary.LabelEx LabelText2
  84. {
  85. get
  86. {
  87. return labelText2;
  88. }
  89. }
  90. /// <summary>
  91. /// 详细描述
  92. /// </summary>
  93. public ComponentLibrary.LabelEx LabelDescription
  94. {
  95. get
  96. {
  97. return labelDescription;
  98. }
  99. }
  100. /// <summary>
  101. /// 方框背景
  102. /// </summary>
  103. public ComponentLibrary.PanelEx PanelBg
  104. {
  105. get
  106. {
  107. return panelBg;
  108. }
  109. }
  110. /// <summary>
  111. ///
  112. /// </summary>
  113. /// <param name="text"></param>
  114. /// <returns></returns>
  115. public System.Windows.Forms.LinkLabel NewLinkBtn( string text = "未知按钮" )
  116. {
  117. System.Windows.Forms.LinkLabel likBtn = new System.Windows.Forms.LinkLabel();
  118. likBtn.Text = text;
  119. likBtn.ActiveLinkColor = System.Drawing.Color.FromArgb( ((int)(((byte)(255)))), ((int)(((byte)(104)))), ((int)(((byte)(109)))) );
  120. likBtn.AutoSize = true;
  121. likBtn.DisabledLinkColor = System.Drawing.Color.DarkGray;
  122. likBtn.Font = new System.Drawing.Font( "微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)) );
  123. likBtn.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;
  124. likBtn.LinkColor = System.Drawing.Color.FromArgb( ((int)(((byte)(255)))), ((int)(((byte)(104)))), ((int)(((byte)(109)))) );
  125. likBtn.Size = new System.Drawing.Size( 56, 17 );
  126. likBtn.TabStop = true;
  127. return likBtn;
  128. }
  129. List<System.Windows.Forms.LinkLabel> likBtnList = new List<System.Windows.Forms.LinkLabel>();
  130. public List<System.Windows.Forms.LinkLabel> LikBtnList
  131. {
  132. get
  133. {
  134. return likBtnList;
  135. }
  136. }
  137. public void AddLinkBtn( System.Windows.Forms.LinkLabel likBtn )
  138. {
  139. likBtn.Location = new System.Drawing.Point( this.panelBg.Location.X + this.panelBg.Width - 60 - 20 * likBtnList.Count - 56 * likBtnList.Count, this.panelBg.Location.Y + this.panelBg.Height + 1 );
  140. likBtnList.Add( likBtn );
  141. this.panelGroup.Controls.Add( likBtn );
  142. }
  143. string[] _btnTexts = null;
  144. public string[] BtnTexts
  145. {
  146. set
  147. {
  148. _btnTexts = value;
  149. }
  150. get
  151. {
  152. return _btnTexts;
  153. }
  154. }
  155. bool isAddBtnText = false;
  156. /// <summary>
  157. /// 是否已添加了按钮
  158. /// </summary>
  159. public bool IsAddBtnText
  160. {
  161. set
  162. {
  163. isAddBtnText = value;
  164. }
  165. get
  166. {
  167. return isAddBtnText;
  168. }
  169. }
  170. FlowchartNode currentNode = null;
  171. /// <summary>
  172. /// 当前节点
  173. /// </summary>
  174. public FlowchartNode CurrentNode
  175. {
  176. set
  177. {
  178. currentNode = value;
  179. }
  180. get
  181. {
  182. return currentNode;
  183. }
  184. }
  185. }
  186. }