DialogListOfStrings: puts up a dialog that lets a user enter a list of strings
Beispiel #1
0
        private void bExpr_Click(object sender, System.EventArgs e)
        {
            Button b = sender as Button;

            if (b == null)
            {
                return;
            }
            Control c      = null;
            bool    bColor = false;

            switch (b.Tag as string)
            {
            case "pleft":
                c = tbPadLeft;
                break;

            case "pright":
                c = tbPadRight;
                break;

            case "ptop":
                c = tbPadTop;
                break;

            case "pbottom":
                c = tbPadBottom;
                break;

            case "bcolor":
                c      = cbBackColor;
                bColor = true;
                break;

            case "bgradient":
                c = cbGradient;
                break;

            case "bendcolor":
                c      = cbEndColor;
                bColor = true;
                break;
            }

            if (c == null)
            {
                return;
            }

            XmlNode sNode = _ReportItems[0];

            DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, sNode, bColor);
            DialogResult     dr = ee.ShowDialog();

            if (dr == DialogResult.OK)
            {
                c.Text = ee.Expression;
            }
            return;
        }
Beispiel #2
0
        private void bValueExpr_Click(object sender, System.EventArgs e)
        {
            int cr = dgSorting.CurrentRowIndex;

            if (cr < 0)
            {                   // No rows yet; create one
                string[] rowValues = new string[2];
                rowValues[0] = null;
                rowValues[1] = null;

                _DataTable.Rows.Add(rowValues);
                cr = 0;
            }
            int     cc = 0;
            DataRow dr = _DataTable.Rows[cr];
            string  cv = dr[cc] as string;

            DialogExprEditor ee   = new DialogExprEditor(_Draw, cv, _SortingParent, false);
            DialogResult     dlgr = ee.ShowDialog();

            if (dlgr == DialogResult.OK)
            {
                dr[cc] = ee.Expression;
            }
        }
Beispiel #3
0
        private void bExpr_Click(object sender, EventArgs e)
        {
            GridItem gi = this.pgProps.SelectedGridItem;

            XmlNode          sNode = _ReportItems[0];
            DialogExprEditor ee    = new DialogExprEditor(_Draw, gi.Value.ToString(), sNode, false);

            try
            {
                DialogResult dr = ee.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    // There's probably a better way without reflection but this works fine.
                    string       nm  = gi.Label;
                    object       sel = pgProps.SelectedObject;
                    Type         t   = sel.GetType();
                    PropertyInfo pi  = t.GetProperty(nm);
                    MethodInfo   mi  = pi.GetSetMethod();
                    object[]     oa  = new object[1];
                    oa[0] = ee.Expression;
                    mi.Invoke(sel, oa);
                    gi.Select();
                }
            }
            finally
            {
                ee.Dispose();
            }
        }
Beispiel #4
0
        private void bExpr_Click(object sender, System.EventArgs e)
        {
            Button b = sender as Button;

            if (b == null)
            {
                return;
            }
            Control c = null;

            switch (b.Tag as string)
            {
            case "label":
                c = this.cbLabelExpr;
                break;

            case "parent":
                c = this.cbParentExpr;
                break;
            }

            if (c == null)
            {
                return;
            }

            DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, _GroupingParent, false);
            DialogResult     dr = ee.ShowDialog();

            if (dr == DialogResult.OK)
            {
                c.Text = ee.Expression;
            }
            return;
        }
        private void bExpr_Click(object sender, System.EventArgs e)
        {
            Button b = sender as Button;

            if (b == null)
            {
                return;
            }
            Control c = null;

            switch (b.Tag as string)
            {
            case "bookmark":
                c = tbBookmark;
                break;

            case "bookmarklink":
                c = tbBookmarkLink;
                break;

            case "hyperlink":
                c = tbHyperlink;
                break;

            case "visibility":
                c = tbHidden;
                break;
            }

            if (c == null)
            {
                return;
            }

            XmlNode sNode = _ReportItems[0];

            DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, sNode);

            try
            {
                DialogResult dr = ee.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    c.Text = ee.Expression;
                    if ((string)(b.Tag) == "bookmark")
                    {
                        fBookmark = true;
                    }
                    else
                    {
                        fAction = true;
                    }
                }
            }
            finally
            {
                ee.Dispose();
            }
            return;
        }
Beispiel #6
0
        private void bValueExpr_Click(object sender, System.EventArgs e)
        {
            int cr = dgGroup.CurrentRowIndex;

            if (cr < 0)
            {                   // No rows yet; create one
                string[] rowValues = new string[1];
                rowValues[0] = null;

                _DataTable.Rows.Add(rowValues);
                cr = 0;
            }
            DataGridCell dgc = dgGroup.CurrentCell;
            int          cc  = dgc.ColumnNumber;
            DataRow      dr  = _DataTable.Rows[cr];
            string       cv  = dr[cc] as string;

            DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _GroupingParent, false);

            try
            {
                DialogResult dlgr = ee.ShowDialog();
                if (dlgr == DialogResult.OK)
                {
                    dr[cc] = ee.Expression;
                }
            }
            finally
            {
                ee.Dispose();
            }
        }
