コード例 #1
0
        public override void Init(Condition cond, List <string> events, ActionCoreController cp, string appfolder, ActionFile actionfile,
                                  System.Func <string, List <BaseUtils.TypeHelpers.PropertyNameInfo> > func, Icon ic, ToolTip toolTip)
        {
            cd = cond;      // on creation, the cond with be set to onVoice with one condition, checked in ActionController.cs:SetPackEditor..

            textBoxInput              = new ExtendedControls.ExtTextBox();
            textBoxInput.Location     = new Point(panelxmargin, panelymargin);
            textBoxInput.Size         = new Size(356, 24); // manually matched to size of eventprogramcondition bits
            textBoxInput.Text         = cd.fields[0].matchstring;
            textBoxInput.TextChanged += TextBoxInput_TextChanged;
            textBoxInput.SetTipDynamically(toolTip, "Enter the voice input to recognise.  Multiple phrases seperate with semicolons");

            Controls.Add(textBoxInput);

            ActionProgram p = cond.action.HasChars() ? actionfile.actionprogramlist.Get(cond.action) : null;

            ActionProgram.ProgramConditionClass classifier = p != null ? p.progclass : ActionProgram.ProgramConditionClass.KeySay;

            ucprog          = new ActionPackEditProgram();
            ucprog.Location = new Point(textBoxInput.Right + 16, 0);
            ucprog.Size     = new Size(400, this.Height);   // init all the panels to 0/this height, select widths
            ucprog.Init(actionfile, cond, cp, appfolder, ic, toolTip, classifier);
            ucprog.onEditKeys         = onEditKeys;
            ucprog.onEditSay          = onEditSay;
            ucprog.onAdditionalNames += () => { return(func(cd.eventname)); };
            ucprog.SuggestedName     += () =>
            {
                string textparse = (textBoxInput.Text.Length > 0 && !textBoxInput.Text.Equals("?")) ? ("_" + textBoxInput.Text.Split(';')[0].SafeVariableString()) : "";
                return("VoiceInput" + textparse);
            };

            ucprog.RefreshEvent += () => { RefreshIt(); };
            Controls.Add(ucprog);
        }
コード例 #2
0
        public override void Init(Condition cond, List <string> events, ActionCoreController cp, string appfolder, ActionFile actionfile,
                                  System.Func <string, List <BaseUtils.TypeHelpers.PropertyNameInfo> > func, Icon ic, ToolTip toolTip)
        {
            cd = cond;

            //this.BackColor = Color.Red; // for debug

            // layed out for 12 point.  UC below require 28 point area

            eventtype = new ExtendedControls.ExtComboBox();
            eventtype.Items.AddRange(events);
            eventtype.Location = new Point(panelxmargin, panelymargin);
            eventtype.Size     = new Size(140, 24);
            if (cd.EventName != null)
            {
                eventtype.SelectedItem = cd.EventName;
            }
            eventtype.SelectedIndexChanged += Eventtype_SelectedIndexChanged;

            Controls.Add(eventtype);

            uccond          = new ActionPackEditCondition();
            uccond.Location = new Point(eventtype.Right + 16, 0);
            uccond.Size     = new Size(200, 28);   // init all the panels to 0/this height, select widths
            uccond.Init(cond, ic, toolTip);
            uccond.onAdditionalNames += () => { return(func(eventtype.Text)); };

            Controls.Add(uccond);

            ActionProgram p = cond.Action.HasChars() ? actionfile.ProgramList.Get(cond.Action) : null;

            ActionProgram.ProgramConditionClass classifier = p != null ? p.ProgramClass : ActionProgram.ProgramConditionClass.Full;
            ucprog          = new ActionPackEditProgram();
            ucprog.Location = new Point(uccond.Right + 16, 0);
            ucprog.Size     = new Size(400, 28);   // init all the panels to 0/this height, select widths
            ucprog.Init(actionfile, cond, cp, appfolder, ic, toolTip, classifier);
            ucprog.onEditKeys         = onEditKeys;
            ucprog.onEditSay          = onEditSay;
            ucprog.onAdditionalNames += () => { return(func(eventtype.Text)); };
            ucprog.SuggestedName     += () => { return(eventtype.Text); };
            ucprog.RefreshEvent      += () => { RefreshIt(); };
            Controls.Add(ucprog);
        }
コード例 #3
0
        public override void Init(Condition cond, List <string> events, ActionCoreController cp, string appfolder, ActionFile actionfile,
                                  System.Func <string, List <string> > func, Icon ic, ToolTip toolTip)
        {
            cd     = cond;
            anfunc = func;

            eventtype = new ExtendedControls.ComboBoxCustom();
            eventtype.Items.AddRange(events);
            eventtype.Location       = new Point(panelxmargin, panelymargin);
            eventtype.Size           = new Size(140, 24);
            eventtype.DropDownHeight = 400;
            eventtype.DropDownWidth  = eventtype.Width * 3 / 2;
            if (cd.eventname != null)
            {
                eventtype.SelectedItem = cd.eventname;
            }
            eventtype.SelectedIndexChanged += Eventtype_SelectedIndexChanged;

            Controls.Add(eventtype);

            uccond          = new ActionPackEditCondition();
            uccond.Location = new Point(eventtype.Right + 16, 0);
            uccond.Size     = new Size(200, this.Height);   // init all the panels to 0/this height, select widths
            uccond.Init(cond, ic, toolTip);
            uccond.onAdditionalNames += () => { return(anfunc(eventtype.Text)); };

            Controls.Add(uccond);

            ActionProgram p = cond.action.HasChars() ? actionfile.actionprogramlist.Get(cond.action) : null;

            ActionProgram.ProgramConditionClass classifier = p != null ? p.progclass : ActionProgram.ProgramConditionClass.Full;
            ucprog          = new ActionPackEditProgram();
            ucprog.Location = new Point(uccond.Right + 16, 0);
            ucprog.Size     = new Size(400, this.Height);   // init all the panels to 0/this height, select widths
            ucprog.Init(actionfile, cond, cp, appfolder, ic, toolTip, classifier);
            ucprog.onEditKeys         = onEditKeys;
            ucprog.onEditSay          = onEditSay;
            ucprog.onAdditionalNames += () => { return(anfunc(eventtype.Text)); };
            ucprog.SuggestedName     += () => { return(eventtype.Text); };
            ucprog.RefreshEvent      += () => { RefreshIt(); };
            Controls.Add(ucprog);
        }