ProductDetailsForm.Designer.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. using System.Drawing;
  2. using System.Windows.Forms;
  3. namespace TradeApp.WinForms.V08;
  4. partial class ProductDetailsForm
  5. {
  6. private System.ComponentModel.IContainer components = null;
  7. private Panel AsyncTaskPhoto;
  8. private PictureBox productPictureBox;
  9. private Label photoPlaceholderLabel;
  10. private TableLayoutPanel AsyncTaskDetails;
  11. private Label titleLabel;
  12. private Label descriptionLabel;
  13. private Label descriptionValueLabel;
  14. private Label manufacturerLabel;
  15. private Label manufacturerValueLabel;
  16. private Label supplierLabel;
  17. private Label supplierValueLabel;
  18. private Label priceLabel;
  19. private Label priceValueLabel;
  20. private FlowLayoutPanel pricePanel;
  21. private Label AsyncTaskOriginalPrice;
  22. private Label unitLabel;
  23. private Label unitValueLabel;
  24. private Label stockLabel;
  25. private Label stockValueLabel;
  26. private Label articleLabel;
  27. private Label articleValueLabel;
  28. private Panel AsyncTaskDiscountContainer;
  29. private Label discountTitleLabel;
  30. private Label AsyncTaskDiscountValue;
  31. private Label finalPriceTitleLabel;
  32. private Label finalPriceValueLabel;
  33. private Button closeButton;
  34. protected override void Dispose(bool disposing)
  35. {
  36. if (disposing)
  37. {
  38. productPictureBox?.Image?.Dispose();
  39. components?.Dispose();
  40. }
  41. base.Dispose(disposing);
  42. }
  43. private void InitializeComponent()
  44. {
  45. AsyncTaskPhoto = new Panel();
  46. productPictureBox = new PictureBox();
  47. photoPlaceholderLabel = new Label();
  48. AsyncTaskDetails = new TableLayoutPanel();
  49. titleLabel = new Label();
  50. descriptionLabel = new Label();
  51. descriptionValueLabel = new Label();
  52. manufacturerLabel = new Label();
  53. manufacturerValueLabel = new Label();
  54. supplierLabel = new Label();
  55. supplierValueLabel = new Label();
  56. priceLabel = new Label();
  57. priceValueLabel = new Label();
  58. AsyncTaskOriginalPrice = new Label();
  59. unitLabel = new Label();
  60. unitValueLabel = new Label();
  61. stockLabel = new Label();
  62. stockValueLabel = new Label();
  63. articleLabel = new Label();
  64. articleValueLabel = new Label();
  65. AsyncTaskDiscountContainer = new Panel();
  66. discountTitleLabel = new Label();
  67. AsyncTaskDiscountValue = new Label();
  68. finalPriceTitleLabel = new Label();
  69. finalPriceValueLabel = new Label();
  70. closeButton = new Button();
  71. AsyncTaskPhoto.SuspendLayout();
  72. ((System.ComponentModel.ISupportInitialize)productPictureBox).BeginInit();
  73. AsyncTaskDetails.SuspendLayout();
  74. AsyncTaskDiscountContainer.SuspendLayout();
  75. SuspendLayout();
  76. AsyncTaskPhoto.BorderStyle = BorderStyle.FixedSingle;
  77. AsyncTaskPhoto.Location = new Point(10, 10);
  78. AsyncTaskPhoto.Margin = new Padding(3);
  79. AsyncTaskPhoto.Size = new Size(270, 410);
  80. AsyncTaskPhoto.Controls.Add(productPictureBox);
  81. AsyncTaskPhoto.Controls.Add(photoPlaceholderLabel);
  82. productPictureBox.Dock = DockStyle.Fill;
  83. productPictureBox.SizeMode = PictureBoxSizeMode.Zoom;
  84. photoPlaceholderLabel.AutoSize = false;
  85. photoPlaceholderLabel.Dock = DockStyle.Fill;
  86. photoPlaceholderLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold);
  87. photoPlaceholderLabel.Text = "Фото";
  88. photoPlaceholderLabel.TextAlign = ContentAlignment.MiddleCenter;
  89. AsyncTaskDetails.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
  90. AsyncTaskDetails.ColumnCount = 2;
  91. AsyncTaskDetails.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 160F));
  92. AsyncTaskDetails.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
  93. AsyncTaskDetails.Location = new Point(293, 10);
  94. AsyncTaskDetails.Margin = new Padding(3);
  95. AsyncTaskDetails.Size = new Size(450, 410);
  96. pricePanel = new FlowLayoutPanel();
  97. pricePanel.FlowDirection = FlowDirection.LeftToRight;
  98. pricePanel.Dock = DockStyle.Fill;
  99. pricePanel.AutoSize = true;
  100. pricePanel.WrapContents = false;
  101. pricePanel.Padding = new Padding(0);
  102. pricePanel.Margin = new Padding(0);
  103. AsyncTaskDetails.Controls.Add(titleLabel, 0, 0);
  104. AsyncTaskDetails.Controls.Add(descriptionLabel, 0, 1);
  105. AsyncTaskDetails.Controls.Add(descriptionValueLabel, 1, 1);
  106. AsyncTaskDetails.Controls.Add(manufacturerLabel, 0, 2);
  107. AsyncTaskDetails.Controls.Add(manufacturerValueLabel, 1, 2);
  108. AsyncTaskDetails.Controls.Add(supplierLabel, 0, 3);
  109. AsyncTaskDetails.Controls.Add(supplierValueLabel, 1, 3);
  110. AsyncTaskDetails.Controls.Add(priceLabel, 0, 4);
  111. // Place both price labels into a FlowLayoutPanel so they share the same row
  112. AsyncTaskDetails.Controls.Add(pricePanel, 1, 4);
  113. pricePanel.Controls.Add(priceValueLabel);
  114. pricePanel.Controls.Add(AsyncTaskOriginalPrice);
  115. AsyncTaskDetails.Controls.Add(unitLabel, 0, 5);
  116. AsyncTaskDetails.Controls.Add(unitValueLabel, 1, 5);
  117. AsyncTaskDetails.Controls.Add(stockLabel, 0, 6);
  118. AsyncTaskDetails.Controls.Add(stockValueLabel, 1, 6);
  119. AsyncTaskDetails.Controls.Add(articleLabel, 0, 7);
  120. AsyncTaskDetails.Controls.Add(articleValueLabel, 1, 7);
  121. AsyncTaskDetails.Margin = new Padding(3);
  122. AsyncTaskDetails.RowCount = 8;
  123. AsyncTaskDetails.RowStyles.Add(new RowStyle(SizeType.Absolute, 54F));
  124. AsyncTaskDetails.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
  125. AsyncTaskDetails.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
  126. AsyncTaskDetails.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
  127. AsyncTaskDetails.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
  128. AsyncTaskDetails.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
  129. AsyncTaskDetails.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
  130. AsyncTaskDetails.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
  131. titleLabel.AutoSize = true;
  132. AsyncTaskDetails.SetColumnSpan(titleLabel, 2);
  133. titleLabel.Dock = DockStyle.Fill;
  134. titleLabel.Font = new Font("Segoe UI", 12F, FontStyle.Bold);
  135. titleLabel.Padding = new Padding(8);
  136. titleLabel.TextAlign = ContentAlignment.MiddleLeft;
  137. ConfigureCaption(descriptionLabel, "Описание товара:");
  138. ConfigureValue(descriptionValueLabel);
  139. descriptionValueLabel.AutoEllipsis = true;
  140. ConfigureCaption(manufacturerLabel, "Производитель:");
  141. ConfigureValue(manufacturerValueLabel);
  142. ConfigureCaption(supplierLabel, "Поставщик:");
  143. ConfigureValue(supplierValueLabel);
  144. ConfigureCaption(priceLabel, "Цена:");
  145. ConfigureValue(priceValueLabel);
  146. // priceValueLabel is placed inside a FlowLayoutPanel; make it autosize and left-docked so it appears
  147. // correctly when generated into the FlowLayoutPanel cell.
  148. priceValueLabel.AutoSize = true;
  149. priceValueLabel.Dock = DockStyle.Left;
  150. priceValueLabel.Padding = new Padding(6);
  151. priceValueLabel.TextAlign = ContentAlignment.MiddleLeft;
  152. AsyncTaskOriginalPrice.AutoSize = true;
  153. AsyncTaskOriginalPrice.Dock = DockStyle.Fill;
  154. AsyncTaskOriginalPrice.Font = new Font("Segoe UI", 9F, FontStyle.Strikeout);
  155. AsyncTaskOriginalPrice.ForeColor = Color.Red;
  156. AsyncTaskOriginalPrice.Padding = new Padding(6);
  157. AsyncTaskOriginalPrice.TextAlign = ContentAlignment.MiddleLeft;
  158. AsyncTaskOriginalPrice.Visible = false;
  159. ConfigureCaption(unitLabel, "Единица измерения:");
  160. ConfigureValue(unitValueLabel);
  161. ConfigureCaption(stockLabel, "Количество на складе:");
  162. ConfigureValue(stockValueLabel);
  163. ConfigureCaption(articleLabel, "Артикул:");
  164. ConfigureValue(articleValueLabel);
  165. AsyncTaskDiscountContainer.BorderStyle = BorderStyle.FixedSingle;
  166. AsyncTaskDiscountContainer.Dock = DockStyle.Right;
  167. AsyncTaskDiscountContainer.Width = 220;
  168. AsyncTaskDiscountContainer.Margin = new Padding(3);
  169. // Add controls in reverse so Dock=Top produces top-to-bottom visual order
  170. AsyncTaskDiscountContainer.Controls.Add(closeButton);
  171. AsyncTaskDiscountContainer.Controls.Add(finalPriceValueLabel);
  172. AsyncTaskDiscountContainer.Controls.Add(finalPriceTitleLabel);
  173. AsyncTaskDiscountContainer.Controls.Add(AsyncTaskDiscountValue);
  174. AsyncTaskDiscountContainer.Controls.Add(discountTitleLabel);
  175. discountTitleLabel.AutoSize = false;
  176. discountTitleLabel.Dock = DockStyle.Top;
  177. discountTitleLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold);
  178. discountTitleLabel.Height = 54;
  179. discountTitleLabel.Text = "Действующая скидка";
  180. discountTitleLabel.TextAlign = ContentAlignment.MiddleCenter;
  181. AsyncTaskDiscountValue.AutoSize = false;
  182. AsyncTaskDiscountValue.Dock = DockStyle.Top;
  183. AsyncTaskDiscountValue.Font = new Font("Segoe UI", 24F, FontStyle.Bold);
  184. AsyncTaskDiscountValue.ForeColor = Color.Black;
  185. AsyncTaskDiscountValue.Height = 70;
  186. AsyncTaskDiscountValue.TextAlign = ContentAlignment.MiddleCenter;
  187. finalPriceTitleLabel.AutoSize = false;
  188. finalPriceTitleLabel.Dock = DockStyle.Top;
  189. finalPriceTitleLabel.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
  190. finalPriceTitleLabel.Height = 35;
  191. finalPriceTitleLabel.Text = "Цена со скидкой";
  192. finalPriceTitleLabel.TextAlign = ContentAlignment.MiddleCenter;
  193. finalPriceValueLabel.AutoSize = false;
  194. finalPriceValueLabel.Dock = DockStyle.Top;
  195. finalPriceValueLabel.Font = new Font("Segoe UI", 13F, FontStyle.Bold);
  196. finalPriceValueLabel.Height = 50;
  197. finalPriceValueLabel.TextAlign = ContentAlignment.MiddleCenter;
  198. closeButton.Dock = DockStyle.Bottom;
  199. closeButton.Height = 36;
  200. closeButton.Margin = new Padding(8);
  201. closeButton.Text = "Закрыть";
  202. closeButton.UseVisualStyleBackColor = true;
  203. closeButton.Click += CloseButton_Click;
  204. AutoScaleDimensions = new SizeF(8F, 20F);
  205. AutoScaleMode = AutoScaleMode.Font;
  206. BackColor = SystemColors.Window;
  207. ClientSize = new Size(1040, 450);
  208. Controls.Add(AsyncTaskDiscountContainer);
  209. Controls.Add(AsyncTaskDetails);
  210. Controls.Add(AsyncTaskPhoto);
  211. MinimumSize = new Size(900, 420);
  212. StartPosition = FormStartPosition.CenterParent;
  213. Text = AppearanceSettings.ProductDetailsTitle;
  214. BackColor = ColorTranslator.FromHtml(AppearanceSettings.MainBackgroundColor);
  215. AsyncTaskPhoto.BackColor = ColorTranslator.FromHtml(AppearanceSettings.MainBackgroundColor);
  216. AsyncTaskDetails.BackColor = ColorTranslator.FromHtml(AppearanceSettings.MainBackgroundColor);
  217. AsyncTaskDiscountContainer.BackColor = ColorTranslator.FromHtml(AppearanceSettings.SecondaryBackgroundColor);
  218. Load += ProductDetailsForm_Load;
  219. AsyncTaskPhoto.ResumeLayout(false);
  220. ((System.ComponentModel.ISupportInitialize)productPictureBox).EndInit();
  221. AsyncTaskDetails.ResumeLayout(false);
  222. AsyncTaskDetails.PerformLayout();
  223. AsyncTaskDiscountContainer.ResumeLayout(false);
  224. ResumeLayout(false);
  225. }
  226. private static void ConfigureCaption(Label label, string text)
  227. {
  228. label.Dock = DockStyle.Fill;
  229. label.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
  230. label.Padding = new Padding(6);
  231. label.Text = text;
  232. label.TextAlign = ContentAlignment.MiddleLeft;
  233. }
  234. private static void ConfigureValue(Label label)
  235. {
  236. label.Dock = DockStyle.Fill;
  237. label.Padding = new Padding(6);
  238. label.TextAlign = ContentAlignment.MiddleLeft;
  239. }
  240. }