Beispiel #7
0
        private void bValueExpr_Click(object sender, EventArgs e)
        {
            if (dgParms.CurrentCell != null)
            {
                DataGridViewCell dgc = dgParms.CurrentCell;
                if (dgc.ColumnIndex == 1)
                {
                    string cv = dgc.Value as string;

                    DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _dsv.Node, false);
                    try
                    {
                        DialogResult dlgr = ee.ShowDialog();
                        if (dlgr == DialogResult.OK)
                        {
                            dgc.Value = ee.Expression;
                        }
                    }
                    finally
                    {
                        ee.Dispose();
                    }
                }
            }
        }
Beispiel #8
0
        private void bExpr_Click(object sender, System.EventArgs e)
        {
            Button b = sender as Button;

            if (b == null)
            {
                return;
            }
            Control c = null;

            switch (b.Tag as string)
            {
            case "visibility":
                c = tbHidden;
                break;
            }

            if (c == null)
            {
                return;
            }

            using (DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, _TableColumn))
            {
                DialogResult dr = ee.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    c.Text = ee.Expression;
                }
            }
            return;
        }
Beispiel #9
0
        private void bValueExpr_Click(object sender, System.EventArgs e)
        {
            if (dgSorting.CurrentCell == null)
            {
                dgSorting.Rows.Add("", true);
            }

            DataGridViewCell dgc = dgSorting.CurrentCell;
            int cc = dgc.ColumnIndex;

            // >>>>>>>>>>
            // the only column that should be edited is the first one ( "Sort expression" )
            if (cc != 0)
            {
                dgc = dgSorting.CurrentCell = dgSorting.CurrentRow.Cells[0];
            }
            // <<<<<<<<<<
            string cv = dgc.Value as string;

            using (DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _SortingParent, false))
            {
                DialogResult dlgr = ee.ShowDialog();
                if (dlgr == DialogResult.OK)
                {
                    dgc.Value = ee.Expression;
                }
            }
        }
Beispiel #10
0
        private void bExprConnect_Click(object sender, System.EventArgs e)
        {
            DialogExprEditor ee = new DialogExprEditor(_Draw, this.tbConnection.Text, null, false);

            DialogResult dr = ee.ShowDialog();

            if (dr == DialogResult.OK)
            {
                tbConnection.Text = ee.Expression;
            }
        }
Beispiel #11
0
        private void bExpr_Click(object sender, System.EventArgs e)
        {
            Button b = sender as Button;

            if (b == null)
            {
                return;
            }
            Control c = null;

            switch (b.Tag as string)
            {
            case "external":
                c = tbValueExternal;
                break;

            case "embedded":
                c = cbValueEmbedded;
                break;

            case "mime":
                c = cbMIMEType;
                break;

            case "database":
                c = cbValueDatabase;
                break;
            }

            if (c == null)
            {
                return;
            }

            XmlNode sNode = _ReportItems[0];

            DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, sNode);

            try
            {
                DialogResult dr = ee.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    c.Text = ee.Expression;
                }
            }
            finally
            {
                ee.Dispose();
            }

            return;
        }
Beispiel #12
0
        private void bExpr_Click(object sender, System.EventArgs e)
        {
            Button b = sender as Button;

            if (b == null)
            {
                return;
            }
            Control c      = null;
            bool    bColor = false;

            switch (b.Tag as string)
            {
            case "min":
                c = this.tbMin;
                break;

            case "max":
                c = this.tbMax;
                break;

            case "majorinterval":
                c = this.tbMajorInterval;
                break;

            case "minorinterval":
                c = this.tbMinorInterval;
                break;
            }

            if (c == null)
            {
                return;
            }

            XmlNode sNode = _ReportItems[0];

            DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, sNode, bColor);

            try
            {
                DialogResult dr = ee.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    c.Text = ee.Expression;
                }
            }
            finally
            {
                ee.Dispose();
            }
            return;
        }
Beispiel #13
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();

            PropertyExpr pe = value as PropertyExpr;

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

            using (DialogExprEditor de = new DialogExprEditor(pri.Draw, pe.Expression, pri.Node))
            {
                // Display the UI editor dialog
                if (editorService.ShowDialog(de) == DialogResult.OK)
                {
                    // Return the new property value from the UI editor form
                    return(new PropertyExpr(de.Expression));
                }

                return(base.EditValue(context, provider, value));
            }
        }
Beispiel #14
0
        private void bDataLabelExpr_Click(object sender, EventArgs e)
        {
            DialogExprEditor ee = new DialogExprEditor(_Draw, cbDataLabel.Text, _ReportItems[0], false);

            try
            {
                if (ee.ShowDialog() == DialogResult.OK)
                {
                    cbDataLabel.Text = ee.Expression;
                }
            }
            finally
            {
                ee.Dispose();
            }
            return;
        }
