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

namespace NotepadEnhanced.GUI.Controls.Panels
{
    public partial class LargePanelBase : DockedPanel
    {
        protected LargePanelBase()
        {
            InitializeComponent();
            base.Dock = DockStyle.Right;
        }

        protected override void OnResize(EventArgs e)
        {
            btnClose.Location = new Point(this.Width - btnClose.Width - 1, 2);
            lblPanelName.Width = this.Width - btnClose.Width;
            base.OnResize(e);
        }

        protected virtual void btnClose_Click(object sender, EventArgs e)
        {
            if (RelatedMenuItem != null)
                RelatedMenuItem.Checked = false;
        }

        /// <summary>
        /// Gets or sets the name of the panel which will be displayed
        /// at the very top in a subtle green font
        /// </summary>
        [Description("The title of the panel which will be displayed at the very top in a subtle green font")]
        [Localizable(true)]
        public string PanelName
        {
            get { return lblPanelName.Text; }
            set { lblPanelName.Text = value; }
        }
    }
}
