Example #1
0
        int filePosition = 0;                                   // file position; for use with search

        public RdlEditPreview()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            rdlPreview.Zoom = 1;                                        // force default zoom to 1
            // initialize the design tab
            dcDesign = new DesignCtl();
            tpDesign.Controls.Add(dcDesign);

            dcDesign.Dock                = System.Windows.Forms.DockStyle.Fill;
            dcDesign.Location            = new System.Drawing.Point(0, 0);
            dcDesign.Name                = "dcDesign";
            dcDesign.Size                = new System.Drawing.Size(480, 350);
            dcDesign.TabIndex            = 0;
            dcDesign.ReportChanged      += new System.EventHandler(dcDesign_ReportChanged);
            dcDesign.HeightChanged      += new DesignCtl.HeightEventHandler(dcDesign_HeightChanged);
            dcDesign.SelectionChanged   += new System.EventHandler(dcDesign_SelectionChanged);
            dcDesign.SelectionMoved     += new System.EventHandler(dcDesign_SelectionMoved);
            dcDesign.ReportItemInserted += new System.EventHandler(dcDesign_ReportItemInserted);
            dcDesign.OpenSubreport      += new DesignCtl.OpenSubreportEventHandler(dcDesign_OpenSubreport);

            tbEditor.SelectionChanged += new EventHandler(tbEditor_SelectionChanged);
            // adjust size of line box by measuring a large #
            using (Graphics g = this.CreateGraphics())
            {
                this.pbLines.Width = (int)(g.MeasureString("99999", tbEditor.Font).Width);
            }
        }
Example #2
0
        internal PropertyReportItem(DesignXmlDraw d, DesignCtl dc, List <XmlNode> ris)
        {
            _Draw      = d;
            _DesignCtl = dc;
            _RIs       = ris;
            _node      = _RIs[0];   // the first node is the model for all of the nodes
            if (_RIs.Count > 1)
            {
                bGroup = true;
            }
            else
            {
                bCustom = _node.Name == "CustomReportItem";
            }

            InTable = _Draw.InTable(_node);
            if (InTable)
            {
                _tnode = _Draw.GetTableFromReportItem(_node);
            }

            InMatrix = _Draw.InMatrix(_node);
            if (InMatrix)
            {
                _mnode = _Draw.GetMatrixFromReportItem(_node);
            }
        }
 internal void Reset()
 {
     _Draw      = null;
     _DesignCtl = null;
     this.pgSelected.SelectedObject = null;
     cbReportItems.Items.Clear();
     _NameCollection = null;
 }
        int filePosition = 0;                                   // file position; for use with search

        public RdlEditPreview()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            pbLines.Editor  = tbEditor;
            rdlPreview.Zoom = 1;                                        // force default zoom to 1
            // initialize the design tab
            dcTopRuler           = new DesignRuler();
            dcLeftRuler          = new DesignRuler();
            dcLeftRuler.Vertical = true;     // need to set before setting  Design property
            dcDesign             = new DesignCtl();
            dcTopRuler.Design    = dcDesign; // associate rulers with design ctl
            dcLeftRuler.Design   = dcDesign;

            tpDesign.Controls.Add(dcTopRuler);
            tpDesign.Controls.Add(dcLeftRuler);
            tpDesign.Controls.Add(dcDesign);

            // Top ruler
            dcTopRuler.Height  = 14;
            dcTopRuler.Width   = tpDesign.Width;
            dcTopRuler.Dock    = DockStyle.Top;
            dcTopRuler.Anchor  = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            dcTopRuler.Enabled = false;

            // Left ruler
            dcLeftRuler.Width   = 14;
            dcLeftRuler.Height  = tpDesign.Height;
            dcLeftRuler.Dock    = DockStyle.Left;
            dcLeftRuler.Anchor  = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            dcLeftRuler.Enabled = false;

            dcTopRuler.Offset  = dcLeftRuler.Width;
            dcLeftRuler.Offset = dcTopRuler.Height;

            // dcDesign.Dock = System.Windows.Forms.DockStyle.Bottom;
            dcDesign.Anchor              = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
            dcDesign.Location            = new System.Drawing.Point(dcLeftRuler.Width, dcTopRuler.Height);
            dcDesign.Name                = "dcDesign";
            dcDesign.Size                = new System.Drawing.Size(tpDesign.Width - dcLeftRuler.Width, tpDesign.Height - dcTopRuler.Height);
            dcDesign.TabIndex            = 0;
            dcDesign.ReportChanged      += new System.EventHandler(dcDesign_ReportChanged);
            dcDesign.HeightChanged      += new DesignCtl.HeightEventHandler(dcDesign_HeightChanged);
            dcDesign.SelectionChanged   += new System.EventHandler(dcDesign_SelectionChanged);
            dcDesign.SelectionMoved     += new System.EventHandler(dcDesign_SelectionMoved);
            dcDesign.ReportItemInserted += new System.EventHandler(dcDesign_ReportItemInserted);
            dcDesign.OpenSubreport      += new DesignCtl.OpenSubreportEventHandler(dcDesign_OpenSubreport);

            tbEditor.SelectionChanged += new EventHandler(tbEditor_SelectionChanged);
            // adjust size of line box by measuring a large #