Beispiel #15
0
        private void functionBox(TextBox txt)
        {
            DialogExprEditor ee = new DialogExprEditor(_Draw, txt.Text, _ReportItems[0], false);

            try
            {
                if (ee.ShowDialog() == DialogResult.OK)
                {
                    txt.Text = ee.Expression;
                }
            }
            finally
            {
                ee.Dispose();
            }
            return;
        }
Beispiel #16
0
        private void bDataExpr_Click(object sender, System.EventArgs e)
        {
            Button bs = sender as Button;

            if (bs == null)
            {
                return;
            }
            Control ctl = null;

            switch (bs.Tag as string)
            {
            case "d1":
                ctl = cbChartData;
                break;

            case "d2":
                ctl = cbChartData2;
                break;

            case "d3":
                ctl = cbChartData3;
                break;

            default:
                return;
            }
            DialogExprEditor ee = new DialogExprEditor(_Draw, ctl.Text, _ReportItems[0], false);

            try
            {
                DialogResult dlgr = ee.ShowDialog();
                if (dlgr == DialogResult.OK)
                {
                    ctl.Text   = ee.Expression;
                    fChartData = true;
                }
            }
            finally
            {
                ee.Dispose();
            }
        }
        private void bValueExpr_Click(object sender, System.EventArgs e)
        {
            if (dgFilters.CurrentCell == null)
            {
                dgFilters.Rows.Add("", "Equal", "");
            }
            DataGridViewCell dgc = dgFilters.CurrentCell;
            int    cc            = dgc.ColumnIndex;
            string cv            = dgc.Value as string;

            if (cc == 1)
            {                   // This is the FilterOperator
                DialogFilterOperator fo = new DialogFilterOperator(cv);
                try
                {
                    DialogResult dlgr = fo.ShowDialog();
                    if (dlgr == DialogResult.OK)
                    {
                        dgc.Value = fo.Operator;
                    }
                }
                finally
                {
                    fo.Dispose();
                }
            }
            else
            {
                DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _FilterParent, false);
                try
                {
                    DialogResult dlgr = ee.ShowDialog();
                    if (dlgr == DialogResult.OK)
                    {
                        dgc.Value = ee.Expression;
                    }
                }
                finally
                {
                    ee.Dispose();
                }
            }
        }
Beispiel #18
0
        private void bValueExpr_Click(object sender, System.EventArgs e)
        {
            if (dgSorting.CurrentCell == null)
            {
                dgSorting.Rows.Add("", true);
            }

            DataGridViewCell dgc = dgSorting.CurrentCell;
            int    cc            = dgc.ColumnIndex;
            string cv            = dgc.Value as string;

            using (DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _SortingParent, false))
            {
                DialogResult dlgr = ee.ShowDialog();
                if (dlgr == DialogResult.OK)
                {
                    dgc.Value = ee.Expression;
                }
            }
        }
        private void bValueExpr_Click(object sender, System.EventArgs e)
        {
            int cr = dgFilters.CurrentRowIndex;

            if (cr < 0)
            {                   // No rows yet; create one
                string[] rowValues = new string[3];
                rowValues[0] = null;
                rowValues[1] = null;
                rowValues[2] = null;

                _DataTable.Rows.Add(rowValues);
                cr = 0;
            }
            DataGridCell dgc = dgFilters.CurrentCell;
            int          cc  = dgc.ColumnNumber;
            DataRow      dr  = _DataTable.Rows[cr];
            string       cv  = dr[cc] as string;

            if (cc == 1)
            {                   // This is the FilterOperator
                DialogFilterOperator fo   = new DialogFilterOperator(cv);
                DialogResult         dlgr = fo.ShowDialog();
                if (dlgr == DialogResult.OK)
                {
                    dr[1] = fo.Operator;
                }
            }
            else
            {
                DialogExprEditor ee   = new DialogExprEditor(_Draw, cv, _FilterParent, false);
                DialogResult     dlgr = ee.ShowDialog();
                if (dlgr == DialogResult.OK)
                {
                    dr[cc] = ee.Expression;
                }
            }
        }
        private void bValueExpr_Click(object sender, EventArgs e)
        {
            if (dgParms.CurrentCell != null)
            {
                DataGridViewCell dgc = dgParms.CurrentCell;
                if (dgc.ColumnIndex == 1)
                {
                    string cv = dgc.Value as string;

                    DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _dsv.Node, false);
                    try
                    {
                        DialogResult dlgr = ee.ShowDialog();
                        if (dlgr == DialogResult.OK)
                            dgc.Value = ee.Expression;
                    }
                    finally
                    {
                        ee.Dispose();
                    }
                }
            }

        }
