Exemple #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;

            //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);
        }
Exemple #2
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);
        }