using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;
using System.Drawing.Drawing2D;
using FastReport.Utils;
namespace FastReport.Dialog
{
///
/// Used to group collections of controls.
/// Wraps the control.
///
public partial class PanelControl : ParentControl
{
private Panel panel;
#region Properties
///
/// Gets an internal Panel.
///
[Browsable(false)]
public Panel Panel
{
get { return panel; }
}
///
/// Indicates the border style for the control.
/// Wraps the property.
///
[DefaultValue(BorderStyle.None)]
[Category("Appearance")]
public BorderStyle BorderStyle
{
get { return Panel.BorderStyle; }
set { Panel.BorderStyle = value; }
}
#endregion
///
public override void Draw(FRPaintEventArgs e)
{
base.Draw(e);
Pen pen = e.Cache.GetPen(Color.Gray, 1, DashStyle.Dash);
e.Graphics.DrawRectangle(pen, AbsLeft, AbsTop, Width - 1, Height - 1);
}
#region Public Methods
///
public override void Serialize(FRWriter writer)
{
PanelControl c = writer.DiffObject as PanelControl;
base.Serialize(writer);
if (BorderStyle != c.BorderStyle)
writer.WriteValue("BorderStyle", BorderStyle);
}
#endregion
///
/// Initializes a new instance of the PanelControl class with default settings.
///
public PanelControl()
{
panel = new Panel();
Control = panel;
}
}
}