Beispiel #21
0
        private void bValueExpr_Click(object sender, System.EventArgs e)
        {
            int cr = dgFilters.CurrentRow.Index;
            //if (cr < 0)
            //{	// No rows yet; create one
            //    string[] rowValues = new string[3];
            //    rowValues[0] = null;
            //    rowValues[1] = null;
            //    rowValues[2] = null;

            //    _DataTable.Rows.Add(rowValues);
            //    cr = 0;
            //}
            DataGridViewCell dgc = dgFilters.CurrentCell;
            int    cc            = dgc.ColumnIndex;
            string cv            = dgc.Value as string;

            if (cc == 1)
            {                   // This is the FilterOperator
                DialogFilterOperator fo   = new DialogFilterOperator(cv);
                DialogResult         dlgr = fo.ShowDialog();
                if (dlgr == DialogResult.OK)
                {
                    dgc.Value = fo.Operator;
                }
            }
            else
            {
                DialogExprEditor ee   = new DialogExprEditor(_Draw, cv, _FilterParent, false);
                DialogResult     dlgr = ee.ShowDialog();
                if (dlgr == DialogResult.OK)
                {
                    dgc.Value = ee.Expression;
                }
            }
        }
        private void bExpr_Click(object sender, EventArgs e)
        {
            GridItem gi = this.pgProps.SelectedGridItem;

            XmlNode          sNode = _ReportItems[0];
            DialogExprEditor ee    = new DialogExprEditor(_Draw, gi.Value.ToString(), sNode, false);

            try
            {
                DialogResult dr = ee.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    // There's probably a better way without reflection but this works fine.

                    object sel = pgProps.SelectedObject;
                    gi.PropertyDescriptor.SetValue(sel, ee.Expression);
                    gi.Select();
                }
            }
            finally
            {
                ee.Dispose();
            }
        }
        private void bExpr_Click(object sender, System.EventArgs e)
        {
            Button b = sender as Button;
            if (b == null)
                return;
            Control c = null;
            switch (b.Tag as string)
            {
                case "visibility":
                    c = tbHidden;
                    break;
            }

            if (c == null)
                return;

            using (DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, _TableColumn))
            {
                DialogResult dr = ee.ShowDialog();
                if (dr == DialogResult.OK)
                    c.Text = ee.Expression;
            }
            return;
        }
 private void bExpr_Click(object sender, EventArgs e)
 {
     GridItem gi = this.pgProps.SelectedGridItem;
     
     XmlNode sNode = _ReportItems[0];
     DialogExprEditor ee = new DialogExprEditor(_Draw, gi.Value.ToString(), sNode, false);
     try
     {
         DialogResult dr = ee.ShowDialog();
         if (dr == DialogResult.OK)
         {
             // There's probably a better way without reflection but this works fine.
             
             object sel = pgProps.SelectedObject;
             gi.PropertyDescriptor.SetValue(sel, ee.Expression); 
             gi.Select();
         }
     }
     finally
     {
         ee.Dispose();
     }
 }
Beispiel #25
0
		private void bExpr_Click(object sender, System.EventArgs e)
		{
			Button b = sender as Button;
			if (b == null)
				return;
			Control c = null;
			bool bColor=false;
			switch (b.Tag as string)
			{
				case "pleft":
					c = tbPadLeft;
					break;
				case "pright":
					c = tbPadRight;
					break;
				case "ptop":
					c = tbPadTop;
					break;
				case "pbottom":
					c = tbPadBottom;
					break;
				case "bcolor":
					c = cbBackColor;
					bColor = true;
					break;
				case "bgradient":
					c = cbGradient;
					break;
				case "bendcolor":
					c = cbEndColor;
					bColor = true;
					break;
			}

			if (c == null)
				return;

			XmlNode sNode = _ReportItems[0];

            using (DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, sNode, bColor))
            {
                DialogResult dr = ee.ShowDialog();
                if (dr == DialogResult.OK)
                    c.Text = ee.Expression;

            } 
            return;
		}
Beispiel #26
0
        private void bExpr_Click(object sender, System.EventArgs e)
        {
            Button b = sender as Button;

            if (b == null)
            {
                return;
            }
            Control c      = null;
            bool    bColor = false;

            switch (b.Tag as string)
            {
            case "family":
                c = cbFontFamily;
                break;

            case "style":
                c = cbFontStyle;
                break;

            case "color":
                c      = cbColor;
                bColor = true;
                break;

            case "size":
                c = cbFontSize;
                break;

            case "weight":
                c = cbFontWeight;
                break;

            case "decoration":
                c = cbTextDecoration;
                break;

            case "halign":
                c = cbHorzAlign;
                break;

            case "valign":
                c = cbVerticalAlign;
                break;

            case "direction":
                c = cbDirection;
                break;

            case "writing":
                c = cbWritingMode;
                break;

            case "format":
                c = cbFormat;
                break;
            }

            if (c == null)
            {
                return;
            }

            XmlNode sNode = _ReportItems[0];

            DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, sNode, bColor);

            try
            {
                DialogResult dr = ee.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    c.Text = ee.Expression;
                }
            }
            finally
            {
                ee.Dispose();
            }
            return;
        }
