OrderDetailsForm.Designer.cs 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. using System.Drawing;
  2. using System.Windows.Forms;
  3. namespace ToyStoreApp;
  4. partial class OrderDetailsForm
  5. {
  6. private System.ComponentModel.IContainer components = null;
  7. private TableLayoutPanel rootLayout;
  8. private TableLayoutPanel infoLayout;
  9. private TableLayoutPanel deliveryLayout;
  10. private Label articleLabel;
  11. private Label articleValueLabel;
  12. private Label statusLabel;
  13. private Label statusValueLabel;
  14. private Label pickupPointLabel;
  15. private Label pickupPointValueLabel;
  16. private Label orderDateLabel;
  17. private Label orderDateValueLabel;
  18. private Label receiveCodeLabel;
  19. private Label receiveCodeValueLabel;
  20. private Label customerLabel;
  21. private Label customerValueLabel;
  22. private Label deliveryTitleLabel;
  23. private Label deliveryDateValueLabel;
  24. private Button closeButton;
  25. protected override void Dispose(bool disposing)
  26. {
  27. if (disposing && (components is not null))
  28. {
  29. components.Dispose();
  30. }
  31. base.Dispose(disposing);
  32. }
  33. private void InitializeComponent()
  34. {
  35. rootLayout = new TableLayoutPanel();
  36. infoLayout = new TableLayoutPanel();
  37. deliveryLayout = new TableLayoutPanel();
  38. articleLabel = new Label();
  39. articleValueLabel = new Label();
  40. statusLabel = new Label();
  41. statusValueLabel = new Label();
  42. pickupPointLabel = new Label();
  43. pickupPointValueLabel = new Label();
  44. orderDateLabel = new Label();
  45. orderDateValueLabel = new Label();
  46. receiveCodeLabel = new Label();
  47. receiveCodeValueLabel = new Label();
  48. customerLabel = new Label();
  49. customerValueLabel = new Label();
  50. deliveryTitleLabel = new Label();
  51. deliveryDateValueLabel = new Label();
  52. closeButton = new Button();
  53. rootLayout.SuspendLayout();
  54. infoLayout.SuspendLayout();
  55. deliveryLayout.SuspendLayout();
  56. SuspendLayout();
  57. rootLayout.ColumnCount = 2;
  58. rootLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
  59. rootLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 230F));
  60. rootLayout.Controls.Add(infoLayout, 0, 0);
  61. rootLayout.Controls.Add(deliveryLayout, 1, 0);
  62. rootLayout.Dock = DockStyle.Fill;
  63. rootLayout.Padding = new Padding(12);
  64. rootLayout.RowCount = 1;
  65. rootLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
  66. infoLayout.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
  67. infoLayout.ColumnCount = 2;
  68. infoLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 170F));
  69. infoLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
  70. infoLayout.Controls.Add(articleLabel, 0, 0);
  71. infoLayout.Controls.Add(articleValueLabel, 1, 0);
  72. infoLayout.Controls.Add(statusLabel, 0, 1);
  73. infoLayout.Controls.Add(statusValueLabel, 1, 1);
  74. infoLayout.Controls.Add(pickupPointLabel, 0, 2);
  75. infoLayout.Controls.Add(pickupPointValueLabel, 1, 2);
  76. infoLayout.Controls.Add(orderDateLabel, 0, 3);
  77. infoLayout.Controls.Add(orderDateValueLabel, 1, 3);
  78. infoLayout.Controls.Add(receiveCodeLabel, 0, 4);
  79. infoLayout.Controls.Add(receiveCodeValueLabel, 1, 4);
  80. infoLayout.Controls.Add(customerLabel, 0, 5);
  81. infoLayout.Controls.Add(customerValueLabel, 1, 5);
  82. infoLayout.Dock = DockStyle.Fill;
  83. infoLayout.Margin = new Padding(3);
  84. infoLayout.RowCount = 6;
  85. infoLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 44F));
  86. infoLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
  87. infoLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
  88. infoLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
  89. infoLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
  90. infoLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
  91. ConfigureCaption(articleLabel, "Артикул заказа");
  92. ConfigureValue(articleValueLabel);
  93. ConfigureCaption(statusLabel, "Статус заказа");
  94. ConfigureValue(statusValueLabel);
  95. ConfigureCaption(pickupPointLabel, "Адрес пункта выдачи");
  96. ConfigureValue(pickupPointValueLabel);
  97. pickupPointValueLabel.AutoEllipsis = true;
  98. ConfigureCaption(orderDateLabel, "Дата заказа");
  99. ConfigureValue(orderDateValueLabel);
  100. ConfigureCaption(receiveCodeLabel, "Код получения");
  101. ConfigureValue(receiveCodeValueLabel);
  102. ConfigureCaption(customerLabel, "Клиент");
  103. ConfigureValue(customerValueLabel);
  104. deliveryLayout.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
  105. deliveryLayout.ColumnCount = 1;
  106. deliveryLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
  107. deliveryLayout.Controls.Add(deliveryTitleLabel, 0, 0);
  108. deliveryLayout.Controls.Add(deliveryDateValueLabel, 0, 1);
  109. deliveryLayout.Controls.Add(closeButton, 0, 2);
  110. deliveryLayout.Dock = DockStyle.Fill;
  111. deliveryLayout.Margin = new Padding(3);
  112. deliveryLayout.RowCount = 3;
  113. deliveryLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 45F));
  114. deliveryLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 35F));
  115. deliveryLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 20F));
  116. deliveryTitleLabel.Dock = DockStyle.Fill;
  117. deliveryTitleLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold);
  118. deliveryTitleLabel.Text = "Дата доставки";
  119. deliveryTitleLabel.TextAlign = ContentAlignment.BottomCenter;
  120. deliveryDateValueLabel.Dock = DockStyle.Fill;
  121. deliveryDateValueLabel.Font = new Font("Segoe UI", 14F, FontStyle.Bold);
  122. deliveryDateValueLabel.TextAlign = ContentAlignment.TopCenter;
  123. closeButton.Anchor = AnchorStyles.None;
  124. closeButton.Size = new Size(118, 32);
  125. closeButton.Text = "Закрыть";
  126. closeButton.UseVisualStyleBackColor = true;
  127. closeButton.Click += CloseButton_Click;
  128. AutoScaleDimensions = new SizeF(8F, 20F);
  129. AutoScaleMode = AutoScaleMode.Font;
  130. ClientSize = new Size(900, 270);
  131. Controls.Add(rootLayout);
  132. FormBorderStyle = FormBorderStyle.FixedDialog;
  133. MaximizeBox = false;
  134. MinimizeBox = false;
  135. MinimumSize = new Size(760, 245);
  136. StartPosition = FormStartPosition.CenterParent;
  137. Text = AppearanceSettings.OrderDetailsTitle;
  138. BackColor = ColorTranslator.FromHtml(AppearanceSettings.MainBackgroundColor);
  139. rootLayout.BackColor = ColorTranslator.FromHtml(AppearanceSettings.MainBackgroundColor);
  140. infoLayout.BackColor = ColorTranslator.FromHtml(AppearanceSettings.MainBackgroundColor);
  141. deliveryLayout.BackColor = ColorTranslator.FromHtml(AppearanceSettings.SecondaryBackgroundColor);
  142. rootLayout.ResumeLayout(false);
  143. infoLayout.ResumeLayout(false);
  144. deliveryLayout.ResumeLayout(false);
  145. ResumeLayout(false);
  146. }
  147. private static void ConfigureCaption(Label label, string text)
  148. {
  149. label.Dock = DockStyle.Fill;
  150. label.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
  151. label.Padding = new Padding(6);
  152. label.Text = text;
  153. label.TextAlign = ContentAlignment.MiddleLeft;
  154. }
  155. private static void ConfigureValue(Label label)
  156. {
  157. label.Dock = DockStyle.Fill;
  158. label.Padding = new Padding(6);
  159. label.TextAlign = ContentAlignment.MiddleLeft;
  160. }
  161. }