Example #1
0
        private void AdvancedFunctionMenuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem mi  = sender as ToolStripMenuItem;
            string            tok = mi.Text;
            int i1 = tok.IndexOf(" ");

            if (i1 > 0)
            {
                tok = tok.Substring(0, i1);
            }
            i1 = tok.IndexOf("m");
            if (i1 < 0)
            {
                i1 = tok.IndexOf("n");
            }
            i1 += AdvancedExpr.SelectionStart;      // where to place cursor
            tok = tok.Replace("n", "");             // remove place holders
            tok = tok.Replace("m", "");

            InsertText(tok);

            AdvancedExpr.Focus();
            AdvancedExpr.SelectionStart  = i1;
            AdvancedExpr.SelectionLength = 0;
            return;
        }
Example #2
0
 private void CalcFieldEditor_Activated(object sender, EventArgs e)
 {
     if (CalcField.CalcType == CalcTypeEnum.Advanced)
     {
         AdvancedExpr.Focus();
     }
 }
Example #3
0
        private void AdvancedOperatorMenuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem mi  = sender as ToolStripMenuItem;
            string            tok = mi.Text;
            int i1 = tok.IndexOf(" ");

            if (i1 > 0)
            {
                tok = tok.Substring(0, i1);
            }

            i1 = AdvancedExpr.SelectionStart + 2;             // where to place cursor
            InsertText(tok);
            AdvancedExpr.Focus();
            AdvancedExpr.SelectionStart  = i1;
            AdvancedExpr.SelectionLength = 0;
            return;
        }
Example #4
0
        private void Advanced_EditValueChanged(object sender, EventArgs e)
        {
            if (!AdvancedOptionButton.Checked || InSetup)
            {
                return;
            }

            GetCalcFieldForm();             // get current values
            string advExp = CalcField.ConvertBasicToAdvanced();

            CalcField.AdvancedExpr = advExp;
            if (!Lex.IsNullOrEmpty(advExp))
            {
                AdvancedExpr.Text = FormatAdvancedExpr(advExp, out AdvancedEditorPseudoQuery);
            }

            CalcField.CalcType = CalcTypeEnum.Advanced;
            SetupControlVisibility();
            AdvancedExpr.Focus();
            return;
        }