Beispiel #27
0
 private void bExpr_Click(object sender, EventArgs e)
 {
     GridItem gi = this.pgProps.SelectedGridItem;
     
     XmlNode sNode = _ReportItems[0];
     DialogExprEditor ee = new DialogExprEditor(_Draw, gi.Value.ToString(), sNode, false);
     DialogResult dr = ee.ShowDialog();
     if (dr == DialogResult.OK)
     {
         // There's probably a better way without reflection but this works fine.
         string nm = gi.Label;
         object sel = pgProps.SelectedObject;
         Type t = sel.GetType();
         PropertyInfo pi = t.GetProperty(nm);
         MethodInfo mi = pi.GetSetMethod();
         object[] oa = new object[1];
         oa[0] = ee.Expression;
         mi.Invoke(sel, oa);
         gi.Select();
     }
 }
        private void bDataLabelExpr_Click(object sender, EventArgs e)
        {
            DialogExprEditor ee = new DialogExprEditor(_Draw, cbDataLabel.Text,_ReportItems[0] , false);
            try
            {
                if (ee.ShowDialog() == DialogResult.OK)
                {                 
                    cbDataLabel.Text = ee.Expression;
                }

            }
            finally
            {
                ee.Dispose();
            }
            return;
        }
        private void functionBox(TextBox txt)
        {
            DialogExprEditor ee = new DialogExprEditor(_Draw, txt.Text,_ReportItems[0] , false);
                try
                {
                    if (ee.ShowDialog() == DialogResult.OK)
                    {
                        txt.Text = ee.Expression;
                    }

                }
            finally
            {
                ee.Dispose();
            }
            return;
        }
Beispiel #30
0
		private void bExpr_Click(object sender, System.EventArgs e)
		{
			Button b = sender as Button;
			if (b == null)
				return;
			Control c = null;
			switch (b.Tag as string)
			{
				case "external":
					c = tbValueExternal;
					break;
				case "embedded":
					c = cbValueEmbedded;
					break;
				case "mime":
					c = cbMIMEType;
					break;
				case "database":
					c = cbValueDatabase;
					break;
			}

			if (c == null)
				return;

			XmlNode sNode = _ReportItems[0];

			DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, sNode);
            try
            {
                DialogResult dr = ee.ShowDialog();
                if (dr == DialogResult.OK)
                    c.Text = ee.Expression;
            }
            finally
            {
                ee.Dispose();
            }
            
            return;
		}
Beispiel #31
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();

            PropertyExpr pe = value as PropertyExpr;
            if (pe == null)
                return base.EditValue(context, provider, value);

            using (DialogExprEditor de = new DialogExprEditor(pri.Draw, pe.Expression, pri.Node))
            {
                // Display the UI editor dialog
                if (editorService.ShowDialog(de) == DialogResult.OK)
                {
                    // Return the new property value from the UI editor form
                    return new PropertyExpr(de.Expression);
                }

                return base.EditValue(context, provider, value);
            }
        }
Beispiel #32
0
		private void bExpr_Click(object sender, System.EventArgs e)
		{
			Button b = sender as Button;
			if (b == null)
				return;
			Control c = null;
			bool bColor=false;
			switch (b.Tag as string)
			{
				case "min":
					c = this.tbMin;
					break;
				case "max":
					c = this.tbMax;
					break;
				case "majorinterval":
					c = this.tbMajorInterval;
					break;
				case "minorinterval":
					c = this.tbMinorInterval;
					break;
			}

			if (c == null)
				return;

			XmlNode sNode = _ReportItems[0];

			DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, sNode, bColor);
            try
            {
                DialogResult dr = ee.ShowDialog();
                if (dr == DialogResult.OK)
                    c.Text = ee.Expression;
            }
            finally
            {
                ee.Dispose();
            }
			return;
		}