#if !MONO
            using (Graphics g = this.CreateGraphics())
            {
                this.pbLines.Width = (int)(g.MeasureString("99999", tbEditor.Font).Width);
            }
#endif
        }
        public RdlEditPreview()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            rdlPreview.Zoom = 1;                                        // force default zoom to 1
            // initialize the design tab
            dcTopRuler           = new DesignRuler();
            dcLeftRuler          = new DesignRuler();
            dcLeftRuler.Vertical = true;     // need to set before setting  Design property
            dcDesign             = new DesignCtl();
            dcTopRuler.Design    = dcDesign; // associate rulers with design ctl
            dcLeftRuler.Design   = dcDesign;

            tpDesign.Controls.Add(dcTopRuler);
            tpDesign.Controls.Add(dcLeftRuler);
            tpDesign.Controls.Add(dcDesign);

            // Top ruler
            dcTopRuler.Height  = 14;
            dcTopRuler.Width   = tpDesign.Width;
            dcTopRuler.Dock    = DockStyle.Top;
            dcTopRuler.Anchor  = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            dcTopRuler.Enabled = false;

            // Left ruler
            dcLeftRuler.Width   = 14;
            dcLeftRuler.Height  = tpDesign.Height;
            dcLeftRuler.Dock    = DockStyle.Left;
            dcLeftRuler.Anchor  = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            dcLeftRuler.Enabled = false;

            dcTopRuler.Offset  = dcLeftRuler.Width;
            dcLeftRuler.Offset = dcTopRuler.Height;

            // dcDesign.Dock = System.Windows.Forms.DockStyle.Bottom;
            dcDesign.Anchor              = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
            dcDesign.Location            = new System.Drawing.Point(dcLeftRuler.Width, dcTopRuler.Height);
            dcDesign.Name                = "dcDesign";
            dcDesign.Size                = new System.Drawing.Size(tpDesign.Width - dcLeftRuler.Width, tpDesign.Height - dcTopRuler.Height);
            dcDesign.TabIndex            = 0;
            dcDesign.ReportChanged      += new System.EventHandler(dcDesign_ReportChanged);
            dcDesign.HeightChanged      += new DesignCtl.HeightEventHandler(dcDesign_HeightChanged);
            dcDesign.SelectionChanged   += new System.EventHandler(dcDesign_SelectionChanged);
            dcDesign.SelectionMoved     += new System.EventHandler(dcDesign_SelectionMoved);
            dcDesign.ReportItemInserted += new System.EventHandler(dcDesign_ReportItemInserted);
            dcDesign.OpenSubreport      += new DesignCtl.OpenSubreportEventHandler(dcDesign_OpenSubreport);

            //ScintillaNET Init
            ConfigureScintillaStyle(scintilla1);
            scintilla1.SetSavePoint();
        }
