PanelBottomRight.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. using Resources;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Drawing;
  5. using System.Windows.Forms;
  6. namespace SmartCoalApplication.Core.CustomControl
  7. {
  8. /// <summary>
  9. /// 画板底部快捷栏 右侧的多图/多相封装
  10. /// </summary>
  11. public partial class PanelBottomRight : Panel
  12. {
  13. /// <summary>
  14. /// 从后往前播放模式
  15. /// </summary>
  16. public Button play1Button;
  17. /// <summary>
  18. /// 从前往后播放模式
  19. /// </summary>
  20. public Button play2Button;
  21. /// <summary>
  22. /// 循环播放模式
  23. /// </summary>
  24. public Button play3Button;
  25. /// <summary>
  26. /// 播放(暂停)
  27. /// </summary>
  28. public Button playOrPauseButton;
  29. /// <summary>
  30. /// 删除当前显示页
  31. /// </summary>
  32. public Button deleteButton;
  33. /// <summary>
  34. /// 修改播放时间间隔
  35. /// </summary>
  36. public Button editTimeButton;
  37. /// <summary>
  38. /// 播放滑动滚动条
  39. /// </summary>
  40. public TriangleTrackBar trackBar;
  41. /// <summary>
  42. /// 当前第几页,一共多少页
  43. /// </summary>
  44. public TextBox textBox;
  45. /// <summary>
  46. /// hint 提示信息
  47. /// </summary>
  48. public ToolTip toolTip;
  49. /// <summary>
  50. /// 位置
  51. /// </summary>
  52. public int locationX = 5;
  53. /// <summary>
  54. /// 左侧快捷工具的容器
  55. /// </summary>
  56. private Panel panelLeft;
  57. /// <summary>
  58. /// 显示多图/多相,ture为显示多图
  59. /// </summary>
  60. private bool showPictures = false;
  61. /// <summary>
  62. /// 目前被改成tab的菜单了
  63. /// </summary>
  64. public DocumentBottomStrip documentStrip;
  65. public bool ShowPictures
  66. {
  67. get
  68. {
  69. return this.showPictures;
  70. }
  71. set
  72. {
  73. this.showPictures = value;
  74. this.documentStrip.Visible = !this.showPictures;
  75. this.panelLeft.Visible = this.showPictures;
  76. }
  77. }
  78. /// <summary>
  79. /// 初始化方法
  80. /// </summary>
  81. public PanelBottomRight()
  82. {
  83. InitializeComponent();
  84. InitInternalControl();
  85. this.documentStrip = new DocumentBottomStrip();
  86. //
  87. // documentStrip
  88. //
  89. this.documentStrip.AutoSize = false;
  90. this.documentStrip.Name = "DocumentBottomStrip";
  91. this.documentStrip.TabIndex = 5;
  92. //设置是否多选模式
  93. this.documentStrip.AllowMultiChoise = true;// false;
  94. //this.documentStrip.DocumentListChanged += new EventHandler(DocumentStrip_DocumentListChanged);
  95. //this.documentStrip.DocumentClicked += DocumentStrip_DocumentClicked;
  96. this.documentStrip.ManagedFocus = false;// true;
  97. this.documentStrip.Location = new Point(0, 0);
  98. this.documentStrip.Size = new Size(200, 20);
  99. this.documentStrip.Dock = DockStyle.Fill;// Right;
  100. this.documentStrip.Visible = false;// !this.showPictures;
  101. this.Controls.Add(this.documentStrip);
  102. }
  103. /// <summary>
  104. /// 创建内部组件
  105. /// </summary>
  106. private void InitInternalControl()
  107. {
  108. //
  109. // 设置Panel属性
  110. //
  111. this.Cursor = Cursors.Default;
  112. //
  113. // 左侧panel属性
  114. //
  115. this.panelLeft = new Panel();
  116. this.panelLeft.Dock = DockStyle.Left;
  117. this.panelLeft.AutoSize = true;
  118. //
  119. // 播放滑动滚动条
  120. //
  121. //this.locationX += 20;
  122. this.trackBar = new TriangleTrackBar();
  123. this.trackBar.AutoSize = false;
  124. this.trackBar.Minimum = 1;
  125. this.trackBar.Name = "amountTrackBar";
  126. this.trackBar.Location = new Point(locationX, 0);
  127. this.trackBar.Size = new Size(175, 30);
  128. this.trackBar.Minimum = 1;
  129. this.trackBar.Maximum = 500;
  130. this.trackBar.Value = 150;
  131. this.trackBar.TrackBarScroll += new System.EventHandler(this.trackBar_Scroll);
  132. //this.trackBar.SmallChange = 1;
  133. //this.trackBar.TickStyle = TickStyle.None;
  134. ////this.trackBar.Value = 100;
  135. this.trackBar.trackBar1.Location = new System.Drawing.Point(10, 6);
  136. this.trackBar.trackBar1.Size = new System.Drawing.Size(155, 19);
  137. //
  138. // 当前第几页,一共多少页
  139. //
  140. this.locationX += 175;
  141. this.textBox = new TextBox();
  142. this.textBox.Enabled = false;
  143. this.textBox.TextAlign = HorizontalAlignment.Center;
  144. this.textBox.Size = new Size(60, 20);
  145. this.textBox.Location = new Point(locationX, 5);
  146. this.textBox.Text = "150/500";
  147. this.locationX += 60 + 5;// + 5;
  148. //
  149. // 从后往前播放
  150. //
  151. this.play1Button = new Button();
  152. this.play1Button.Location = new Point(locationX, 5);
  153. this.play1Button.Size = new Size(20, 20);
  154. this.play1Button.Image = PdnResources.GetImageResource("Icons.MultiFromAfterPlayIcon.png").Reference;
  155. this.play1Button.FlatStyle = FlatStyle.Flat;
  156. this.play1Button.FlatAppearance.BorderSize = 0;
  157. //
  158. // 从前往后播放
  159. //
  160. this.locationX += 20;
  161. this.play2Button = new Button();
  162. this.play2Button.Location = new Point(locationX, 5);
  163. this.play2Button.Size = new Size(20, 20);
  164. this.play2Button.Image = PdnResources.GetImageResource("Icons.MultiFromBehindPlayIcon.png").Reference;
  165. this.play2Button.FlatStyle = FlatStyle.Flat;
  166. this.play2Button.FlatAppearance.BorderSize = 0;
  167. //
  168. // 循环播放
  169. //
  170. this.locationX += 20;
  171. this.play3Button = new Button();
  172. this.play3Button.Location = new Point(locationX, 5);
  173. this.play3Button.Size = new Size(20, 20);
  174. this.play3Button.Image = PdnResources.GetImageResource("Icons.MultiCirclePlayIcon.png").Reference;
  175. this.play3Button.FlatStyle = FlatStyle.Flat;
  176. this.play3Button.FlatAppearance.BorderSize = 0;
  177. //
  178. // 播放(暂停) 备注:这里需要判断显示播放/暂停
  179. //
  180. this.locationX += 20;
  181. this.playOrPauseButton = new Button();
  182. this.playOrPauseButton.Location = new Point(locationX, 5);
  183. this.playOrPauseButton.Size = new Size(20, 20);
  184. this.playOrPauseButton.Image = PdnResources.GetImageResource("Icons.MultiNowPlayIcon.png").Reference;
  185. this.playOrPauseButton.FlatStyle = FlatStyle.Flat;
  186. this.playOrPauseButton.FlatAppearance.BorderSize = 0;
  187. //
  188. // 删除当前显示页
  189. //
  190. this.locationX += 20;
  191. this.deleteButton = new Button();
  192. this.deleteButton.Location = new Point(locationX, 5);
  193. this.deleteButton.Size = new Size(20, 20);
  194. this.deleteButton.Image = PdnResources.GetImageResource("Icons.MultiNowDeleteIcon.png").Reference;
  195. this.deleteButton.FlatStyle = FlatStyle.Flat;
  196. this.deleteButton.FlatAppearance.BorderSize = 0;
  197. //
  198. // 修改播放时间间隔
  199. //
  200. this.locationX += 20;
  201. this.editTimeButton = new Button();
  202. this.editTimeButton.Location = new Point(locationX, 5);
  203. this.editTimeButton.Size = new Size(20, 20);
  204. this.editTimeButton.Image = PdnResources.GetImageResource("Icons.MultiChangeTimeIcon.png").Reference;
  205. this.editTimeButton.FlatStyle = FlatStyle.Flat;
  206. this.editTimeButton.FlatAppearance.BorderSize = 0;
  207. ////
  208. //// 播放滑动滚动条
  209. ////
  210. this.locationX += 20;
  211. //this.trackBar = new TrackBar();
  212. //this.trackBar.AutoSize = false;
  213. //this.trackBar.Minimum = 1;
  214. //this.trackBar.Name = "amountTrackBar";
  215. //this.trackBar.Location = new Point(locationX, 5);
  216. //this.trackBar.Size = new Size(175, 20);
  217. //this.trackBar.SmallChange = 1;
  218. //this.trackBar.TickStyle = TickStyle.None;
  219. ////this.trackBar.Value = 100;
  220. ////
  221. //// 当前第几页,一共多少页
  222. ////
  223. //this.locationX += 175;
  224. //this.textBox = new TextBox();
  225. //this.textBox.Size = new Size(40, 20);
  226. //this.textBox.Location = new Point(locationX, 5);
  227. //this.locationX += 40;// + 5 + 5;
  228. //
  229. // 提示信息
  230. //
  231. this.toolTip = new ToolTip();
  232. this.toolTip.SetToolTip(this.play1Button, PdnResources.GetString("Menu.Playitbackwards.text"));
  233. this.toolTip.SetToolTip(this.play2Button, PdnResources.GetString("Menu.Playbackandforth.text"));
  234. this.toolTip.SetToolTip(this.play3Button, PdnResources.GetString("Menu.Loopfor.text"));
  235. this.toolTip.SetToolTip(this.playOrPauseButton, PdnResources.GetString("Menu.Playpause.text"));
  236. this.toolTip.SetToolTip(this.deleteButton, PdnResources.GetString("Menu.Deletethecurrentdisplaypage.text"));
  237. this.toolTip.SetToolTip(this.editTimeButton, PdnResources.GetString("Menu.Modifytheplaybackinterval.text"));
  238. this.panelLeft.Visible = false;// this.showPictures;
  239. this.panelLeft.Controls.Add(this.play1Button);
  240. this.panelLeft.Controls.Add(this.play2Button);
  241. this.panelLeft.Controls.Add(this.play3Button);
  242. this.panelLeft.Controls.Add(this.playOrPauseButton);
  243. this.panelLeft.Controls.Add(this.deleteButton);
  244. this.panelLeft.Controls.Add(this.editTimeButton);
  245. this.panelLeft.Controls.Add(this.trackBar);
  246. this.panelLeft.Controls.Add(this.textBox);
  247. this.Controls.Add(this.panelLeft);
  248. }
  249. /// <summary>
  250. /// 图片选择改变
  251. /// </summary>
  252. /// <param name="sender"></param>
  253. /// <param name="e"></param>
  254. private void trackBar_Scroll(object sender, EventArgs e)
  255. {
  256. this.textBox.Text = trackBar.Value + @"/" + trackBar.Maximum;
  257. }
  258. }
  259. }