Beispiel #33
0
		private void bValueExpr_Click(object sender, System.EventArgs e)
		{
			int cr = dgSorting.CurrentRowIndex;
			if (cr < 0)
			{	// No rows yet; create one
				string[] rowValues = new string[2];
				rowValues[0] = null;
				rowValues[1] = null;

				_DataTable.Rows.Add(rowValues);
				cr = 0;
			}
			int cc = 0;
			DataRow dr = _DataTable.Rows[cr];
			string cv = dr[cc] as string;

			DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _SortingParent, false);
			DialogResult dlgr = ee.ShowDialog();
			if (dlgr == DialogResult.OK)
				dr[cc] = ee.Expression;

		}
        private void bExpr_Click(object sender, System.EventArgs e)
        {
            Button b = sender as Button;
            if (b == null)
                return;
            Control c = null;
            switch (b.Tag as string)
            {
                case "bookmark":
                    c = tbBookmark;
             					break;
                case "bookmarklink":
                    c = tbBookmarkLink;
             					break;
                case "hyperlink":
                    c = tbHyperlink;
                    break;
                case "visibility":
                    c = tbHidden;
                    break;
            }

            if (c == null)
                return;

            XmlNode sNode = _ReportItems[0];

            DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, sNode);
            try
            {
                DialogResult dr = ee.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    c.Text = ee.Expression;
                    if ((string)(b.Tag) == "bookmark")
                        fBookmark = true;
                    else
                        fAction = true;
                }
            }
            finally
            {
                ee.Dispose();
            }
            return;
        }
        void fxExpr_Click(object sender, EventArgs e)
        {
            MDIChild mc = this.ActiveMdiChild as MDIChild;
            if (mc == null ||
                mc.DesignTab != "design" || mc.DrawCtl.SelectedCount != 1 ||
                mc.Editor == null)
                return;

            XmlNode tn = mc.DrawCtl.SelectedList[0];

            using (DialogExprEditor de = new DialogExprEditor(mc.DrawCtl, ctlEditTextbox.Text, tn))
            {
                // Display the UI editor dialog
                if (de.ShowDialog(this) == DialogResult.OK)
                {
                    ctlEditTextbox.Text = de.Expression;
                    mc.Editor.SetSelectedText(de.Expression);
                    SetProperties(mc);
                }
            }
        }
Beispiel #36
0
        private void bExpr_Click(object sender, System.EventArgs e)
        {
            Button b = sender as Button;
            if (b == null)
                return;
            Control c = null;
            switch (b.Tag as string)
            {
                case "label":
                    c = this.cbLabelExpr;
                    break;
                case "parent":
                    c = this.cbParentExpr;
                    break;
            }

            if (c == null)
                return;

            DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, _GroupingParent, false);
            try
            {
                DialogResult dr = ee.ShowDialog();
                if (dr == DialogResult.OK)
                    c.Text = ee.Expression;
            }
            finally
            {
                ee.Dispose();
            }
            return;
        }
        private void bDataExpr_Click(object sender, System.EventArgs e)
        {
            Button bs = sender as Button;
            if (bs == null)
                return;
            Control ctl = null; 
            switch (bs.Tag as string)
            {
                case "d1":
                    ctl = cbChartData;
                    break;
                case "d2":
                    ctl = cbChartData2;
                    break;
                case "d3":
                    ctl = cbChartData3;
                    break;
				//AJM GJL 14082008
                case "d4":
                    ctl = cbVector;
                    fVector = true;
                    break;
                case "d5":
                    ctl = cbChartType;
                    fChartType = true;
                    break;
                case "d6":
                    ctl = cbPalette;
                    fPalette = true;
                    break;
                case "d7":
                    ctl = cbSubType;
                    fSubtype = true;
                    break;
                default:
                    return;
            }
            DialogExprEditor ee = new DialogExprEditor(_Draw, ctl.Text, _ReportItems[0], false);
            try
            {
                DialogResult dlgr = ee.ShowDialog();
                if (dlgr == DialogResult.OK)
                {
                    ctl.Text = ee.Expression;
                    fChartData = true;
                }
            }
            finally
            {
                ee.Dispose();
            }
        }
		private void bValueExpr_Click(object sender, System.EventArgs e)
		{
			int cr = dgFilters.CurrentRowIndex;
			if (cr < 0)
			{	// No rows yet; create one
				string[] rowValues = new string[3];
				rowValues[0] = null;
				rowValues[1] = null;
				rowValues[2] = null;

				_DataTable.Rows.Add(rowValues);
				cr = 0;
			}
			DataGridCell dgc = dgFilters.CurrentCell;
			int cc = dgc.ColumnNumber;
			DataRow dr = _DataTable.Rows[cr];
			string cv = dr[cc] as string;

			if (cc == 1)
			{	// This is the FilterOperator
				DialogFilterOperator fo = new DialogFilterOperator(cv);
				DialogResult dlgr = fo.ShowDialog();
				if (dlgr == DialogResult.OK)
					dr[1] = fo.Operator;
			}
			else
			{
				DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _FilterParent, false);
				DialogResult dlgr = ee.ShowDialog();
				if (dlgr == DialogResult.OK)
					dr[cc] = ee.Expression;
			}
		}
Beispiel #39
0
		private void bValueExpr_Click(object sender, System.EventArgs e)
		{
			int cr = dgFilters.CurrentRow.Index;
            //if (cr < 0)
            //{	// No rows yet; create one
            //    string[] rowValues = new string[3];
            //    rowValues[0] = null;
            //    rowValues[1] = null;
            //    rowValues[2] = null;

            //    _DataTable.Rows.Add(rowValues);
            //    cr = 0;
            //}
			DataGridViewCell dgc = dgFilters.CurrentCell;
			int cc = dgc.ColumnIndex;
			string cv = dgc.Value as string;

			if (cc == 1)
			{	// This is the FilterOperator
				DialogFilterOperator fo = new DialogFilterOperator(cv);
				DialogResult dlgr = fo.ShowDialog();
				if (dlgr == DialogResult.OK)
					dgc.Value = fo.Operator;
			}
			else
			{
				DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _FilterParent, false);
				DialogResult dlgr = ee.ShowDialog();
				if (dlgr == DialogResult.OK)
					dgc.Value = ee.Expression;
			}
		}