Example #6
0
 internal PropertyTextbox(DesignXmlDraw d, DesignCtl dc, List <XmlNode> ris) : base(d, dc, ris)
 {
 }
        internal void ResetSelection(DesignXmlDraw d, DesignCtl dc)
        {
            _Draw      = d;
            _DesignCtl = dc;

            if (_Draw == null)
            {
                this.pgSelected.SelectedObject = null;
                cbReportItems.Items.Clear();

                return;
            }
            SetPropertyNames();

            if (_Draw.SelectedCount == 0)
            {
                this.pgSelected.SelectedObject = new PropertyReport(_Draw, dc);
                cbReportItems.SelectedItem     = REPORT;
            }
            else if (SingleReportItemType())
            {
                XmlNode n = _Draw.SelectedList[0];
                if (_Draw.SelectedCount > 1)
                {
                    int si = cbReportItems.Items.Add(GROUP);
                    cbReportItems.SelectedIndex = si;
                }
                else
                {
                    XmlAttribute xAttr = n.Attributes["Name"];
                    if (xAttr == null)
                    {
                        int si = cbReportItems.Items.Add(NONAME);
                        cbReportItems.SelectedIndex = si;
                    }
                    else
                    {
                        cbReportItems.SelectedItem = xAttr.Value;
                    }
                }
                switch (n.Name)
                {
                case "Textbox":
                    this.pgSelected.SelectedObject = new PropertyTextbox(_Draw, dc, _Draw.SelectedList);
                    break;

                case "System.Drawing.Rectangle":
                    this.pgSelected.SelectedObject = new PropertyRectangle(_Draw, dc, _Draw.SelectedList);
                    break;

                case "Chart":
                    this.pgSelected.SelectedObject = new PropertyChart(_Draw, dc, _Draw.SelectedList);
                    break;

                case "System.Drawing.Image":
                    this.pgSelected.SelectedObject = new PropertyImage(_Draw, dc, _Draw.SelectedList);
                    break;

                case "List":
                    this.pgSelected.SelectedObject = new PropertyList(_Draw, dc, _Draw.SelectedList);
                    break;

                case "Subreport":
                    this.pgSelected.SelectedObject = new PropertySubreport(_Draw, dc, _Draw.SelectedList);
                    break;

                case "CustomReportItem":
                default:
                    this.pgSelected.SelectedObject = new PropertyReportItem(_Draw, dc, _Draw.SelectedList);
                    break;
                }
            }
            else
            {
                int si = cbReportItems.Items.Add(GROUP);
                cbReportItems.SelectedIndex    = si;
                this.pgSelected.SelectedObject = new PropertyReportItem(_Draw, dc, _Draw.SelectedList);
            }
        }
Example #8
0
 internal PropertyDataRegion(DesignXmlDraw d, DesignCtl dc, List <XmlNode> ris) : base(d, dc, ris)
 {
 }
 internal PropertyReport(DesignXmlDraw d, DesignCtl dc)
 {
     _Draw      = d;
     _DesignCtl = dc;
 }
