namespace PerpetuumSoft.Widgets
{
    using PerpetuumSoft.Widgets.Licensing;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    [LicenseProvider(typeof(WidgetsLicenseProvider)), ToolboxBitmap(typeof(DisplayPanel))]
    public class DisplayPanel : ContainerControl
    {
        private PerpetuumSoft.Widgets.Bevel bevel = new PerpetuumSoft.Widgets.Bevel(BevelStyle.None, false, false);

        public DisplayPanel()
        {
            base.SetStyle(0x10, true);
        }

        private void DrawBevel(Graphics g, Rectangle r)
        {
            Rectangle rectangle = this.get_DisplayRectangle();
            rectangle.Size -= new Size(1, 1);
            this.bevel.Draw(g, rectangle);
        }

        protected override void OnPaint(PaintEventArgs pe)
        {
            base.OnPaint(pe);
            this.DrawBevel(pe.Graphics, pe.ClipRectangle);
        }

        [Category("Appearance"), Description("Control's Bevel"), DesignerSerializationVisibility(2), Browsable(true)]
        public PerpetuumSoft.Widgets.Bevel Bevel
        {
            get
            {
                return this.bevel;
            }
            set
            {
                this.bevel = value;
                base.Invalidate();
            }
        }

        [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
        public override string Text
        {
            get
            {
                return base.Text;
            }
            set
            {
                base.Text = value;
            }
        }
    }
}