Beispiel #40
0
        private void bExpr_Click(object sender, System.EventArgs e)
        {
            Button b = sender as Button;

            if (b == null)
            {
                return;
            }
            Control c      = null;
            bool    bColor = false;

            switch (b.Tag as string)
            {
            case "bcolor":
                c      = cbBackColor;
                bColor = true;
                break;

            case "bgradient":
                c = cbGradient;
                break;

            case "bendcolor":
                c      = cbEndColor;
                bColor = true;
                break;

            case "database":
                c = cbValueDatabase;
                break;

            case "embedded":
                c = cbValueEmbedded;
                break;

            case "external":
                c = tbValueExternal;
                break;

            case "repeat":
                c = cbRepeat;
                break;

            case "mime":
                c = cbMIMEType;
                break;
            }

            if (c == null)
            {
                return;
            }

            XmlNode sNode = _ReportItems[0];

            DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, sNode, bColor);
            DialogResult     dr = ee.ShowDialog();

            if (dr == DialogResult.OK)
            {
                c.Text = ee.Expression;
            }
            return;
        }
        private void bExpr_Click(object sender, System.EventArgs e)
        {
            Button b = sender as Button;

            if (b == null)
            {
                return;
            }
            Control c      = null;
            bool    bColor = false;

            switch (b.Tag as string)
            {
            case "sd":
                c = cbStyleDefault;
                break;

            case "cd":
                c      = cbColorDefault;
                bColor = true;
                break;

            case "wd":
                c = tbWidthDefault;
                break;

            case "sl":
                c = cbStyleLeft;
                break;

            case "cl":
                c      = cbColorLeft;
                bColor = true;
                break;

            case "wl":
                c = tbWidthLeft;
                break;

            case "sr":
                c = cbStyleRight;
                break;

            case "cr":
                c      = cbColorRight;
                bColor = true;
                break;

            case "wr":
                c = tbWidthRight;
                break;

            case "st":
                c = cbStyleTop;
                break;

            case "ct":
                c      = cbColorTop;
                bColor = true;
                break;

            case "wt":
                c = tbWidthTop;
                break;

            case "sb":
                c = cbStyleBottom;
                break;

            case "cb":
                c      = cbColorBottom;
                bColor = true;
                break;

            case "wb":
                c = tbWidthBottom;
                break;
            }

            if (c == null)
            {
                return;
            }

            XmlNode sNode = _ReportItems[0];

            using (DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, sNode, bColor))
            {
                DialogResult dr = ee.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    c.Text = ee.Expression;
                }
            }
            return;
        }
Beispiel #42
0
        private void bValueExpr_Click(object sender, System.EventArgs e)
        {
            int cr = dgGroup.CurrentRowIndex;
            if (cr < 0)
            {	// No rows yet; create one
                string[] rowValues = new string[1];
                rowValues[0] = null;

                _DataTable.Rows.Add(rowValues);
                cr = 0;
            }
            DataGridCell dgc = dgGroup.CurrentCell;
            int cc = dgc.ColumnNumber;
            DataRow dr = _DataTable.Rows[cr];
            string cv = dr[cc] as string;

            DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _GroupingParent, false);
            try
            {
                DialogResult dlgr = ee.ShowDialog();
                if (dlgr == DialogResult.OK)
                    dr[cc] = ee.Expression;
            }
            finally
            {
                ee.Dispose();
            }
        }
Beispiel #43
0
		private void bExpr_Click(object sender, System.EventArgs e)
		{
			Button b = sender as Button;
			if (b == null)
				return;
			Control c = null;
			bool bColor=false;
			switch (b.Tag as string)
			{
				case "sd":
					c = cbStyleDefault;
					break;
				case "cd":
					c = cbColorDefault;
					bColor = true;
					break;
				case "wd":
					c = tbWidthDefault;
					break;
				case "sl":
					c = cbStyleLeft;
					break;
				case "cl":
					c = cbColorLeft;
					bColor = true;
					break;
				case "wl":
					c = tbWidthLeft;
					break;
				case "sr":
					c = cbStyleRight;
					break;
				case "cr":
					c = cbColorRight;
					bColor = true;
					break;
				case "wr":
					c = tbWidthRight;
					break;
				case "st":
					c = cbStyleTop;
					break;
				case "ct":
					c = cbColorTop;
					bColor = true;
					break;
				case "wt":
					c = tbWidthTop;
					break;
				case "sb":
					c = cbStyleBottom;
					break;
				case "cb":
					c = cbColorBottom;
					bColor = true;
					break;
				case "wb":
					c = tbWidthBottom;
					break;
			}

			if (c == null)
				return;

			XmlNode sNode = _ReportItems[0];
			DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, sNode, bColor);
			DialogResult dr = ee.ShowDialog();
			if (dr == DialogResult.OK)
				c.Text = ee.Expression;
			return;
		}