Example #10
0
        public override object EditValue(ITypeDescriptorContext context,
                                         IServiceProvider provider,
                                         object value)
        {
            if ((context == null) || (provider == null))
            {
                return(base.EditValue(context, provider, value));
            }

            // Access the Property Browser's UI display service
            IWindowsFormsEditorService editorService =
                (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (editorService == null)
            {
                return(base.EditValue(context, provider, value));
            }

            // Create an instance of the UI editor form
            IReportItem iri = context.Instance as IReportItem;

            if (iri == null)
            {
                return(base.EditValue(context, provider, value));
            }
            PropertyReportItem pri = iri.GetPRI();

            PropertyTable pt = value as PropertyTable;

            if (pt == null)
            {
                return(base.EditValue(context, provider, value));
            }

            //SingleCtlDialog scd = new SingleCtlDialog(pri.DesignCtl, pri.Draw, pri.Nodes, SingleCtlTypeEnum.BorderCtl, pb.Names);
            DesignCtl     dc = pri.DesignCtl;
            DesignXmlDraw dp = dc.DrawCtl;

            if (dp.SelectedCount != 1)
            {
                return(base.EditValue(context, provider, value));
            }
            XmlNode riNode = dp.SelectedList[0];
            XmlNode table  = dp.GetTableFromReportItem(riNode);

            if (table == null)
            {
                return(base.EditValue(context, provider, value));
            }
            XmlNode tc = dp.GetTableColumn(riNode);
            XmlNode tr = dp.GetTableRow(riNode);

            List <XmlNode> ar = new List <XmlNode>();             // need to put this is a list for dialog to handle

            ar.Add(table);
            dc.UndoObject.StartUndoGroup(Strings.PropertyTableUIEditor_EditValue_TableDialog);
            using (PropertyDialog pd = new PropertyDialog(dp, ar, PropertyTypeEnum.ReportItems, tc, tr))
            {
                // Display the UI editor dialog
                DialogResult dr = editorService.ShowDialog(pd);
                dc.UndoObject.EndUndoGroup(pd.Changed || dr == DialogResult.OK);
                if (pd.Changed || dr == DialogResult.OK)
                {
                    dp.Invalidate();
                    return(new PropertyTable(dp, dc, pt.Nodes));
                }

                return(base.EditValue(context, provider, value));
            }
        }
 internal PropertyRectangle(DesignXmlDraw d, DesignCtl dc, List <XmlNode> ris) : base(d, dc, ris)
 {
 }
Example #12
0
        internal SingleCtlDialog(DesignCtl dc, DesignXmlDraw dxDraw, List <XmlNode> sNodes,
                                 SingleCtlTypeEnum type, string[] names)
        {
            this._Type      = type;
            this._DesignCtl = dc;
            this._Draw      = dxDraw;
            this._Nodes     = sNodes;

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //   Add the control for the selected ReportItems
            //     We could have forced the user to create this (and maybe should have)
            //     instead of using an enum.
            UserControl uc    = null;
            string      title = null;

            switch (type)
            {
            case SingleCtlTypeEnum.InteractivityCtl:
                title = " - Interactivty";
                uc    = new InteractivityCtl(dxDraw, sNodes);
                break;

            case SingleCtlTypeEnum.VisibilityCtl:
                title = " - Visibility";
                uc    = new VisibilityCtl(dxDraw, sNodes);
                break;

            case SingleCtlTypeEnum.BorderCtl:
                title = " - Borders";
                uc    = new StyleBorderCtl(dxDraw, names, sNodes);
                break;

            case SingleCtlTypeEnum.FontCtl:
                title = " - Font";
                uc    = new FontCtl(dxDraw, names, sNodes);
                break;

            case SingleCtlTypeEnum.BackgroundCtl:
                title = " - Background";
                uc    = new BackgroundCtl(dxDraw, names, sNodes);
                break;

            case SingleCtlTypeEnum.ImageCtl:
                title = " - Image";
                uc    = new ImageCtl(dxDraw, sNodes);
                break;

            case SingleCtlTypeEnum.SubreportCtl:
                title = " - Subreport";
                uc    = new SubreportCtl(dxDraw, sNodes[0]);
                break;

            case SingleCtlTypeEnum.FiltersCtl:
                title = " - Filter";
                uc    = new FiltersCtl(dxDraw, sNodes[0]);
                break;

            case SingleCtlTypeEnum.SortingCtl:
                title = " - Sorting";
                uc    = new SortingCtl(dxDraw, sNodes[0]);
                break;

            case SingleCtlTypeEnum.GroupingCtl:
                title = " - Grouping";
                uc    = new GroupingCtl(dxDraw, sNodes[0]);
                break;

            case SingleCtlTypeEnum.ReportParameterCtl:
                title = " - Report Parameters";
                uc    = new ReportParameterCtl(dxDraw);
                break;

            case SingleCtlTypeEnum.ReportCodeCtl:
                title = " - Code";
                uc    = new CodeCtl(dxDraw);
                break;

            case SingleCtlTypeEnum.ReportModulesClassesCtl:
                title = " - Modules and Classes";
                uc    = new ModulesClassesCtl(dxDraw);
                break;
            }
            _Ctl = uc as IProperty;
            if (title != null)
            {
                this.Text = this.Text + title;
            }

            if (uc == null)
            {
                return;
            }
            int h = uc.Height;
            int w = uc.Width;

            uc.Top      = 0;
            uc.Left     = 0;
            uc.Dock     = DockStyle.Fill;
            uc.Parent   = this.pMain;
            this.Height = h + (this.Height - pMain.Height);
            this.Width  = w + (this.Width - pMain.Width);
            this.ResumeLayout(true);
        }
 internal PropertySubreport(DesignXmlDraw d, DesignCtl dc, List <XmlNode> ris) : base(d, dc, ris)
 {
 }