Esempio n. 1
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);
        }
Esempio n. 2
0
        private void BuildReportItemTabs()
        {
            XmlNode aNode = _Nodes[0];

            // Determine if all nodes are the same type
            string type = aNode.Name;

            if (type == "CustomReportItem")
            {
                // For customReportItems we use the type that is a parameter
                string t = _Draw.GetElementValue(aNode, "Type", "");
                if (t.Length > 0)
                {
                    type = t;
                }
            }

            foreach (XmlNode pNode in this._Nodes)
            {
                // For customReportItems we use the type that is a parameter
                string t = pNode.Name;
                if (t == "CustomReportItem")
                {
                    t = _Draw.GetElementValue(aNode, "Type", "");
                    if (t.Length == 0)       // Shouldn't happen
                    {
                        t = pNode.Name;
                    }
                }
                if (t != type)
                {
                    type = "";                                          // Not all nodes have the same type
                }
            }

            EnsureStyle();              // Make sure we have Style nodes for all the report items

            if (_Nodes.Count > 1)
            {
                this.Text = "Group Selection Properties";
            }
            else
            {
                string name = _Draw.GetElementAttribute(aNode, "Name", "");
                this.Text = string.Format("{0} {1} Properties", type.Replace("fyi:", ""), name);
            }

            // Create all the tabs
            if (type == "Textbox")
            {
                StyleTextCtl stc = new StyleTextCtl(_Draw, this._Nodes);
                AddTab("Text", stc);
            }
            else if (type == "List")
            {
                ListCtl lc = new ListCtl(_Draw, this._Nodes);
                AddTab("List", lc);
                if (_Nodes.Count == 1)
                {
                    XmlNode    l  = _Nodes[0];
                    FiltersCtl fc = new FiltersCtl(_Draw, l);
                    AddTab("Filters", fc);
                    SortingCtl srtc = new SortingCtl(_Draw, l);
                    AddTab("Sorting", srtc);
                }
            }
            else if (type == "Chart")
            {
                ChartCtl cc = new ChartCtl(_Draw, this._Nodes);
                AddTab("Chart", cc);

                // 05122007 AJM & GJL Create a new StaticSeriesCtl tab
                StaticSeriesCtl ssc = new StaticSeriesCtl(_Draw, this._Nodes);
                if (ssc.ShowMe)
                {
                    //If the chart has static series, then show the StaticSeriesCtl GJL
                    AddTab("Static Series", ssc);
                }


                if (_Nodes.Count == 1)
                {
                    FiltersCtl fc = new FiltersCtl(_Draw, _Nodes[0]);
                    AddTab("Filters", fc);
                }
            }
            else if (type == "Image")
            {
                ImageCtl imgc = new ImageCtl(_Draw, this._Nodes);
                AddTab("Image", imgc);
            }
            else if (type == "Table")
            {
                XmlNode  table = _Nodes[0];
                TableCtl tc    = new TableCtl(_Draw, this._Nodes);
                AddTab("Table", tc);
                FiltersCtl fc = new FiltersCtl(_Draw, table);
                AddTab("Filters", fc);
                XmlNode details = _Draw.GetNamedChildNode(table, "Details");
                if (details != null)
                {                       // if no details then we don't need details sorting
                    GroupingCtl grpc = new GroupingCtl(_Draw, details);
                    AddTab("Grouping", grpc);
                    SortingCtl srtc = new SortingCtl(_Draw, details);
                    AddTab("Sorting", srtc);
                }
                if (_TableColumn != null)
                {
                    TableColumnCtl tcc = new TableColumnCtl(_Draw, _TableColumn);
                    AddTab("Table Column", tcc);
                }
                if (_TableRow != null)
                {
                    TableRowCtl trc = new TableRowCtl(_Draw, _TableRow);
                    AddTab("Table Row", trc);
                }
            }
            else if (type == "fyi:Grid")
            {
                GridCtl gc = new GridCtl(_Draw, this._Nodes);
                AddTab("Grid", gc);
            }
            else if (type == "Matrix")
            {
                XmlNode   matrix = _Nodes[0];
                MatrixCtl mc     = new MatrixCtl(_Draw, this._Nodes);
                AddTab("Matrix", mc);
                FiltersCtl fc = new FiltersCtl(_Draw, matrix);
                AddTab("Filters", fc);
            }
            else if (type == "Subreport" && _Nodes.Count == 1)
            {
                XmlNode      subreport = _Nodes[0];
                SubreportCtl src       = new SubreportCtl(_Draw, subreport);
                AddTab("Subreport", src);
            }
            else if (aNode.Name == "CustomReportItem")
            {
                XmlNode             cri  = _Nodes[0];
                CustomReportItemCtl cric = new CustomReportItemCtl(_Draw, _Nodes);
                AddTab(type, cric);
            }

            // Position tab
            PositionCtl pc = new PositionCtl(_Draw, this._Nodes);

            AddTab("Name/Position", pc);

            // Border tab
            StyleBorderCtl bc = new StyleBorderCtl(_Draw, null, this._Nodes);

            AddTab("Border", bc);

            if (!(type == "Line" || type == "Subreport"))
            {
                // Style tab
                StyleCtl sc = new StyleCtl(_Draw, this._Nodes);
                AddTab("Style", sc);

                // Interactivity tab
                InteractivityCtl ic = new InteractivityCtl(_Draw, this._Nodes);
                AddTab("Interactivity", ic);
            }
        }