Beispiel #44
0
        private void bValueExpr_Click(object sender, System.EventArgs e)
        {
            if (dgSorting.CurrentCell == null)
                dgSorting.Rows.Add("",true);

            DataGridViewCell dgc = dgSorting.CurrentCell;
            int cc = dgc.ColumnIndex;

            // >>>>>>>>>>
            // the only column that should be edited is the first one ( "Sort expression" )
            if (cc != 0)
                dgc = dgSorting.CurrentCell = dgSorting.CurrentRow.Cells[0];
            // <<<<<<<<<<
            string cv = dgc.Value as string;

            using (DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _SortingParent, false))
            {
                DialogResult dlgr = ee.ShowDialog();
                if (dlgr == DialogResult.OK)
                    dgc.Value = ee.Expression;
            }
        }
 private void bExprConnect_Click(object sender, System.EventArgs e)
 {
     DialogExprEditor ee = new DialogExprEditor(_Draw, this.tbConnection.Text, null, false);
     try
     {
         DialogResult dr = ee.ShowDialog();
         if (dr == DialogResult.OK)
             tbConnection.Text = ee.Expression;
     }
     finally
     {
         ee.Dispose();
     }
 }
        private void bExpr_Click(object sender, System.EventArgs e)
        {
            Button b = sender as Button;
            if (b == null)
                return;
            Control c = null;
            bool bColor=false;
            switch (b.Tag as string)
            {
                case "bcolor":
                    c = cbBackColor;
                    bColor = true;
                    break;
                case "bgradient":
                    c = cbGradient;
                    break;
                case "bendcolor":
                    c = cbEndColor;
                    bColor = true;
                    break;
                case "database":
                    c = cbValueDatabase;
                    break;
                case "embedded":
                    c = cbValueEmbedded;
                    break;
                case "external":
                    c = tbValueExternal;
                    break;
                case "repeat":
                    c = cbRepeat;
                    break;
                case "mime":
                    c = cbMIMEType;
                    break;
            }

            if (c == null)
                return;

            XmlNode sNode = _ReportItems[0];

            DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, sNode, bColor);
            DialogResult dr = ee.ShowDialog();
            if (dr == DialogResult.OK)
                c.Text = ee.Expression;
            return;
        }
Beispiel #47
0
        private void bValueExpr_Click(object sender, System.EventArgs e)
        {
            if (dgFilters.CurrentCell == null)
                dgFilters.Rows.Add("", "Equal", "");
            DataGridViewCell dgc = dgFilters.CurrentCell;
            int cc = dgc.ColumnIndex;
            string cv = dgc.Value as string;

            if (cc == 1)
            {	// This is the FilterOperator
                DialogFilterOperator fo = new DialogFilterOperator(cv);
                try
                {
                    DialogResult dlgr = fo.ShowDialog();
                    if (dlgr == DialogResult.OK)
                        dgc.Value = fo.Operator;
                }
                finally
                {
                    fo.Dispose();
                }
            }
            else
            {
                DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _FilterParent, false);
                try
                {
                    DialogResult dlgr = ee.ShowDialog();
                    if (dlgr == DialogResult.OK)
                        dgc.Value = ee.Expression;
                }
                finally
                {
                    ee.Dispose();
                }
            }
        }
Beispiel #48
0
        private void bExpr_Click(object sender, System.EventArgs e)
        {
            Button b = sender as Button;
            if (b == null)
                return;
            Control c = null;
            bool bColor=false;
            switch (b.Tag as string)
            {
                case "family":
                    c = cbFontFamily;
                    break;
                case "style":
                    c = cbFontStyle;
                    break;
                case "color":
                    c = cbColor;
                    bColor = true;
                    break;
                case "size":
                    c = cbFontSize;
                    break;
                case "weight":
                    c = cbFontWeight;
                    break;
                case "decoration":
                    c = cbTextDecoration;
                    break;
                case "halign":
                    c = cbHorzAlign;
                    break;
                case "valign":
                    c = cbVerticalAlign;
                    break;
                case "direction":
                    c = cbDirection;
                    break;
                case "writing":
                    c = cbWritingMode;
                    break;
                case "format":
                    c = cbFormat;
                    break;
            }

            if (c == null)
                return;

            XmlNode sNode = _ReportItems[0];

            DialogExprEditor ee = new DialogExprEditor(_Draw, c.Text, sNode, bColor);
            try
            {
                DialogResult dr = ee.ShowDialog();
                if (dr == DialogResult.OK)
                    c.Text = ee.Expression;
            }
            finally
            {
                ee.Dispose();
            }
            return;
        }