using System.Drawing;
using System.Windows.Forms;

namespace TradeApp.WinForms.V08;

partial class OrderDetailsForm
{
    private System.ComponentModel.IContainer components = null;
    private TableLayoutPanel rootLayout;
    private TableLayoutPanel infoLayout;
    private TableLayoutPanel deliveryLayout;
    private Label articleLabel;
    private Label articleValueLabel;
    private Label statusLabel;
    private Label statusValueLabel;
    private Label pickupPointLabel;
    private Label pickupPointValueLabel;
    private Label orderDateLabel;
    private Label orderDateValueLabel;
    private Label receiveCodeLabel;
    private Label receiveCodeValueLabel;
    private Label customerLabel;
    private Label customerValueLabel;
    private Label deliveryTitleLabel;
    private Label deliveryDateValueLabel;
    private Button closeButton;

    protected override void Dispose(bool disposing)
    {
        if (disposing && (components is not null))
        {
            components.Dispose();
        }

        base.Dispose(disposing);
    }

    private void InitializeComponent()
    {
        rootLayout = new TableLayoutPanel();
        infoLayout = new TableLayoutPanel();
        deliveryLayout = new TableLayoutPanel();
        articleLabel = new Label();
        articleValueLabel = new Label();
        statusLabel = new Label();
        statusValueLabel = new Label();
        pickupPointLabel = new Label();
        pickupPointValueLabel = new Label();
        orderDateLabel = new Label();
        orderDateValueLabel = new Label();
        receiveCodeLabel = new Label();
        receiveCodeValueLabel = new Label();
        customerLabel = new Label();
        customerValueLabel = new Label();
        deliveryTitleLabel = new Label();
        deliveryDateValueLabel = new Label();
        closeButton = new Button();
        rootLayout.SuspendLayout();
        infoLayout.SuspendLayout();
        deliveryLayout.SuspendLayout();
        SuspendLayout();
        rootLayout.ColumnCount = 2;
        rootLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
        rootLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 230F));
        rootLayout.Controls.Add(infoLayout, 0, 0);
        rootLayout.Controls.Add(deliveryLayout, 1, 0);
        rootLayout.Dock = DockStyle.Fill;
        rootLayout.Padding = new Padding(12);
        rootLayout.RowCount = 1;
        rootLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
        infoLayout.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
        infoLayout.ColumnCount = 2;
        infoLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 170F));
        infoLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
        infoLayout.Controls.Add(articleLabel, 0, 0);
        infoLayout.Controls.Add(articleValueLabel, 1, 0);
        infoLayout.Controls.Add(statusLabel, 0, 1);
        infoLayout.Controls.Add(statusValueLabel, 1, 1);
        infoLayout.Controls.Add(pickupPointLabel, 0, 2);
        infoLayout.Controls.Add(pickupPointValueLabel, 1, 2);
        infoLayout.Controls.Add(orderDateLabel, 0, 3);
        infoLayout.Controls.Add(orderDateValueLabel, 1, 3);
        infoLayout.Controls.Add(receiveCodeLabel, 0, 4);
        infoLayout.Controls.Add(receiveCodeValueLabel, 1, 4);
        infoLayout.Controls.Add(customerLabel, 0, 5);
        infoLayout.Controls.Add(customerValueLabel, 1, 5);
        infoLayout.Dock = DockStyle.Fill;
        infoLayout.Margin = new Padding(3);
        infoLayout.RowCount = 6;
        infoLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 44F));
        infoLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
        infoLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
        infoLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
        infoLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
        infoLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
        ConfigureCaption(articleLabel, "Артикул заказа");
        ConfigureValue(articleValueLabel);
        ConfigureCaption(statusLabel, "Статус заказа");
        ConfigureValue(statusValueLabel);
        ConfigureCaption(pickupPointLabel, "Адрес пункта выдачи");
        ConfigureValue(pickupPointValueLabel);
        pickupPointValueLabel.AutoEllipsis = true;
        ConfigureCaption(orderDateLabel, "Дата заказа");
        ConfigureValue(orderDateValueLabel);
        ConfigureCaption(receiveCodeLabel, "Код получения");
        ConfigureValue(receiveCodeValueLabel);
        ConfigureCaption(customerLabel, "Клиент");
        ConfigureValue(customerValueLabel);
        deliveryLayout.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
        deliveryLayout.ColumnCount = 1;
        deliveryLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
        deliveryLayout.Controls.Add(deliveryTitleLabel, 0, 0);
        deliveryLayout.Controls.Add(deliveryDateValueLabel, 0, 1);
        deliveryLayout.Controls.Add(closeButton, 0, 2);
        deliveryLayout.Dock = DockStyle.Fill;
        deliveryLayout.Margin = new Padding(3);
        deliveryLayout.RowCount = 3;
        deliveryLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 45F));
        deliveryLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 35F));
        deliveryLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 20F));
        deliveryTitleLabel.Dock = DockStyle.Fill;
        deliveryTitleLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold);
        deliveryTitleLabel.Text = "Дата доставки";
        deliveryTitleLabel.TextAlign = ContentAlignment.BottomCenter;
        deliveryDateValueLabel.Dock = DockStyle.Fill;
        deliveryDateValueLabel.Font = new Font("Segoe UI", 14F, FontStyle.Bold);
        deliveryDateValueLabel.TextAlign = ContentAlignment.TopCenter;
        closeButton.Anchor = AnchorStyles.None;
        closeButton.Size = new Size(118, 32);
        closeButton.Text = "Закрыть";
        closeButton.UseVisualStyleBackColor = true;
        closeButton.Click += CloseButton_Click;
        AutoScaleDimensions = new SizeF(8F, 20F);
        AutoScaleMode = AutoScaleMode.Font;
        ClientSize = new Size(900, 270);
        Controls.Add(rootLayout);
        FormBorderStyle = FormBorderStyle.FixedDialog;
        MaximizeBox = false;
        MinimizeBox = false;
        MinimumSize = new Size(760, 245);
        StartPosition = FormStartPosition.CenterParent;
        Text = AppearanceSettings.OrderDetailsTitle;
                BackColor = ColorTranslator.FromHtml(AppearanceSettings.MainBackgroundColor);
                rootLayout.BackColor = ColorTranslator.FromHtml(AppearanceSettings.MainBackgroundColor);
                infoLayout.BackColor = ColorTranslator.FromHtml(AppearanceSettings.MainBackgroundColor);
                deliveryLayout.BackColor = ColorTranslator.FromHtml(AppearanceSettings.SecondaryBackgroundColor);
        rootLayout.ResumeLayout(false);
        infoLayout.ResumeLayout(false);
        deliveryLayout.ResumeLayout(false);
        ResumeLayout(false);
    }

    private static void ConfigureCaption(Label label, string text)
    {
        label.Dock = DockStyle.Fill;
        label.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
        label.Padding = new Padding(6);
        label.Text = text;
        label.TextAlign = ContentAlignment.MiddleLeft;
    }

    private static void ConfigureValue(Label label)
    {
        label.Dock = DockStyle.Fill;
        label.Padding = new Padding(6);
        label.TextAlign = ContentAlignment.MiddleLeft;
    }
}