Exemplo n.º 1
0
        //- ctor
        public FormDesignerForm(MainForm parent, StudioFormTypes form_type)
        {
            InitializeComponent();

            base.MainForm = parent;
            FormType      = form_type;
            pDesignerCore = new pF.pDesigner.pDesigner(this.MainForm.PropertyWindow);

            //- the control: (pDesigner)pDesignerCore
            IpDesignerCore       = this.pDesignerCore as IpDesigner;
            pDesignerCore.Parent = this.pnl4pDesigner;
        }
        private void AddSection(EbReportSection section)
        {
            if (section.Panel == null)
            {
                section.Panel = new Panel
                {
                    Dock      = DockStyle.Top,
                    Height    = 100,
                    BackColor = Color.Transparent
                };

                Color btnColor = Color.White;
                if (section.Type == EbReportSectionType.ReportHeader || section.Type == EbReportSectionType.ReportFooter)
                {
                    btnColor = Color.LightSeaGreen;
                }
                else if (section.Type == EbReportSectionType.PageHeader || section.Type == EbReportSectionType.PageFooter)
                {
                    btnColor = Color.LightSkyBlue;
                }
                else if (section.Type == EbReportSectionType.Detail)
                {
                    btnColor = Color.SandyBrown;
                }

                var sectionlbl = new Label {
                    Dock = DockStyle.Left, BackColor = btnColor, Width = 35
                };
                sectionlbl.Tag         = section;
                sectionlbl.MouseClick += Sectionlbl_MouseClick;

                section.Panel.Controls.Add(sectionlbl);

                if (pDesignerCore1 == null)
                {
                    pDesignerCore1           = new pF.pDesigner.pDesigner(this.MainForm.PropertyWindow);
                    pDesignerCore1.BackColor = Color.Transparent;
                    pDesignerCore1.Parent    = this;
                    (pDesignerCore1 as IpDesigner).Toolbox = this.MainForm.Toolbox.listBox1;
                }

                (pDesignerCore1 as IpDesigner).AddReportSectionDesignSurface(section.Panel, this);
            }

            (section.Panel.Controls[0] as Label).Text = section.Name;
            this.Controls.Add(section.Panel);
            this.Controls.Add(new Splitter {
                Dock = DockStyle.Top, BackColor = Color.DarkBlue, Width = 0
            });
        }